Fix -Wno-unknown-warning support detection
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2015-12-16  Pedro Alves  <palves@redhat.com>
2
3         * configure.ac (compiler warning flags): When testing a
4         -Wno-foo option, check whether -Wfoo works instead.
5         * configure: Regenerate.
6
7 2015-12-11  Don Breazeal  <donb@codesourcery.com>
8
9         * server.c (process_serial_event): Don't exit from gdbserver
10         in remote mode if there are still active inferiors.
11
12 2015-12-11  Yao Qi  <yao.qi@linaro.org>
13
14         * linux-aarch64-low.c (aarch64_breakpoint_at): Call
15         arm_breakpoint_at if the process is 32-bit.
16
17 2015-12-11  Yao Qi  <yao.qi@linaro.org>
18
19         * linux-aarch32-low.c [__aarch64__]: Use arm_abi_breakpoint
20         arm breakpoint.
21
22 2015-12-07  Yao Qi  <yao.qi@linaro.org>
23
24         * configure.srv: Append arm.o to srv_tgtobj for
25         aarch64*-*-linux* target.
26         * linux-aarch32-low.c (arm_abi_breakpoint): New macro.  Moved
27         from linux-arm-low.c.
28         (arm_eabi_breakpoint, arm_breakpoint): Likewise.
29         (arm_breakpoint_len, thumb_breakpoint): Likewise.
30         (thumb_breakpoint_len, thumb2_breakpoint): Likewise.
31         (thumb2_breakpoint_len): Likewise.
32         (arm_is_thumb_mode, arm_breakpoint_at): Likewise.
33         (arm_breakpoint_kinds): Likewise.
34         (arm_breakpoint_kind_from_pc): Likewise.
35         (arm_sw_breakpoint_from_kind): Likewise.
36         (arm_breakpoint_kind_from_current_state): Likewise.
37         * linux-aarch32-low.h (arm_breakpoint_kind_from_pc): Declare.
38         (arm_sw_breakpoint_from_kind): Declare.
39         (arm_breakpoint_kind_from_current_state): Declare.
40         (arm_breakpoint_at): Declare.
41         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): Call
42         arm_sw_breakpoint_from_kind if process is 32-bit.
43         (aarch64_breakpoint_kind_from_pc): New function.
44         (aarch64_breakpoint_kind_from_current_state): New function.
45         (the_low_target): Initialize fields breakpoint_kind_from_pc
46         and breakpoint_kind_from_current_state.
47         * linux-arm-low.c (arm_breakpoint_kinds): Move to
48         linux-aarch32-low.c.
49         (arm_abi_breakpoint, arm_eabi_breakpoint): Likewise.
50         (arm_breakpoint, arm_breakpoint_len): Likewise.
51         (thumb_breakpoint, thumb_breakpoint_len): Likewise.
52         (thumb2_breakpoint, thumb2_breakpoint_len): Likewise.
53         (arm_is_thumb_mode): Likewise.
54         (arm_breakpoint_at): Likewise.
55         (arm_breakpoint_kind_from_pc): Likewise.
56         (arm_sw_breakpoint_from_kind): Likewise.
57         (arm_breakpoint_kind_from_current_state): Likewise.
58
59         Revert:
60         2015-08-04  Yao Qi  <yao.qi@linaro.org>
61
62         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
63         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
64         * server.c (extended_protocol): Remove "static".
65         * server.h (extended_protocol): Declare it.
66
67 2015-12-04  Josh Stone  <jistone@redhat.com>
68
69         * target.h (struct target_ops) <arch_setup>: Rename to ...
70         (struct target_ops) <post_create_inferior>: ... this.
71         (target_arch_setup): Rename to ...
72         (target_post_create_inferior): ... this, calling post_create_inferior.
73         * server.c (start_inferior): Update target_arch_setup calls to
74         target_post_create_inferior.
75         * linux-low.c (linux_low_ptrace_options): Forward declare.
76         (linux_arch_setup): Update its comment for general use.
77         (linux_post_create_inferior): New, run arch_setup and setup ptrace.
78         (struct linux_target_ops): Use linux_post_create_inferior.
79         * lynx-low.c (struct lynx_target_ops): Update arch_setup stub comment
80         to post_create_inferior.
81         * nto-low.c (struct nto_target_ops): Likewise.
82         * spu-low.c (struct spu_target_ops): Likewise.
83         * win32-low.c (struct win32_target_ops): Likewise.
84
85 2015-12-03  Antoine Tremblay  <antoine.tremblay@ericsson.com>
86
87         * linux-arm-low.c: Remove duplicate arch/arm.h include.
88
89 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
90
91         * linux-arm-low.c (arm_reinsert_addr): Remove function.
92         (struct linux_target_ops <breakpoint_reinsert_addr>: Set to NULL.
93         * linux-cris-low.c (cris_reinsert_addr> Remove function.
94         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
95         * linux-crisv32-low.c (cris_reinsert_addr): Remove function.
96         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
97         * linux-mips-low.c (mips_reinsert_addr): Remove function.
98         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
99         * linux-nios2-low.c (nios2_reinsert_addr): Remove function.
100         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
101         * linux-sparc-low.c (sparc_reinsert_addr): Remove function.
102         (struct linux_target_ops) <breakpoint_reinsert_addr>: Set to NULL.
103
104 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
105
106         * linux-low.c (linux_look_up_symbols): Don't call
107         linux_supports_traceclone.
108         * linux-low.h (thread_db_init): Remove use_events argument.
109         * thread-db.c (thread_db_use_event): Remove global variable.
110         (struct thread_db) <td_thr_event_enable_p>: Remove field.
111         (struct thread_db) <td_create_bp>: Remove field.
112         (thread_db_create_event): Remove function.
113         (thread_db_enable_reporting): Likewise.
114         (find_one_thread): Don't check for thread_db_use_events.
115         (attach_thread): Likewise.
116         (thread_db_load_search): Remove td_thr_event_enable_p initialization.
117         (try_thread_db_load_1): Don't check for thread_db_use_events.
118         (thread_db_init): Remove use_events argument and thread events
119         handling.
120         (remove_thread_event_breakpoints): Remove function.
121         (thread_db_detach): Remove call to remove_thred_event_breakpoints.
122
123 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
124
125         * linux-aarch64-low.c (aarch64_supports_hardware_single_step):
126         New function.
127         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
128         * linux-arm-low.c (arm_supports_hardware_single_step): New function.
129         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
130         * linux-bfin-low.c (bfin_supports_hardware_single_step): New function.
131         (struct linux_target_ops) <bfin_supports_hardware_single_step>:
132         Initialize.
133         * linux-crisv32-low.c (cris_supports_hardware_single_step):
134         New function.
135         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
136         * linux-low.c (can_hardware_single_step): Use
137         supports_hardware_single_step.
138         (can_software_single_step): New function.
139         (start_step_over): Call can_software_single_step.
140         (linux_supports_hardware_single_step): New function.
141         (struct target_ops) <supports_software_single_step>: Initialize.
142         * linux-low.h (struct linux_target_ops)
143         <supports_hardware_single_step>: Initialize.
144         * linux-m32r-low.c (m32r_supports_hardware_single_step): New function.
145         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
146         * linux-ppc-low.c (ppc_supports_hardware_single_step): New function.
147         (struct linux_target_ops) <supports_hardware_single_step> Initialize.
148         * linux-s390-low.c (s390_supports_hardware_single_step): New function.
149         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
150         * linux-sh-low.c (sh_supports_hardware_single_step): New function.
151         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
152         * linux-tic6x-low.c (tic6x_supports_hardware_single_step): New function.
153         (struct linux_target_ops) <tic6x_supports_hardware_single_step>:
154         Initialize.
155         * linux-tile-low.c (tile_supports_hardware_single_step): New function.
156         (struct linux_target_ops) <tile_supports_hardware_single_step>:
157         Initialize.
158         * linux-x86-low.c (x86_supports_hardware_single_step) New function.
159         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
160         * linux-xtensa-low.c (xtensa_supports_hardware_single_step):
161         New function.
162         (struct linux_target_ops) <supports_hardware_single_step>: Initialize.
163         * target.h (struct target_ops): <supports_software_single_step>:
164         New field.
165         (target_supports_software_single_step): New macro.
166
167 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
168
169         * linux-low.c (linux_wait_1): Fix pc advance condition.
170         * mem-break.c (reinsert_breakpoint_inserted_here): New function.
171         * mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
172
173 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
174
175         * linux-arm-low.c (arm_is_thumb_mode): New function.
176         (arm_breakpoint_at): Use arm_is_thumb_mode.
177         (arm_breakpoint_kind_from_current_state): New function.
178         (struct linux_target_ops) <breakpoint_kind_from_current_state>:
179         Initialize.
180         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state.
181         (linux_breakpoint_kind_from_current_state): New function.
182         (struct target_ops <breakpoint_kind_from_current_state>: Initialize.
183         * linux-low.h (struct linux_target_ops)
184         <breakpoint_kind_from_current_state>: New field.
185         * target.h (struct target_ops): Likewise.
186         (target_breakpoint_kind_from_current_state): New macro.
187
188 2015-11-30  Pedro Alves  <palves@redhat.com>
189
190         * linux-low.c (linux_resume): Wake up the event loop before
191         returning.
192
193 2015-11-30  Pedro Alves  <palves@redhat.com>
194
195         * mem-break.c (check_gdb_bp_preconditions): Remove current_thread
196         check.
197         (set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
198         to -1.
199         * target.c (struct thread_search): New structure.
200         (thread_search_callback): New function.
201         (prev_general_thread): New global.
202         (prepare_to_access_memory, done_accessing_memory): New functions.
203         * target.h (prepare_to_access_memory, done_accessing_memory):
204         Replace macros with function declarations.
205
206 2015-11-30  Pedro Alves  <palves@redhat.com>
207
208         PR 14618
209         * linux-low.c (linux_wait_1): If the last resumed thread is gone,
210         report TARGET_WAITKIND_NO_RESUMED.
211         * remote-utils.c (prepare_resume_reply): Handle
212         TARGET_WAITKIND_NO_RESUMED.
213         * server.c (report_no_resumed): New global.
214         (handle_query) <qSupported>: Handle "no-resumed+".  Report
215         "no-resumed+" support.
216         (resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only
217         return error if the client doesn't support no-resumed events.
218         (push_stop_notification): New function.
219         (handle_target_event): Use it.  Report TARGET_WAITKIND_NO_RESUMED
220         events if the client supports them.
221
222 2015-11-30  Pedro Alves  <palves@redhat.com>
223
224         * linux-low.c (thread_still_has_status_pending_p): Don't check
225         vCont;t here.
226         (lwp_resumed): New function.
227         (status_pending_p_callback): Return early if the LWP is not
228         supposed to be resumed.
229
230 2015-11-30  Pedro Alves  <palves@redhat.com>
231
232         * linux-low.c (handle_extended_wait): Assert that the LWP's
233         waitstatus is TARGET_WAITKIND_IGNORE.  If GDB wants to hear about
234         thread create events, leave the new child's status pending.
235         (linux_low_filter_event): If GDB wants to hear about thread exit
236         events, leave the LWP marked dead and don't delete it.
237         (linux_wait_for_event_filtered): Don't check for thread exit.
238         (filter_exit_event): New function.
239         (linux_wait_1): Use it, when returning an exit event.
240         (linux_resume_one_lwp_throw): Assert that the LWP's
241         waitstatus is TARGET_WAITKIND_IGNORE.
242         * remote-utils.c (prepare_resume_reply): Handle
243         TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
244         * server.c (report_thread_events): New global.
245         (handle_general_set): Handle QThreadEvents.
246         (handle_query) <qSupported>: Handle and report QThreadEvents+;
247         (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
248         TARGET_WAITKIND_THREAD_EXITED.
249         * server.h (report_thread_events): Declare.
250
251 2015-11-30  Pedro Alves  <palves@redhat.com>
252
253         * linux-low.c (resume_stopped_resumed_lwps): Don't check whether
254         the thread's last_resume_kind was resume_stop.
255
256 2015-11-30  Pedro Alves  <palves@redhat.com>
257
258         * linux-low.c (linux_attach): In non-stop mode, wait for one stop
259         before returning.
260
261 2015-11-30  Pedro Alves  <palves@redhat.com>
262
263         * server.c (handle_v_requests): Handle vCtrlC.
264
265 2015-11-30  Pedro Alves  <palves@redhat.com>
266
267         * gdbthread.h (find_any_thread_of_pid): Declare.
268         * inferiors.c (thread_of_pid, find_any_thread_of_pid): New
269         functions.
270         * server.c (handle_query): If current_thread is NULL, look for
271         another thread of the selected process.
272
273 2015-11-26  Daniel Colascione  <dancol@dancol.org>
274             Simon Marchi  <simon.marchi@ericsson.com>
275
276         * linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
277         * server.c (handle_qxfer_threads_worker): Refactor to include thread
278         name in reply.
279         * target.h (struct target_ops) <thread_name>: New field.
280         (target_thread_name): New macro.
281
282 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
283
284         * regcache.h (regcache_invalidate_pid): Add declaration.
285         * regcache.c (regcache_invalidate_pid): New function, extracted
286         from regcache_invalidate.
287         (regcache_invalidate): Reimplement using regcache_invalidate_pid.
288         Add trivial documentation comment.
289         * lynx-low.c: Use regcache_invalidate_pid instead of
290         regcache_invalidate.
291
292 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
293
294         * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
295         and Elf64_auxv_t if the target is Android.
296
297 2015-11-22  Doug Evans  <xdje42@gmail.com>
298
299         * target.h: #include <sys/types.h>.
300
301 2015-11-19  Pedro Alves  <palves@redhat.com>
302
303         * linux-low.c (linux_process_qsupported): Change prototype.
304         Adjust.
305         * linux-low.h (struct linux_target_ops) <process_qsupported>:
306         Change prototype.
307         * linux-x86-low.c (x86_linux_process_qsupported): Change prototype
308         and adjust to loop over all features.
309         * server.c (handle_query) <qSupported>: Adjust to call
310         target_process_qsupported once, passing it a vector of unprocessed
311         features.
312         * target.h (struct target_ops) <process_qsupported>: Change
313         prototype.
314         (target_process_qsupported): Adjust.
315
316 2015-11-19  Pedro Alves  <palves@redhat.com>
317
318         * configure.ac (ERROR_ON_WARNING): Don't check whether in C++
319         mode.
320         * configure: Regenerate.
321
322 2015-11-19  Pedro Alves  <palves@redhat.com>
323
324         * configure: Regenerate.
325
326 2015-11-19  Yao Qi  <yao.qi@linaro.org>
327
328         * linux-aarch64-low.c (emit_data_processing_reg): Change opcode
329         type to uint32_t.
330
331 2015-11-19  Yao Qi  <yao.qi@linaro.org>
332
333         * linux-aarch64-low.c (enum aarch64_operand_type): New.
334         (struct aarch64_operand): Move enum out.
335
336 2015-11-19  Yao Qi  <yao.qi@linaro.org>
337
338         * linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
339         struct user_fpsimd_state *.
340         (aarch64_store_fpregset): Likewise.
341
342 2015-11-19  Yao Qi  <yao.qi@linaro.org>
343
344         * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
345         struct user_pt_regs *.
346         (aarch64_store_gregset): Likewise.
347
348 2015-11-18  Pedro Alves  <palves@redhat.com>
349
350         * Makefile.in (all_object_files): Add $IPA_OBJS.
351
352 2015-11-17  Pedro Alves  <palves@redhat.com>
353
354         * win32-low.c (win32_resume): Use gdb_signal_from_host,
355         GDB_SIGNAL_0 and gdb_signal_to_string.
356
357 2015-11-17  Pedro Alves  <palves@redhat.com>
358
359         * win32-low.c (handle_output_debug_string): Remove parameter.
360         (win32_kill): Remove our_status local and adjust call to
361         handle_output_debug_string.
362         (get_child_debug_event): Adjust call to
363         handle_output_debug_string.
364
365 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
366
367         * linux-mips-low.c (mips_fill_gregset): Add cast.
368         (mips_store_gregset): Likewise.
369         (mips_fill_fpregset): Likewise.
370         (mips_store_fpregset): Likewise.
371
372 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
373
374         * linux-mips-low.c (mips_add_watchpoint): Rename private to
375         priv.
376
377 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
378
379         * linux-mips-low.c (mips_linux_new_thread): Change type of
380         watch_type to enum target_hw_bp_type.
381
382 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
383
384                 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
385                 Change return type to arm_hwbp_type.
386
387 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
388
389         * linux-aarch32-low.c (arm_fill_gregset): Add cast.
390         (arm_store_gregset): Likewise.
391         * linux-arm-low.c (arm_get_hwcap): Likewise.
392         (arm_read_description): Likewise.
393
394 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
395
396         * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
397
398 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
399
400         * linux-ppc-low.c (ppc_get_hwcap): Add cast.
401         (ppc_fill_vsxregset): Likewise.
402         (ppc_store_vsxregset): Likewise.
403         (ppc_fill_vrregset): Likewise.
404         (ppc_store_vrregset): Likewise.
405         (ppc_fill_evrregset): Likewise.
406         (ppc_store_evrregset): Likewise.
407
408 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
409
410         * linux-ppc-low.c (ppc_usrregs_info): Remove
411         forward-declaration.
412         (ppc_arch_setup): Move lower in file.
413
414 2015-10-30  Simon Marchi  <simon.marchi@ericsson.com>
415
416         * proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
417         (ps_pdwrite): Likewise.
418
419 2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
420
421         * linux-arm-low.c (arm_new_thread): Move pointer dereference
422         to after assert checks.
423
424 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
425
426         * proc-service.c (ps_pdread): Add/adjust casts.
427         (ps_pdwrite): Add/adjust casts.
428
429 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
430
431         * server.c (handle_search_memory_1): Cast return value of
432         memmem.
433
434 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
435
436         * server.c (write_qxfer_response): Change type of data to
437         gdb_byte *.
438
439 2015-10-29  Pedro Alves  <palves@redhat.com>
440
441         * mem-break.c (Z_packet_to_bkpt_type): Add cast.
442
443 2015-10-29  Pedro Alves  <palves@redhat.com>
444
445         * tracepoint.c (clear_installed_tracepoints): Add casts.
446
447 2015-10-29  Pedro Alves  <palves@redhat.com>
448
449         * server.c (handle_v_cont, process_serial_event): Add enum
450         gdb_signal casts to signal parsing code.
451
452 2015-10-29  Pedro Alves  <palves@redhat.com>
453
454         * linux-low.h (NULL_REGSET): Define.
455         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
456         * linux-arm-low.c (arm_regsets): Likewise.
457         * linux-crisv32-low.c (cris_regsets): Likewise.
458         * linux-m68k-low.c (m68k_regsets): Likewise.
459         * linux-mips-low.c (mips_regsets): Likewise.
460         * linux-nios2-low.c (nios2_regsets): Likewise.
461         * linux-ppc-low.c (ppc_regsets): Likewise.
462         * linux-s390-low.c (s390_regsets): Likewise.
463         * linux-sh-low.c (sh_regsets): Likewise.
464         * linux-sparc-low.c (sparc_regsets): Likewise.
465         * linux-tic6x-low.c (tic6x_regsets): Likewise.
466         * linux-tile-low.c (tile_regsets): Likewise.
467         * linux-x86-low.c (x86_regsets): Likewise.
468         * linux-xtensa-low.c (xtensa_regsets): Likewise.
469
470 2015-10-29  Pedro Alves  <palves@redhat.com>
471
472         * linux-low.h (NULL_REGSET): Define.
473         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
474         * linux-arm-low.c (arm_regsets): Likewise.
475         * linux-crisv32-low.c (cris_regsets): Likewise.
476         * linux-m68k-low.c (m68k_regsets): Likewise.
477         * linux-mips-low.c (mips_regsets): Likewise.
478         * linux-nios2-low.c (nios2_regsets): Likewise.
479         * linux-ppc-low.c (ppc_regsets): Likewise.
480         * linux-s390-low.c (s390_regsets): Likewise.
481         * linux-sh-low.c (sh_regsets): Likewise.
482         * linux-sparc-low.c (sparc_regsets): Likewise.
483         * linux-tic6x-low.c (tic6x_regsets): Likewise.
484         * linux-tile-low.c (tile_regsets): Likewise.
485         * linux-x86-low.c (x86_regsets): Likewise.
486         * linux-xtensa-low.c (xtensa_regsets): Likewise.
487
488 2015-10-26  Doug Evans  <dje@google.com>
489
490         * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
491
492 2015-10-26  Doug Evans  <dje@google.com>
493
494         * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
495
496 2015-10-26  Doug Evans  <dje@google.com>
497
498         * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
499         for debug_printf.
500         (attach_thread, find_new_threads_callback): Ditto.
501
502 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
503
504         * mem-break.h (set_breakpoint_data): Remove.
505
506 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
507
508         * nto-low.c (nto_sw_breakpoint_from_kind): New function.
509         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
510         (initialize_low): Remove set_breakpoint_data call.
511         * spu-low.c (spu_sw_breakpoint_from_kind): New function.
512         (struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
513         (initialize_low): Remove set_breakpoint_data call.
514         * win32-low.c (win32_sw_breakpoint_from_kind): New function.
515         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
516         (initialize_low): Remove set_breakpoint_data call.
517
518 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
519
520         * linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
521         * mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
522         * target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
523         * target.h (target_breakpoint_kind_from_pc): New macro.
524
525 2015-10-22  Antoine Tremblay  <antoine.tremblay@ericsson.com>
526
527         * linux-low.c (default_breakpoint_kind_from_pc): New function.
528         (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
529         the default breakpoint kind.
530
531 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
532
533         * linux-arm-low.c (arm_supports_z_point_type): Add software
534         breakpoint support.
535
536 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
537
538         * linux-arm-low.c: Refactor breakpoint definitions.
539         (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
540         (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
541
542 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
543
544         * Makefile.in: Add arm.c/o.
545         * configure.srv: Likewise.
546         * linux-arm-low.c (arm_breakpoint_kinds): New enum.
547         (arm_breakpoint_kind_from_pc): New function.
548         (arm_sw_breakpoint_from_kind): Return proper kind.
549         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
550
551 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
552
553         * linux-low.c (initialize_low): Ajdust for breakpoint global variables
554         removal.
555         * mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
556         (struct raw_breakpoint) <size>: Remove.
557         (struct raw_breakpoint) <kind>: Add.
558         (bp_size): New function.
559         (bp_opcode): Likewise.
560         (find_raw_breakpoint_at): Adjust for kind.
561         (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
562         (remove_memory_breakpoint): Adjust for kind call bp_size.
563         (set_raw_breakpoint_at): Adjust for kind.
564         (set_breakpoint): Likewise.
565         (set_breakpoint_at): Call breakpoint_kind_from_pc.
566         (delete_raw_breakpoint): Adjust for kind.
567         (delete_breakpoint): Likewise.
568         (find_gdb_breakpoint): Likewise.
569         (set_gdb_breakpoint_1): Likewise.
570         (set_gdb_breakpoint): Likewise.
571         (delete_gdb_breakpoint_1): Likewise.
572         (delete_gdb_breakpoint): Likewise.
573         (uninsert_raw_breakpoint): Likewise.
574         (reinsert_raw_breakpoint): Likewise.
575         (set_breakpoint_data): Remove.
576         (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
577         (check_mem_read): Adjust for kind call bp_size.
578         (check_mem_write): Adjust for kind call bp_size,bp_opcode.
579         (clone_one_breakpoint): Adjust for kind.
580         * mem-break.h (set_gdb_breakpoint): Likewise.
581         (delete_gdb_breakpoint): Likewise.
582         * server.c (process_serial_event): Likewise.
583
584 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
585
586         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
587         (struct linux_target_ops) <breakpoint>: Remove.
588         (struct linux_target_ops) <breakpoint_len>: Remove.
589         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
590         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
591         * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
592         (arm_sw_breakpoint_from_kind): New function.
593         * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
594         (struct linux_target_ops) <breakpoint>: Remove.
595         (struct linux_target_ops) <breakpoint_len>: Remove.
596         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
597         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
598         * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
599         (struct linux_target_ops) <breakpoint>: Remove.
600         (struct linux_target_ops) <breakpoint_len>: Remove.
601         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
602         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
603         * linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function.
604         (struct linux_target_ops) <breakpoint>: Remove.
605         (struct linux_target_ops) <breakpoint_len>: Remove.
606         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
607         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
608         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc
609         and sw_breakpoint_from_kind to increment the pc.
610         (linux_breakpoint_kind_from_pc): New function.
611         (linux_sw_breakpoint_from_kind): New function.
612         (struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
613         (initialize_low): Call breakpoint_kind_from_pc and
614         sw_breakpoint_from_kind to replace breakpoint_data/len.
615         * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
616         New field.
617         (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
618         * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
619         (struct linux_target_ops) <breakpoint>: Remove.
620         (struct linux_target_ops) <breakpoint_len>: Remove.
621         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
622         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
623         * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
624         (struct linux_target_ops) <breakpoint>: Remove.
625         (struct linux_target_ops) <breakpoint_len>: Remove.
626         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
627         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
628         * linux-mips-low.c (mips_sw_breakpoint_from_kind): New function.
629         (struct linux_target_ops) <breakpoint>: Remove.
630         (struct linux_target_ops) <breakpoint_len>: Remove.
631         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
632         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
633         * linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function.
634         (struct linux_target_ops) <breakpoint>: Remove.
635         (struct linux_target_ops) <breakpoint_len>: Remove.
636         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
637         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
638         * linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function.
639         (struct linux_target_ops) <breakpoint>: Remove.
640         (struct linux_target_ops) <breakpoint_len>: Remove.
641         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
642         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
643         * linux-s390-low.c (s390_sw_breakpoint_from_kind): New function.
644         (struct linux_target_ops) <breakpoint>: Remove.
645         (struct linux_target_ops) <breakpoint_len>: Remove.
646         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
647         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
648         * linux-sh-low.c (sh_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-sparc-low.c (sparc_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         * linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function.
659         (struct linux_target_ops) <breakpoint>: Remove.
660         (struct linux_target_ops) <breakpoint_len>: Remove.
661         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
662         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
663         * linux-tile-low.c (tile_sw_breakpoint_from_kind): New function.
664         * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
665         (struct linux_target_ops) <breakpoint>: Remove.
666         (struct linux_target_ops) <breakpoint_len>: Remove.
667         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
668         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
669         * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
670         (struct linux_target_ops) <breakpoint>: Remove.
671         (struct linux_target_ops) <breakpoint_len>: Remove.
672         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
673         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
674
675 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
676
677         * linux-cris-low.c (cris_get_pc): Remove void arg.
678
679 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
680
681         * gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
682         variable name.
683
684 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
685
686         * inferiors.c (thread_pid_matches_callback): New function.
687         (find_thread_process): New function.
688         (remove_thread): Reset current_thread.
689         (remove_process): Assert threads have been removed first.
690
691 2015-10-15  Yao Qi  <yao.qi@linaro.org>
692
693         * linux-aarch64-low.c (aarch64_insert_point): Set len to 2
694         if it is 3.
695         (aarch64_remove_point): Likewise.
696         * regcache.c (regcache_register_size): New function.
697
698 2015-10-12  Yao Qi  <yao.qi@linaro.org>
699
700         * linux-aarch64-low.c: Update all callers as emit_load_store
701         is renamed to aarch64_emit_load_store.
702
703 2015-10-12  Yao Qi  <yao.qi@linaro.org>
704
705         * linux-aarch64-low.c: Update all callers of function renaming
706         from emit_insn to aarch64_emit_insn.
707
708 2015-10-12  Yao Qi  <yao.qi@linaro.org>
709
710         * linux-aarch64-low.c (enum aarch64_opcodes): Move to
711         arch/aarch64-insn.h.
712         (struct aarch64_memory_operand): Likewise.
713         (ENCODE): Likewise.
714         (emit_insn): Move to arch/aarch64-insn.c.
715         (emit_b, emit_bcond, emit_cb, emit_tb): Remove.
716         (emit_load_store): Move to arch/aarch64-insn.c.
717         (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
718         (can_encode_int32): Remove.
719
720 2015-10-12  Yao Qi  <yao.qi@linaro.org>
721
722         * linux-aarch64-low.c (extract_signed_bitfield): Remove.
723         (aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
724         (aarch64_relocate_instruction): Likewise.
725         (struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
726         (struct aarch64_insn_visitor): Likewise.
727
728 2015-10-12  Yao Qi  <yao.qi@linaro.org>
729
730         * linux-aarch64-low.c (struct aarch64_insn_data): New.
731         (struct aarch64_insn_visitor): New.
732         (struct aarch64_insn_relocation_data): New.
733         (aarch64_ftrace_insn_reloc_b): New function.
734         (aarch64_ftrace_insn_reloc_b_cond): Likewise.
735         (aarch64_ftrace_insn_reloc_cb): Likewise.
736         (aarch64_ftrace_insn_reloc_tb): Likewise.
737         (aarch64_ftrace_insn_reloc_adr): Likewise.
738         (aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
739         (aarch64_ftrace_insn_reloc_others): Likewise.
740         (visitor): New.
741         (aarch64_relocate_instruction): Use visitor.
742
743 2015-10-12  Yao Qi  <yao.qi@linaro.org>
744
745         * linux-aarch64-low.c (aarch64_relocate_instruction): Return
746         int.  Add argument buf.
747         (aarch64_install_fast_tracepoint_jump_pad): Pass buf to
748         aarch64_relocate_instruction.
749
750 2015-10-12  Yao Qi  <yao.qi@linaro.org>
751
752         * linux-aarch64-low.c (aarch64_relocate_instruction): Add
753         argument insn.  Remove local variable insn.  Don't call
754         target_read_uint32.
755         (aarch64_install_fast_tracepoint_jump_pad): Call
756         target_read_uint32.
757
758 2015-09-30  Yao Qi  <yao.qi@linaro.org>
759
760         * linux-aarch64-low.c (emit_movk): Shorten a long line.
761         (emit_load_store_pair): Likewise.
762
763 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
764
765         * dll.c (match_dll): Add cast(s).
766         (unloaded_dll): Likewise.
767         * linux-low.c (second_thread_of_pid_p): Likewise.
768         (delete_lwp_callback): Likewise.
769         (count_events_callback): Likewise.
770         (select_event_lwp_callback): Likewise.
771         (linux_set_resume_request): Likewise.
772         * server.c (accumulate_file_name_length): Likewise.
773         (emit_dll_description): Likewise.
774         (handle_qxfer_threads_worker): Likewise.
775         (visit_actioned_threads): Likewise.
776         * thread-db.c (any_thread_of): Likewise.
777         * tracepoint.c (same_process_p): Likewise.
778         (match_blocktype): Likewise.
779         (build_traceframe_info_xml): Likewise.
780
781 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
782
783         * ax.c (gdb_parse_agent_expr): Add cast to allocation result
784         assignment.
785         (gdb_unparse_agent_expr): Likewise.
786         * hostio.c (require_data): Likewise.
787         (handle_pread): Likewise.
788         * linux-low.c (disable_regset): Likewise.
789         (fetch_register): Likewise.
790         (store_register): Likewise.
791         (get_dynamic): Likewise.
792         (linux_qxfer_libraries_svr4): Likewise.
793         * mem-break.c (delete_fast_tracepoint_jump): Likewise.
794         (set_fast_tracepoint_jump): Likewise.
795         (uninsert_fast_tracepoint_jumps_at): Likewise.
796         (reinsert_fast_tracepoint_jumps_at): Likewise.
797         (validate_inserted_breakpoint): Likewise.
798         (clone_agent_expr): Likewise.
799         * regcache.c (init_register_cache): Likewise.
800         * remote-utils.c (putpkt_binary_1): Likewise.
801         (decode_M_packet): Likewise.
802         (decode_X_packet): Likewise.
803         (look_up_one_symbol): Likewise.
804         (relocate_instruction): Likewise.
805         (monitor_output): Likewise.
806         * server.c (handle_search_memory): Likewise.
807         (handle_qxfer_exec_file): Likewise.
808         (handle_qxfer_libraries): Likewise.
809         (handle_qxfer): Likewise.
810         (handle_query): Likewise.
811         (handle_v_cont): Likewise.
812         (handle_v_run): Likewise.
813         (captured_main): Likewise.
814         * target.c (write_inferior_memory): Likewise.
815         * thread-db.c (try_thread_db_load_from_dir): Likewise.
816         * tracepoint.c (init_trace_buffer): Likewise.
817         (add_tracepoint_action): Likewise.
818         (add_traceframe): Likewise.
819         (add_traceframe_block): Likewise.
820         (cmd_qtdpsrc): Likewise.
821         (cmd_qtdv): Likewise.
822         (cmd_qtstatus): Likewise.
823         (response_source): Likewise.
824         (response_tsv): Likewise.
825         (cmd_qtnotes): Likewise.
826         (gdb_collect): Likewise.
827         (initialize_tracepoint): Likewise.
828
829 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
830
831         * linux-aarch64-low-.c: Include ax.h and tracepoint.h.
832         (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
833         <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
834         <NOP>: New.
835         (enum aarch64_condition_codes): New enum.
836         (w0): New static global.
837         (fp): Likewise.
838         (lr): Likewise.
839         (struct aarch64_memory_operand) <type>: New
840         MEMORY_OPERAND_POSTINDEX type.
841         (postindex_memory_operand): New helper function.
842         (emit_ret): New function.
843         (emit_load_store_pair): New function, factored out of emit_stp
844         with support for MEMORY_OPERAND_POSTINDEX.
845         (emit_stp): Rewrite using emit_load_store_pair.
846         (emit_ldp): New function.
847         (emit_load_store): Likewise.
848         (emit_ldr): Mention post-index instruction in comment.
849         (emit_ldrh): New function.
850         (emit_ldrb): New function.
851         (emit_ldrsw): Mention post-index instruction in comment.
852         (emit_str): Likewise.
853         (emit_subs): New function.
854         (emit_cmp): Likewise.
855         (emit_and): Likewise.
856         (emit_orr): Likewise.
857         (emit_orn): Likewise.
858         (emit_eor): Likewise.
859         (emit_mvn): Likewise.
860         (emit_lslv): Likewise.
861         (emit_lsrv): Likewise.
862         (emit_asrv): Likewise.
863         (emit_mul): Likewise.
864         (emit_sbfm): Likewise.
865         (emit_sbfx): Likewise.
866         (emit_ubfm): Likewise.
867         (emit_ubfx): Likewise.
868         (emit_csinc): Likewise.
869         (emit_cset): Likewise.
870         (emit_nop): Likewise.
871         (emit_ops_insns): New helper function.
872         (emit_pop): Likewise.
873         (emit_push): Likewise.
874         (aarch64_emit_prologue): New function.
875         (aarch64_emit_epilogue): Likewise.
876         (aarch64_emit_add): Likewise.
877         (aarch64_emit_sub): Likewise.
878         (aarch64_emit_mul): Likewise.
879         (aarch64_emit_lsh): Likewise.
880         (aarch64_emit_rsh_signed): Likewise.
881         (aarch64_emit_rsh_unsigned): Likewise.
882         (aarch64_emit_ext): Likewise.
883         (aarch64_emit_log_not): Likewise.
884         (aarch64_emit_bit_and): Likewise.
885         (aarch64_emit_bit_or): Likewise.
886         (aarch64_emit_bit_xor): Likewise.
887         (aarch64_emit_bit_not): Likewise.
888         (aarch64_emit_equal): Likewise.
889         (aarch64_emit_less_signed): Likewise.
890         (aarch64_emit_less_unsigned): Likewise.
891         (aarch64_emit_ref): Likewise.
892         (aarch64_emit_if_goto): Likewise.
893         (aarch64_emit_goto): Likewise.
894         (aarch64_write_goto_address): Likewise.
895         (aarch64_emit_const): Likewise.
896         (aarch64_emit_call): Likewise.
897         (aarch64_emit_reg): Likewise.
898         (aarch64_emit_pop): Likewise.
899         (aarch64_emit_stack_flush): Likewise.
900         (aarch64_emit_zero_ext): Likewise.
901         (aarch64_emit_swap): Likewise.
902         (aarch64_emit_stack_adjust): Likewise.
903         (aarch64_emit_int_call_1): Likewise.
904         (aarch64_emit_void_call_2): Likewise.
905         (aarch64_emit_eq_goto): Likewise.
906         (aarch64_emit_ne_goto): Likewise.
907         (aarch64_emit_lt_goto): Likewise.
908         (aarch64_emit_le_goto): Likewise.
909         (aarch64_emit_gt_goto): Likewise.
910         (aarch64_emit_ge_got): Likewise.
911         (aarch64_emit_ops_impl): New static global variable.
912         (aarch64_emit_ops): New target function, return
913         &aarch64_emit_ops_impl.
914         (struct linux_target_ops): Install it.
915
916 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
917
918         * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
919         * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
920         aarch64-ipa.o.
921         * linux-aarch64-ipa.c: New file.
922         * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
923         and endian.h.
924         (aarch64_get_thread_area): New target method.
925         (extract_signed_bitfield): New helper function.
926         (aarch64_decode_ldr_literal): New function.
927         (enum aarch64_opcodes): New enum.
928         (struct aarch64_register): New struct.
929         (struct aarch64_operand): New struct.
930         (x0): New static global.
931         (x1): Likewise.
932         (x2): Likewise.
933         (x3): Likewise.
934         (x4): Likewise.
935         (w2): Likewise.
936         (ip0): Likewise.
937         (sp): Likewise.
938         (xzr): Likewise.
939         (aarch64_register): New helper function.
940         (register_operand): Likewise.
941         (immediate_operand): Likewise.
942         (struct aarch64_memory_operand): New struct.
943         (offset_memory_operand): New helper function.
944         (preindex_memory_operand): Likewise.
945         (enum aarch64_system_control_registers): New enum.
946         (ENCODE): New macro.
947         (emit_insn): New helper function.
948         (emit_b): New function.
949         (emit_bcond): Likewise.
950         (emit_cb): Likewise.
951         (emit_tb): Likewise.
952         (emit_blr): Likewise.
953         (emit_stp): Likewise.
954         (emit_ldp_q_offset): Likewise.
955         (emit_stp_q_offset): Likewise.
956         (emit_load_store): Likewise.
957         (emit_ldr): Likewise.
958         (emit_ldrsw): Likewise.
959         (emit_str): Likewise.
960         (emit_ldaxr): Likewise.
961         (emit_stxr): Likewise.
962         (emit_stlr): Likewise.
963         (emit_data_processing_reg): Likewise.
964         (emit_data_processing): Likewise.
965         (emit_add): Likewise.
966         (emit_sub): Likewise.
967         (emit_mov): Likewise.
968         (emit_movk): Likewise.
969         (emit_mov_addr): Likewise.
970         (emit_mrs): Likewise.
971         (emit_msr): Likewise.
972         (emit_sevl): Likewise.
973         (emit_wfe): Likewise.
974         (append_insns): Likewise.
975         (can_encode_int32_in): New helper function.
976         (aarch64_relocate_instruction): New function.
977         (aarch64_install_fast_tracepoint_jump_pad): Likewise.
978         (aarch64_get_min_fast_tracepoint_insn_len): Likewise.
979         (struct linux_target_ops): Install aarch64_get_thread_area,
980         aarch64_install_fast_tracepoint_jump_pad and
981         aarch64_get_min_fast_tracepoint_insn_len.
982
983 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
984
985         * Makefile.in (aarch64-insn.o): New rule.
986         * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
987
988 2015-09-21  Yao Qi  <yao.qi@linaro.org>
989
990         * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
991
992 2015-09-21  Yao Qi  <yao.qi@linaro.org>
993
994         * tracepoint.c (max_jump_pad_size): Remove.
995
996 2015-09-18  Yao Qi  <yao.qi@linaro.org>
997
998         * linux-aarch64-low.c: Don't include sys/uio.h.
999         (ps_get_thread_area): Call aarch64_ps_get_thread_area.
1000
1001 2015-09-16  Wei-cheng Wang  <cole945@gmail.com>
1002
1003         * tracepoint.c (eval_result_type): Change prototype.
1004         (condition_true_at_tracepoint): Fix argument to compiled_cond.
1005
1006 2015-09-15  Pedro Alves  <palves@redhat.com>
1007
1008         * remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
1009         Check whether to report exec events instead of checking whether
1010         multiprocess is enabled.
1011
1012 2015-09-15  Pedro Alves  <palves@redhat.com>
1013
1014         PR remote/18965
1015         * remote-utils.c (prepare_resume_reply): Merge
1016         TARGET_WAITKIND_VFORK_DONE switch case with the
1017         TARGET_WAITKIND_FORKED case.
1018
1019 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1020
1021         * server.c (handle_query): Check string comparison using
1022         "else if" instead of "if".
1023
1024 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1025
1026         * server.c (vCont_supported): New global variable.
1027         (handle_query): Set vCont_supported to 1 if "vContSupported+"
1028         matches.  Append ";vContSupported+" to own_buf.
1029         (handle_v_requests): Append ";s;S" to own_buf if target supports
1030         hardware single step or vCont_supported is false.
1031         (capture_main): Set vCont_supported to zero.
1032
1033 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1034
1035         * linux-low.c (linux_supports_conditional_breakpoints): Rename
1036         it to ...
1037         (linux_supports_hardware_single_step): ... New function.
1038         (linux_target_ops): Update.
1039         * lynx-low.c (lynx_target_ops): Set field
1040         supports_hardware_single_step to target_can_do_hardware_single_step.
1041         * nto-low.c (nto_target_ops): Likewise.
1042         * spu-low.c (spu_target_ops): Likewise.
1043         * win32-low.c (win32_target_ops): Likewise.
1044         * target.c (target_can_do_hardware_single_step): New function.
1045         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1046         Remove.  <supports_hardware_single_step>: New field.
1047         (target_supports_conditional_breakpoints): Remove.
1048         (target_supports_hardware_single_step): New macro.
1049         (target_can_do_hardware_single_step): Declare.
1050         * server.c (handle_query): Use target_supports_hardware_single_step
1051         instead of target_supports_conditional_breakpoints.
1052
1053 2015-09-15  Yao Qi  <yao.qi@linaro.org>
1054
1055         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
1056         function.
1057         (struct linux_target_ops the_low_target): Install
1058         aarch64_linux_siginfo_fixup.
1059
1060 2015-09-11  Don Breazeal  <donb@codesourcery.com>
1061             Luis Machado  <lgustavo@codesourcery.com>
1062
1063         * linux-low.c (linux_mourn): Static declaration.
1064         (linux_arch_setup): Move in front of
1065         handle_extended_wait.
1066         (linux_arch_setup_thread): New function.
1067         (handle_extended_wait): Handle exec events.  Call
1068         linux_arch_setup_thread.  Make event_lwp argument a
1069         pointer-to-a-pointer.
1070         (check_zombie_leaders): Do not check stopped threads.
1071         (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
1072         (linux_low_filter_event): Add lwp and thread for exec'ing
1073         non-leader thread if leader thread has been deleted.
1074         Refactor code into linux_arch_setup_thread and call it.
1075         Pass child lwp pointer by reference to handle_extended_wait.
1076         (linux_wait_for_event_filtered): Update comment.
1077         (linux_wait_1): Prevent clobbering exec event status.
1078         (linux_supports_exec_events): New function.
1079         (linux_target_ops) <supports_exec_events>: Initialize new member.
1080         * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
1081         new member.
1082         * remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
1083         * server.c (report_exec_events): New global variable.
1084         (handle_query): Handle qSupported query for exec-events feature.
1085         (captured_main): Initialize report_exec_events.
1086         * server.h (report_exec_events): Declare new global variable.
1087         * target.h (struct target_ops) <supports_exec_events>: New
1088         member.
1089         (target_supports_exec_events): New macro.
1090         * win32-low.c (win32_target_ops) <supports_exec_events>:
1091         Initialize new member.
1092
1093 2015-09-09  Markus Metzger  <markus.t.metzger@intel.com>
1094
1095         * linux-low.c (linux_low_enable_btrace): Remove.
1096         (linux_target_ops): Replace linux_low_enable_btrace with
1097         linux_enable_btrace.
1098
1099 2015-09-03  Yao Qi  <yao.qi@linaro.org>
1100
1101         * linux-aarch64-low.c (aarch64_insert_point): Call
1102         aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
1103         returns true.
1104
1105 2015-08-27  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
1106
1107         * linux-low.c (check_stopped_by_breakpoint): Use
1108         GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
1109
1110 2015-08-27  Pedro Alves  <palves@redhat.com>
1111
1112         * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
1113
1114 2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
1115
1116         * ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
1117         the XNEW-family equivalent.
1118         (compile_bytecodes): Likewise.
1119         * dll.c (loaded_dll): Likewise.
1120         * event-loop.c (append_callback_event): Likewise.
1121         (create_file_handler): Likewise.
1122         (create_file_event): Likewise.
1123         * hostio.c (handle_open): Likewise.
1124         * inferiors.c (add_thread): Likewise.
1125         (add_process): Likewise.
1126         * linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
1127         * linux-arm-low.c (arm_new_process): Likewise.
1128         (arm_new_thread): Likewise.
1129         * linux-low.c (add_to_pid_list): Likewise.
1130         (linux_add_process): Likewise.
1131         (handle_extended_wait): Likewise.
1132         (add_lwp): Likewise.
1133         (enqueue_one_deferred_signal): Likewise.
1134         (enqueue_pending_signal): Likewise.
1135         (linux_resume_one_lwp_throw): Likewise.
1136         (linux_resume_one_thread): Likewise.
1137         (linux_read_memory): Likewise.
1138         (linux_write_memory): Likewise.
1139         * linux-mips-low.c (mips_linux_new_process): Likewise.
1140         (mips_linux_new_thread): Likewise.
1141         (mips_add_watchpoint): Likewise.
1142         * linux-x86-low.c (initialize_low_arch): Likewise.
1143         * lynx-low.c (lynx_add_process): Likewise.
1144         * mem-break.c (set_raw_breakpoint_at): Likewise.
1145         (set_breakpoint): Likewise.
1146         (add_condition_to_breakpoint): Likewise.
1147         (add_commands_to_breakpoint): Likewise.
1148         (clone_agent_expr): Likewise.
1149         (clone_one_breakpoint): Likewise.
1150         * regcache.c (new_register_cache): Likewise.
1151         * remote-utils.c (look_up_one_symbol): Likewise.
1152         * server.c (queue_stop_reply): Likewise.
1153         (start_inferior): Likewise.
1154         (queue_stop_reply_callback): Likewise.
1155         (handle_target_event): Likewise.
1156         * spu-low.c (fetch_ppc_memory): Likewise.
1157         (store_ppc_memory): Likewise.
1158         * target.c (set_target_ops): Likewise.
1159         * thread-db.c (thread_db_load_search): Likewise.
1160         (try_thread_db_load_1): Likewise.
1161         * tracepoint.c (add_tracepoint): Likewise.
1162         (add_tracepoint_action): Likewise.
1163         (create_trace_state_variable): Likewise.
1164         (cmd_qtdpsrc): Likewise.
1165         (cmd_qtro): Likewise.
1166         (add_while_stepping_state): Likewise.
1167         * win32-low.c (child_add_thread): Likewise.
1168         (get_image_name): Likewise.
1169
1170 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1171
1172         * linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
1173
1174 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1175
1176         * Makefile.in (aarch64-linux.o): New rule.
1177         * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
1178         srv_tgtobj.
1179         * linux-aarch64-low.c: Include nat/aarch64-linux.h.
1180         (aarch64_init_debug_reg_state): Make it extern.
1181         (aarch64_linux_prepare_to_resume): Remove.
1182
1183 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1184
1185         * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
1186         lwp_arch_private_info and ptid_of_lwp.
1187
1188 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1189
1190         * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
1191         Find proc_info by find_process_pid.  All callers updated.
1192
1193 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1194
1195         * linux-aarch64-low.c (struct arch64_dr_update_callback_param):
1196         Remove.
1197         (debug_reg_change_callback): Remove.
1198         (aarch64_notify_debug_reg_change): Remove.
1199
1200 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1201
1202         * linux-aarch64-low.c (aarch64_notify_debug_reg_change):
1203         Call current_lwp_ptid.
1204
1205 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1206
1207         * linux-aarch64-low.c (debug_reg_change_callback): Use
1208         debug_printf.
1209
1210 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1211
1212         * linux-aarch64-low.c (debug_reg_change_callback): Use phex.
1213
1214 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1215
1216         * linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
1217
1218 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1219
1220         * linux-aarch64-low.c (debug_reg_change_callback): Re-indent
1221         the code.
1222
1223 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1224
1225         * linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
1226         Remove.
1227         (debug_reg_change_callback): Remove argument entry and add argument
1228         lwp.  Remove local variable thread.  Don't print thread id in the
1229         debugging output.  Don't check whether pid of thread equals to pid.
1230         (aarch64_notify_debug_reg_change): Don't set param.pid.  Call
1231         iterate_over_lwps instead find_inferior.
1232
1233 2015-08-24  Pedro Alves  <palves@redhat.com>
1234
1235         * inferiors.c (get_first_process): New function.
1236         * inferiors.h (get_first_process): New declaration.
1237         * remote-utils.c (read_ptid): Default to the first process in the
1238         list, instead of to the current thread's process.
1239
1240 2015-08-24  Pedro Alves  <palves@redhat.com>
1241
1242         * debug.c: Include gdb_sys_time.h instead of sys/time.h.
1243         * event-loop.c: Likewise.
1244         * remote-utils.c: Likewise.
1245         * tracepoint.c: Likewise.
1246
1247 2015-08-24  Pedro Alves  <palves@redhat.com>
1248
1249         * spu-low.c (spu_request_interrupt): Use lwpid_of instead of
1250         ptid_get_lwp.
1251
1252 2015-08-21  Pedro Alves  <palves@redhat.com>
1253
1254         * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
1255         instead of literal 1.
1256
1257 2015-08-21  Pedro Alves  <palves@redhat.com>
1258
1259         * tdesc.c (default_description): Explicitly zero-initialize.
1260
1261 2015-08-21  Pedro Alves  <palves@redhat.com>
1262
1263         PR gdb/18749
1264         * inferiors.c (remove_thread): Discard any pending stop reply for
1265         this thread.
1266         * server.c (remove_all_on_match_pid): Rename to ...
1267         (remove_all_on_match_ptid): ... this.  Work with a filter ptid
1268         instead of a pid.
1269         (discard_queued_stop_replies): Change parameter to a ptid.  Now
1270         extern.
1271         (handle_v_kill, kill_inferior_callback, captured_main)
1272         (process_serial_event): Adjust.
1273         * server.h (discard_queued_stop_replies): Declare.
1274
1275 2015-08-21  Pedro Alves  <palves@redhat.com>
1276
1277         * linux-low.c (wait_for_sigstop): Always switch to no thread
1278         selected if the previously current thread dies.
1279         * lynx-low.c (lynx_request_interrupt): Use the first thread's
1280         process instead of the current thread's.
1281         * remote-utils.c (input_interrupt): Don't check if there's no
1282         current thread.
1283         * server.c (gdb_read_memory, gdb_write_memory): If setting the
1284         current thread to the general thread fails, error out.
1285         (handle_qxfer_auxv, handle_qxfer_libraries)
1286         (handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
1287         (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
1288         (handle_query): Check if there's a thread selected instead of
1289         checking whether there's any thread in the thread list.
1290         (handle_qxfer_threads, handle_qxfer_btrace)
1291         (handle_qxfer_btrace_conf): Don't error out early if there's no
1292         thread in the thread list.
1293         (handle_v_cont, myresume): Don't set the current thread to the
1294         continue thread.
1295         (process_serial_event) <Hg handling>: Also set thread_id if the
1296         previous general thread is still alive.
1297         (process_serial_event) <g/G handling>: If setting the current
1298         thread to the general thread fails, error out.
1299         * spu-low.c (spu_resume, spu_request_interrupt): Use the first
1300         thread's lwp instead of the current thread's.
1301         * target.c (set_desired_thread): If the desired thread was not
1302         found, leave the current thread pointing to NULL.  Return an int
1303         (boolean) indicating success.
1304         * target.h (set_desired_thread): Change return type to int.
1305
1306 2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
1307
1308         * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
1309         * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
1310         #includes.
1311         (ps_get_thread_area): New function.
1312
1313 2015-08-19  Gary Benson  <gbenson@redhat.com>
1314
1315         * hostio.c (handle_pread): Do not attempt to read more data
1316         than hostio_reply_with_data can fit in a packet.
1317
1318 2015-08-18  Joel Brobecker  <brobecker@adacore.com>
1319
1320         * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
1321
1322 2015-08-14  Matthew Fortune  <matthew.fortune@imgtec.com>
1323
1324         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
1325
1326 2015-08-06  Pedro Alves  <palves@redhat.com>
1327
1328         * tracepoint.c (expr_eval_result): Now an int.
1329
1330 2015-08-06  Pedro Alves  <palves@redhat.com>
1331
1332         * gdbthread.h (struct regcache): Forward declare.
1333         (struct thread_info) <regcache_data>: Now a struct regcache
1334         pointer.
1335         * inferiors.c (inferior_regcache_data)
1336         (set_inferior_regcache_data): Now work with struct regcache
1337         pointers.
1338         * inferiors.h (struct regcache): Forward declare.
1339         (inferior_regcache_data, set_inferior_regcache_data): Now work
1340         with struct regcache pointers.
1341         * regcache.c (get_thread_regcache, regcache_invalidate_thread)
1342         (free_register_cache_thread): Remove struct regcache pointer
1343         casts.
1344
1345 2015-08-06  Pedro Alves  <palves@redhat.com>
1346
1347         * server.c (captured_main): On error, print the exception message
1348         to stderr, and if run_once is set, throw a quit.
1349
1350 2015-08-06  Pedro Alves  <palves@redhat.com>
1351
1352         * linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
1353         the current thread.
1354
1355 2015-08-06  Pedro Alves  <palves@redhat.com>
1356
1357         * linux-low.c (linux_write_memory): Rewrite debug output to avoid
1358         reading beyond the passed in buffer length.
1359
1360 2015-08-06  Pierre Langlois  <pierre.langlois@arm.com>
1361
1362         * tracepoint.c (symbol_list) <required>: Remove.
1363
1364 2015-08-06  Pedro Alves  <palves@redhat.com>
1365
1366         * linux-low.c (handle_extended_wait): Set the fork child's suspend
1367         count if stopping and suspending threads.
1368         (check_stopped_by_breakpoint): If stopped by trace, set the LWP's
1369         stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
1370         (linux_detach): Complete an ongoing step-over.
1371         (lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
1372         throughout.
1373         (resume_stopped_resumed_lwps): Don't resume a suspended thread.
1374         (linux_wait_1): If passing a signal to the inferior after
1375         finishing a step-over, unsuspend and re-resume all lwps.  If we
1376         see a single-step event but the thread should be continuing, don't
1377         pass the trap to gdb.
1378         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
1379         internal_error instead of gdb_assert.
1380         (enqueue_pending_signal): New function.
1381         (check_ptrace_stopped_lwp_gone): Add debug output.
1382         (start_step_over): Use internal_error instead of gdb_assert.
1383         (complete_ongoing_step_over): New function.
1384         (linux_resume_one_thread): Don't resume a suspended thread.
1385         (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
1386         it stepping.
1387
1388 2015-08-06  Pedro Alves  <palves@redhat.com>
1389
1390         * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
1391         (linux_thread_alive): Use lwp_is_marked_dead.
1392         (extended_event_reported): Delete.
1393         (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
1394         instead of extended_event_reported.
1395         (mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
1396         as well.
1397         (lwp_is_marked_dead): New function.
1398         (lwp_running): Use lwp_is_marked_dead.
1399         * linux-low.h: Delete 'dead' field, and update 'waitstatus's
1400         comment.
1401
1402 2015-08-06  Pedro Alves  <palves@redhat.com>
1403
1404         * linux-low.c (linux_wait_1): Move fork event output out of the
1405         !report_to_gdb check.  Pass event_child->waitstatus to
1406         target_waitstatus_to_string instead of ourstatus.
1407
1408 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1409
1410         * linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
1411         if current_thread is 32 bit.
1412
1413 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1414
1415         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
1416         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
1417         * server.c (extended_protocol): Remove "static".
1418         * server.h (extended_protocol): Declare it.
1419
1420 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1421
1422         * linux-aarch64-low.c (aarch64_get_pc): Get PC register on
1423         both aarch64 and aarch32.
1424         (aarch64_set_pc): Likewise.
1425
1426 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1427
1428         * configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
1429         to srv_regobj and append arm-core.xml arm-vfpv3.xml and
1430         arm-with-neon.xml to srv_xmlfiles.
1431         * linux-aarch64-low.c: Include linux-aarch32-low.h.
1432         (is_64bit_tdesc): New function.
1433         (aarch64_linux_read_description): New function.
1434         (aarch64_arch_setup): Call aarch64_linux_read_description.
1435         (regs_info): Rename to regs_info_aarch64.
1436         (aarch64_regs_info): Return right regs_info.
1437         (initialize_low_arch): Call initialize_low_arch_aarch32.
1438
1439 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1440
1441         * configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
1442         * linux-aarch32-low.c: New file.
1443         * linux-aarch32-low.h: New file.
1444         * linux-arm-low.c (arm_fill_gregset): Move it to
1445         linux-aarch32-low.c.
1446         (arm_store_gregset): Likewise.
1447         (arm_fill_vfpregset): Call arm_fill_vfpregset_num
1448         (arm_store_vfpregset): Call arm_store_vfpregset_num.
1449         (arm_arch_setup): Check if PTRACE_GETREGSET works.
1450         (regs_info): Rename to regs_info_arm.
1451         (arm_regs_info): Return regs_info_aarch32 if
1452         have_ptrace_getregset is 1 and target description is
1453         arm_with_neon or arm_with_vfpv3.
1454         (initialize_low_arch): Don't call init_registers_arm_with_neon.
1455         Call initialize_low_arch_aarch32 instead.
1456
1457 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1458
1459         * linux-x86-low.c (have_ptrace_getregset): Move it to ...
1460         * linux-low.c: ... here.
1461         * linux-low.h (have_ptrace_getregset): Declare it.
1462
1463 2015-08-04  Pedro Alves  <palves@redhat.com>
1464
1465         * thread-db.c (struct thread_db): Use new typedefs.
1466         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
1467         CHK calls.
1468         (disable_thread_event_reporting): Cast result of dlsym to
1469         destination function pointer type.
1470         (thread_db_mourn): Use td_ta_delete_ftype.
1471
1472 2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
1473
1474         * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
1475         arch variant.
1476         (CDX_BREAKPOINT): Define for R2.
1477         (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
1478         (the_low_target): Add comments.
1479
1480 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1481
1482         * linux-arm-low.c (arm_hwcap): Remove it.
1483         (arm_read_description): New local variable arm_hwcap.  Don't
1484         set arm_hwcap to zero.
1485
1486 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1487
1488         * linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
1489         Use regcache->tdesc instead.
1490         (arm_store_wmmxregset): Likewise.
1491         (arm_fill_vfpregset): Likewise.
1492         (arm_store_vfpregset): Likewise.
1493
1494 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1495
1496         * linux-arm-low.c: Include arch/arm.h.
1497         (arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
1498         (arm_store_gregset): Likewise.
1499
1500 2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
1501
1502         * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
1503         ptrace's 4th parameter.
1504
1505 2015-07-27  Yao Qi  <yao.qi@linaro.org>
1506
1507         * configure.srv (case aarch64*-*-linux*): Don't set
1508         srv_linux_usrregs.
1509
1510 2015-07-24  Pedro Alves  <palves@redhat.c: Likewise.om>
1511
1512         * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
1513         sys/ptrace.h.
1514         * linux-arm-low.c: Likewise.
1515         * linux-cris-low.c: Likewise.
1516         * linux-crisv32-low.c: Likewise.
1517         * linux-low.c: Likewise.
1518         * linux-m68k-low.c: Likewise.
1519         * linux-mips-low.c: Likewise.
1520         * linux-nios2-low.c: Likewise.
1521         * linux-s390-low.c: Likewise.
1522         * linux-sparc-low.c: Likewise.
1523         * linux-tic6x-low.c: Likewise.
1524         * linux-tile-low.c: Likewise.
1525         * linux-x86-low.c: Likewise.
1526
1527 2015-07-24  Pedro Alves  <palves@redhat.com>
1528
1529         * config.in: Regenerate.
1530         * configure: Regenerate.
1531
1532 2015-07-24  Pedro Alves  <palves@redhat.com>
1533
1534         * acinclude.m4: Include ../ptrace.m4.
1535         * configure.ac: Call GDB_AC_PTRACE.
1536         * config.in, configure: Regenerate.
1537
1538 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1539
1540         * linux-low.c (linux_create_inferior): Remove setting to
1541         proc->priv->new_inferior.
1542         (linux_attach): Likewise.
1543         (linux_low_filter_event): Likewise.
1544         * linux-low.h (struct process_info_private) <new_inferior>: Remove.
1545
1546 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1547
1548         * linux-low.c (linux_arch_setup): New function.
1549         (linux_low_filter_event): If proc->tdesc is NULL and
1550         proc->attached is true, call the_low_target.arch_setup.
1551         Otherwise, keep status pending, and return.
1552         (linux_resume_one_lwp_throw): Don't call get_pc if
1553         thread->while_stepping isn't NULL.  Don't call
1554         get_thread_regcache if proc->tdesc is NULL.
1555         (need_step_over_p): Return 0 if proc->tdesc is NULL.
1556         (linux_target_ops): Install arch_setup.
1557         * server.c (start_inferior): Call the_target->arch_setup.
1558         * target.h (struct target_ops) <arch_setup>: New field.
1559         (target_arch_setup): New marco.
1560         * lynx-low.c (lynx_target_ops): Update.
1561         * nto-low.c (nto_target_ops): Update.
1562         * spu-low.c (spu_target_ops): Update.
1563         * win32-low.c (win32_target_ops): Update.
1564
1565 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1566
1567         * linux-low.c (linux_add_process): Don't set
1568         proc->priv->new_inferior.
1569         (linux_create_inferior): Set proc->priv->new_inferior to 1.
1570         (linux_attach): Likewise.
1571
1572 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1573
1574         * server.c (start_inferior): Code refactor.
1575
1576 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1577
1578         * server.c (process_serial_event): Set general_thread.
1579
1580 2015-07-21  Yao Qi  <yao.qi@linaro.org>
1581
1582         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
1583         aarch64_linux_get_debug_reg_capacity.
1584
1585 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1586
1587         * Makefile.in (aarch64-linux-hw-point.o): New rule.
1588         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
1589         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
1590         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
1591         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
1592         (AARCH64_HWP_ALIGNMENT): Likewise.
1593         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
1594         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
1595         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
1596         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
1597         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
1598         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
1599         (struct aarch64_debug_reg_state): Likewise.
1600         (struct arch_lwp_info): Likewise.
1601         (aarch64_align_watchpoint): Likewise.
1602         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
1603         (aarch64_watchpoint_length): Likewise.
1604         (aarch64_point_encode_ctrl_reg): Likewise
1605         (aarch64_point_is_aligned): Likewise.
1606         (aarch64_align_watchpoint): Likewise.
1607         (aarch64_linux_set_debug_regs):
1608         (aarch64_dr_state_insert_one_point): Likewise.
1609         (aarch64_dr_state_remove_one_point): Likewise.
1610         (aarch64_handle_breakpoint): Likewise.
1611         (aarch64_handle_aligned_watchpoint): Likewise.
1612         (aarch64_handle_unaligned_watchpoint): Likewise.
1613         (aarch64_handle_watchpoint): Likewise.
1614
1615 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1616
1617         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
1618         and don't aarch64_get_debug_reg_state.  All callers update.
1619         (aarch64_handle_aligned_watchpoint): Likewise.
1620         (aarch64_handle_unaligned_watchpoint): Likewise.
1621         (aarch64_handle_watchpoint): Likewise.
1622         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
1623         (aarch64_remove_point): Likewise.
1624
1625 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1626
1627         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
1628         debug_printf.
1629         (aarch64_handle_unaligned_watchpoint): Likewise.
1630
1631 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1632
1633         Revert the previous 3 commits:
1634         Move gdb_regex* to common/
1635         Move linux_find_memory_regions_full & co.
1636         gdbserver build-id attribute generator
1637
1638 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1639             Jan Kratochvil  <jan.kratochvil@redhat.com>
1640
1641         gdbserver build-id attribute generator.
1642         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
1643         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
1644         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
1645         (find_phdr): New.
1646         (get_dynamic): Use find_pdhr to traverse program headers.
1647         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
1648         (compare_mapping_entry_range, struct find_memory_region_callback_data)
1649         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
1650         (get_hex_build_id): New.
1651         (linux_qxfer_libraries_svr4): Add optional build-id attribute
1652         to reply XML document.
1653
1654 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1655             Jan Kratochvil  <jan.kratochvil@redhat.com>
1656
1657         * target.c: Include target/target-utils.h and fcntl.h.
1658         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
1659         (target_fileio_read_stralloc): New functions.
1660
1661 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1662
1663         * Makefile.in (OBS): Add gdb_regex.o.
1664         (gdb_regex.o): New.
1665         * config.in: Rebuilt.
1666         * configure: Rebuilt.
1667
1668 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1669             Jan Kratochvil  <jan.kratochvil@redhat.com>
1670
1671         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
1672         * Makefile.in (OBS): Add target-utils.o.
1673         (linux-maps.o, target-utils.o): New.
1674         * configure.srv (srv_linux_obj): Add linux-maps.o.
1675
1676 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
1677
1678         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
1679         function, return 1.
1680         (the_low_target): Install it.
1681
1682 2015-07-14  Pedro Alves  <palves@redhat.com>
1683
1684         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
1685         Instead, ignore ECHILD, and throw an error for other errnos.
1686
1687 2015-07-10  Pedro Alves  <palves@redhat.com>
1688
1689         * event-loop.c (struct callback_event) <data>: Change type to
1690         gdb_client_data instance instead of gdb_client_data pointer.
1691         (append_callback_event): Adjust.
1692
1693 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
1694
1695         * linux-aarch64-low.c: Add comments for each linux_target_ops
1696         method.  Remove comments already covered in target_ops and
1697         linux_target_ops definitions.
1698         (the_low_target): Add comments for each unimplemented method.
1699
1700 2015-07-09  Yao Qi  <yao.qi@linaro.org>
1701
1702         * linux-aarch64-low.c (aarch64_regmap): Remove.
1703         (aarch64_usrregs_info): Remove.
1704         (regs_info): Set field usrregs to NULL.
1705
1706 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
1707
1708         * linux-low.c: Include "rsp-low.h"
1709         (linux_low_encode_pt_config, linux_low_encode_raw): New.
1710         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
1711         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
1712         (handle_btrace_enable_pt): New.
1713         (handle_btrace_general_set): Support "pt".
1714         (handle_btrace_conf_general_set): Support "pt:size".
1715
1716 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1717
1718         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
1719         Z_PACKET_SW_BP.
1720
1721 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1722
1723         * linux-aarch64-low.c: Remove comment about endianness.
1724         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
1725         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
1726         memcmp.
1727
1728 2015-06-24  Gary Benson  <gbenson@redhat.com>
1729
1730         * linux-i386-ipa.c (stdint.h): Do not include.
1731         * lynx-i386-low.c (stdint.h): Likewise.
1732         * lynx-ppc-low.c (stdint.h): Likewise.
1733         * mem-break.c (stdint.h): Likewise.
1734         * thread-db.c (stdint.h): Likewise.
1735         * tracepoint.c (stdint.h): Likewise.
1736         * win32-low.c (stdint.h): Likewise.
1737
1738 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
1739
1740         * server.c (write_qxfer_response): Update call to
1741         remote_escape_output.
1742
1743 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
1744             Jan Kratochvil  <jan.kratochvil@redhat.com>
1745
1746         Merge multiple hex conversions.
1747         * gdbreplay.c (tohex): Rename to 'fromhex'.
1748         (logchar): Use fromhex.
1749
1750 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1751
1752         * server.c (handle_qxfer_libraries): Set `version' attribute for
1753         <library-list>.
1754
1755 2015-06-10  Gary Benson  <gbenson@redhat.com>
1756
1757         * target.h (struct target_ops) <multifs_open>: New field.
1758         <multifs_unlink>: Likewise.
1759         <multifs_readlink>: Likewise.
1760         * linux-low.c (nat/linux-namespaces.h): New include.
1761         (linux_target_ops): Initialize the_target->multifs_open,
1762         the_target->multifs_unlink and the_target->multifs_readlink.
1763         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
1764         * hostio.c (hostio_fs_pid): New static variable.
1765         (hostio_handle_new_gdb_connection): New function.
1766         (handle_setfs): Likewise.
1767         (handle_open): Use the_target->multifs_open as appropriate.
1768         (handle_unlink): Use the_target->multifs_unlink as appropriate.
1769         (handle_readlink): Use the_target->multifs_readlink as
1770         appropriate.
1771         (handle_vFile): Handle vFile:setfs packets.
1772         * server.c (handle_query): Call hostio_handle_new_gdb_connection
1773         after target_handle_new_gdb_connection.
1774
1775 2015-06-10  Gary Benson  <gbenson@redhat.com>
1776
1777         * configure.ac (AC_CHECK_FUNCS): Add setns.
1778         * config.in: Regenerate.
1779         * configure: Likewise.
1780         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
1781         (linux-namespaces.o): New rule.
1782         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
1783
1784 2015-06-09  Gary Benson <gbenson@redhat.com>
1785
1786         * hostio.c (handle_open): Process mode argument with
1787         fileio_to_host_mode.
1788
1789 2015-06-01  Yao Qi  <yao.qi@linaro.org>
1790
1791         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
1792         * linux-x86-low.c: Likewise.
1793
1794 2015-05-28  Don Breazeal  <donb@codesourcery.com>
1795
1796         * linux-low.c (handle_extended_wait): Initialize
1797         thread_info.last_resume_kind for new fork children.
1798
1799 2015-05-15  Pedro Alves  <palves@redhat.com>
1800
1801         * target.h (target_handle_new_gdb_connection): Rewrite using if
1802         wrapped in do/while.
1803
1804 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
1805
1806         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
1807         * configure, config.in: Regenerate.
1808         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
1809         Declare typedef.
1810
1811 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1812
1813         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
1814         PTRACE_EVENT_VFORK_DONE.
1815         (linux_low_ptrace_options, extended_event_reported): Add vfork
1816         events.
1817         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
1818         and "vforkdone" for RSP 'T' Stop Reply Packet.
1819         * server.h (report_vfork_events): Declare
1820         global variable.
1821
1822 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1823
1824         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
1825         (the_low_target) <new_fork>: Initialize new member.
1826         * linux-arm-low.c (arm_new_fork): New function.
1827         (the_low_target) <new_fork>: Initialize new member.
1828         * linux-low.c (handle_extended_wait): Call new target function
1829         new_fork.
1830         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
1831         * linux-mips-low.c (mips_add_watchpoint): New function
1832         extracted from mips_insert_point.
1833         (the_low_target) <new_fork>: Initialize new member.
1834         (mips_linux_new_fork): New function.
1835         (mips_insert_point): Call mips_add_watchpoint.
1836         * linux-x86-low.c (x86_linux_new_fork): New function.
1837         (the_low_target) <new_fork>: Initialize new member.
1838
1839 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1840
1841         * linux-low.c (handle_extended_wait): Implement return value,
1842         rename argument 'event_child' to 'event_lwp', handle
1843         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
1844         (linux_low_ptrace_options): New function.
1845         (linux_low_filter_event): Call linux_low_ptrace_options,
1846         use different argument fo linux_enable_event_reporting,
1847         use return value from handle_extended_wait.
1848         (extended_event_reported): New function.
1849         (linux_wait_1): Call extended_event_reported and set
1850         status to report fork events.
1851         (linux_write_memory): Add pid to debug message.
1852         (reset_lwp_ptrace_options_callback): New function.
1853         (linux_handle_new_gdb_connection): New function.
1854         (linux_target_ops): Initialize new structure member.
1855         * linux-low.h (struct lwp_info) <waitstatus>: New member.
1856         * lynx-low.c: Initialize new structure member.
1857         * remote-utils.c (prepare_resume_reply): Implement stop reason
1858         "fork" for "T" stop message.
1859         * server.c (handle_query): Call handle_new_gdb_connection.
1860         * server.h (report_fork_events): Declare global flag.
1861         * target.h (struct target_ops) <handle_new_gdb_connection>:
1862         New member.
1863         (target_handle_new_gdb_connection): New macro.
1864         * win32-low.c: Initialize new structure member.
1865
1866 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1867
1868         * mem-break.c (APPEND_TO_LIST): Define macro.
1869         (clone_agent_expr): New function.
1870         (clone_one_breakpoint): New function.
1871         (clone_all_breakpoints): New function.
1872         * mem-break.h: Declare new functions.
1873
1874 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1875
1876         * linux-low.c (linux_supports_fork_events): New function.
1877         (linux_supports_vfork_events): New function.
1878         (linux_target_ops): Initialize new structure members.
1879         (initialize_low): Call linux_check_ptrace_features.
1880         * lynx-low.c (lynx_target_ops): Initialize new structure
1881         members.
1882         * server.c (report_fork_events, report_vfork_events):
1883         New global flags.
1884         (handle_query): Add new features to qSupported packet and
1885         response.
1886         (captured_main): Initialize new global variables.
1887         * target.h (struct target_ops) <supports_fork_events>:
1888         New member.
1889         <supports_vfork_events>: New member.
1890         (target_supports_fork_events): New macro.
1891         (target_supports_vfork_events): New macro.
1892         * win32-low.c (win32_target_ops): Initialize new structure
1893         members.
1894
1895 2015-05-12  Gary Benson <gbenson@redhat.com>
1896
1897         * server.c (handle_qxfer_exec_file): Use current process
1898         if annex is empty.
1899
1900 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
1901
1902         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
1903         Remove HAVE_PTRACE_GETREGS conditionals.
1904         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
1905         instead of PTRACE_GETREGS and PTRACE_SETREGS.
1906
1907 2015-05-08  Yao Qi  <yao.qi@linaro.org>
1908
1909         * linux-low.c (linux_supports_conditional_breakpoints): New
1910         function.
1911         (linux_target_ops): Install new target method.
1912         * lynx-low.c (lynx_target_ops): Install NULL hook for
1913         supports_conditional_breakpoints.
1914         * nto-low.c (nto_target_ops): Likewise.
1915         * spu-low.c (spu_target_ops): Likewise.
1916         * win32-low.c (win32_target_ops): Likewise.
1917         * server.c (handle_query): Check
1918         target_supports_conditional_breakpoints.
1919         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1920         New field.
1921         (target_supports_conditional_breakpoints): New macro.
1922
1923 2015-05-06  Pedro Alves  <palves@redhat.com>
1924
1925         PR server/18081
1926         * server.c (start_inferior): If the process exits, mourn it.
1927
1928 2015-04-21  Gary Benson <gbenson@redhat.com>
1929
1930         * hostio.c (fileio_open_flags_to_host): Factored out to
1931         fileio_to_host_openflags in common/fileio.c.  Single use
1932         updated.
1933
1934 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1935
1936         * linux-xtensa-low.c (xtensa_fill_gregset)
1937         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
1938         XCHAL_HAVE_LOOP.
1939
1940 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1941
1942         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
1943         (regs_info): Replace usrregs pointer with NULL.
1944
1945 2015-04-17  Gary Benson  <gbenson@redhat.com>
1946
1947         * target.h (struct target_ops) <pid_to_exec_file>: New field.
1948         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
1949         * server.c (handle_qxfer_exec_file): New function.
1950         (qxfer_packets): Add exec-file entry.
1951         (handle_query): Report qXfer:exec-file:read as supported packet.
1952
1953 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
1954
1955         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
1956
1957 2015-04-09  Gary Benson <gbenson@redhat.com>
1958
1959         * hostio-errno.c (errno_to_fileio_error): Remove function.
1960         Update caller to use remote_fileio_to_fio_error.
1961
1962 2015-04-09  Yao Qi  <yao.qi@linaro.org>
1963
1964         * linux-low.c (linux_insert_point): Call
1965         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
1966         (linux_remove_point): Call remove_memory_breakpoint if type is
1967         raw_bkpt_type_sw.
1968         * linux-x86-low.c (x86_insert_point): Don't call
1969         insert_memory_breakpoint.
1970         (x86_remove_point): Don't call remove_memory_breakpoint.
1971
1972 2015-04-01  Pedro Alves  <palves@redhat.com>
1973             Cleber Rosa  <crosa@redhat.com>
1974
1975         * server.c (gdbserver_usage): Reorganize and extend the usage
1976         message.
1977
1978 2015-03-24  Pedro Alves  <palves@redhat.com>
1979
1980         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
1981         output.  Also dump TRAP_TRACE.
1982         (linux_low_filter_event): In debug output, distinguish a
1983         resume_stop SIGSTOP from a delayed SIGSTOP.
1984
1985 2015-03-24  Gary Benson  <gbenson@redhat.com>
1986
1987         * linux-x86-low.c (x86_linux_new_thread): Moved to
1988         nat/x86-linux.c.
1989         (x86_linux_prepare_to_resume): Likewise.
1990
1991 2015-03-24  Gary Benson  <gbenson@redhat.com>
1992
1993         * Makefile.in (x86-linux-dregs.o): New rule.
1994         * configure.srv: Add x86-linux-dregs.o to relevant targets.
1995         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
1996         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
1997         (x86_linux_dr_get): Likewise.
1998         (x86_linux_dr_set): Likewise.
1999         (update_debug_registers_callback): Likewise.
2000         (x86_linux_dr_set_addr): Likewise.
2001         (x86_linux_dr_get_addr): Likewise.
2002         (x86_linux_dr_set_control): Likewise.
2003         (x86_linux_dr_get_control): Likewise.
2004         (x86_linux_dr_get_status): Likewise.
2005         (x86_linux_update_debug_registers): Likewise.
2006
2007 2015-03-24  Gary Benson  <gbenson@redhat.com>
2008
2009         * linux-x86-low.c (x86_linux_update_debug_registers):
2010         New function, factored out from...
2011         (x86_linux_prepare_to_resume): ...this.
2012
2013 2015-03-24  Gary Benson  <gbenson@redhat.com>
2014
2015         * linux-x86-low.c (x86_linux_dr_get): Update comments.
2016         (x86_linux_dr_set): Likewise.
2017         (update_debug_registers_callback): Likewise.
2018         (x86_linux_dr_set_addr): Likewise.
2019         (x86_linux_dr_get_addr): Likewise.
2020         (x86_linux_dr_set_control): Likewise.
2021         (x86_linux_dr_get_control): Likewise.
2022         (x86_linux_dr_get_status): Likewise.
2023         (x86_linux_prepare_to_resume): Likewise.
2024
2025 2015-03-24  Gary Benson  <gbenson@redhat.com>
2026
2027         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
2028         Use perror_with_name.  Pass string through gettext.
2029         (x86_linux_dr_set): Likewise.
2030
2031 2015-03-24  Gary Benson  <gbenson@redhat.com>
2032
2033         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
2034         (x86_linux_dr_set_addr): ...this.
2035         (x86_dr_low_get_addr): Rename to...
2036         (x86_linux_dr_get_addr): ...this.
2037         (x86_dr_low_set_control): Rename to...
2038         (x86_linux_dr_set_control): ...this.
2039         (x86_dr_low_get_control): Rename to...
2040         (x86_linux_dr_get_control): ...this.
2041         (x86_dr_low_get_status): Rename to...
2042         (x86_linux_dr_get_status): ...this.
2043         (x86_dr_low): Update with new function names.
2044
2045 2015-03-24  Gary Benson  <gbenson@redhat.com>
2046
2047         * Makefile.in (x86-linux.o): New rule.
2048         * configure.srv: Add x86-linux.o to relevant targets.
2049         * linux-low.c (lwp_set_arch_private_info): New function.
2050         (lwp_arch_private_info): Likewise.
2051         * linux-x86-low.c: Include nat/x86-linux.h.
2052         (arch_lwp_info): Removed structure.
2053         (update_debug_registers_callback):
2054         Use lwp_set_debug_registers_changed.
2055         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
2056         and lwp_set_debug_registers_changed.
2057         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
2058
2059 2015-03-24  Gary Benson  <gbenson@redhat.com>
2060
2061         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
2062         * linux-arm-low.c (arm_new_thread): Likewise.
2063         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
2064         * linux-mips-low.c (mips_linux_new_thread): Likewise.
2065         * linux-x86-low.c (x86_linux_new_thread): Likewise.
2066         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
2067
2068 2015-03-24  Gary Benson  <gbenson@redhat.com>
2069
2070         * linux-low.c (ptid_of_lwp): New function.
2071         (lwp_is_stopped): Likewise.
2072         (lwp_stop_reason): Likewise.
2073         * linux-x86-low.c (update_debug_registers_callback):
2074         Use lwp_is_stopped.
2075         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
2076         lwp_stop_reason.
2077
2078 2015-03-24  Gary Benson  <gbenson@redhat.com>
2079
2080         * linux-low.h (linux_stop_lwp): Remove declaration.
2081
2082 2015-03-24  Gary Benson  <gbenson@redhat.com>
2083
2084         * linux-low.h: Include nat/linux-nat.h.
2085         * linux-low.c (iterate_over_lwps_args): New structure.
2086         (iterate_over_lwps_filter): New function.
2087         (iterate_over_lwps): Likewise.
2088         * linux-x86-low.c (update_debug_registers_callback):
2089         Update signature to what iterate_over_lwps expects.
2090         Remove PID check that iterate_over_lwps now performs.
2091         (x86_dr_low_set_addr): Use iterate_over_lwps.
2092         (x86_dr_low_set_control): Likewise.
2093
2094 2015-03-24  Gary Benson  <gbenson@redhat.com>
2095
2096         * linux-x86-low.c (x86_debug_reg_state): New function.
2097         (x86_linux_prepare_to_resume): Use the above.
2098
2099 2015-03-24  Gary Benson  <gbenson@redhat.com>
2100
2101         * linux-low.c (current_lwp_ptid): New function.
2102         * linux-x86-low.c: Include nat/linux-nat.h.
2103         (x86_dr_low_get_addr): Use current_lwp_ptid.
2104         (x86_dr_low_get_control): Likewise.
2105         (x86_dr_low_get_status): Likewise.
2106
2107 2015-03-20  Pedro Alves  <palves@redhat.com>
2108
2109         * tracepoint.c (cmd_qtstatus): Make "str" const.
2110
2111 2015-03-20  Pedro Alves  <palves@redhat.com>
2112
2113         * server.c (handle_general_set): Make "req_str" const.
2114
2115 2015-03-19  Pedro Alves  <palves@redhat.com>
2116
2117         * linux-low.c (linux_resume_one_lwp): Rename to ...
2118         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
2119         instead call perror_with_name.
2120         (check_ptrace_stopped_lwp_gone): New function.
2121         (linux_resume_one_lwp): Reimplement as wrapper around
2122         linux_resume_one_lwp_throw that swallows errors if the LWP is
2123         gone.
2124
2125 2015-03-19  Pedro Alves  <palves@redhat.com>
2126
2127         * linux-low.c (count_events_callback, select_event_lwp_callback):
2128         No longer check whether the thread has resume_stop as last resume
2129         kind.
2130
2131 2015-03-19 Pedro Alves  <palves@redhat.com>
2132
2133         * linux-low.c (count_events_callback, select_event_lwp_callback):
2134         Use the lwp's status_pending_p field, not the thread's.
2135
2136 2015-03-19  Pedro Alves  <palves@redhat.com>
2137
2138         * linux-low.c (select_event_lwp_callback): Update comments to
2139         no longer mention SIGTRAP.
2140
2141 2015-03-18  Gary Benson  <gbenson@redhat.com>
2142
2143         * server.c (handle_query): Do not report vFile:fstat as supported.
2144
2145 2015-03-11  Gary Benson  <gbenson@redhat.com>
2146
2147         * hostio.c (sys/types.h): New include.
2148         (sys/stat.h): Likewise.
2149         (common-remote-fileio.h): Likewise.
2150         (handle_fstat): New function.
2151         (handle_vFile): Handle vFile:fstat packets.
2152
2153 2015-03-11  Gary Benson  <gbenson@redhat.com>
2154
2155         * configure.ac (AC_CHECK_MEMBERS): Add checks for
2156         struct stat.st_blocks and struct stat.st_blksize.
2157         * configure: Regenerate.
2158         * config.in: Likewise.
2159         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
2160         (OBS): Add common-remote-fileio.o.
2161         (common-remote-fileio.o): New rule.
2162
2163 2015-03-09  Pedro Alves  <palves@redhat.com>
2164
2165         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
2166         'struct sockaddr' pointer in 'accept' call.
2167
2168 2015-03-09  Pedro Alves  <palves@redhat.com>
2169
2170         Revert:
2171         2015-03-07  Pedro Alves  <palves@redhat.com>
2172         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2173         or <winsock2.h> here.  Instead include "gdb_socket.h".
2174         (remote_open): Use union gdb_sockaddr_u.
2175         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2176         or <winsock2.h> here.  Instead include "gdb_socket.h".
2177         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2178         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2179         or <sys/un.h>.
2180         (init_named_socket, gdb_agent_helper_thread): Use union
2181         gdb_sockaddr_u.
2182
2183 2015-03-07  Pedro Alves  <palves@redhat.com>
2184
2185         * configure.ac (build_warnings): Move
2186         -Wdeclaration-after-statement to the C-specific set.
2187         * configure: Regenerate.
2188
2189 2015-03-07  Pedro Alves  <palves@redhat.com>
2190
2191         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2192         or <winsock2.h> here.  Instead include "gdb_socket.h".
2193         (remote_open): Use union gdb_sockaddr_u.
2194         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2195         or <winsock2.h> here.  Instead include "gdb_socket.h".
2196         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2197         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2198         or <sys/un.h>.
2199         (init_named_socket, gdb_agent_helper_thread): Use union
2200         gdb_sockaddr_u.
2201
2202 2015-03-07  Pedro Alves  <palves@redhat.com>
2203
2204         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
2205         instead.
2206
2207 2015-03-06  Yao Qi  <yao.qi@linaro.org>
2208
2209         * linux-aarch64-low.c (aarch64_insert_point): Use
2210         show_debug_regs as a boolean.
2211         (aarch64_remove_point): Likewise.
2212
2213 2015-03-05  Pedro Alves  <palves@redhat.com>
2214
2215         * lynx-low.c (lynx_target_ops): Install NULL hooks for
2216         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
2217         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
2218         * nto-low.c (nto_target_ops): Likewise.
2219         * spu-low.c (spu_target_ops): Likewise.
2220         * win32-low.c (win32_target_ops): Likewise.
2221
2222 2015-03-04  Pedro Alves  <palves@redhat.com>
2223
2224         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
2225         Decide whether a breakpoint triggered based on the SIGTRAP's
2226         siginfo.si_code.
2227         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
2228         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
2229         (linux_low_filter_event): Check for breakpoints before checking
2230         watchpoints.
2231         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
2232         siginfo.si_code.
2233         (linux_stopped_by_sw_breakpoint)
2234         (linux_supports_stopped_by_sw_breakpoint)
2235         (linux_stopped_by_hw_breakpoint)
2236         (linux_supports_stopped_by_hw_breakpoint): New functions.
2237         (linux_target_ops): Install new target methods.
2238
2239 2015-03-04  Pedro Alves  <palves@redhat.com>
2240
2241         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
2242         * server.c (swbreak_feature, hwbreak_feature): New globals.
2243         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
2244         (captured_main): Clear swbreak_feature and hwbreak_feature.
2245         * server.h (swbreak_feature, hwbreak_feature): Declare.
2246         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
2247         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
2248         supports_stopped_by_hw_breakpoint>: New fields.
2249         (target_supports_stopped_by_sw_breakpoint)
2250         (target_stopped_by_sw_breakpoint)
2251         (target_supports_stopped_by_hw_breakpoint)
2252         (target_stopped_by_hw_breakpoint): Declare.
2253
2254 2015-03-04  Pedro Alves  <palves@redhat.com>
2255
2256         enum lwp_stop_reason -> enum target_stop_reason
2257         * linux-low.c (check_stopped_by_breakpoint): Adjust.
2258         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
2259         (linux_wait_1, stuck_in_jump_pad_callback)
2260         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
2261         (linux_stopped_by_watchpoint):
2262         * linux-low.h (enum lwp_stop_reason): Delete.
2263         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
2264         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2265
2266 2015-03-04  Yao Qi  <yao.qi@linaro.org>
2267
2268         * Makefile.in (SFILES): Add linux-aarch64-low.c.
2269
2270 2015-03-03  Gary Benson  <gbenson@redhat.com>
2271
2272         * hostio.c (handle_vFile): Fix prefix lengths.
2273
2274 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
2275
2276         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
2277         ptr_bits.
2278
2279 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2280
2281         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
2282         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
2283         (clean): Add "rm -f" for above C files.
2284         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
2285         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
2286         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
2287         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
2288         * linux-s390-low.c (HWCAP_S390_VX): New macro.
2289         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
2290         (init_registers_s390x_vx_linux64)
2291         (init_registers_s390x_tevx_linux64)
2292         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
2293         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
2294         declarations.
2295         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
2296         (s390_store_vxrs_high): New functions.
2297         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
2298         NT_S390_VXRS_HIGH.
2299         (s390_arch_setup): Add logic for selecting one of the new target
2300         descriptions.  Activate the new vector regsets if applicable.
2301         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
2302         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
2303         and init_registers_s390x_tevx_linux64.
2304
2305 2015-03-01  Pedro Alves  <palves@redhat.com>
2306
2307         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
2308         parameter.
2309
2310 2015-02-27  Pedro Alves  <palves@redhat.com>
2311
2312         * linux-x86-low.c (u_debugreg_offset): New function.
2313         (x86_linux_dr_get, x86_linux_dr_set): Use it.
2314
2315 2015-02-27  Pedro Alves  <palves@redhat.com>
2316
2317         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
2318         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
2319         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
2320         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
2321         (ps_lsetfpregs, ps_getpid)
2322         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
2323         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
2324         (ps_lsetxregs, ps_plog): Declare.
2325
2326 2015-02-27  Pedro Alves  <palves@redhat.com>
2327
2328         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
2329         IP_AGENT_EXPORT_FUNC.
2330         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
2331         IP_AGENT_EXPORT_FUNC.
2332         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
2333         (IP_AGENT_EXPORT): Delete.
2334         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2335         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2336         (gdb_trampoline_buffer_error, collecting, gdb_collect)
2337         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
2338         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
2339         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
2340         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
2341         (traceframe_read_count, traceframe_write_count)
2342         (traceframes_created, trace_state_variables, get_raw_reg)
2343         (get_trace_state_variable_value, set_trace_state_variable_value)
2344         (ust_loaded, helper_thread_id, cmd_buf): Use
2345         IPA_SYM_EXPORTED_NAME.
2346         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
2347         (tracepoints) Use IP_AGENT_EXPORT_VAR.
2348         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
2349         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2350         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
2351         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
2352         EXTERN_C_PUSH/EXTERN_C_POP.
2353         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
2354         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
2355         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2356         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
2357         (traceframe_write_count, traceframe_read_count)
2358         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
2359         (about_to_request_buffer_space, get_trace_state_variable_value)
2360         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
2361         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
2362         EXTERN_C_PUSH/EXTERN_C_POP.
2363         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
2364         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
2365         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
2366         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2367         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2368         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2369         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
2370         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
2371         Define.
2372         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
2373         (IP_AGENT_EXPORT_VAR_DECL): Define.
2374         (tracing): Declare.
2375         (gdb_agent_get_raw_reg): Declare.
2376
2377 2015-02-27  Tom Tromey  <tromey@redhat.com>
2378             Pedro Alves  <palves@redhat.com>
2379
2380         Rename symbols whose names are reserved C++ keywords throughout.
2381
2382 2015-02-27  Pedro Alves  <palves@redhat.com>
2383
2384         * Makefile.in (COMPILER): New, get it from autoconf.
2385         (CXX): Get from autoconf instead.
2386         (COMPILE.pre): Use COMPILER.
2387         (CC-LD): Rename to ...
2388         (CC_LD): ... this.  Use COMPILER.
2389         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
2390         (CXX_FOR_TARGET): Default to g++ instead of gcc.
2391         * acinclude.m4: Include build-with-cxx.m4.
2392         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
2393         Disable -Werror by default if building in C++ mode.
2394         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
2395         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
2396         the C++ compiler.  Save/restore CXXFLAGS too.
2397         * configure: Regenerate.
2398
2399 2015-02-27  Pedro Alves  <palves@redhat.com>
2400
2401         * acinclude.m4: Include libiberty.m4.
2402         * configure.ac: Call libiberty_INIT.
2403         * config.in, configure: Regenerate.
2404
2405 2015-02-26  Pedro Alves  <palves@redhat.com>
2406
2407         * linux-low.c (linux_wait_1): When incrementing the PC past a
2408         program breakpoint always use the_low_target.breakpoint_len as
2409         increment, rather than the maximum between that and
2410         the_low_target.decr_pc_after_break.
2411
2412 2015-02-23  Pedro Alves  <palves@redhat.com>
2413
2414         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
2415         thread was doing a step-over; always adjust the PC if
2416         we stepped over a permanent breakpoint.
2417         (linux_wait_1): If we stepped over breakpoint that was on top of a
2418         permanent breakpoint, manually advance the PC past it.
2419
2420 2015-02-23  Pedro Alves  <palves@redhat.com>
2421
2422         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
2423         modes.
2424         (x86_fill_gregset, x86_store_gregset): Use it when handling
2425         $orig_eax.
2426
2427 2015-02-20  Pedro Alves  <palves@redhat.com>
2428
2429         * thread-db.c: Include "nat/linux-procfs.h".
2430         (thread_db_init): Skip listing new threads if the kernel supports
2431         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
2432
2433 2015-02-20  Pedro Alves  <palves@redhat.com>
2434
2435         * linux-low.c (status_pending_p_callback): Use ptid_match.
2436
2437 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2438
2439         PR breakpoints/16812
2440         * linux-low.c (wstatus_maybe_breakpoint): Remove.
2441         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
2442         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
2443
2444 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
2445
2446         PR breakpoints/15956
2447         * tracepoint.c (cmd_qtinit): Add check for current_thread.
2448
2449 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2450
2451         * linux-low.c (linux_low_btrace_conf): Print size.
2452         * server.c (handle_btrace_conf_general_set): New.
2453         (hanle_general_set): Call handle_btrace_conf_general_set.
2454         (handle_query): Report Qbtrace-conf:bts:size as supported.
2455
2456 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2457
2458         * linux-low.c (linux_low_enable_btrace): Update parameters.
2459         (linux_low_btrace_conf): New.
2460         (linux_target_ops)<to_btrace_conf>: Initialize.
2461         * server.c (current_btrace_conf): New.
2462         (handle_btrace_enable): Rename to ...
2463         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
2464         to target_enable_btrace.  Update comment.  Update users.
2465         (handle_qxfer_btrace_conf): New.
2466         (qxfer_packets): Add btrace-conf entry.
2467         (handle_query): Report qXfer:btrace-conf:read as supported packet.
2468         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
2469         (target_ops)<read_btrace_conf>: New.
2470         (target_enable_btrace): Update parameters.
2471         (target_read_btrace_conf): New.
2472
2473 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2474
2475         * server.c (handle_btrace_general_set): Remove call to
2476         target_supports_btrace.
2477         (supported_btrace_packets): New.
2478         (handle_query): Call supported_btrace_packets.
2479         * target.h: include btrace-common.h.
2480         (btrace_target_info): Removed.
2481         (supports_btrace, target_supports_btrace): Update parameters.
2482
2483 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2484
2485         * Makefile.in (SFILES): Add common/btrace-common.c.
2486         (OBS): Add common/btrace-common.o.
2487         (btrace-common.o): Add build rules.
2488         * linux-low: Include btrace-common.h.
2489         (linux_low_read_btrace): Use struct btrace_data.  Call
2490         btrace_data_init and btrace_data_fini.
2491
2492 2015-02-06  Pedro Alves  <palves@redhat.com>
2493
2494         * thread-db.c (find_new_threads_callback): Add debug output.
2495
2496 2015-02-04  Pedro Alves  <palves@redhat.com>
2497
2498         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
2499         (resume_stopped_resumed_lwps): New function.
2500         (linux_wait_for_event_filtered): Use it.
2501
2502 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2503
2504         * Makefile.in (SFILES): Add linux-personality.c.
2505         (linux-personality.o): New rule.
2506         * configure.srv (srv_linux_obj): Add linux-personality.o to the
2507         list of objects to be built.
2508         * linux-low.c: Include nat/linux-personality.h.
2509         (linux_create_inferior): Remove code to disable address space
2510         randomization (moved to ../nat/linux-personality.c).  Create
2511         cleanup to disable address space randomization.
2512
2513 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2514
2515         * Makefile.in (posix-strerror.o): New rule.
2516         (mingw-strerror.o): Likewise.
2517         * configure: Regenerated.
2518         * configure.ac: Source file ../common/common.host.  Initialize new
2519         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
2520
2521 2015-01-14  Yao Qi  <yao@codesourcery.com>
2522
2523         * Makefile.in (SFILES): Add nat/ppc-linux.c.
2524         (ppc-linux.o): New rule.
2525         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
2526         * configure.ac: AC_CHECK_FUNCS(getauxval).
2527         * config.in: Re-generated.
2528         * configure: Re-generated.
2529         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
2530         ppc64_64bit_inferior_p
2531
2532 2015-01-14  Yao Qi  <yao@codesourcery.com>
2533
2534         * linux-ppc-low.c: Include "nat/ppc-linux.h".
2535          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
2536         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
2537         (PT_ORIG_R3, PT_TRAP): Likewise.
2538         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
2539         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
2540         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
2541
2542 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
2543
2544         * i387-fp.c (i387_cache_to_xsave): In look over
2545         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
2546         zmmh_low_space field by use of zmmh_high_space.
2547
2548 2015-01-09  Pedro Alves  <palves@redhat.com>
2549
2550         * linux-low.c (step_over_bkpt): Move higher up in the file.
2551         (handle_extended_wait): Don't store the stop_pc here.
2552         (get_stop_pc): Adjust comments and rename to ...
2553         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
2554         stopped for a software breakpoint or hardware breakpoint.
2555         (thread_still_has_status_pending_p): New function.
2556         (status_pending_p_callback): Use
2557         thread_still_has_status_pending_p.  If the event is no longer
2558         interesting, resume the LWP.
2559         (handle_tracepoints): Add assert.
2560         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
2561         (wstatus_maybe_breakpoint): New function.
2562         (cancel_breakpoint): Delete function.
2563         (check_stopped_by_watchpoint): New function, factored out from
2564         linux_low_filter_event.
2565         (lp_status_maybe_breakpoint): Delete function.
2566         (linux_low_filter_event): Remove filter_ptid argument.
2567         Leave thread group exits pending here.  Store the LWP's stop PC.
2568         Always leave events pending.
2569         (linux_wait_for_event_filtered): Pull all events out of the
2570         kernel, and leave them all pending.
2571         (count_events_callback, select_event_lwp_callback): Consider all
2572         events.
2573         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
2574         (select_event_lwp): Only give preference to the stepping LWP in
2575         all-stop mode.  Adjust comments.
2576         (ignore_event): New function.
2577         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
2578         references to cancel_breakpoints.  Adjust to renames.  Also give
2579         equal priority to all LWPs that have had events in non-stop mode.
2580         If reporting a software breakpoint event, unadjust the LWP's PC.
2581         (linux_wait): If linux_wait_1 returned an ignored event, retry.
2582         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
2583         Adjust.
2584         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
2585         (resume_status_pending_p): Use thread_still_has_status_pending_p.
2586         (linux_stopped_by_watchpoint): Adjust.
2587         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
2588         * linux-low.h (enum lwp_stop_reason): New.
2589         (struct lwp_info) <stop_pc>: Adjust comment.
2590         <stopped_by_watchpoint>: Delete field.
2591         <stop_reason>: New field.
2592         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2593         * mem-break.c (software_breakpoint_inserted_here)
2594         (hardware_breakpoint_inserted_here): New function.
2595         * mem-break.h (software_breakpoint_inserted_here)
2596         (hardware_breakpoint_inserted_here): Declare.
2597         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
2598         (cancel_breakpoints): Delete.
2599         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
2600         (upload_fast_traceframes): Remove references to
2601         cancel_breakpoints.
2602
2603 2015-01-09  Pedro Alves  <palves@redhat.com>
2604
2605         * thread-db.c (find_new_threads_callback): Ignore thread if the
2606         kernel thread ID is -1.
2607
2608 2015-01-09  Pedro Alves  <palves@redhat.com>
2609
2610         * linux-low.c (linux_attach_fail_reason_string): Move to
2611         nat/linux-ptrace.c, and rename.
2612         (linux_attach_lwp): Update comment.
2613         (attach_proc_task_lwp_callback): New function.
2614         (linux_attach): Adjust to rename and use
2615         linux_proc_attach_tgid_threads.
2616         (linux_attach_fail_reason_string): Delete declaration.
2617
2618 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
2619
2620         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
2621         * server.c (gdbserver_version): Likewise.
2622
2623 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
2624
2625         * remote-utils.c: Include ctype.h.
2626         (input_interrupt): Explicitly handle the case when the char
2627         received is the NUL byte.  Improve the printing of non-ASCII
2628         characters.
2629
2630 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
2631
2632         * linux-low.c (linux_low_filter_event): Update call to
2633         linux_enable_event_reporting following the addition of
2634         a new parameter to that function.
2635
2636 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
2637
2638         PR server/17457
2639         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
2640         (AARCH64_FPCR_REGNO): Likewise.
2641         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
2642         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
2643         (aarch64_store_fpregset): Likewise.
2644
2645 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
2646
2647         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
2648         Remove FIXME comment about assumption about N.
2649
2650 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
2651
2652         * configure.ac: If large-file support is disabled in GDBserver,
2653         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
2654         * configure: Regenerate.
2655
2656 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2657
2658         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
2659         warning upon ENODATA from ptrace.
2660         * linux-s390-low.c (s390_store_tdb): New.
2661         (s390_regsets): Add regset for NT_S390_TDB.
2662
2663 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2664
2665         * linux-low.c (regsets_store_inferior_registers): Skip regsets
2666         without a fill_function.
2667         * linux-s390-low.c (s390_fill_last_break): Remove.
2668         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
2669         (s390_arch_setup): Use regset's size instead of fill_function for
2670         loop end condition.
2671
2672 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2673
2674         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
2675         the regset's store function when ptrace returned an error.
2676         * regcache.c (get_thread_regcache): Invalidate register cache
2677         before fetching inferior's registers.
2678
2679 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2680
2681         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
2682         while-loop as for-loop.
2683         (regsets_store_inferior_registers): Likewise.
2684
2685 2014-11-28  Yao Qi  <yao@codesourcery.com>
2686
2687         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
2688         * config.in, configure: Re-generate.
2689         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
2690         is defined.
2691
2692 2014-11-21  Yao Qi  <yao@codesourcery.com>
2693
2694         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
2695         (AC_CHECK_HEADERS): Remove malloc.h.
2696         * configure: Re-generated.
2697         * config.in: Re-generated.
2698         * server.h: Don't include alloca.h and malloc.h.
2699         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
2700         Don't include malloc.h.
2701
2702 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
2703
2704         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
2705         corresponding ERRNO check in same block.
2706
2707 2014-11-12  Pedro Alves  <palves@redhat.com>
2708
2709         * server.c (cont_thread): Update comment.
2710         (start_inferior, attach_inferior): No longer clear cont_thread.
2711         (handle_v_cont): No longer set cont_thread.
2712         (captured_main): Clear cont_thread each time a GDB connects.
2713
2714 2014-11-12  Pedro Alves  <palves@redhat.com>
2715
2716         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
2717         thread, and don't resume all threads if the Hc thread has exited.
2718
2719 2014-11-12  Pedro Alves  <palves@redhat.com>
2720
2721         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
2722         the process group instead of to a specific LWP.
2723
2724 2014-10-15  Pedro Alves  <palves@redhat.com>
2725
2726         PR server/17487
2727         * win32-arm-low.c (arm_set_thread_context): Remove current_event
2728         parameter.
2729         (arm_set_thread_context): Delete.
2730         (the_low_target): Adjust.
2731         * win32-i386-low.c (debug_registers_changed)
2732         (debug_registers_used): Delete.
2733         (update_debug_registers_callback): New function.
2734         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
2735         needing to update their debug registers.
2736         (win32_get_current_dr): New function.
2737         (x86_dr_low_get_addr, x86_dr_low_get_control)
2738         (x86_dr_low_get_status): Fetch the debug register from the thread
2739         record's context.
2740         (i386_initial_stuff): Adjust.
2741         (i386_get_thread_context): Remove current_event parameter.  Don't
2742         clear debug_registers_changed nor copy DR values to
2743         debug_reg_state.
2744         (i386_set_thread_context): Delete.
2745         (i386_prepare_to_resume): New function.
2746         (i386_thread_added): Mark the thread as needing to update irs
2747         debug registers.
2748         (the_low_target): Remove i386_set_thread_context and install
2749         i386_prepare_to_resume.
2750         * win32-low.c (win32_get_thread_context): Adjust.
2751         (win32_set_thread_context): Use SetThreadContext
2752         directly.
2753         (win32_prepare_to_resume): New function.
2754         (win32_require_context): New function, factored out from ...
2755         (thread_rec): ... this.
2756         (continue_one_thread): Call win32_prepare_to_resume on each thread
2757         we're about to continue.
2758         (win32_resume): Call win32_prepare_to_resume on the event thread.
2759         * win32-low.h (struct win32_thread_info)
2760         <debug_registers_changed>: New field.
2761         (struct win32_target_ops): Change prototype of set_thread_context,
2762         delete set_thread_context and add prepare_to_resume.
2763         (win32_require_context): New declaration.
2764
2765 2014-10-08  Gary Benson  <gbenson@redhat.com>
2766
2767         * server.h: Do not include common-exceptions.h.
2768
2769 2014-10-08  Gary Benson  <gbenson@redhat.com>
2770
2771         * server.h: Do not include cleanups.h.
2772
2773 2014-09-30  James Hogan  <james.hogan@imgtec.com>
2774
2775         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
2776         mips64-dsp-linux.c.
2777
2778 2014-09-23  Yao Qi  <yao@codesourcery.com>
2779
2780         * linux-low.c (lp_status_maybe_breakpoint): New function.
2781         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
2782         (count_events_callback): Likewise.
2783         (select_event_lwp_callback): Likewise.
2784         (cancel_breakpoints_callback): Likewise.
2785
2786 2014-09-19  Don Breazeal  <donb@codesourcery.com>
2787
2788         * linux-low.c (handle_extended_wait): Call
2789         linux_ptrace_get_extended_event.
2790         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
2791         linux_is_extended_waitstatus.
2792
2793 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
2794
2795         * Makefile.in (CPPFLAGS): Define.
2796         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
2797         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
2798
2799 2014-09-16  Gary Benson  <gbenson@redhat.com>
2800
2801         * inferiors.h (current_inferior): Renamed as...
2802         (current_thread): New variable.  All uses updated.
2803         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
2804         (maybe_move_out_of_jump_pad): Likewise.
2805         (cancel_breakpoint): Likewise.
2806         (linux_low_filter_event): Likewise.
2807         (wait_for_sigstop): Likewise.
2808         (linux_resume_one_lwp): Likewise.
2809         (need_step_over_p): Likewise.
2810         (start_step_over): Likewise.
2811         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
2812         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
2813         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
2814         and save_inferior as saved_thread.
2815         * regcache.c (get_thread_regcache): Renamed saved_inferior as
2816         saved_thread.
2817         (regcache_invalidate_thread): Likewise.
2818         * remote-utils.c (prepare_resume_reply): Likewise.
2819         * thread-db.c (thread_db_get_tls_address): Likewise.
2820         (disable_thread_event_reporting): Likewise.
2821         (remove_thread_event_breakpoints): Likewise.
2822         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
2823         as saved_thread.
2824         * target.h (set_desired_inferior): Renamed as...
2825         (set_desired_thread): New declaration.  All uses updated.
2826         * server.c (myresume): Updated comment to reference thread instead
2827         of inferior.
2828         (handle_serial_event): Likewise.
2829         (handle_target_event): Likewise.
2830
2831 2014-09-12  Tom Tromey  <tromey@redhat.com>
2832             Gary Benson  <gbenson@redhat.com>
2833
2834         * regcache.h: Include common-regcache.h.
2835         (regcache_read_pc): Don't declare.
2836         * regcache.c (get_thread_regcache_for_ptid): New function.
2837
2838 2014-09-11  Tom Tromey  <tromey@redhat.com>
2839             Gary Benson  <gbenson@redhat.com>
2840
2841         * symbol.c: New file.
2842         * Makefile.in (SFILES): Add symbol.c.
2843         (OBS): Add symbol.o.
2844
2845 2014-09-11  Gary Benson  <gbenson@redhat.com>
2846
2847         * target.c (target_stop_ptid, target_continue_ptid): New
2848         functions.
2849
2850 2014-09-11  Tom Tromey  <tromey@redhat.com>
2851             Gary Benson  <gbenson@redhat.com>
2852
2853         * target.h: Include target/target.h.
2854         * target.c (target_read_memory, target_read_uint32)
2855         (target_write_memory): New functions.
2856
2857 2014-09-11  Gary Benson  <gbenson@redhat.com>
2858
2859         * server.h (debug_hw_points): Don't declare.
2860         * server.c (debug_hw_points): Don't define.  Replace all uses
2861         with show_debug_regs.
2862         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
2863         all uses with show_debug_regs.
2864
2865 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
2866
2867         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
2868         endianness into account.
2869         (ppc_supply_ptrace_register): Likewise.
2870
2871 2014-09-03  James Hogan  <james.hogan@imgtec.com>
2872
2873         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
2874         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
2875
2876 2014-09-03  Gary Benson  <gbenson@redhat.com>
2877
2878         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
2879         ALL_DEBUG_ADDRESS_REGISTERS.
2880
2881 2014-09-02  Gary Benson  <gbenson@redhat.com>
2882
2883         * i386-low.h: Renamed as...
2884         * x86-low.h: New file.  All type, function and variable name
2885         prefixes changed from "i386_" to "x86_".  All references updated.
2886         * i386-low.c: Renamed as...
2887         * x86-low.c: New file.  All type, function and variable name
2888         prefixes changed from "i386_" to "x86_".  All references updated.
2889
2890 2014-09-02  Gary Benson  <gbenson@redhat.com>
2891
2892         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
2893         (x86_linux_new_thread): Likewise.
2894
2895 2014-08-29  Gary Benson  <gbenson@redhat.com>
2896
2897         * server.h (setjmp.h): Do not include.
2898         (toplevel): Do not declare.
2899         (common-exceptions.h): Include.
2900         (cleanups.h): Likewise.
2901         * server.c (toplevel): Do not define.
2902         (exit_code): New static global.
2903         (detach_or_kill_for_exit_cleanup): New function.
2904         (main): New function.  Original main renamed to...
2905         (captured_main): New function.
2906         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
2907
2908 2014-08-29  Gary Benson  <gbenson@redhat.com>
2909
2910         * Makefile.in (SFILES): Add common/common-exceptions.c.
2911         (OBS): Add common-exceptions.o.
2912         (common-exceptions.o): New rule.
2913         * utils.c (prepare_to_throw_exception): New function.
2914
2915 2014-08-29  Gary Benson  <gbenson@redhat.com>
2916
2917         * config.in: Regenerate.
2918         * configure: Likewise.
2919
2920 2014-08-29  Gary Benson  <gbenson@redhat.com>
2921
2922         * Makefile.in (SFILES): Add common/cleanups.c.
2923         (OBS): cleanups.o.
2924         (cleanups.o): New rule.
2925
2926 2014-08-29  Gary Benson  <gbenson@redhat.com>
2927
2928         * utils.c (internal_vwarning): New function.
2929
2930 2014-08-28  Gary Benson  <gbenson@redhat.com>
2931
2932         * utils.h (fatal): Remove declaration.
2933         * utils.c (fatal): Remove function.
2934
2935 2014-08-28  Gary Benson  <gbenson@redhat.com>
2936
2937         * tracepoint.c (gdb_agent_init): Replace fatal with
2938         perror_with_name.
2939         (initialize_tracepoint): Likewise.
2940
2941 2014-08-28  Gary Benson  <gbenson@redhat.com>
2942
2943         * remote-utils.c (remote_prepare): Replace fatal with error.
2944
2945 2014-08-28  Gary Benson  <gbenson@redhat.com>
2946
2947         * linux-low.c (linux_async): Replace fatal with warning.
2948         Tidy up and return.
2949         (linux_start_non_stop): Return -1 if linux_async failed.
2950
2951 2014-08-28  Gary Benson  <gbenson@redhat.com>
2952
2953         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
2954         gdb_assert.
2955         (i386_dr_low_get_addr): Remove vague comment.
2956         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
2957         gdb_assert.
2958
2959 2014-08-28  Gary Benson  <gbenson@redhat.com>
2960
2961         * inferiors.c (get_thread_process): Replace check with gdb_assert.
2962         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
2963         internal_error.
2964         (linux_resume_one_lwp): Likewise.
2965         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
2966         gdb_assert.
2967         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
2968         with internal_error.
2969         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
2970         (init_register_cache): Replace fatal with gdb_assert_not_reached.
2971         (find_register_by_name): Replace fatal with internal_error.
2972         (find_regno): Likewise.
2973         * tdesc.c (init_target_desc): Replace check with gdb_assert.
2974         * thread-db.c (thread_db_create_event): Likewise.
2975         (thread_db_load_search): Likewise.
2976         (try_thread_db_load_1): Likewise.
2977         * tracepoint.c (get_jump_space_head): Replace fatal with
2978         internal_error.
2979         (claim_trampoline_space): Likewise.
2980         (have_fast_tracepoint_trampoline_buffer): Likewise.
2981         (cmd_qtstart): Likewise.
2982         (stop_tracing): Likewise.
2983         (fast_tracepoint_collecting): Likewise.
2984         (target_malloc): Likewise.
2985         (download_tracepoint): Likewise.
2986         (download_trace_state_variables): Replace check with gdb_assert.
2987         (upload_fast_traceframes): Replace fatal with internal_error.
2988
2989 2014-08-19  Tom Tromey  <tromey@redhat.com>
2990             Gary Benson  <gbenson@redhat.com>
2991
2992         * Makefile.in (SFILES): Add common/common-debug.c.
2993         (OBS): Add common-debug.o.
2994         (common-debug.o): New rule.
2995         * debug.h (debug_printf): Don't declare.
2996         * debug.c (debug_printf): Renamed and rewritten as...
2997         (debug_vprintf): New function.
2998
2999 2014-08-19  Gary Benson  <gbenson@redhat.com>
3000
3001         * utils.h: Do not include print-utils.h.
3002
3003 2014-08-19  Tom Tromey  <tromey@redhat.com>
3004             Gary Benson  <gbenson@redhat.com>
3005
3006         * server.h: Add static assertion.
3007         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
3008
3009 2014-08-19  Tom Tromey  <tromey@redhat.com>
3010             Gary Benson  <gbenson@redhat.com>
3011
3012         * Makefile.in (SFILES): Add common/errors.c.
3013         (OBS): Add errors.o.
3014         (IPA_OBS): Add errors-ipa.o.
3015         (errors.o): New rule.
3016         (errors-ipa.o): Likewise.
3017         * utils.h (perror_with_name, error, warning): Don't declare.
3018         * utils.c (warning): Renamed and rewritten as...
3019         (vwarning): New function.
3020         (error): Renamed and rewritten as...
3021         (verror): New function.
3022         (internal_error): Renamed and rewritten as...
3023         (internal_verror): New function.
3024
3025 2014-08-07  Gary Benson  <gbenson@redhat.com>
3026
3027         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
3028         * configure: Regenerate.
3029         * config.in: Likewise.
3030         * server.h: Do not include errno.h.
3031         * event-loop.c: Likewise.
3032         * hostio-errno.c: Likewise.
3033         * linux-low.c: Likewise.
3034         * remote-utils.c: Likewise.
3035         * spu-low.c: Likewise.
3036         * utils.c: Likewise.
3037         * gdbreplay.c: Unconditionally include errno.h.
3038
3039 2014-08-07  Gary Benson  <gbenson@redhat.com>
3040
3041         * server.h: Do not include string.h.
3042         * event-loop.c: Likewise.
3043         * linux-low.c: Likewise.
3044         * regcache.c: Likewise.
3045         * remote-utils.c: Likewise.
3046         * spu-low.c: Likewise.
3047         * utils.c: Likewise.
3048
3049 2014-08-07  Gary Benson  <gbenson@redhat.com>
3050
3051         * server.h: Do not include gdb_assert.h.
3052
3053 2014-08-07  Gary Benson  <gbenson@redhat.com>
3054
3055         * server.h: Do not include common-utils.h.
3056
3057 2014-08-07  Gary Benson  <gbenson@redhat.com>
3058
3059         * server.h: Do not include ptid.h.
3060         * notif.h: Likewise.
3061
3062 2014-08-07  Gary Benson  <gbenson@redhat.com>
3063
3064         * server.h: Do not include gdb_locale.h.
3065
3066 2014-08-07  Gary Benson  <gbenson@redhat.com>
3067
3068         * server.h: Do not include gdb/signals.h.
3069         * win32-low.c: Likewise.
3070
3071 2014-08-07  Gary Benson  <gbenson@redhat.com>
3072
3073         * server.h: Do not include pathmax.h.
3074
3075 2014-08-07  Gary Benson  <gbenson@redhat.com>
3076
3077         * server.h: Do not include libiberty.h.
3078         * linux-bfin-low.c: Likewise.
3079
3080 2014-08-07  Gary Benson  <gbenson@redhat.com>
3081
3082         * server.h: Do not include ansidecl.h.
3083
3084 2014-08-07  Gary Benson  <gbenson@redhat.com>
3085
3086         * linux-x86-low.c: Do not include stddef.h.
3087         * lynx-ppc-low.c: Likewise.
3088         * tracepoint.c: Likewise.
3089
3090 2014-08-07  Gary Benson  <gbenson@redhat.com>
3091
3092         * server.h: Do not include stdarg.h.
3093         * nto-low.c: Likewise.
3094
3095 2014-08-07  Gary Benson  <gbenson@redhat.com>
3096
3097         * server.h: Do not include stdlib.h.
3098         * inferiors.c: Likewise.
3099         * linux-low.c: Likewise.
3100         * regcache.c: Likewise.
3101         * spu-low.c: Likewise.
3102         * tracepoint.c: Likewise.
3103         * utils.c: Likewise.
3104
3105 2014-08-07  Gary Benson  <gbenson@redhat.com>
3106
3107         * server.h: Do not include stdio.h.
3108         * linux-low.c: Likewise.
3109         * remote-utils.c: Likewise.
3110         * spu-low.c: Likewise.
3111         * utils.c: Likewise.
3112         * wincecompat.c: Likewise.
3113
3114 2014-08-06  Gary Benson  <gbenson@redhat.com>
3115
3116         * regcache.c (init_register_cache): Move conditionals inside if.
3117
3118 2014-08-06  Gary Benson  <gbenson@redhat.com>
3119
3120         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
3121
3122 2014-07-31  Gary Benson  <gbenson@redhat.com>
3123
3124         * ax.h: Do not include server.h.
3125         * gdbthread.h: Likewise.
3126         * lynx-low.h: Likewise.
3127         * notif.h: Likewise.
3128
3129 2014-07-30  Gary Benson  <gbenson@redhat.com>
3130
3131         * server.h: Include common-defs.h.
3132         Do not include config.h or build-gnulib-gdbserver/config.h.
3133
3134 2014-07-30  Gary Benson  <gbenson@redhat.com>
3135
3136         * hostio-errno.c: Move server.h to top of includes list.
3137         * inferiors.c: Likewise.
3138         * linux-x86-low.c: Likewise.
3139         * notif.c: Include server.h.
3140
3141 2014-07-24  Tom Tromey  <tromey@redhat.com>
3142             Gary Benson  <gbenson@redhat.com>
3143
3144         * server.h (CORE_ADDR): Now unsigned.
3145
3146 2014-07-16  Pedro Alves  <palves@redhat.com>
3147
3148         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
3149
3150 2014-07-15  Pedro Alves  <palves@redhat.com>
3151
3152         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
3153         copy.
3154
3155 2014-07-11  Pedro Alves  <palves@redhat.com>
3156
3157         * linux-low.c (kill_wait_lwp): New function, based on
3158         kill_one_lwp_callback, but use my_waitpid directly.
3159         (kill_one_lwp_callback, linux_kill): Use it.
3160
3161 2014-06-23  Pedro Alves  <palves@redhat.com>
3162
3163         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
3164         before setting DR0..DR3.
3165
3166 2014-06-20  Gary Benson  <gbenson@redhat.com>
3167
3168         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
3169         * configure: Regenerated.
3170         * config.in: Likewise.
3171
3172 2014-06-20  Gary Benson  <gbenson@redhat.com>
3173
3174         * Makefile.in (SFILES): Update locations for files moved
3175         from common to nat.
3176         (object file files): Reordered.
3177
3178 2014-06-20  Gary Benson  <gbenson@redhat.com>
3179
3180         * i386-low.h (i386_dr_low_can_set_addr): Removed.
3181         (i386_dr_low_set_addr): Likewise.
3182         (i386_dr_low_get_addr): Likewise.
3183         (i386_dr_low_can_set_control): Likewise.
3184         (i386_dr_low_set_control): Likewise.
3185         (i386_dr_low_get_control): Likewise.
3186         (i386_dr_low_get_status): Likewise.
3187         (i386_get_debug_register_length): Likewise.
3188         * linux-x86-low.c (i386_dr_low_set_addr):
3189         Changed signature.  Made static.
3190         (i386_dr_low_get_addr): Likewise.
3191         (i386_dr_low_set_control): Likewise.
3192         (i386_dr_low_get_control): Likewise.
3193         (i386_dr_low_get_status): Likewise.
3194         (i386_dr_low): New global variable.
3195         * win32-i386-low.c (i386_dr_low_set_addr):
3196         Changed signature.  Made static.
3197         (i386_dr_low_get_addr): Likewise.
3198         (i386_dr_low_set_control): Likewise.
3199         (i386_dr_low_get_control): Likewise.
3200         (i386_dr_low_get_status): Likewise.
3201         (i386_dr_low): New global variable.
3202
3203 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3204
3205         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
3206         * Makefile.in (AR, AR_FLAGS): Define.
3207         * configure: Regenerate.
3208
3209 2014-06-19  Gary Benson  <gbenson@redhat.com>
3210
3211         * Makefile.in (i386-dregs.o): New rule.
3212         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
3213         * i386-low.c (target.h): Remove include.
3214         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
3215         (DR_CONTROL_SHIFT): Likewise.
3216         (DR_CONTROL_SIZE): Likewise.
3217         (DR_RW_EXECUTE): Likewise.
3218         (DR_RW_WRITE): Likewise.
3219         (DR_RW_READ): Likewise.
3220         (DR_RW_IORW): Likewise.
3221         (DR_LEN_1): Likewise.
3222         (DR_LEN_2): Likewise.
3223         (DR_LEN_4): Likewise.
3224         (DR_LEN_8): Likewise.
3225         (DR_LOCAL_ENABLE_SHIFT): Likewise.
3226         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
3227         (DR_ENABLE_SIZE): Likewise.
3228         (DR_LOCAL_SLOWDOWN): Likewise.
3229         (DR_GLOBAL_SLOWDOWN): Likewise.
3230         (DR_CONTROL_RESERVED): Likewise.
3231         (I386_DR_CONTROL_MASK): Likewise.
3232         (I386_DR_VACANT): Likewise.
3233         (I386_DR_LOCAL_ENABLE): Likewise.
3234         (I386_DR_GLOBAL_ENABLE): Likewise.
3235         (I386_DR_DISABLE): Likewise.
3236         (I386_DR_SET_RW_LEN): Likewise.
3237         (I386_DR_GET_RW_LEN): Likewise.
3238         (I386_DR_WATCH_HIT): Likewise.
3239         (i386_wp_op_t): Likewise.
3240         (i386_show_dr): Likewise.
3241         (i386_length_and_rw_bits): Likewise.
3242         (i386_insert_aligned_watchpoint): Likewise.
3243         (i386_remove_aligned_watchpoint): Likewise.
3244         (i386_handle_nonaligned_watchpoint): Likewise.
3245         i386_update_inferior_debug_regs(): Likewise.
3246         (i386_dr_insert_watchpoint): Likewise.
3247         (i386_dr_remove_watchpoint): Likewise.
3248         (i386_dr_region_ok_for_watchpoint): Likewise.
3249         (i386_dr_stopped_data_address): Likewise.
3250         (i386_dr_stopped_by_watchpoint): Likewise.
3251
3252 2014-06-19  Gary Benson  <gbenson@redhat.com>
3253
3254         * i386-low.c (i386_dr_show): Renamed to
3255         i386_show_dr and made static.  All uses updated.
3256         (i386_dr_length_and_rw_bits): Renamed to
3257         i386_length_and_rw_bits and made static.
3258         All uses updated.
3259         (i386_dr_insert_aligned_watchpoint): Renamed to
3260         i386_insert_aligned_watchpoint and made static.
3261         All uses updated.
3262         (i386_dr_remove_aligned_watchpoint): Renamed to
3263         i386_remove_aligned_watchpoint and made static.
3264         All uses updated.
3265         (i386_dr_update_inferior_debug_regs): Renamed to
3266         i386_update_inferior_debug_regs and made static.
3267         All uses updated.
3268
3269 2014-06-18  Gary Benson  <gbenson@redhat.com>
3270
3271         * i386-low.h (i386_dr_low_can_set_addr): New macro.
3272         (i386_dr_low_can_set_control): Likewise.
3273         (i386_get_debug_register_length): Likewise.
3274         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
3275         (i386_dr_low_can_set_control): Likewise.
3276         (i386_get_debug_register_length): Likewise.
3277
3278 2014-06-17  Gary Benson  <gbenson@redhat.com>
3279
3280         * i386-low.h (i386-dregs.h): New include.
3281         (DR_FIRSTADDR): Now in i386-dregs.h.
3282         (DR_LASTADDR): Likewise.
3283         (DR_NADDR): Likewise.
3284         (DR_STATUS): Likewise.
3285         (DR_CONTROL): Likewise.
3286         (i386_debug_reg_state): Likewise.
3287         (i386_dr_insert_watchpoint): Likewise.
3288         (i386_dr_remove_watchpoint): Likewise.
3289         (i386_dr_region_ok_for_watchpoint): Likewise.
3290         (i386_dr_stopped_data_address): Likewise.
3291         (i386_dr_stopped_by_watchpoint): Likewise.
3292         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
3293
3294 2014-06-18  Gary Benson  <gbenson@redhat.com>
3295
3296         * i386-low.h (i386_low_insert_watchpoint): Renamed to
3297         i386_dr_insert_watchpoint.
3298         (i386_low_remove_watchpoint): Renamed to
3299         i386_dr_remove_watchpoint.
3300         (i386_low_region_ok_for_watchpoint): Renamed to
3301         i386_dr_region_ok_for_watchpoint.
3302         (i386_low_stopped_data_address): Renamed to
3303         i386_dr_stopped_data_address.
3304         (i386_low_stopped_by_watchpoint): Renamed to
3305         i386_dr_stopped_by_watchpoint.
3306         * i386-low.c (i386_show_dr): Renamed to
3307         i386_dr_show and made nonstatic.  All uses updated.
3308         (i386_length_and_rw_bits): Renamed to
3309         i386_dr_length_and_rw_bits and made nonstatic.
3310         All uses updated.
3311         (i386_insert_aligned_watchpoint): Renamed to
3312         i386_dr_insert_aligned_watchpoint and made nonstatic.
3313         All uses updated.
3314         (i386_remove_aligned_watchpoint): Renamed to
3315         i386_dr_remove_aligned_watchpoint and made nonstatic.
3316         All uses updated.
3317         (i386_update_inferior_debug_regs): Renamed to
3318         i386_dr_update_inferior_debug_regs and made nonstatic.
3319         All uses updated.
3320         (i386_low_insert_watchpoint): Renamed to
3321         i386_dr_insert_watchpoint.  All uses updated.
3322         (i386_low_remove_watchpoint): Renamed to
3323         i386_dr_remove_watchpoint.  All uses updated.
3324         (i386_low_region_ok_for_watchpoint): Renamed to
3325         i386_dr_region_ok_for_watchpoint.  All uses updated.
3326         (i386_low_stopped_data_address): Renamed to
3327         i386_dr_stopped_data_address.  All uses updated.
3328         (i386_low_stopped_by_watchpoint): Renamed to
3329         i386_dr_stopped_by_watchpoint.  All uses updated.
3330
3331 2014-06-18  Gary Benson  <gbenson@redhat.com>
3332
3333         * i386-low.c (i386_dr_low_can_set_addr): New macro.
3334         (i386_dr_low_can_set_control): Likewise.
3335         (i386_insert_aligned_watchpoint): New check.
3336
3337 2014-06-18  Gary Benson  <gbenson@redhat.com>
3338
3339         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
3340         Renamed to state.
3341
3342 2014-06-18  Gary Benson  <gbenson@redhat.com>
3343
3344         * i386-low.c (i386_length_and_rw_bits): Use internal_error
3345         instead of fatal and error.
3346         (i386_handle_nonaligned_watchpoint): Likewise.
3347
3348 2014-06-18  Gary Benson  <gbenson@redhat.com>
3349
3350         * i386-low.c (i386_get_debug_register_length): New macro.
3351         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
3352         (i386_show_dr): Use debug_printf instead of fprintf.  Use
3353         phex to format values.
3354
3355 2014-06-18  Gary Benson  <gbenson@redhat.com>
3356
3357         * i386-low.h: Comment changes.
3358         * i386-low.c: Likewise.
3359
3360 2014-06-18  Gary Benson  <gbenson@redhat.com>
3361
3362         * i386-low.c: Whitespace changes.
3363
3364 2014-06-12  Tom Tromey  <tromey@redhat.com>
3365
3366         * utils.c (freeargv): Remove.
3367
3368 2014-06-12  Tom Tromey  <tromey@redhat.com>
3369
3370         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
3371         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
3372         (parse_debug_format_options): Likewise.
3373         (gdbserver_usage): Likewise.
3374         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
3375         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
3376         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
3377         against libiberty.
3378         ($(LIBGNU)): Depend on libiberty.
3379         (all-lib): Recurse into all subdirs.
3380         (install-only): Invoke "install" target in subdirs.
3381         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
3382         targets.
3383         * configure: Rebuild.
3384         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
3385         for vasprintf, vsnprintf, or gettimeofday.
3386         * configure.srv: Don't add safe-ctype.o or lbasename.o to
3387         srv_tgtobj.
3388
3389 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
3390
3391         * development.sh: Delete.
3392         * Makefile.in (config.status): Adjust dependency on development.sh.
3393         * configure.ac: Adjust development.sh source call.
3394         * configure: Regenerate.
3395
3396 2014-06-02  Pedro Alves  <palves@redhat.com>
3397
3398         * ax.c (gdb_free_agent_expr): New function.
3399         * ax.h (gdb_free_agent_expr): New declaration.
3400         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
3401         list.
3402         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
3403         static.
3404         (clear_breakpoint_conditions_and_commands): New function.
3405         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
3406         (clear_breakpoint_conditions_and_commands): New declaration.
3407
3408 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
3409
3410         * linux-aarch64-low.c (asm/ptrace.h): Include.
3411
3412 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3413
3414         Fix TLS access for -static -pthread.
3415         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
3416         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
3417         (thread_db_load_search, try_thread_db_load_1): Initialize it.
3418
3419 2014-05-20  Pedro Alves  <palves@redhat.com>
3420
3421         * linux-aarch64-low.c (aarch64_insert_point)
3422         (aarch64_remove_point): No longer check whether the type is
3423         supported here.  Adjust to new interface.
3424         (the_low_target): Install aarch64_supports_z_point_type as
3425         supports_z_point_type method.
3426         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
3427         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
3428         instead of a Z packet char.  Adjust.
3429         (arm_supports_z_point_type): New function.
3430         (arm_insert_point, arm_remove_point): Adjust to new interface.
3431         (the_low_target): Install arm_supports_z_point_type.
3432         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
3433         (cris_insert_point, cris_remove_point): Adjust to new interface.
3434         Don't check whether the type is supported here.
3435         (the_low_target): Install cris_supports_z_point_type.
3436         * linux-low.c (linux_supports_z_point_type): New function.
3437         (linux_insert_point, linux_remove_point): Adjust to new interface.
3438         * linux-low.h (struct linux_target_ops) <insert_point,
3439         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
3440         raw_breakpoint pointer parameter.
3441         <supports_z_point_type>: New method.
3442         * linux-mips-low.c (mips_supports_z_point_type): New function.
3443         (mips_insert_point, mips_remove_point): Adjust to new interface.
3444         Use mips_supports_z_point_type.
3445         (the_low_target): Install mips_supports_z_point_type.
3446         * linux-ppc-low.c (the_low_target): Install NULL as
3447         supports_z_point_type method.
3448         * linux-s390-low.c (the_low_target): Install NULL as
3449         supports_z_point_type method.
3450         * linux-sparc-low.c (the_low_target): Install NULL as
3451         supports_z_point_type method.
3452         * linux-x86-low.c (x86_supports_z_point_type): New function.
3453         (x86_insert_point): Adjust to new insert_point interface.  Use
3454         insert_memory_breakpoint.  Adjust to new
3455         i386_low_insert_watchpoint interface.
3456         (x86_remove_point): Adjust to remove_point interface.  Use
3457         remove_memory_breakpoint.  Adjust to new
3458         i386_low_remove_watchpoint interface.
3459         (the_low_target): Install x86_supports_z_point_type.
3460         * lynx-low.c (lynx_target_ops): Install NULL as
3461         supports_z_point_type callback.
3462         * nto-low.c (nto_supports_z_point_type): New.
3463         (nto_insert_point, nto_remove_point): Adjust to new interface.
3464         (nto_target_ops): Install nto_supports_z_point_type.
3465         * mem-break.c: Adjust intro comment.
3466         (struct raw_breakpoint) <raw_type, size>: New fields.
3467         <inserted>: Update comment.
3468         <shlib_disabled>: Delete field.
3469         (enum bkpt_type) <gdb_breakpoint>: Delete value.
3470         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
3471         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
3472         (raw_bkpt_type_to_target_hw_bp_type): New function.
3473         (find_enabled_raw_code_breakpoint_at): New function.
3474         (find_raw_breakpoint_at): New type and size parameters.  Use them.
3475         (insert_memory_breakpoint): New function, based off
3476         set_raw_breakpoint_at.
3477         (remove_memory_breakpoint): New function.
3478         (set_raw_breakpoint_at): Reimplement.
3479         (set_breakpoint): New, based on set_breakpoint_at.
3480         (set_breakpoint_at): Reimplement.
3481         (delete_raw_breakpoint): Go through the_target->remove_point
3482         instead of assuming memory breakpoints.
3483         (find_gdb_breakpoint_at): Delete.
3484         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
3485         (find_gdb_breakpoint): New function.
3486         (set_gdb_breakpoint_at): Delete.
3487         (z_type_supported): New function.
3488         (set_gdb_breakpoint_1): New function, loosely based off
3489         set_gdb_breakpoint_at.
3490         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
3491         (delete_gdb_breakpoint_at): Delete.
3492         (delete_gdb_breakpoint_1): New function, loosely based off
3493         delete_gdb_breakpoint_at.
3494         (delete_gdb_breakpoint): New function.
3495         (clear_gdb_breakpoint_conditions): Rename to ...
3496         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
3497         breakpoint.
3498         (add_condition_to_breakpoint): Make static.
3499         (add_breakpoint_condition): Take a struct breakpoint pointer
3500         instead of an address.  Adjust.
3501         (gdb_condition_true_at_breakpoint): Rename to ...
3502         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
3503         z_type parameter.
3504         (gdb_condition_true_at_breakpoint): Reimplement.
3505         (add_breakpoint_commands): Take a struct breakpoint pointer
3506         instead of an address.  Adjust.
3507         (gdb_no_commands_at_breakpoint): Rename to ...
3508         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
3509         parameter.  Return true if no breakpoint was found.  Change debug
3510         output.
3511         (gdb_no_commands_at_breakpoint): Reimplement.
3512         (run_breakpoint_commands): Rename to ...
3513         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
3514         and change return type to boolean.
3515         (run_breakpoint_commands): New function.
3516         (gdb_breakpoint_here): Also check for Z1 breakpoints.
3517         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
3518         breakpoint.  Go through the_target->remove_point instead of
3519         assuming memory breakpoint.
3520         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
3521         software and hardware breakpoints.
3522         (reinsert_raw_breakpoint): Go through the_target->insert_point
3523         instead of assuming memory breakpoint.
3524         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
3525         software and hardware breakpoints.
3526         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
3527         Check both software and hardware breakpoints.
3528         (validate_inserted_breakpoint): Assert the breakpoint is a
3529         software breakpoint.  Set the inserted flag to -1 instead of
3530         setting shlib_disabled.
3531         (delete_disabled_breakpoints): Adjust.
3532         (validate_breakpoints): Only validate software breakpoints.
3533         Adjust to inserted flag change.
3534         (check_mem_read, check_mem_write): Skip breakpoint types other
3535         than software breakpoints.  Adjust to inserted flag change.
3536         * mem-break.h (enum raw_bkpt_type): New enum.
3537         (raw_breakpoint, struct process_info): Forward declare.
3538         (Z_packet_to_target_hw_bp_type): Delete declaration.
3539         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
3540         (set_gdb_breakpoint, delete_gdb_breakpoint)
3541         (clear_breakpoint_conditions): New declarations.
3542         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
3543         (breakpoint_inserted_here): Update comment.
3544         (add_breakpoint_condition, add_breakpoint_commands): Replace
3545         address parameter with a breakpoint pointer parameter.
3546         (gdb_breakpoint_here): Update comment.
3547         (delete_gdb_breakpoint_at): Delete.
3548         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
3549         * server.c (process_point_options): Take a struct breakpoint
3550         pointer instead of an address.  Adjust.
3551         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
3552         delete_gdb_breakpoint.
3553         * spu-low.c (spu_target_ops): Install NULL as
3554         supports_z_point_type method.
3555         * target.h: Include mem-break.h.
3556         (struct target_ops) <prepare_to_access_memory>: Update comment.
3557         <supports_z_point_type>: New field.
3558         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3559         instead of a char.  Also take a raw breakpoint pointer.
3560         * win32-arm-low.c (the_low_target): Install NULL as
3561         supports_z_point_type.
3562         * win32-i386-low.c (i386_supports_z_point_type): New function.
3563         (i386_insert_point, i386_remove_point): Adjust to new interface.
3564         (the_low_target): Install i386_supports_z_point_type.
3565         * win32-low.c (win32_supports_z_point_type): New function.
3566         (win32_insert_point, win32_remove_point): Adjust to new interface.
3567         (win32_target_ops): Install win32_supports_z_point_type.
3568         * win32-low.h (struct win32_target_ops):
3569         <supports_z_point_type>: New method.
3570         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3571         instead of a char.  Also take a raw breakpoint pointer.
3572
3573 2014-05-20  Pedro Alves  <palves@redhat.com>
3574
3575         * mem-break.h: Include break-common.h.
3576         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3577         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
3578         (Z_packet_to_target_hw_bp_type): New declaration.
3579         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
3580         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
3581         (Z_PACKET_ACCESS_WP): Delete macros.
3582         (Z_packet_to_hw_type): Delete function.
3583         * i386-low.h: Don't include break-common.h here.
3584         (Z_packet_to_hw_type): Delete declaration.
3585         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
3586         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3587         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
3588         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3589         * linux-aarch64-low.c: Don't include break-common.h here.
3590         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3591         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
3592         (Z_packet_to_target_hw_bp_type): Delete function.
3593         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
3594         function.
3595         (mips_insert_point, mips_remove_point): Use
3596         Z_packet_to_target_hw_bp_type.
3597
3598 2014-05-20  Pedro Alves  <palves@redhat.com>
3599
3600         * linux-aarch64-low.c: Include break-common.h.
3601         (enum target_point_type): Delete.
3602         (Z_packet_to_point_type): Rename to ...
3603         (Z_packet_to_target_hw_bp_type): ... this, and return a
3604         target_hw_bp_type instead.
3605         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
3606         instead of an enum target_point_type.
3607         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
3608         breakpoint type.
3609         (aarch64_dr_state_insert_one_point)
3610         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
3611         (aarch64_handle_aligned_watchpoint)
3612         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
3613         Take an enum target_hw_bp_type instead of an enum
3614         target_point_type.
3615         (aarch64_supports_z_point_type): New function.
3616         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
3617         use Z_packet_to_target_hw_bp_type.
3618
3619 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
3620
3621         * configure.ac: Only use -Werror by default when DEVELOPMENT
3622         is true.
3623         * configure: Regenerate.
3624
3625 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
3626
3627         Fix gdbserver qGetTLSAddr for x86_64 -m32.
3628         * linux-x86-low.c (X86_64_USER_REGS): New.
3629         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
3630
3631 2014-04-28  Yao Qi  <yao@codesourcery.com>
3632
3633         * Makefile.in (i386-avx512.c): Fix the typo of generated file
3634         name.
3635
3636 2014-04-25  Pedro Alves  <palves@redhat.com>
3637
3638         PR server/16255
3639         * linux-low.c (linux_attach_fail_reason_string): New function.
3640         (linux_attach_lwp): Delete.
3641         (linux_attach_lwp_1): Rename to ...
3642         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
3643         argument.  Remove "initial" parameter.  Return int instead of
3644         void.  Don't error or warn here.
3645         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
3646         failure to attach to the tgid.  Call warning when failing to
3647         attach to an lwp.
3648         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
3649         argument.  Remove "initial" parameter.  Return int instead of
3650         void.  Don't error or warn here.
3651         (linux_attach_fail_reason_string): New declaration.
3652         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
3653         interface change.  Use linux_attach_fail_reason_string.
3654
3655 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
3656             Walfred Tedeschi  <walfred.tedeschi@intel.com>
3657
3658         * Makefile.in: Added rules to handle new files
3659         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
3660         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
3661         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
3662         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
3663         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
3664         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
3665         x32-avx512-linux.o.
3666         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
3667         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
3668         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
3669         i386/x32-avx512.xml.
3670         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
3671         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
3672         i386/x32-avx512-linux.xml.
3673         * i387-fp.c (num_avx512_k_registers): New constant for number
3674         of K registers.
3675         (num_avx512_zmmh_low_registers): New constant for number of
3676         lower ZMM registers (0-15).
3677         (num_avx512_zmmh_high_registers): New constant for number of
3678         higher ZMM registers (16-31).
3679         (num_avx512_ymmh_registers): New contant for number of higher
3680         YMM registers (ymm16-31 added by avx521 on x86_64).
3681         (num_avx512_xmm_registers): New constant for number of higher
3682         XMM registers (xmm16-31 added by AVX512 on x86_64).
3683         (struct i387_xsave): Add space for AVX512 registers.
3684         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
3685         Add code to handle AVX512 registers.
3686         (i387_xsave_to_cache): Add code to handle AVX512 registers.
3687         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
3688         prototypei from generated file.
3689         (tdesc_amd64_avx512_linux): Likewise.
3690         (init_registers_x32_avx512_linux): Likewise.
3691         (tdesc_x32_avx512_linux): Likewise.
3692         (init_registers_i386_avx512_linux): Likewise.
3693         (tdesc_i386_avx512_linux): Likewise.
3694         (x86_64_regmap): Add AVX512 registers.
3695         (x86_linux_read_description): Add code to handle AVX512 XSTATE
3696         mask.
3697         (initialize_low_arch): Add code to initialize AVX512 registers.
3698
3699 2014-04-23  Pedro Alves  <palves@redhat.com>
3700
3701         * mem-break.c (find_gdb_breakpoint_at): Make static.
3702         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
3703
3704 2014-04-23  Pedro Alves  <palves@redhat.com>
3705
3706         * i386-low.c: Don't include break-common.h here.
3707         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3708         prototype to take target_hw_bp_type as argument instead of a Z
3709         packet char.
3710         * i386-low.h: Include break-common.h here.
3711         (Z_packet_to_hw_type): Declare.
3712         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3713         prototypes.
3714         * linux-x86-low.c (x86_insert_point): Convert the packet number to
3715         a target_hw_bp_type before calling i386_low_insert_watchpoint.
3716         (x86_remove_point): Convert the packet number to a
3717         target_hw_bp_type before calling i386_low_remove_watchpoint.
3718         * win32-i386-low.c (i386_insert_point): Convert the packet number
3719         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
3720         (i386_remove_point): Convert the packet number to a
3721         target_hw_bp_type before calling i386_low_remove_watchpoint.
3722
3723 2014-04-23  Pedro Alves  <palves@redhat.com>
3724
3725         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
3726
3727 2014-04-10  Pedro Alves  <palves@redhat.com>
3728
3729         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
3730         Check if the condition or command is NULL before checking if the
3731         breakpoint is known.  On success, return true.
3732         * mem-break.h (add_breakpoint_condition): Document return.
3733         (add_breakpoint_commands): Add describing comment.
3734         * server.c (skip_to_semicolon): New function.
3735         (process_point_options): Use it.
3736
3737 2014-04-09  Pedro Alves  <palves@redhat.com>
3738
3739         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
3740         to lwpid_of.
3741
3742 2014-02-27  Pedro Alves  <palves@redhat.com>
3743
3744         PR 12702
3745         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
3746         macros.
3747         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
3748         output.
3749         (last_thread_of_process_p): Take a PID argument instead of a
3750         thread pointer.
3751         (linux_wait_for_lwp): Delete.
3752         (num_lwps, check_zombie_leaders, not_stopped_callback): New
3753         functions.
3754         (linux_low_filter_event): New function, party factored out from
3755         linux_wait_for_event.
3756         (linux_wait_for_event): Rename to ...
3757         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
3758         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
3759         sigsuspend.  Check for zombie leaders.
3760         (linux_wait_for_event): Reimplement as wrapper around
3761         linux_wait_for_event_filtered.
3762         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
3763         a normal or signal exit is seen, it's the whole process exiting.
3764         (wait_for_sigstop): No longer a for_each_inferior callback.
3765         Rewrite on top of linux_wait_for_event_filtered.
3766         (stop_all_lwps): Call wait_for_sigstop directly.
3767         * server.c (resume, handle_target_event): Handle
3768         TARGET_WAITKIND_NO_RESUMED.
3769
3770 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3771
3772         * win32-low.c (psapi_get_dll_name,
3773         * win32_CreateToolhelp32Snapshot): Delete.
3774         (win32_CreateToolhelp32Snapshot, win32_Module32First)
3775         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
3776         Delete.
3777         (handle_load_dll): Add function description.
3778         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
3779
3780 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3781
3782         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
3783         Add comment.
3784         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
3785         base address when calling win32_add_one_solib.
3786         (handle_load_dll): Delete local variable load_addr.
3787         Remove 0x1000 offset applied to DLL base address when calling
3788         win32_add_one_solib.
3789         (handle_unload_dll): Add comment.
3790
3791 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3792
3793         * win32-low.c (win32_add_all_dlls): Renames
3794         win32_ensure_ntdll_loaded.  Rewrite function documentation.
3795         Adjust implementation to always load all DLLs.
3796         Add 0x1000 offset to DLL base address when calling
3797         win32_add_one_solib.
3798         (child_initialization_done): New static global.
3799         (do_initial_child_stuff): Set child_initialization_done to
3800         zero during child initialization, and 1 after.  Replace call
3801         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
3802         Add comment.
3803         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
3804         (handle_unload_dll): Add function documentation.
3805         (get_child_debug_event): Ignore load and unload DLL events
3806         during child initialization.
3807
3808 2014-02-20  Doug Evans  <dje@google.com>
3809
3810         Remove global all_lwps.
3811         * inferiors.h (ptid_of): Move here from linux-low.h.
3812         (pid_of, lwpid_of): Ditto.
3813         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
3814         parameter is a struct thread_info * now.
3815         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
3816         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
3817         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
3818         directly.
3819         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
3820         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
3821         * linux-arm-low.c (update_registers_callback): Update, "entry"
3822         parameter is a struct thread_info * now.
3823         Fetch lwpid from current_inferior directly.
3824         (arm_insert_point): Pass &all_threads to find_inferior instead of
3825         &all_lwps.
3826         (arm_remove_point): Ditto.
3827         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
3828         (arm_prepare_to_resume): Fetch pid from thread.
3829         (arm_read_description): Fetch lwpid from current_inferior directly.
3830         * linux-low.c (all_lwps): Delete.
3831         (delete_lwp): Delete call to remove_inferior.
3832         (handle_extended_wait): Fetch lwpid from thread.
3833         (add_lwp): Don't set lwp->entry.id.  Remove call to
3834         add_inferior_to_list.
3835         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
3836         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
3837         (kill_one_lwp_callback): Ditto.
3838         (linux_kill): Don't dereference NULL pointer.
3839         Fetch ptid,lwpid from thread.
3840         (get_detach_signal): Fetch ptid from thread.
3841         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
3842         Simplify call to regcache_invalidate_thread.
3843         (delete_lwp_callback): Update, "entry" parameter is a
3844         struct thread_info * now.  Fetch pid from thread.
3845         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
3846         (status_pending_p_callback): Update, "entry" parameter is a
3847         struct thread_info * now.  Fetch ptid from thread.
3848         (find_lwp_pid): Update, "entry" parameter is a
3849         struct thread_info * now.
3850         (linux_wait_for_lwp): Fetch pid from thread.
3851         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
3852         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
3853         (enqueue_one_deferred_signal): Fetch lwpid from thread.
3854         (dequeue_one_deferred_signal): Ditto.
3855         (cancel_breakpoint): Fetch ptid from current_inferior.
3856         (linux_wait_for_event): Pass &all_threads to find_inferior,
3857         not &all_lwps.  Fetch ptid, lwpid from thread.
3858         (count_events_callback): Update, "entry" parameter is a
3859         struct thread_info * now.
3860         (select_singlestep_lwp_callback): Ditto.
3861         (select_event_lwp_callback): Ditto.
3862         (cancel_breakpoints_callback): Ditto.
3863         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
3864         not &all_lwps.
3865         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
3866         (unsuspend_one_lwp): Update, "entry" parameter is a
3867         struct thread_info * now.
3868         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
3869         not &all_lwps.
3870         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
3871         Fetch lwpid from thread, not lwp.
3872         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
3873         Pass &all_threads to find_inferior, not &all_lwps.
3874         (send_sigstop): Fetch lwpid from thread, not lwp.
3875         (send_sigstop_callback): Update, "entry" parameter is a
3876         struct thread_info * now.
3877         (suspend_and_send_sigstop_callback): Ditto.
3878         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
3879         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
3880         struct thread_info * now.
3881         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
3882         from thread, lwp.
3883         (lwp_running): Update, "entry" parameter is a
3884         struct thread_info * now.
3885         (stop_all_lwps): Fetch ptid from thread.
3886         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
3887         (linux_resume_one_lwp): Fetch lwpid from thread.
3888         (linux_set_resume_request): Update, "entry" parameter is a
3889         struct thread_info * now.  Fetch pid, lwpid from thread.
3890         (resume_status_pending_p): Update, "entry" parameter is a
3891         struct thread_info * now.
3892         (need_step_over_p): Ditto.  Fetch lwpid from thread.
3893         (start_step_over): Fetch lwpid from thread.
3894         (linux_resume_one_thread): Update, "entry" parameter is a
3895         struct thread_info * now.  Fetch lwpid from thread.
3896         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
3897         (proceed_one_lwp): Update, "entry" parameter is a
3898         struct thread_info * now.  Fetch lwpid from thread.
3899         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
3900         struct thread_info * now.
3901         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
3902         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
3903         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
3904         directly.
3905         (regsets_store_inferior_registers): Ditto.
3906         (fetch_register, store_register): Ditto.
3907         (linux_read_memory, linux_write_memory): Ditto.
3908         (linux_request_interrupt): Ditto.
3909         (linux_read_auxv): Ditto.
3910         (linux_xfer_siginfo): Ditto.
3911         (linux_qxfer_spu): Ditto.
3912         (linux_qxfer_libraries_svr4): Ditto.
3913         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
3914         moved to inferiors.h.
3915         (get_lwp): Delete.
3916         (get_thread_lwp): Update.
3917         (struct lwp_info): Delete member "entry".  Simplify comment for
3918         member "thread".
3919         (all_lwps): Delete.
3920         * linux-mips-low.c (mips_read_description): Fetch lwpid from
3921         current_inferior directly.
3922         (update_watch_registers_callback): Update, "entry" parameter is a
3923         struct thread_info * now.  Fetch pid from thread.
3924         (mips_linux_prepare_to_resume): Fetch ptid from thread.
3925         (mips_insert_point): Fetch lwpid from current_inferior.
3926         Pass &all_threads to find_inferior, not &all_lwps.
3927         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
3928         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
3929         directly.
3930         (mips_stopped_data_address): Ditto.
3931         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
3932         directly.
3933         * linux-tile-low.c (tile_arch_setup): Ditto.
3934         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
3935         (update_debug_registers_callback): Update, "entry" parameter is a
3936         struct thread_info * now.  Fetch pid from thread.
3937         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
3938         Pass &all_threads to find_inferior, not &all_lwps.
3939         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
3940         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
3941         Pass &all_threads to find_inferior, not &all_lwps.
3942         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
3943         (i386_dr_low_get_status): Ditto.
3944         (x86_linux_prepare_to_resume): Fetch ptid from thread.
3945         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
3946         (x86_linux_read_description): Ditto.
3947         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
3948
3949 2014-02-20  Doug Evans  <dje@google.com>
3950
3951         * inferiors.c (get_first_inferior): Fix buglet.
3952
3953 2014-02-19  Doug Evans  <dje@google.com>
3954
3955         * gdbthread.h (add_thread): Change result type to struct thread_info *.
3956         * inferiors.c (add_thread): Change result type to struct thread_info *.
3957         All callers updated.
3958         (add_lwp): Call add_thread here instead of in callers.
3959         All callers updated.
3960         * linux-low.h (get_lwp_thread): Rewrite.
3961         (struct lwp_info): New member "thread".
3962
3963 2014-02-19  Doug Evans  <dje@google.com>
3964
3965         * linux-low.c (add_lwp): Change result to struct lwp_info *.
3966         All callers updated.
3967
3968 2014-02-19  Doug Evans  <dje@google.com>
3969
3970         * inferiors.c (add_thread): Fix whitespace.
3971
3972 2014-02-19  Doug Evans  <dje@google.com>
3973
3974         * dll.c (clear_dlls): Replace accessing list implemention details
3975         with API function.
3976         * gdbthread.h (get_first_thread): Declare.
3977         * inferiors.c (for_each_inferior_with_data): New function.
3978         (get_first_thread): New function.
3979         (find_thread_ptid): Simplify.
3980         (get_first_inferior): New function.
3981         (clear_list): Delete.
3982         (one_inferior_p): New function.
3983         (clear_inferior_list): New function.
3984         (clear_inferiors): Update.
3985         * inferiors.h (for_each_inferior_with_data): Declare.
3986         (clear_inferior_list): Declare.
3987         (one_inferior_p): Declare.
3988         (get_first_inferior): Declare.
3989         * linux-low.c (linux_wait_for_event): Replace accessing list
3990         implemention details with API function.
3991         * server.c (target_running): Ditto.
3992         (accumulate_file_name_length): New function.
3993         (emit_dll_description): New function.
3994         (handle_qxfer_libraries): Replace accessing list implemention
3995         details with API function.
3996         (handle_qxfer_threads_worker): New function.
3997         (handle_qxfer_threads_proper): Replace accessing list implemention
3998         details with API function.
3999         (handle_query): Ditto.
4000         (visit_actioned_threads_callback_ftype): New typedef.
4001         (visit_actioned_threads_data): New struct.
4002         (visit_actioned_threads): Rewrite to be find_inferior callback.
4003         (resume): Call find_inferior.
4004         (handle_status): Replace accessing list implemention
4005         details with API function.
4006         (process_serial_event): Replace accessing list implemention details
4007         with API function.
4008         * target.c (set_desired_inferior): Replace accessing list implemention
4009         details with API function.
4010         * tracepoint.c (same_process_p): New function.
4011         (gdb_agent_about_to_close): Replace accessing list implemention
4012         details with API function.
4013         * win32-low.c (child_delete_thread): Replace accessing list
4014         implemention details with API function.
4015         (match_dll_by_basename): New function.
4016         (dll_is_loaded_by_basename): New function.
4017         (win32_ensure_ntdll_loaded): Replace accessing list implemention
4018         details call to dll_is_loaded_by_basename.
4019
4020 2014-02-19  Doug Evans  <dje@google.com>
4021
4022         * dll.h (struct dll_info): Add comment.
4023         * gdbthread.h (struct thread_info): Add comment.
4024         (current_ptid): Simplify.
4025         * inferiors.c (add_process): Update.
4026         (remove_process): Update.
4027         * inferiors.h (struct process_info): Rename member "head" to "entry".
4028         * linux-low.c (delete_lwp): Update.
4029         (add_lwp): Update.
4030         (last_thread_of_process_p): Update.
4031         (kill_one_lwp_callback, linux_kill): Update.
4032         (status_pending_p_callback): Update.
4033         (wait_for_sigstop): Update.  Simplify read of ptid.
4034         (start_step_over): Update.
4035         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
4036         (get_lwp_thread): Update.
4037         (struct lwp_info): Rename member "head" to "entry".
4038         * regcache.h (inferior_list_entry): Delete.
4039         * server.c (kill_inferior_callback): Update.
4040         (detach_or_kill_inferior_callback): Update.
4041         (print_started_pid): Update.
4042         (print_attached_pid): Update.
4043         (process_serial_event): Simplify read of ptid.
4044         * thread-db.c (thread_db_create_event): Update.
4045         (thread_db_get_tls_address): Update.
4046         * win32-low.c (current_inferior_ptid): Simplify.
4047
4048 2014-02-19  Tom Tromey  <tromey@redhat.com>
4049
4050         * target.h (struct target_ops) <supports_btrace>: Add target_ops
4051         argument.
4052         (target_supports_btrace): Update.
4053
4054 2014-02-14  Yao Qi  <yao@codesourcery.com>
4055
4056         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
4057         (rsp-low-ipa.o): New target.
4058
4059 2014-02-12  Tom Tromey  <tromey@redhat.com>
4060
4061         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
4062         convert_ascii_to_int.
4063         * regcache.c (registers_to_string): Likewise.
4064         * remote-utils.c (decode_M_packet): Likewise.
4065         * server.c (process_serial_event): Likewise.
4066
4067 2014-02-12  Tom Tromey  <tromey@redhat.com>
4068
4069         * server.c (handle_query, handle_v_run): Use hex2bin, not
4070         unhexify.
4071         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
4072
4073 2014-02-12  Tom Tromey  <tromey@redhat.com>
4074
4075         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
4076         convert_int_to_ascii.
4077         * regcache.c (registers_to_string, collect_register_as_string):
4078         Likewise.
4079         * remote-utils.c (look_up_one_symbol, relocate_instruction):
4080         Likewise.
4081         * server.c (process_serial_event): Likewise.
4082         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
4083         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
4084
4085 2014-02-12  Tom Tromey  <tromey@redhat.com>
4086
4087         * remote-utils.c (look_up_one_symbol, monitor_output): Use
4088         bin2hex, not hexify.
4089         * tracepoint.c (cmd_qtstatus): Likewise.
4090
4091 2014-02-12  Tom Tromey  <tromey@redhat.com>
4092
4093         * remote-utils.c (monitor_output): Pass explicit length to
4094         hexify.
4095
4096 2014-02-12  Tom Tromey  <tromey@redhat.com>
4097
4098         * tracepoint.c: Include rsp-low.h.
4099         * server.c: Include rsp-low.h.
4100         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
4101         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
4102         declare.
4103         * remote-utils.c: Include rsp-low.h.
4104         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
4105         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
4106         (convert_int_to_ascii, convert_ascii_to_int): Move to
4107         common/rsp-low.c.
4108         * regcache.c: Include rsp-low.h.
4109         * ax.c: Include rsp-low.h.
4110         * Makefile.in (SFILES): Add common/rsp-low.c.
4111         (OBS): Add rsp-low.o.
4112         (rsp-low.o): New target.
4113
4114 2014-02-12  Tom Tromey  <tromey@redhat.com>
4115
4116         * utils.h (pulongest, plongest, phex_nz): Don't declare.
4117         Include print-utils.h.
4118         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
4119         (plongest, thirty_two, phex_nz): Remove.
4120         * Makefile.in (SFILES): Add common/print-utils.c.
4121         (OBS): Add print-utils.o.
4122         (print-utils-ipa.o): New target.
4123         (print-utils.o): New target.
4124         (IPA_OBJS): Add print-utils-ipa.o.
4125
4126 2014-02-06  Tom Tromey  <tromey@redhat.com>
4127
4128         * Makefile.in (SFILES): Fix indentation.
4129
4130 2014-02-05  Doug Evans  <dje@google.com>
4131
4132         * linux-low.c (linux_wait_for_event): Improve comment.
4133         (linux_wait_1): Keep current_inferior in sync with event_child.
4134
4135 2014-01-22  Doug Evans  <dje@google.com>
4136
4137         * gdbthread.h (gdb_id_to_thread): Delete, unused.
4138
4139 2014-01-22  Doug Evans  <dje@google.com>
4140
4141         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
4142         * configure: Regenerate.
4143         * config.in: Regenerate.
4144         * Makefile.in (SFILES): Add debug.c.
4145         (OBS): Add debug.o.
4146         * debug.c: New file.
4147         * debug.h: New file.
4148         * linux-aarch64-low.c (*): Update all debugging printfs to use
4149         debug_printf instead of fprintf.
4150         * linux-arm-low.c (*): Ditto.
4151         * linux-cris-low.c (*): Ditto.
4152         * linux-crisv32-low.c (*): Ditto.
4153         * linux-m32r-low.c (*): Ditto.
4154         * linux-sparc-low.c (*): Ditto.
4155         * linux-x86.c (*): Ditto.
4156         * linux-low.c (*): Ditto.
4157         (linux_wait_1): Add calls to debug_enter, debug_exit.
4158         (linux_wait): Remove redundant debugging printf.
4159         (stop_all_lwps): Add calls to debug_enter, debug_exit.
4160         (linux_resume, unstop_all_lwps): Ditto.
4161         * mem-break.c (*): Update all debugging printfs to use
4162         debug_printf instead of fprintf.
4163         * remote-utils.c (*): Ditto.
4164         * thread-db.c (*): Ditto.
4165         * server.c #include <ctype.h>, "gdb_vecs.h".
4166         (debug_threads): Moved to debug.c.
4167         (*): Update all debugging printfs to use debug_printf instead of
4168         fprintf.
4169         (start_inferior): Replace call to fflush with call to debug_flush.
4170         (monitor_show_help): Mention set debug-format.
4171         (parse_debug_format_options): New function.
4172         (handle_monitor_command): Handle "monitor set debug-format".
4173         (gdbserver_usage): Mention --debug-format.
4174         (main): Parse --debug-format.
4175         * server.h (debug_threads): Declaration moved to debug.h.
4176         #include "debug.h".
4177         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
4178         trace_debug_1 that uses debug_printf.
4179         (tracepoint_look_up_symbols): Update all debugging printfs to use
4180         debug_printf instead of fprintf.
4181
4182 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
4183
4184         * linux-xtensa-low.c: Include asm/ptrace.h instead of
4185         sys/ptrace.h.
4186
4187 2014-01-17  Pedro Alves  <palves@redhat.com>
4188
4189         PR build/16445
4190         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
4191         defined after including gdb_proc_service.h.
4192
4193 2014-01-16  Doug Evans  <dje@google.com>
4194
4195         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
4196         (match_dll): Use it.
4197
4198 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
4199
4200         * target.h (target_ops) <read_btrace>: Change parameters and
4201         return type to allow error reporting.
4202         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
4203         trace reading errors on.
4204         * linux-low.c (linux_low_read_btrace): Pass trace reading
4205         errors on.
4206         (linux_low_disable_btrace): New.
4207
4208 2014-01-15  Doug Evans  <dje@google.com>
4209
4210         * inferiors.c (thread_id_to_gdb_id): Delete.
4211         * inferiors.h (thread_id_to_gdb_id): Delete.
4212
4213 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
4214
4215         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
4216         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
4217         versions.
4218
4219 2014-01-08  Pedro Alves  <palves@redhat.com>
4220
4221         * server.c (handle_status): Don't discard previous queued stop
4222         replies or thread's pending status here.
4223         (main) <disconnection>: Do it here instead.
4224
4225 2014-01-08  Pedro Alves  <palves@redhat.com>
4226
4227         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
4228         * server.c (visit_actioned_threads, handle_pending_status): New
4229         function.
4230         (handle_v_cont): Factor out parts to ...
4231         (resume): ... this new function.  If in all-stop, and a thread
4232         being resumed has a pending status, report it without actually
4233         resuming.
4234         (myresume): Adjust to use the new 'resume' function.
4235         (clear_pending_status_callback, set_pending_status_callback)
4236         (find_status_pending_thread_callback): New functions.
4237         (handle_status): Handle the case of multiple threads having
4238         interesting statuses to report.  Report threads' real last signal
4239         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
4240         with an interesting thread to report the status for, instead of
4241         always reporting the status of the first thread.
4242
4243 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
4244
4245         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
4246         * gdbreplay.c (gdbreplay_version): Likewise.
4247
4248 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
4249
4250         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
4251         iov.iov_len with the real length in use.
4252
4253 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
4254
4255         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
4256         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
4257         for all targets that use win32-low.c.
4258         * win32-low.c (win32_ensure_ntdll_loaded): New function.
4259         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
4260
4261 2013-12-13  Pedro Alves  <palves@redhat.com>
4262
4263         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
4264         if equal to TARGET_WAITKIND_LOADED.
4265         * win32-low.c (cached_status): New static global.
4266         (win32_wait): Add declaration.
4267         (do_initial_child_stuff): Flush all initial pending debug events
4268         up to the initial breakpoint.
4269         (win32_wait): If CACHED_STATUS was set, return that instead
4270         of doing a real wait.  Remove the code resuming the execution
4271         of the inferior after receiving a TARGET_WAITKIND_LOADED event
4272         during the initial phase.  Also remove the code changing
4273         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
4274         TARGET_WAITKIND_STOPPED.
4275
4276 2013-12-11  Yao Qi  <yao@codesourcery.com>
4277
4278         * notif.c (handle_notif_ack): Return 0 if no notification
4279         matches.
4280
4281 2013-11-20  Doug Evans  <dje@google.com>
4282
4283         * linux-low.c (linux_set_resume_request): Fix comment.
4284
4285 2013-11-20  Doug Evans  <dje@google.com>
4286
4287         * linux-low.c (resume_status_pending_p): Tweak comment.
4288
4289 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4290
4291         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
4292         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
4293         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
4294         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
4295         (srv_amd64_regobj): Add amd64-mpx.o.
4296         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
4297         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
4298         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
4299         * i387-fp.c (num_pl_bnd_register) Added constant.
4300         (num_pl_bnd_cfg_registers) Added constant.
4301         (struct i387_xsave) Added reserved area and MPX fields.
4302         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
4303         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
4304         function.
4305         (tdesc_i386_mpx_linux): Add MPX amd64 target.
4306         (init_registers_amd64_mpx_linux): Declare new function.
4307         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
4308         (x86_64_regmap): Add MPX registers.
4309         (x86_linux_read_description): Add MPX case.
4310         (initialize_low_arch): Initialize MPX targets.
4311
4312 2013-11-18  Tom Tromey  <tromey@redhat.com>
4313
4314         * configure: Rebuild.
4315         * configure.ac: Don't check for stdlib.h.
4316         * gdbreplay.c: Unconditionally include stdlib.h.
4317
4318 2013-11-18  Tom Tromey  <tromey@redhat.com>
4319
4320         * config.in: Rebuild.
4321         * configure: Rebuild.
4322         * configure.ac: Don't use AC_HEADER_DIRENT.
4323
4324 2013-11-18  Tom Tromey  <tromey@redhat.com>
4325
4326         * server.h: Don't check HAVE_STRING_H.
4327         * gdbreplay.c: Don't check HAVE_STRING_H.
4328         * configure: Rebuild.
4329
4330 2013-11-18  Tom Tromey  <tromey@redhat.com>
4331
4332         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
4333         LIBGNU.
4334
4335 2013-11-08  Tom Tromey  <tromey@redhat.com>
4336
4337         * configure, config.in: Rebuild.
4338         * configure.ac: Remove unused configury.
4339
4340 2013-11-08  Tom Tromey  <tromey@redhat.com>
4341
4342         * acinclude.m4: Include common.m4, codeset.m4.
4343         * configure, config.in: Rebuild.
4344         * configure.ac: Use GDB_AC_COMMON.
4345
4346 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4347
4348         * linux-s390-low.c (HWCAP_S390_TE): New define.
4349         (s390_arch_setup): Consider the TE field in the HWCAP for
4350         determining 'have_regset_tdb'.
4351
4352 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
4353
4354         PR gdb/16014
4355         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
4356         call to sizeof.
4357
4358 2013-10-02  Pedro Alves  <palves@redhat.com>
4359
4360         * server.c (process_serial_event): Don't output "GDBserver
4361         exiting" if GDB is connected through stdio.
4362         * target.c (mywait): Likewise, be silent if GDB is connected
4363         through stdio.
4364
4365 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
4366
4367         * lynx-low.c (lynx_add_threads_after_attach): New function.
4368         (lynx_attach): Remove call to add_thread.  Add call to
4369         lynx_add_threads_after_attach instead.
4370
4371 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
4372
4373         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
4374         * config.in, configure: Regenerated.
4375
4376 2013-09-18  Yao Qi  <yao@codesourcery.com>
4377
4378         PR server/15959
4379         * server.c (start_inferior): Clear 'resume_info'.
4380
4381 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4382
4383         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
4384         for each register.
4385
4386 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4387
4388         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
4389         linux-tile-low.o to srv_tgtobj.
4390
4391 2013-09-16  Will Newton  <will.newton@linaro.org>
4392
4393         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
4394         out regs.
4395
4396 2013-09-06  Pedro Alves  <palves@redhat.com>
4397
4398         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
4399         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
4400         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
4401         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
4402         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
4403         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
4404
4405 2013-09-06  Pedro Alves  <palves@redhat.com>
4406
4407         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
4408         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
4409
4410 2013-09-06  Pedro Alves  <palves@redhat.com>
4411
4412         * linux-amd64-ipa.c: Include tracepoint.h.
4413         * linux-i386-ipa.c: Include tracepoint.h.
4414
4415 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4416
4417         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
4418         (ps_get_thread_area): New function.
4419
4420 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4421
4422         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
4423         (initialize_low_arch): Call init_registers_crisv32 rather than
4424         init_register_crisv32.
4425
4426 2013-09-05  Pedro Alves  <palves@redhat.com>
4427
4428         * server.h (handle_vFile, hostio_last_error_from_errno): Move
4429         to ...
4430         * hostio.h: ... this new file.
4431         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
4432         win32-low.c: Include hostio.h.
4433
4434 2013-09-05  Pedro Alves  <palves@redhat.com>
4435
4436         * server.h (gdb_client_data, handler_func, callback_handler_func)
4437         (delete_file_handler, add_file_handler, append_callback_event)
4438         (delete_callback_event, start_event_loop, initialize_event_loop):
4439         Move to event-loop.h and include it.
4440         * event-loop.h: New file.
4441
4442 2013-09-05  Pedro Alves  <palves@redhat.com>
4443
4444         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
4445         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
4446         (loaded_dll, unloaded_dll): Move to ...
4447         * dll.h: ... this new file.
4448         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
4449
4450 2013-09-05  Pedro Alves  <palves@redhat.com>
4451
4452         * server.h (current_process, get_thread_process, all_processes)
4453         (add_inferior_to_list, for_each_inferior, current_inferior)
4454         (remove_inferior, add_process, remove_process, find_process_pid)
4455         (have_started_inferiors_p, have_attached_inferiors_p)
4456         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
4457         (clear_inferiors, find_inferior, find_inferior_id)
4458         (inferior_target_data, set_inferior_target_data)
4459         (inferior_regcache_data, set_inferior_regcache_data): Move to
4460         inferiors.h, and include it.
4461         * inferiors.h: New file.
4462
4463 2013-09-05  Pedro Alves  <palves@redhat.com>
4464
4465         * server.h (struct emit_ops, current_insn_ptr, emit_error):
4466         Move ...
4467         * ax.h: ... here.
4468
4469 2013-09-05  Pedro Alves  <palves@redhat.com>
4470
4471         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
4472         tracepoint.h.
4473         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
4474         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
4475         (handle_tracepoint_general_set, handle_tracepoint_query)
4476         (tracepoint_finished_step, tracepoint_was_hit)
4477         (release_while_stepping_state_list, current_traceframe)
4478         (in_readonly_region, traceframe_read_mem)
4479         (fetch_traceframe_registers, traceframe_read_sdata)
4480         (traceframe_read_info, struct fast_tpoint_collect_status)
4481         (fast_tracepoint_collecting, force_unlock_trace_buffer)
4482         (handle_tracepoit_bkpts, initialize_low_tracepoint)
4483         (supply_fast_tracepoint_registers)
4484         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
4485         (ipa_tdesc, claim_trampoline_space)
4486         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
4487         (agent_mem_read, agent_get_trace_state_variable_value)
4488         (agent_set_trace_state_variable_value, agent_tsv_read)
4489         (agent_mem_read_string, get_raw_reg_func_addr)
4490         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
4491         * tracepoint.h: ... this new file.
4492
4493 2013-09-05  Pedro Alves  <palves@redhat.com>
4494
4495         * server.h (perror_with_name, error, fatal, warning, paddress)
4496         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
4497         include it.
4498         * utils.h: New file.
4499
4500 2013-09-05  Pedro Alves  <palves@redhat.com>
4501
4502         * server.h (remote_debug, noack_mode, transport_is_reliable)
4503         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
4504         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
4505         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
4506         (write_enn, initialize_async_io, enable_async_io)
4507         (disable_async_io, check_remote_input_interrupt_request)
4508         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
4509         (dead_thread_notify, prepare_resume_reply)
4510         (decode_address_to_semicolon, decode_address, decode_m_packet)
4511         (decode_M_packet, decode_X_packet, decode_xfer_write)
4512         (decode_search_memory_packet, unhexify, hexify)
4513         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
4514         (look_up_one_symbol, relocate_instruction)
4515         (monitor_output): Move to remote-utils.h, and include it.
4516         * remote-utils.h: New file.
4517
4518 2013-09-05  Pedro Alves  <palves@redhat.com>
4519
4520         * server.h (_): Delete.
4521
4522 2013-09-02  Pedro Alves  <palves@redhat.com>
4523
4524         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
4525         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
4526         allocated.
4527         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
4528
4529 2013-09-02  Pierre Muller  <muller@sourceware.org>
4530
4531         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
4532         or WriteProcessMemory complete successfully and handle
4533         ERROR_PARTIAL_COPY error.
4534
4535 2013-09-02  Pedro Alves  <palves@redhat.com>
4536
4537         * server.c (gdb_read_memory): Return -1 on traceframe memory read
4538         error instead of EIO.
4539
4540 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4541
4542         PR server/15604
4543         * linux-low.c: Include filestuff.h.
4544         (linux_create_inferior) <pid == 0>: Call close_most_fds.
4545         * lynx-low.c: Include filestuff.h.
4546         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
4547         * server.c: Include filestuff.h.
4548         (main): Call notice_open_fds.
4549         * spu-low.c: Include filestuff.h.
4550         (spu_create_inferior) <pid == 0>: Call close_most_fds.
4551
4552 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
4553
4554         * Makefile.in: Explain why ../target and ../nat are not
4555         listed as include file search paths.
4556         (linux-waitpid.o): New object file rule.
4557         * configure.srv (srv_native_linux_obj): New variable.
4558         Replace all occurrences of linux native object files with
4559         $srv_native_linux_obj.
4560         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
4561         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
4562         (linux_enable_event_reporting): Remove declaration.
4563         (my_waitpid): Moved to common/linux-waitpid.c.
4564         (linux_wait_for_event): Pass ptid when calling
4565         linux_enable_event_reporting.
4566         (linux_supports_tracefork_flag): Remove.
4567         (linux_enable_event_reporting): Likewise.
4568         (linux_tracefork_grandchild): Remove.
4569         (STACK_SIZE): Moved to common/linux-ptrace.c.
4570         (linux_tracefork_child): Remove.
4571         (linux_test_for_tracefork): Remove.
4572         (linux_look_up_symbols): Call linux_supports_traceclone.
4573         (initialize_low): Remove call to linux_test_for_tracefork.
4574         * linux-low.h (PTRACE_TYPE_ARG3): Move to
4575         common/linux-ptrace.h.
4576         (PTRACE_TYPE_ARG4): Likewise.
4577         Include linux-ptrace.h.
4578
4579 2013-08-21  Pedro Alves  <palves@redhat.com>
4580
4581         * config.in: Renegerate.
4582
4583 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
4584
4585         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
4586         (SFILES): Remove $(srcdir)/common/target-common.c and
4587         add $(srcdir)/target/waitstatus.c.
4588         (OBS): Remove target-common.o and add waitstatus.o.
4589         (server_h): Remove $(srcdir)/../common/target-common.h and
4590         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
4591         and $(srcdir)/../target/waitstatus.h.
4592         (target-common.o): Remove.
4593         (waitstatus.o): New target object file.
4594         * target.h: Do not include target-common.h and
4595         include target/resume.h, target/wait.h and
4596         target/waitstatus.h.
4597
4598 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
4599
4600         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4601         to PTRACE_TYPE_ARG3.
4602         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4603         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
4604         PTRACE_TYPE_ARG4.
4605         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
4606         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
4607
4608 2013-07-27  Jie Zhang  <jie@codesourcery.com>
4609             Daniel Jacobowitz  <dan@codesourcery.com>
4610             Yao Qi  <yao@codesourcery.com>
4611
4612         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
4613         (mips-linux-watch.o): New rule.
4614         (mips_linux_watch_h): New variable.
4615         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
4616         srv_tgtobj.
4617         * linux-mips-low.c: Include mips-linux-watch.h.
4618         (struct arch_process_info, struct arch_lwp_info): New.
4619         (update_watch_registers_callback): New function.
4620         (mips_linux_new_process, mips_linux_new_thread) New functions.
4621         (mips_linux_prepare_to_resume, mips_insert_point): New
4622         functions.
4623         (mips_remove_point, mips_stopped_by_watchpoint): New
4624         functions.
4625         (rsp_bp_type_to_target_hw_bp_type): New function.
4626         (mips_stopped_data_address): New function.
4627         (the_low_target): Add watchpoint support functions.
4628
4629 2013-07-27  Yao Qi  <yao@codesourcery.com>
4630
4631         * i386-low.c: Include break-common.h.
4632         (enum target_hw_bp_type): Remove.
4633
4634 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
4635
4636         * Makefile.in (SFILES): /common/target-common.c.
4637         (OBS): Add target-common.o.
4638         (server_h): Add $(srcdir)/../common/target-common.h.
4639         (target-common.o): New target.
4640         * server.c (queue_stop_reply_callback): Free
4641         status string after use.
4642         * target.c (target_waitstatus_to_string): Remove.
4643         * target.h: Include target-common.h.
4644         (resume_kind): Likewise.
4645         (target_waitkind): Likewise.
4646         (target_waitstatus): Likewise.
4647         (TARGET_WNOHANG): Likewise.
4648
4649 2013-07-04  Yao Qi  <yao@codesourcery.com>
4650
4651         * Makefile.in (host_alias): Use @host_noncanonical@.
4652         (target_alias): Use @target_noncanonical@.
4653         * configure.ac: Use ACX_NONCANONICAL_TARGET and
4654         ACX_NONCANONICAL_HOST.
4655         * configure: Regenerated.
4656
4657         Revert:
4658         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4659
4660         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4661         * configure: Rebuild.
4662         * Makefile.in (version_host, version_target): Get from configure.
4663         (version.c): Use $(version_host) and $(version_target).
4664
4665 2013-07-03  Pedro Alves  <palves@redhat.com>
4666
4667         * Makefile.in (config.status): Depend on development.sh.
4668         * acinclude.m4: Include libmcheck.m4.
4669         * configure: Regenerate.
4670
4671 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4672
4673         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
4674         attribute inside the parentheses.
4675         (winapi_DebugSetProcessKillOnExit): Ditto.
4676         (winapi_DebugBreakProcess): Ditto.
4677         (winapi_GenerateConsoleCtrlEvent): Ditto.
4678
4679 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4680
4681         * notif.h (notif_event): Add a dummy member to avoid compiler
4682         errors.
4683
4684 2013-07-01  Pedro Alves  <palves@redhat.com>
4685
4686         * hostio.c (HOSTIO_PATH_MAX): Define.
4687         (require_filename, handle_open, handle_unlink, handle_readlink):
4688         Use it.
4689
4690 2013-07-01  Pedro Alves  <palves@redhat.com>
4691
4692         * server.h: Include "pathmax.h".
4693         * linux-low.c: Don't include sys/param.h.
4694         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
4695         MAXPATHLEN.
4696         * win32-low.c: Don't include sys/param.h.
4697         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
4698
4699 2013-07-01  Pedro Alves  <palves@redhat.com>
4700
4701         * event-loop.c: Don't check HAVE_UNISTD_H before including
4702         <unistd.h>.
4703         * gdbreplay.c: Likewise.
4704         * remote-utils.c: Likewise.
4705         * server.c: Likewise.
4706         * configure.ac: Don't check for unistd.h.
4707         * configure: Regenerate.
4708
4709 2013-06-28  Tom Tromey  <tromey@redhat.com>
4710
4711         * Makefile.in (version.c): Use version.in, not
4712         common/version.in.
4713
4714 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4715
4716         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4717         * configure: Rebuild.
4718         * Makefile.in (version_host, version_target): Get from configure.
4719         (version.c): Use $(version_host) and $(version_target).
4720
4721 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4722
4723         Fix trace-status to output user name without trailing colon.
4724         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
4725
4726 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4727
4728         Fix trace-status to output proper start-time and stop-time.
4729         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
4730         output start time and stop time in hex as gdb expects.
4731
4732 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
4733
4734         * tracepoint.c (build_traceframe_info_xml): Output trace state
4735         variables present in the trace buffer.
4736
4737 2013-06-24  Tom Tromey  <tromey@redhat.com>
4738
4739         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
4740         create-version.sh.
4741         (version.o): Remove.
4742         * gdbreplay.c: Include version.h.
4743         (version, host_name): Don't declare.
4744         * server.h: Include version.h.
4745         (version, host_name): Don't declare.
4746
4747 2013-06-12  Pedro Alves  <palves@redhat.com>
4748
4749         * linux-x86-low.c (linux_is_elf64): Delete global.
4750         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
4751         with local linux_pid_exe_is_elf_64_file use.
4752
4753 2013-06-11  Pedro Alves  <palves@redhat.com>
4754
4755         * linux-low.c (regset_disabled, disable_regset): New functions.
4756         (regsets_fetch_inferior_registers)
4757         (regsets_store_inferior_registers): Use them.
4758         (initialize_regsets_info); Don't allocate the disabled_regsets
4759         array here.
4760         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
4761         comment.
4762
4763 2013-06-11  Pedro Alves  <palves@redhat.com>
4764
4765         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
4766         xmalloc.
4767
4768 2013-06-11  Pedro Alves  <palves@redhat.com>
4769
4770         * linux-x86-low.c (initialize_low_arch): Call
4771         init_registers_x32_avx_linux.
4772
4773 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
4774
4775         Fix compatibility with Android Bionic.
4776         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
4777         it is not empty.
4778
4779 2013-06-07  Pedro Alves  <palves@redhat.com>
4780
4781         PR server/14823
4782         * Makefile.in (OBS): Add tdesc.o.
4783         (IPA_OBJS): Add tdesc-ipa.o.
4784         (tdesc-ipa.o): New rule.
4785         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
4786         interface.
4787         * linux-low.c (new_inferior): Delete.
4788         (disabled_regsets, num_regsets): Delete.
4789         (linux_add_process): Adjust to set the new per-process
4790         new_inferior flag.
4791         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
4792         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
4793         was a stop.  When calling arch_setup, switch the current inferior
4794         to the thread that got an event.
4795         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
4796         (regsets_fetch_inferior_registers)
4797         (regsets_store_inferior_registers): New regsets_info parameter.
4798         Adjust to use it.
4799         (linux_register_in_regsets): New regs_info parameter.  Adjust to
4800         use it.
4801         (register_addr, fetch_register, store_register): New usrregs_info
4802         parameter.  Adjust to use it.
4803         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
4804         parameter regs_info.  Adjust to use it.
4805         (linux_fetch_registers): Get the current inferior's regs_info, and
4806         adjust to use it.
4807         (linux_store_registers): Ditto.
4808         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
4809         (initialize_low): Don't initialize the target_regsets here.  Call
4810         initialize_low_arch.
4811         * linux-low.h (target_regsets): Delete declaration.
4812         (struct regsets_info): New.
4813         (struct usrregs_info): New.
4814         (struct regs_info): New.
4815         (struct process_info_private) <new_inferior>: New field.
4816         (struct linux_target_ops): Delete the num_regs, regmap, and
4817         regset_bitmap fields.  New field regs_info.
4818         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
4819         * i387-fp.c (num_xmm_registers): Delete.
4820         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
4821         calls to new interface.
4822         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
4823         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
4824         Infer the number of xmm registers from the regcache's target
4825         description.
4826         * i387-fp.h (num_xmm_registers): Delete.
4827         * inferiors.c (add_thread): Don't install the thread's regcache
4828         here.
4829         * proc-service.c (gregset_info): Fetch the current inferior's
4830         regs_info.  Adjust to use it.
4831         * regcache.c: Include tdesc.h.
4832         (register_bytes, reg_defs, num_registers)
4833         (gdbserver_expedite_regs): Delete.
4834         (get_thread_regcache): If the thread doesn't have a regcache yet,
4835         create one, instead of aborting gdbserver.
4836         (regcache_invalidate_one): Rename to ...
4837         (regcache_invalidate_thread): ... this.
4838         (regcache_invalidate_one): New.
4839         (regcache_invalidate): Only invalidate registers of the current
4840         process.
4841         (init_register_cache): Add target_desc parameter, and use it.
4842         (new_register_cache): Ditto.  Assert the target description has a
4843         non zero registers_size.
4844         (regcache_cpy): Add assertions.  Adjust.
4845         (realloc_register_cache, set_register_cache): Delete.
4846         (registers_to_string, registers_from_string): Adjust.
4847         (find_register_by_name, find_regno, find_register_by_number)
4848         (register_cache_size): Add target_desc parameter, and use it.
4849         (free_register_cache_thread, free_register_cache_thread_one)
4850         (regcache_release, register_cache_size): New.
4851         (register_size): Add target_desc parameter, and use it.
4852         (register_data, supply_register, supply_register_zeroed)
4853         (supply_regblock, supply_register_by_name, collect_register)
4854         (collect_register_as_string, collect_register_by_name): Adjust.
4855         * regcache.h (struct target_desc): Forward declare.
4856         (struct regcache) <tdesc>: New field.
4857         (init_register_cache, new_register_cache): Add target_desc
4858         parameter.
4859         (regcache_invalidate_thread): Declare.
4860         (regcache_invalidate_one): Delete declaration.
4861         (regcache_release): Declare.
4862         (find_register_by_number, register_cache_size, register_size)
4863         (find_regno): Add target_desc parameter.
4864         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
4865         declarations.
4866         * remote-utils.c: Include tdesc.h.
4867         (outreg, prepare_resume_reply): Adjust.
4868         * server.c: Include tdesc.h.
4869         (gdbserver_xmltarget): Delete declaration.
4870         (get_features_xml, process_serial_event): Adjust.
4871         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
4872         declare.
4873         (struct process_info) <tdesc>: New field.
4874         (ipa_tdesc): Declare.
4875         * tdesc.c: New file.
4876         * tdesc.h: New file.
4877         * tracepoint.c: Include tdesc.h.
4878         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
4879         (get_context_regcache): Adjust to pass ipa_tdesc down.
4880         (do_action_at_tracepoint): Adjust to get the register cache size
4881         from the context regcache's description.
4882         (traceframe_walk_blocks): Adjust to get the register cache size
4883         from the current trace frame's description.
4884         (traceframe_get_pc): Adjust to get current trace frame's
4885         description and pass it down.
4886         (gdb_collect): Adjust to get the register cache size from the
4887         IPA's description.
4888         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
4889         (gdbserver_xmltarget): Delete.
4890         (initialize_low_tracepoint): Set the ipa's target description.
4891         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
4892         (initialize_low_tracepoint): Set the ipa's target description.
4893         * linux-x86-low.c: Include tdesc.h.
4894         [__x86_64__] (is_64bit_tdesc): New.
4895         (ps_get_thread_area, x86_get_thread_area): Use it.
4896         (i386_cannot_store_register): Rename to ...
4897         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
4898         (i386_cannot_fetch_register): Rename to ...
4899         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
4900         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
4901         to new interface.
4902         (target_regsets): Rename to ...
4903         (x86_regsets): ... this.
4904         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
4905         interface.
4906         (x86_siginfo_fixup): Use is_64bit_tdesc.
4907         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
4908         (tdesc_x32_avx_linux, tdesc_x32_linux)
4909         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
4910         Declare.
4911         (x86_linux_update_xmltarget): Delete.
4912         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
4913         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
4914         (AMD64_LINUX_USER64_CS): New.
4915         (x86_linux_read_description): New, based on
4916         x86_linux_update_xmltarget.
4917         (same_process_callback): New.
4918         (x86_arch_setup_process_callback): New.
4919         (x86_linux_update_xmltarget): New.
4920         (x86_regsets_info): New.
4921         (amd64_linux_regs_info): New.
4922         (i386_linux_usrregs_info): New.
4923         (i386_linux_regs_info): New.
4924         (x86_linux_regs_info): New.
4925         (x86_arch_setup): Reimplement.
4926         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
4927         (x86_emit_ops): Ditto.
4928         (the_low_target): Adjust.  Install x86_linux_regs_info,
4929         x86_cannot_fetch_register, and x86_cannot_store_register.
4930         (initialize_low_arch): New.
4931         * linux-ia64-low.c (tdesc_ia64): Declare.
4932         (ia64_fetch_register): Adjust.
4933         (ia64_usrregs_info, regs_info): New globals.
4934         (ia64_regs_info): New function.
4935         (the_low_target): Adjust.
4936         (initialize_low_arch): New function.
4937         * linux-sparc-low.c (tdesc_sparc64): Declare.
4938         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
4939         Adjust.
4940         (sparc_arch_setup): New function.
4941         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
4942         (the_low_target): Adjust.
4943         (initialize_low_arch): New function.
4944         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
4945         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
4946         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
4947         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
4948         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
4949         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
4950         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
4951         (tdesc_powerpc_isa205_vsx64l): Declare.
4952         (ppc_cannot_store_register, ppc_collect_ptrace_register)
4953         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
4954         (ppc_set_pc, ppc_get_hwcap): Adjust.
4955         (ppc_usrregs_info): Forward declare.
4956         (!__powerpc64__) ppc_regmap_adjusted: New global.
4957         (ppc_arch_setup): Adjust to the current process'es target
4958         description.
4959         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
4960         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
4961         (ppc_store_evrregset): Adjust.
4962         (target_regsets): Rename to ...
4963         (ppc_regsets): ... this, and make static.
4964         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
4965         (ppc_regs_info): New function.
4966         (the_low_target): Adjust.
4967         (initialize_low_arch): New function.
4968         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
4969         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
4970         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
4971         (tdesc_s390x_linux64v2): Declare.
4972         (s390_collect_ptrace_register, s390_supply_ptrace_register)
4973         (s390_fill_gregset, s390_store_last_break): Adjust.
4974         (target_regsets): Rename to ...
4975         (s390_regsets): ... this, and make static.
4976         (s390_get_pc, s390_set_pc): Adjust.
4977         (s390_get_hwcap): New target_desc parameter, and use it.
4978         [__s390x__] (have_hwcap_s390_high_gprs): New global.
4979         (s390_arch_setup): Adjust to set the current process'es target
4980         description.  Don't adjust the regmap.
4981         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
4982         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
4983         (regs_info_3264): New globals.
4984         (s390_regs_info): New function.
4985         (the_low_target): Adjust.
4986         (initialize_low_arch): New function.
4987         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
4988         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
4989         [__mips64] (init_registers_mips_linux)
4990         (init_registers_mips_dsp_linux): Delete defines.
4991         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
4992         (have_dsp): New global.
4993         (mips_read_description): New, based on mips_arch_setup.
4994         (mips_arch_setup): Reimplement.
4995         (get_usrregs_info): New function.
4996         (mips_cannot_fetch_register, mips_cannot_store_register)
4997         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
4998         (mips_fill_fpregset, mips_store_fpregset): Adjust.
4999         (target_regsets): Rename to ...
5000         (mips_regsets): ... this, and make static.
5001         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
5002         (dsp_regs_info, regs_info): New globals.
5003         (mips_regs_info): New function.
5004         (the_low_target): Adjust.
5005         (initialize_low_arch): New function.
5006         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
5007         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
5008         Declare.
5009         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
5010         (arm_read_description): New, with bits factored from
5011         arm_arch_setup.
5012         (arm_arch_setup): Reimplement.
5013         (target_regsets): Rename to ...
5014         (arm_regsets): ... this, and make static.
5015         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
5016         (arm_regs_info): New function.
5017         (the_low_target): Adjust.
5018         (initialize_low_arch): New function.
5019         * linux-m68k-low.c (tdesc_m68k): Declare.
5020         (target_regsets): Rename to ...
5021         (m68k_regsets): ... this, and make static.
5022         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
5023         (m68k_regs_info): New function.
5024         (m68k_arch_setup): New function.
5025         (the_low_target): Adjust.
5026         (initialize_low_arch): New function.
5027         * linux-sh-low.c (tdesc_sharch): Declare.
5028         (target_regsets): Rename to ...
5029         (sh_regsets): ... this, and make static.
5030         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
5031         (sh_regs_info, sh_arch_setup): New functions.
5032         (the_low_target): Adjust.
5033         (initialize_low_arch): New function.
5034         * linux-bfin-low.c (tdesc_bfin): Declare.
5035         (bfin_arch_setup): New function.
5036         (bfin_usrregs_info, regs_info): New globals.
5037         (bfin_regs_info): New function.
5038         (the_low_target): Adjust.
5039         (initialize_low_arch): New function.
5040         * linux-cris-low.c (tdesc_cris): Declare.
5041         (cris_arch_setup): New function.
5042         (cris_usrregs_info, regs_info): New globals.
5043         (cris_regs_info): New function.
5044         (the_low_target): Adjust.
5045         (initialize_low_arch): New function.
5046         * linux-cris-low.c (tdesc_crisv32): Declare.
5047         (cris_arch_setup): New function.
5048         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
5049         (cris_regs_info): New function.
5050         (the_low_target): Adjust.
5051         (initialize_low_arch): New function.
5052         * linux-m32r-low.c (tdesc_m32r): Declare.
5053         (m32r_arch_setup): New function.
5054         (m32r_usrregs_info, regs_info): New globals.
5055         (m32r_regs_info): Adjust.
5056         (initialize_low_arch): New function.
5057         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
5058         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
5059         (tic6x_usrregs_info): Forward declare.
5060         (tic6x_read_description): New function, based on ...
5061         (tic6x_arch_setup): ... this.  Reimplement.
5062         (target_regsets): Rename to ...
5063         (tic6x_regsets): ... this, and make static.
5064         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
5065         (tic6x_regs_info): New function.
5066         (the_low_target): Adjust.
5067         (initialize_low_arch): New function.
5068         * linux-xtensa-low.c (tdesc_xtensa): Declare.
5069         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
5070         (target_regsets): Rename to ...
5071         (xtensa_regsets): ... this, and make static.
5072         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
5073         globals.
5074         (xtensa_arch_setup, xtensa_regs_info): New functions.
5075         (the_low_target): Adjust.
5076         (initialize_low_arch): New function.
5077         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
5078         (nios2_arch_setup): Set the current process'es tdesc.
5079         (target_regsets): Rename to ...
5080         (nios2_regsets): ... this.
5081         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
5082         (nios2_regs_info): New function.
5083         (the_low_target): Adjust.
5084         (initialize_low_arch): New function.
5085         * linux-aarch64-low.c (tdesc_aarch64): Declare.
5086         (aarch64_arch_setup): Set the current process'es tdesc.
5087         (target_regsets): Rename to ...
5088         (aarch64_regsets): ... this.
5089         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
5090         (aarch64_regs_info): New function.
5091         (the_low_target): Adjust.
5092         (initialize_low_arch): New function.
5093         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
5094         globals.
5095         (target_regsets): Rename to ...
5096         (tile_regsets): ... this.
5097         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
5098         (tile_regs_info): New function.
5099         (tile_arch_setup): Set the current process'es tdesc.
5100         (the_low_target): Adjust.
5101         (initialize_low_arch): New function.
5102         * spu-low.c (tdesc_spu): Declare.
5103         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
5104         * win32-arm-low.c (tdesc_arm): Declare.
5105         (arm_arch_setup): New function.
5106         (the_low_target): Install arm_arch_setup instead of
5107         init_registers_arm.
5108         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
5109         (init_windows_x86): Rename to ...
5110         (i386_arch_setup): ... this.  Set `win32_tdesc'.
5111         (the_low_target): Adjust.
5112         * win32-low.c (win32_tdesc): New global.
5113         (child_add_thread): Don't create the thread cache here.
5114         (do_initial_child_stuff): Set the new process'es tdesc.
5115         * win32-low.h (struct target_desc): Forward declare.
5116         (win32_tdesc): Declare.
5117         * lynx-i386-low.c (tdesc_i386): Declare global.
5118         (lynx_i386_arch_setup): Set `lynx_tdesc'.
5119         * lynx-low.c (lynx_tdesc): New global.
5120         (lynx_add_process): Set the new process'es tdesc.
5121         * lynx-low.h (struct target_desc): Forward declare.
5122         (lynx_tdesc): Declare global.
5123         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
5124         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
5125         * nto-low.c (nto_tdesc): New global.
5126         (do_attach): Set the new process'es tdesc.
5127         * nto-low.h (struct target_desc): Forward declare.
5128         (nto_tdesc): Declare.
5129         * nto-x86-low.c (tdesc_i386): Declare.
5130         (nto_x86_arch_setup): Set `nto_tdesc'.
5131
5132 2013-06-04  Gary Benson  <gbenson@redhat.com>
5133
5134         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
5135         to qSupported response when appropriate.
5136         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
5137         with nonzero-length annex.
5138         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
5139         arguments supplied in annex.
5140
5141 2013-05-31  Doug Evans  <dje@google.com>
5142
5143         PR server/15594
5144         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
5145         64 bits in 64-cross-32 environment.
5146
5147 2013-05-28  Pedro Alves  <palves@redhat.com>
5148
5149         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
5150         (aarch64-without-fpu.c): Delete rule.
5151         * configure.srv (aarch64*-*-linux*): Remove references to
5152         aarch64-without-fpu.o and aarch64-without-fpu.xml.
5153         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
5154         declaration.
5155
5156 2013-05-24  Pedro Alves  <palves@redhat.com>
5157
5158         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
5159         instead of strchr/decode_address.  Error if the range isn't split
5160         with a ','.  Don't assume there's be a ':' in the action.
5161
5162 2013-05-23  Yao Qi  <yao@codesourcery.com>
5163             Pedro Alves  <palves@redhat.com>
5164
5165         * linux-low.c (lwp_in_step_range): New function.
5166         (linux_wait_1): If the thread was range stepping and stopped
5167         outside the stepping range, report the stop to GDB.  Otherwise,
5168         continue stepping.  Add range stepping debug output.
5169         (linux_set_resume_request): Copy the step range from the resume
5170         request to the lwp.
5171         (linux_supports_range_stepping): New.
5172         (linux_target_ops) <supports_range_stepping>: Set to
5173         linux_supports_range_stepping.
5174         * linux-low.h (struct linux_target_ops)
5175         <supports_range_stepping>: New field.
5176         (struct lwp_info) <step_range_start, step_range_end>: New fields.
5177         * linux-x86-low.c (x86_supports_range_stepping): New.
5178         (the_low_target) <supports_range_stepping>: Set to
5179         x86_supports_range_stepping.
5180         * server.c (handle_v_cont): Handle 'r' action.
5181         (handle_v_requests): Append ";r" if the target supports range
5182         stepping.
5183         * target.h (struct thread_resume) <step_range_start,
5184         step_range_end>: New fields.
5185         (struct target_ops) <supports_range_stepping>:
5186         New field.
5187         (target_supports_range_stepping): New macro.
5188
5189 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5190
5191         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
5192         confusion in comment.
5193
5194 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5195
5196         * lynx-low.c (struct process_info_private): New type.
5197         (lynx_add_process): New function.
5198         (lynx_create_inferior, lynx_attach): Replace calls to
5199         add_process by calls to lynx_add_process.
5200         (lynx_resume): If PTID is null, then try using
5201         current_process()->private->last_wait_event_ptid.
5202         Add comments.
5203         (lynx_clear_inferiors): Delete.  The contents of that function
5204         has been inlined in lynx_mourn;
5205         (lynx_wait_1): Save the ptid in the process's private data.
5206         (lynx_mourn): Free the process' private data.  Replace call
5207         to lynx_clear_inferiors by call to clear_inferiors.
5208
5209 2013-05-17  Yao Qi  <yao@codesourcery.com>
5210
5211         * i386-low.c (i386_length_and_rw_bits): Move the comment to
5212         the right place.
5213
5214 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
5215
5216         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
5217         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
5218         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
5219         PT_TEXT_END_ADDR guards.  Update comments.
5220         (linux_target_op) <read_offsets>: Conditionally define to
5221         linux_read_offsets if the target is UCLIBC and if it defines
5222         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
5223
5224 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
5225             Andrew Jenner  <andrew@codesourcery.com>
5226
5227         * Makefile.in (SFILES): Add linux-nios2-low.c.
5228         (clean): Add action to delete nios2-linux.c.
5229         (nios2-linux.c): New rule.
5230         * configure.srv: Add nios2*-*-linux*.
5231         * linux-nios2-low.c: New.
5232
5233 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
5234
5235         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
5236
5237 2013-04-25  Hui Zhu  <hui@codesourcery.com>
5238
5239         PR gdb/15186
5240         * ax.c (ax_printf): Add fflush.
5241
5242 2013-04-22  Tom Tromey  <tromey@redhat.com>
5243
5244         * Makefile.in (SFILES): Add filestuff.c.
5245         (OBS): Add filestuff.o.
5246         (filestuff.o): New target.
5247         * config.in, configure: Rebuild.
5248         * configure.ac: Check for fdwalk, pipe2.
5249
5250 2013-04-17  Pedro Alves  <palves@redhat.com>
5251
5252         * configure.ac (USE_THREAD_DB): Delete variable.
5253         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
5254         Don't AC_SUBST USE_THREAD_DB.
5255         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
5256         * config.in, configure: Regenerate.
5257
5258 2013-04-16  Pedro Alves  <palves@redhat.com>
5259
5260         * linux-low.h (struct lwp_info) <thread_known>: Move under
5261         the USE_THREAD_DB #ifdef.
5262
5263 2013-04-16  Pedro Alves  <palves@redhat.com>
5264
5265         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
5266         (linux-low.o): Delete rule.
5267         * linux-low.h: Always include "gdb_thread_db.h" instead of
5268         conditionally including thread_db.h.
5269         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
5270         HAVE_THREAD_DB_H.
5271
5272 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5273
5274         * Makefile.in (install-only): Fix make install regression.
5275
5276 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
5277
5278         Convert man pages to texinfo, new gdbinit.5 texinfo page.
5279         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
5280         installation.
5281         * gdbserver.1: Remove.
5282
5283 2013-03-22  Pedro Alves  <palves@redhat.com>
5284
5285         * linux-low.c (handle_extended_wait): Don't call
5286         linux_enable_event_reporting.
5287
5288 2013-03-15  Tony Theodore  <tonyt@logyst.com>
5289
5290         PR build/9098:
5291         * Makefile.in (SHELL): Use @SHELL@.
5292
5293 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
5294
5295         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
5296         compiler warning.
5297
5298 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
5299
5300         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
5301         Remove extraneous NULL element.
5302
5303 2013-03-13  Yao Qi  <yao@codesourcery.com>
5304
5305         * tracepoint.c (traceframe_read_tsv): Look for the last matched
5306         'V' block in trace frame.
5307
5308 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5309
5310         * target.h (struct target_ops): Add btrace ops.
5311         (target_supports_btrace): New macro.
5312         (target_enable_btrace): New macro.
5313         (target_disable_btrace): New macro.
5314         (target_read_btrace): New macro.
5315         * gdbthread.h (struct thread_info): Add btrace field.
5316         * server.c: Include btrace-common.h.
5317         (handle_btrace_general_set): New function.
5318         (handle_btrace_enable): New function.
5319         (handle_btrace_disable): New function.
5320         (handle_general_set): Call handle_btrace_general_set.
5321         (handle_qxfer_btrace): New function.
5322         (struct qxfer qxfer_packets[]): Add btrace entry.
5323         * inferiors.c (remove_thread): Disable btrace.
5324         * linux-low: Include linux-btrace.h.
5325         (linux_low_enable_btrace): New function.
5326         (linux_low_read_btrace): New function.
5327         (linux_target_ops): Add btrace ops.
5328         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
5329         Add srv_linux_btrace=yes.
5330         (x86_64-*-linux*): Add linux-btrace.o.
5331         Add srv_linux_btrace=yes.
5332         * configure.ac: Define HAVE_LINUX_BTRACE.
5333         * config.in: Regenerated.
5334         * configure: Regenerated.
5335
5336 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5337
5338         * server.c (handle_qxfer): Preserve error message if -3 is
5339         returned.
5340         (qxfer): Document the -3 return value.
5341
5342 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5343
5344         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
5345         (linux_btrace_h): New variable.
5346         (linux-btrace.o): New rule.
5347
5348 2013-03-08  Stan Shebs  <stan@codesourcery.com>
5349             Hafiz Abid Qadeer  <abidh@codesourcery.com>
5350
5351         * tracepoint.c (trace_buffer_size): New global.
5352         (DEFAULT_TRACE_BUFFER_SIZE): New define.
5353         (init_trace_buffer): Change to one-argument function. Allocate
5354         trace buffer memory.
5355         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
5356         handle QTBuffer:size packet.
5357         (cmd_bigqtbuffer_size): New function.
5358         (initialize_tracepoint): Call init_trace_buffer with
5359         DEFAULT_TRACE_BUFFER_SIZE.
5360         * server.c (handle_query): Add QTBuffer:size in the
5361         supported packets.
5362
5363 2013-03-07  Yao Qi  <yao@codesourcery.com>
5364
5365         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
5366         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
5367         of -1.
5368         (cmd_qtsp): Adjust condition.  Do post increment.
5369         Set cur_action and cur_step_action back to 0.
5370
5371 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
5372
5373         PR server/15236
5374         * linux-low.c (linux_write_memory): Return early success if LEN is
5375         zero.
5376
5377 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
5378
5379         * configure.srv: Add x86_64-*-cygwin* as target.
5380
5381 2013-02-28  Tom Tromey  <tromey@redhat.com>
5382
5383         * configure.ac: Invoke AC_SYS_LARGEFILE.
5384         * configure, config.in: Rebuild.
5385
5386 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
5387
5388         * win32-low.c: Throughout, fix format strings and casts of
5389         printf-like functions to avoid type related warnings on all
5390         platforms.
5391         (get_child_debug_event): Print dwDebugEventCode as hex since
5392         that's how it's usually documented.
5393
5394 2013-02-28  Yao Qi  <yao@codesourcery.com>
5395
5396         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
5397         pulongest.
5398
5399 2013-02-27  Jiong Wang  <jiwang@tilera.com>
5400
5401         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
5402         (reg-tilegx32.c): New rule.
5403         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
5404         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
5405         different register info initializer according to elf class.
5406         (init_registers_tilgx32): New function.  The tilegx32 register info
5407         initializer.
5408         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
5409         (tile_store_gregset): Likewise.
5410
5411 2013-02-27  Yao Qi  <yao@codesourcery.com>
5412
5413         * server.c (process_point_options): Print debug message when
5414         debug_threads is true.
5415
5416 2013-02-26  Yao Qi  <yao@codesourcery.com>
5417
5418         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
5419
5420 2013-02-19  Pedro Alves  <palves@redhat.com>
5421             Kai Tietz <ktietz@redhat.com>
5422
5423         PR gdb/15161
5424
5425         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
5426         instead of strtoul to extract address from packet.
5427         (process_serial_event) <'z'>: Likewise.
5428
5429 2013-02-18  Yao Qi  <yao@codesourcery.com>
5430
5431         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
5432
5433 2013-02-14  Pedro Alves  <palves@redhat.com>
5434
5435         Plug memory leak.
5436
5437         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
5438         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
5439
5440 2013-02-14  Pedro Alves  <palves@redhat.com>
5441
5442         * tracepoint.c (cmd_qtdpsrc): Use savestring.
5443
5444 2013-02-14  Pedro Alves  <palves@redhat.com>
5445
5446         * tracepoint.c (save_string): Delete.
5447         (add_tracepoint_action): Use savestring instead of save_string.
5448
5449 2013-02-12  Pedro Alves  <palves@redhat.com>
5450
5451         * linux-xtensa-low.c: Ditto.
5452         * xtensa-xtregs.c: Ditto.
5453
5454 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
5455
5456         * thread-db.c (thread_db_get_tls_address): NULL pointer check
5457         thread_db.
5458
5459 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5460
5461         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
5462         aarch64_num_wp_regs and aarch64_num_bp_regs to
5463         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
5464
5465 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5466
5467         * linux-aarch64-low.c (ps_get_thread_area): Replace
5468         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
5469
5470 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
5471             Marcus Shawcroft  <marcus.shawcroft@arm.com>
5472             Nigel Stephens  <nigel.stephens@arm.com>
5473             Yufeng Zhang  <yufeng.zhang@arm.com>
5474
5475         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
5476         (aarch64.c, aarch64-without-fpu.c): New targets.
5477         * configure.srv (aarch64*-*-linux*): New.
5478         * linux-aarch64-low.c: New file.
5479
5480 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5481
5482         * linux-low.c (handle_extended_wait, linux_create_inferior)
5483         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
5484         (dequeue_one_deferred_signal, linux_resume_one_thread)
5485         (fetch_register, linux_write_memory, linux_enable_event_reporting)
5486         (linux_tracefork_grandchild, linux_test_for_tracefork)
5487         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
5488         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
5489         where the argument is 0.
5490
5491 2013-01-25  Yao Qi  <yao@codesourcery.com>
5492
5493         * event-loop.c: Include "queue.h".
5494         (gdb_event_p): New typedef.
5495         (struct gdb_event) <next_event>: Remove.
5496         (event_queue): Change to QUEUE(gdb_event_p).
5497         (async_queue_event): Remove.
5498         (gdb_event_xfree): New.
5499         (initialize_event_loop): New.
5500         (process_event): Use API from QUEUE.
5501         (wait_for_event): Likewise.
5502         * server.c (main): Call initialize_event_loop.
5503         * server.h (initialize_event_loop): Declare.
5504
5505 2013-01-18  Yao Qi  <yao@codesourcery.com>
5506
5507         * ax.h (struct eval_agent_expr_context): New.
5508         (gdb_eval_agent_expr): Update declaration.
5509         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
5510         TFRAME.  Add new argument CTX.
5511         * server.h (struct eval_agent_expr_context): Declare.
5512         (agent_mem_read, agent_tsv_read): Update declaration.
5513         (agent_mem_read_string): Likewise.
5514         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
5515         (add_traceframe_block): Add new argument TPOINT.
5516         Increase TPOINT->traceframe_usage.
5517         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
5518         eval_tracepoint_agent_expr.
5519         (condition_true_at_tracepoint): Likewise.
5520         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
5521         (agent_mem_read_string, agent_tsv_read): Likewise.
5522
5523 2013-01-16  Yao Qi  <yao@codesourcery.com>
5524
5525         * linux-low.c (linux_resume_one_lwp): Don't check
5526         'lwp->bp_reinsert != 0'.
5527
5528 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5529             Pedro Alves  <palves@redhat.com>
5530
5531         * lynx-low.c (ptrace_request_to_str): Define a temporary
5532         macro and use it to simplify this function's implementation.
5533
5534 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5535
5536         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
5537         sets errno.
5538
5539 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5540
5541         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
5542
5543 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5544
5545         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
5546
5547 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5548
5549         * lynx-low.c (lynx_resume): Use the resume_info parameter
5550         to determine the ptid for the lynx_ptrace call, unless
5551         it is equal to minus_one_ptid, in which case we use the
5552         ptid of the current_inferior.
5553         (lynx_wait_1): After having received a thread create/exit
5554         event, resume the inferior's execution using the signaling
5555         thread's ptid, rather than the old ptid.
5556
5557 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5558
5559         * lynx-low.c (lynx_resume): Delete variable ret.
5560
5561 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
5562
5563         * gdbreplay.c (gdbreplay_version): Update copyright year.
5564         * server.c (gdbserver_version): Likewise.
5565
5566 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5567
5568         * lynx-low.c (lynx_wait_1): Add debug trace before adding
5569         new thread.
5570
5571 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5572
5573         * lynx-low.c (ptrace_request_to_str): Add handling for
5574         PTRACE_GETTRACESIG.
5575
5576 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5577
5578         * lynx-low.c (lynx_attach): Delete variable new_process.
5579
5580 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5581
5582         * lynx-low.c (lynx_create_inferior): Delete variable
5583         new_process.
5584
5585 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5586
5587         * lynx-low.c (ptrace_request_to_str): Do not handle
5588         PTRACE_GETTHREADLIST if this macro does not exist.
5589
5590 2012-12-15  Yao Qi  <yao@codesourcery.com>
5591
5592         * Makefile.in (OBS): Add notif.o.
5593         * notif.c, notif.h: New.
5594         * server.c: Include "notif.h".
5595         (struct vstop_notif) <next>: Remove.
5596         <base>: New field.
5597         (queue_stop_reply): Update.
5598         (push_event, send_next_stop_reply): Remove.
5599         (discard_queued_stop_replies): Update.
5600         (notif_stop): New variable.
5601         (handle_v_stopped): Remove.
5602         (handle_v_requests): Don't call handle_v_stopped.  Call
5603         handle_ack_notif instead.
5604         (queue_stop_reply_callback): Call notif_event_enque instead
5605         of queue_stop_reply.
5606         (handle_status): Don't call send_next_stop_reply, call
5607         notif_write_event instead.
5608         (kill_inferior_callback): Likewise.
5609         (detach_or_kill_inferior_callback): Likewise.
5610         (main): Call initialize_notif.
5611         (process_serial_event): Call QUEUE_is_empty.
5612         (handle_target_event): Call notif_push instead of push event.
5613         * server.h (push_event): Remove declaration.
5614
5615 2012-12-10  Tom Tromey  <tromey@redhat.com>
5616
5617         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
5618         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
5619         macros.
5620         (.c.o): Rewrite.
5621         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
5622         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
5623         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
5624         (amd64-linux-ipa.o, ax.o): Rewrite.
5625         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
5626         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
5627         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
5628         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
5629         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
5630         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
5631         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
5632         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
5633         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
5634         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
5635         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
5636         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
5637         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
5638         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
5639         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
5640         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
5641         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
5642         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
5643         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
5644         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
5645         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
5646         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
5647         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
5648         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
5649         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
5650         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
5651         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
5652         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
5653         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
5654         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
5655         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
5656         (reg-tilegx.o): Remove.
5657         (all_object_files): New macro.
5658         Include .deps files.
5659         * aclocal.m4, configure: Rebuild.
5660         * acinclude.m4: Include depstand.m4, lead-dot.m4.
5661         * configure.ac: Invoke ZW_CREATE_DEPDIR,
5662         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
5663
5664 2012-12-05  Tom Tromey  <tromey@redhat.com>
5665
5666         PR gdb/14917:
5667         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
5668
5669 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
5670
5671         * configure.ac: Check for linux/perf_event.h.
5672         * config.in: Regenerated.
5673         * configure: Regenerated.
5674
5675 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
5676
5677         * hostio.c (handle_readlink): Decrease buffer size
5678         parameter passed to readlink by one byte.
5679
5680 2012-11-26  Yao Qi  <yao@codesourcery.com>
5681
5682         * configure.ac (build_warnings): Append '-Wempty-body'.
5683         * configure: Regenerated.
5684         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
5685         body.
5686
5687 2012-11-15  Pierre Muller  <muller@sourceware.org>
5688
5689         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
5690         * config.in: Regenerate.
5691         * configure: Regenerate.
5692         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
5693         Use "gdb_wait.h" header instead of <sys/wait.h> header.
5694         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5695         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
5696         header.
5697         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
5698         instead of <sys/wait.h> header.
5699         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5700
5701 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
5702
5703         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
5704         (various make rules): Remove -DGDBSERVER
5705
5706 2012-11-09  Yao Qi  <yao@codesourcery.com>
5707
5708         * spu-low.c (current_ptid): Move it to ..
5709         * gdbthread.h: ... here.  New.
5710         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
5711         * server.c (myresume, process_serial_event): Likewise.
5712         * thread-db.c (thread_db_find_new_threads): Likewise.
5713         * tracepoint.c (run_inferior_command): Likewise.
5714
5715 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
5716
5717         * server.c (handle_search_memory_1): Include access length in
5718         warning message.
5719
5720 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
5721
5722         * linux-crisv32-low.c: Fix compile errors.
5723
5724 2012-09-04  Yao Qi  <yao@codesourcery.com>
5725
5726         * tracepoint.c (cmd_qtsv): Adjust debug message.
5727         Don't check CUR_TPOINT.
5728
5729 2012-08-28  Yao Qi  <yao@codesourcery.com>
5730
5731         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
5732         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
5733         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
5734         Remove declarations of xmalloc, xreallloc, xstrdup and
5735         freeargv.
5736         * Makefile.in (libiberty_h): New.
5737         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
5738         (linux-bfin-low.o): Append dependency 'libiberty.h'.
5739
5740 2012-08-23  Yao Qi  <yao@codesourcery.com>
5741
5742         * server.h: Remove declaration of 'xsnprintf'.
5743
5744 2012-08-22  Keith Seitz  <keiths@redhat.com>
5745
5746         * server.h: Include build-gnulib-gbserver/config.h.
5747         * gdbreplay.c: Likewise.
5748
5749 2012-08-08  Doug Evans  <dje@google.com>
5750
5751         * Makefile.in (SFILES): Add gdb_vecs.c.
5752         (OBS): Add gdb_vecs.o.
5753         (gdb_vecs_h, host_defs_h): New variables.
5754         (thread-db.o): Add $(gdb_vecs_h) dependency.
5755         (gdb_vecs.o): New rule.
5756         * thread-db.c: #include "gdb_vecs.h".
5757         (thread_db_load_search): Use a vector to iterate over path elements.
5758         Handle text appearing after "$pdir".
5759
5760         * configure.ac: Add check for strstr.
5761         * config.in: Regenerate.
5762         * configure: Regenerate.
5763
5764 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
5765
5766         * hostio.c (handle_pread): If pread fails, fall back to attempting
5767         lseek/read.
5768         (handle_pwrite): Likewise for pwrite.
5769
5770 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
5771
5772         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
5773         between unsupported TYPE and unimplementable ADDR/LEN combination.
5774         (arm_insert_point): Act on new return value.
5775
5776 2012-07-31  Pedro Alves  <palves@redhat.com>
5777
5778         * server.c (process_point_options): Only skip tokens if we find
5779         one that is unrecognized.  Don't treat 'X' specially while
5780         skipping unrecognized tokens.
5781
5782 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
5783
5784         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
5785         to 4-byte-align HW breakpoint addresses for Thumb.
5786
5787 2012-07-27  Yao Qi  <yao@codesourcery.com>
5788
5789         PR remote/14161.
5790
5791         * server.h: Declare gdb_agent_about_to_close.
5792         * target.c (kill_inferior): Include "agent.h".
5793         New.  Send command 'kill'.
5794         * target.h (kill_inferior): Removed macro.
5795         * tracepoint.c (gdb_agent_about_to_close): New.
5796         (gdb_agent_helper_thread): Handle command 'close'.
5797         Wait endlessly until the inferior stops.
5798         Install gdb_agent_remove_socket to atexit hook.
5799         (agent_socket_name): New static variable.
5800         (gdb_agent_socket_init): Replace local variable 'name' with
5801         'agent_socket_name'.
5802         (gdb_agent_remove_socket): New.
5803
5804 2012-07-27  Yao Qi  <yao@codesourcery.com>
5805
5806         * server.c (process_point_options): Stop at 'X' when parsing.
5807
5808 2012-07-19  Michael Eager  <eager@eagercon.com>
5809
5810         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
5811         to hw_execute.
5812         * linux-x86-low.c (x86_insert_point, x86_remove_point):
5813         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
5814         hardware breakpoint.
5815
5816 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5817
5818         * gdbserver/linux-low.c (initialize_low): Call
5819         linux_ptrace_init_warnings.
5820
5821 2012-07-02  Doug Evans  <dje@google.com>
5822
5823         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
5824         pointer to int.
5825
5826 2012-07-02  Stan Shebs  <stan@codesourcery.com>
5827
5828         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
5829         (ax.o): Add it to build rule.
5830         (ax-ipa.o): Ditto.
5831         (OBS): Add format.o.
5832         (IPA_OBS): Add format.o.
5833         * server.c (handle_query): Claim support for breakpoint commands.
5834         (process_point_options): Add command case.
5835         (process_serial_event): Leave running if there are printfs in
5836         effect.
5837         * mem-break.h (any_persistent_commands): Declare.
5838         (add_breakpoint_commands): Declare.
5839         (gdb_no_commands_at_breakpoint): Declare.
5840         (run_breakpoint_commands): Declare.
5841         * mem-break.c (struct point_command_list): New struct.
5842         (struct breakpoint): New field command_list.
5843         (any_persistent_commands): New function.
5844         (add_commands_to_breakpoint): New function.
5845         (add_breakpoint_commands): New function.
5846         (gdb_no_commands_at_breakpoint): New function.
5847         (run_breakpoint_commands): New function.
5848         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
5849         locally.
5850         * ax.c: Include format.h.
5851         (ax_printf): New function.
5852         (gdb_eval_agent_expr): Add printf opcode.
5853
5854 2012-06-13  Yao Qi  <yao@codesourcery.com>
5855
5856         * server.c (start_inferior): Remove duplicated writes to fields
5857         'last_resume_kind' and 'last_status' of 'current_inferior'.
5858
5859 2012-06-12  Yao Qi  <yao@codesourcery.com>
5860             Pedro Alves  <palves@redhat.com>
5861
5862         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
5863         comment.
5864         * server.c (handle_v_cont): Extend comment.
5865
5866 2012-06-11  Yao Qi  <yao@codesourcery.com>
5867
5868         * linux-low.c (linux_attach): Add 'static'.
5869
5870 2012-06-06  Yao Qi  <yao@codesourcery.com>
5871
5872         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
5873
5874 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
5875
5876         Fix gcc -flto compilation warning.
5877         * server.c (main): Make variable multi_mode and attach volatile.
5878
5879 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5880
5881         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
5882         if the platform doesn't know about it.
5883
5884 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
5885
5886         * Makefile.in (SFILES): Add linux-tile-low.c.
5887         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
5888         * configure.srv: Handle tilegx-*-linux*.
5889         * linux-tile-low.c: New file.
5890
5891 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5892
5893         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
5894
5895 2012-05-24  Pedro Alves  <palves@redhat.com>
5896
5897         PR gdb/7205
5898
5899         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
5900
5901 2012-05-24  Pedro Alves  <palves@redhat.com>
5902
5903         PR gdb/7205
5904
5905         Replace target_signal with gdb_signal throughout.
5906
5907 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
5908
5909         * linux-low.c (linux_store_registers): Avoid the copying sequence
5910         when no data has been retrieved by ptrace.
5911
5912 2012-05-22  Will Deacon  <will.deacon@arm.com>
5913
5914         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
5915         Include asm/ptrace.h.
5916         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
5917         already defined.
5918
5919 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
5920
5921         * linux-low.c (linux_store_registers): Don't re-retrieve data
5922         with ptrace that has already been obtained from /proc.  Always
5923         copy any data retrieved with ptrace to the buffer supplied.
5924
5925 2012-05-11  Yao Qi  <yao@codesourcery.com>
5926             Pedro Alves  <palves@redhat.com>
5927
5928         * linux-low.c (enum stopping_threads_kind): New.
5929         (stopping_threads): Change type to `enum stopping_threads_kind'.
5930         (handle_extended_wait): If stopping and suspending threads, leave
5931         the new_lwp suspended too.
5932         (linux_wait_for_event): Adjust.
5933         (stop_all_lwps): Set `stopping_threads' to
5934         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
5935         whether we're suspending threads or just stopping them.  Assert no
5936         recursion happens.
5937
5938 2012-04-29  Yao Qi  <yao@codesourcery.com>
5939
5940         * server.h: Move some code to ...
5941         * gdbthread.h: ... here.  New.
5942         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
5943         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
5944         (nto-low.o, win32-low.o): Likewise.
5945         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
5946         * regcache.c, remote-utils.c, server.c: Likewise.
5947         * target.c, tracepoint.c, win32-low.c: Likewise.
5948
5949 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5950
5951         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
5952         (PTRACE_ARG4_TYPE): Likewise.
5953         (PTRACE_XFER_TYPE): Likewise.
5954         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
5955         ptrace to PTRACE_ARG3_TYPE.
5956         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
5957         (PTRACE_ARG4_TYPE): Likewise.
5958         (PTRACE_XFER_TYPE): Likewise.
5959         (linux_detach_one_lwp): Cast fourth argument of
5960         ptrace to long then PTRACE_ARG4_TYPE.
5961         (regsets_fetch_inferior_registers): Cast third argument of
5962         ptrace to long then PTRACE_ARG3_TYPE.
5963         (regsets_store_inferior_registers): Likewise.
5964
5965 2012-04-20  Pedro Alves  <palves@redhat.com>
5966
5967         * configure: Regenerate.
5968
5969 2012-04-19  Pedro Alves  <palves@redhat.com>
5970
5971         * Makefile.in (GNULIB_BUILDDIR): New.
5972         (LIBGNU, INCGNU, GNULIB_H): Adjust.
5973         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
5974         (all, install-only, uninstall, clean-info, all-lib, clean): No
5975         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
5976         (maintainer-clean realclean distclean): Use subdir_do.
5977         (subdir_do): New.
5978         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
5979         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
5980         * acinclude.m4: Include acx_configure_dir.m4.
5981         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
5982         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
5983         ACX_CONFIGURE_DIR.
5984         (GNULIB): New.
5985         (GNULIB_STDINT_H): Adjust.
5986         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
5987         * gdbreplay.c: Include build-gnulib/config.h.
5988         * server.h: Likewise.
5989         * aclocal.m4: Regenerate.
5990         * config.in: Regenerate.
5991         * configure: Regenerate.
5992
5993 2012-04-19  Pedro Alves  <palves@redhat.com>
5994
5995         * Makefile.in (LIBGNU, INCGNU): Adjust.
5996         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
5997         (all, install-only, uninstall, clean-info, all-lib, clean)
5998         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
5999         * configure.ac: Adjust AC_OUTPUT output.
6000         * aclocal.m4: Regenerate.
6001         * configure: Regenerate.
6002
6003 2012-04-19  Pedro Alves  <palves@redhat.com>
6004
6005         * Makefile.in (generated_files): New.
6006         (server_h): Remove the explicit dependency on config.h, and depend
6007         on $generated_files.
6008
6009 2012-04-19  Pedro Alves  <palves@redhat.com>
6010
6011         * Makefile.in (INCGNU): Add -Ignulib.
6012
6013 2012-04-19  Pedro Alves  <palves@redhat.com>
6014
6015         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
6016         (INCGNU): ... this, and spell out -I here.
6017         (GNULIB_LIB): Rename to ...
6018         (LIBGNU): ... this.
6019         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
6020
6021 2012-04-19  Pedro Alves  <palves@redhat.com>
6022
6023         * config.in: Regenerate.
6024
6025 2012-04-19  Pedro Alves  <palves@redhat.com>
6026
6027         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
6028         * server.h (memmem): Remove declaration.
6029         * config.in: Regenerate.
6030         * configure: Regenerate.
6031
6032 2012-04-19  Yao Qi  <yao@codesourcery.com>
6033
6034         * Makefile.in (SFILES): Add common/vec.c.
6035         (OBS): Add vec.o.
6036         (vec.o): New rule.
6037
6038 2012-04-19  Yao Qi  <yao@codesourcery.com>
6039
6040         * remote-utils.c (prepare_resume_reply): Replace with macro
6041         target_core_of_thread.
6042         * server.c (handle_qxfer_threads_proper): Likewise.
6043         * target.h (traget_core_of_thread): New macro.
6044
6045 2012-04-18  Pedro Alves  <palves@redhat.com>
6046
6047         * aclocal.m4: Regenerate.
6048         * configure: Regenerate.
6049
6050 2012-04-16  Yao Qi  <yao@codesourcery.com>
6051
6052         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
6053         duplicated on address.
6054
6055 2012-04-16  Yao Qi  <yao@codesourcery.com>
6056
6057         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
6058         (struct tracepoint_action_ops) <send>: New field.
6059         (m_tracepoint_action_send, r_tracepoint_action_send): New.
6060         (agent_expr_send, x_tracepoint_action_send): New.
6061         (l_tracepoint_action_send): New.
6062         (cmd_qtdp): Download and install tracepoint
6063         according to `use_agent'.
6064         (run_inferior_command): Add one more parameter `len'.
6065         Update callers.
6066         (tracepoint_send_agent): New.
6067         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
6068
6069 2012-04-16  Yao Qi  <yao@codesourcery.com>
6070
6071         * tracepoint.c (download_tracepoints): Moved to ...
6072         (cmd_qtstart): ... here.
6073
6074 2012-04-14  Yao Qi  <yao@codesourcery.com>
6075
6076         * tracepoint.c: Include inttypes.h.
6077         (struct collect_memory_action): Use sized types.
6078         (struct tracepoint): Likewise.
6079         (cmd_qtdp, stop_tracing): Update print specifiers.
6080         (cmd_qtp, response_tracepoint): Likewise.
6081         (collect_data_at_tracepoint): Likewise.
6082         (collect_data_at_step): Likewise.
6083
6084 2012-04-14  Yao Qi  <yao@codesourcery.com>
6085
6086         Import gnulib module inttypes.
6087         * aclocal.m4, config.in, configure: Regenerated.
6088
6089 2012-04-14  Yao Qi  <yao@codesourcery.com>
6090
6091         * Makefile.in (maintainer-clean, realclean, distclean): Remove
6092         Makefile and config.status at last.
6093
6094 2012-04-13  Yao Qi  <yao@codesourcery.com>
6095
6096         * tracepoint.c: Include stdint.h unconditionally.
6097
6098 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6099
6100         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
6101         on BFD_HAVE_SYS_PROCFS_TYPE.
6102         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
6103         * configure: Regenerate.
6104         * config.in: Likewise.
6105
6106 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
6107
6108         * Makefile.in (clean): Also remove x32.c x32-linux.c
6109         x32-avx.c x32-avx-linux.c.
6110         (x32.o): New target.
6111         (x32.c): Likewise.
6112         (x32-linux.o): Likewise.
6113         (x32-linux.c): Likewise.
6114         (x32-avx.o): Likewise.
6115         (x32-avx.c): Likewise.
6116         (x32-avx-linux.o): Likewise.
6117         (x32-avx-linux.c): Likewise.
6118
6119         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
6120         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
6121         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
6122         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
6123         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
6124         i386/x32-avx-linux.xml.
6125
6126         * linux-x86-low.c (init_registers_x32_linux): New prototype.
6127         (init_registers_x32_avx_linux): Likwise.
6128         (x86_linux_update_xmltarget): Call init_registers_x32_linux
6129         or init_registers_x32_avx_linux if linux_is_elf64 is false.
6130
6131 2012-04-13  Pedro Alves  <palves@redhat.com>
6132
6133         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
6134         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
6135         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
6136         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
6137         the sub-make.
6138
6139 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6140
6141         * linux-x86-low.c (compat_x32_clock_t): New.
6142         (compat_x32_siginfo_t): Likewise.
6143         (compat_x32_siginfo_from_siginfo): Likewise.
6144         (siginfo_from_compat_x32_siginfo): Likewise.
6145         (linux_is_elf64): Likewise.
6146         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
6147         and siginfo_from_compat_x32_siginfo for x32.
6148         (x86_arch_setup): Set linux_is_elf64.
6149
6150 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6151
6152         PR gdb/13969
6153         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
6154         e_machine field.
6155         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
6156         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
6157         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
6158         compatible with process.
6159
6160 2012-04-12  Yao Qi  <yao@codesourcery.com>
6161
6162         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
6163         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
6164         (install-only, install-info, clean): Handle sub dir gnulib.
6165         (all-lib, am--refresh): New targets.
6166         (memmem.o): Remove target.
6167         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
6168         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
6169         (AC_REPLACE_FUNCS): Remove memmem.
6170         Invoke gl_INIT and AM_INIT_AUTOMAKE.
6171         (AC_OUTPUT): Generate Makefile in gnulib/.
6172         * aclocal.m4, config.in, configure: Regenerated.
6173
6174 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
6175
6176         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
6177
6178 2012-04-05  Pedro Alves  <palves@redhat.com>
6179
6180         -Werror=strict-aliasing
6181
6182         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
6183         pointer.
6184
6185 2012-04-04  Pedro Alves  <palves@redhat.com>
6186
6187         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6188         (sparc_store_gregset_from_stack, sparc_store_gregset)
6189         (sparc_breakpoint_at): Fix formatting.
6190
6191 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6192
6193         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
6194         are available.
6195         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
6196         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
6197         * config.in: Regenerate.
6198         * configure: Likewise.
6199
6200 2012-03-29  Pedro Alves  <palves@redhat.com>
6201
6202         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
6203         Correct ptrace arguments.
6204
6205 2012-03-28  Pedro Alves  <palves@redhat.com>
6206
6207         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
6208         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
6209         (IA64_FR1_REGNUM): New defines.
6210         (ia64_fetch_register): New.
6211         (the_low_target): Install it.
6212         * linux-low.h (struct linux_target_ops) <fetch_register>: New
6213         field.
6214         * linux-low.c (linux_fetch_registers): Try the
6215         the_low_target.fetch_register hook first.
6216
6217         * linux-arm-low.c (the_low_target): Adjust.
6218         * linux-bfin-low.c (the_low_target): Adjust.
6219         * linux-cris-low.c (the_low_target): Adjust.
6220         * linux-crisv32-low.c (the_low_target): Adjust.
6221         * linux-m32r-low.c (the_low_target): Adjust.
6222         * linux-m68k-low.c (the_low_target): Adjust.
6223         * linux-mips-low.c (the_low_target): Adjust.
6224         * linux-ppc-low.c (the_low_target): Adjust.
6225         * linux-s390-low.c (the_low_target): Adjust.
6226         * linux-sh-low.c (the_low_target): Adjust.
6227         * linux-sparc-low.c (the_low_target): Adjust.
6228         * linux-tic6x-low.c (the_low_target): Adjust.
6229         * linux-x86-low.c (the_low_target): Adjust.
6230         * linux-xtensa-low.c (the_low_target): Adjust.
6231
6232 2012-03-26  Pedro Alves  <palves@redhat.com>
6233
6234         * server.c (handle_qxfer_libraries): Don't bail early if
6235         the_target->qxfer_libraries_svr4 is not NULL.
6236
6237 2012-03-26  Pedro Alves  <palves@redhat.com>
6238
6239         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
6240
6241 2012-03-23  Pedro Alves  <palves@redhat.com>
6242
6243         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
6244         "library-list-svr4" element's start tag when the the DSO list is
6245         empty.
6246
6247 2012-03-23  Pedro Alves  <palves@redhat.com>
6248
6249         * linux-low.c (read_one_ptr): Read the inferior's pointer through
6250         a variable whose type size is the same as the inferior's pointer
6251         size.
6252
6253 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
6254
6255         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
6256         struct siginfo.
6257         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
6258         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
6259         * linux-low.h: Include <signal.h>.
6260         (struct siginfo): Remove forward declaration.
6261         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
6262         struct siginfo.
6263
6264 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
6265
6266         * .gitignore: Ignore more files.
6267
6268 2012-03-19  Pedro Alves  <palves@redhat.com>
6269             Jan Kratochvil  <jan.kratochvil@redhat.com>
6270
6271         * server.c (cont_thread, general_thread): Add describing comments.
6272         (start_inferior): Clear `cont_thread'.
6273         (handle_v_cont): Don't set `cont_thread' if resuming all threads
6274         of a process.
6275
6276 2012-03-15  Yao Qi  <yao@codesourcery.com>
6277
6278         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
6279         handling to ...
6280         (cmd_qtdp): ... here.
6281
6282 2012-03-15  Yao Qi  <yao@codesourcery.com>
6283
6284         * tracepoint.c (struct tracepoint_action_ops): New.
6285         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
6286         (m_tracepoint_action_download): New.
6287         (r_tracepoint_action_download): New.
6288         (x_tracepoint_action_download): New.
6289         (l_tracepoint_action_download): New.
6290         (add_tracepoint_action): Install `action->ops' according type.
6291         (download_tracepoint_1): Move code `download' function pointer
6292         of various tracepoint_action_ops.
6293
6294 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6295
6296         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
6297         linux_ptrace_attach_warnings.
6298
6299 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6300
6301         * Makefile.in (linux-ptrace.o): New.
6302         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
6303         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
6304         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
6305         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
6306         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
6307         of these targets.
6308         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
6309
6310 2012-03-08  Yao Qi  <yao@codesourcery.com>
6311             Pedro Alves  <palves@redhat.com>
6312
6313         Fix PR server/13392.
6314         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
6315         offset of JMP insn.
6316         * tracepoint.c (remove_tracepoint): New.
6317         (cmd_qtdp): Call remove_tracepoint when failed to install.
6318
6319 2012-03-07  Pedro Alves  <palves@redhat.com>
6320
6321         * linux-low.c (get_detach_signal): New.
6322         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
6323         Pass on pending signals to PTRACE_DETACH.  Check the result of the
6324         ptrace call.
6325         * server.c (program_signals, program_signals_p): New.
6326         (handle_general_set): Handle QProgramSignals.
6327         * server.h (program_signals, program_signals_p): Declare.
6328
6329 2012-03-05  Pedro Alves  <palves@redhat.com>
6330             Jan Kratochvil  <jan.kratochvil@redhat.com>
6331
6332         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
6333         New comment why.
6334
6335 2012-03-03  Yao Qi  <yao@codesourcery.com>
6336
6337         * tracepoint.c (tracepoint_look_up_symbols): Update call to
6338         agent_look_up_symbols.
6339
6340 2012-03-03  Yao Qi  <yao@codesourcery.com>
6341
6342         * Makefile.in (linux-low.o): Keep dependence on agent.h.
6343         (linux-x86-low.o): Likewise.
6344         * server.h: Remove in_process_agent_loaded.
6345         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
6346         common/agent.c.
6347         Update callers.
6348
6349 2012-03-03  Yao Qi  <yao@codesourcery.com>
6350
6351         * tracepoint.c (gdb_agent_capability): New global.
6352         (in_process_agent_loaded_ust): Renamed to
6353         `in_process_agent_supports_ust'.
6354         Update callers.
6355         (in_process_agent_supports_ust): Call agent_capability_check.
6356         (clear_installed_tracepoints): Assert that agent supports
6357         agent.
6358
6359 2012-03-03  Yao Qi  <yao@codesourcery.com>
6360
6361         * linux-low.c (linux_supports_agent): New.
6362         (linux_target_ops): Initialize field `supports_agent' with
6363         linux_supports_agent.
6364         * target.h (struct target_ops) <supports_agent>: New.
6365         (target_supports_agent): New macro.
6366         * server.c (handle_general_set): Handle packet 'QAgent'.
6367         (handle_query): Send `QAgent+'.
6368         * Makefile.in (server.o): Depends on agent.h.
6369
6370 2012-03-03  Yao Qi  <yao@codesourcery.com>
6371
6372         * Makefile.in (OBS): Add agent.o.
6373         Add new rule for agent.o.
6374         Track dependence of tracepoint.c on agent.h.
6375         * tracepoint.c (run_inferior_command_1):
6376         (run_inferior_command): Call agent_run_command.
6377         (gdb_ust_connect_sync_socket): Deleted.  Move it to
6378         common/agent.c.
6379         (resume_thread, stop_thread): Likewise.
6380         (gdb_ust_socket_init): Renamed to ...
6381         (gdb_agent_socket_init): ... New.
6382         (gdb_ust_thread): Renamed to ...
6383         (gdb_agent_helper_thread): ... New.
6384         (gdb_ust_init): Move some code to ...
6385         (gdb_agent_init): ... here.  New.
6386         [HAVE_UST]: Call gdb_ust_init.
6387         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
6388         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
6389         * config.in, configure: Regenerated.
6390
6391 2012-03-02  Pedro Alves  <palves@redhat.com>
6392
6393         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
6394         * linux-low.c (struct simple_pid_list): New.
6395         (stopped_pids): New a struct simple_pid_list pointer.
6396         (add_to_pid_list, pull_pid_from_list): New.
6397         (handle_extended_wait): Don't assume the first signal new children
6398         report is SIGSTOP.  Adjust call to pull_pid_from_list.
6399         (linux_wait_for_lwp): Adjust.
6400
6401 2012-03-02  Yao Qi  <yao@codesourcery.com>
6402
6403         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
6404         debug log.
6405
6406 2012-03-02  Yao Qi  <yao@codesourcery.com>
6407
6408         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
6409         `stop_pc' and `tpoint'.  Update caller.
6410
6411 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
6412
6413         * linux-low.h (linux_target_ops): Add regset_bitmap member.
6414         * linux-low.c (use_linux_regsets): New macro.
6415         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
6416         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
6417         (linux_register_in_regsets): New function.
6418         (usr_fetch_inferior_registers): Skip registers covered by
6419         regsets.
6420         (usr_store_inferior_registers): Likewise.
6421         (usr_fetch_inferior_registers): New macro.
6422         (usr_store_inferior_registers): Likewise.
6423         (linux_fetch_registers): Handle mixed regset/non-regset targets.
6424         (linux_store_registers): Likewise.
6425         * linux-mips-low.c (init_registers_mips_dsp_linux): New
6426         prototype.
6427         (init_registers_mips64_dsp_linux): Likewise.
6428         (init_registers_mips_linux): New macro.
6429         (init_registers_mips_dsp_linux): Likewise.
6430         (mips_dsp_num_regs): Likewise.
6431         (DSP_BASE, DSP_CONTROL): New fallback macros.
6432         (mips_base_regs): New macro.
6433         (mips_regmap): Use it.  Fix the size.
6434         (mips_dsp_regmap): New variable.
6435         (mips_dsp_regset_bitmap): Likewise.
6436         (mips_arch_setup): New function.
6437         (mips_cannot_fetch_register): Use the_low_target.regmap rather
6438         than mips_regmap.
6439         (mips_cannot_store_register): Likewise.
6440         (the_low_target): Update .arch_setup, .num_regs and .regmap
6441         initializers.  Add .regset_bitmap initializer.
6442         * linux-arm-low.c (the_low_target): Add .regset_bitmap
6443         initializer.
6444         * linux-bfin-low.c (the_low_target): Likewise.
6445         * linux-cris-low.c (the_low_target): Likewise.
6446         * linux-crisv32-low.c (the_low_target): Likewise.
6447         * linux-ia64-low.c (the_low_target): Likewise.
6448         * linux-m32r-low.c (the_low_target): Likewise.
6449         * linux-m68k-low.c (the_low_target): Likewise.
6450         * linux-ppc-low.c (the_low_target): Likewise.
6451         * linux-s390-low.c (the_low_target): Likewise.
6452         * linux-sh-low.c (the_low_target): Likewise.
6453         * linux-sparc-low.c (the_low_target): Likewise.
6454         * linux-tic6x-low.c (the_low_target): Likewise.
6455         * linux-x86-low.c (the_low_target): Likewise.
6456         * linux-xtensa-low.c (the_low_target): Likewise.
6457         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
6458         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
6459         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
6460         srv_xmlfiles.
6461         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
6462         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
6463
6464 2012-02-29  Yao Qi  <yao@codesourcery.com>
6465             Pedro Alves  <palves@redhat.com>
6466
6467         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
6468         `step_over_finished' is true.
6469
6470 2012-02-27  Pedro Alves  <palves@redhat.com>
6471
6472         * linux-low.c (pid_is_stopped): Delete, moved to common/.
6473         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
6474
6475 2012-02-27  Pedro Alves  <palves@redhat.com>
6476
6477         PR server/9684
6478         * linux-low.c (pid_is_stopped): New.
6479         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
6480
6481 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
6482
6483         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
6484         of conditions.
6485
6486 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
6487
6488         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
6489
6490 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6491
6492         * server.c (handle_query): Advertise support for target-side
6493         breakpoint condition evaluation.
6494         (process_point_options): New function.
6495         (process_serial_event): When inserting a breakpoint, check for
6496         a target-side condition that should be evaluated.
6497
6498         * mem-break.c: Include regcache.h and ax.h.
6499         (point_cond_list_t): New data structure.
6500         (breakpoint) <cond_list>: New field.
6501         (find_gdb_breakpoint_at): Make non-static.
6502         (delete_gdb_breakpoint_at): Clear any target-side
6503         conditions.
6504         (clear_gdb_breakpoint_conditions): New function.
6505         (add_condition_to_breakpoint): Likewise.
6506         (add_breakpoint_condition): Likewise.
6507         (gdb_condition_true_at_breakpoint): Likewise.
6508         (gdb_breakpoint_here): Return result directly instead
6509         of going through a local variable.
6510
6511         * mem-break.h (find_gdb_breakpoint_at): New prototype.
6512         (clear_gdb_breakpoint_conditions): Likewise.
6513         (add_breakpoint_condition): Likewise.
6514         (gdb_condition_true_at_breakpoint): Likewise.
6515
6516         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
6517         (need_step_over_p): Take target-side breakpoint condition into
6518         consideration.
6519
6520 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6521
6522         * server.h: Include tracepoint.h.
6523         (agent_mem_read, agent_get_trace_state_variable_value,
6524         agent_set_trace_state_variable_value,
6525         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
6526         get_set_tsv_func_addr): New prototypes.
6527
6528         * ax.h: New include file.
6529         * ax.c: New source file.
6530
6531         * tracepoint.c: Include ax.h.
6532         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
6533         agent_expr, eval_result_type): Move to ax.h.
6534         (parse_agent_expr): Rename to ...
6535         (gdb_parse_agent_expr): ... this, make it non-static and move
6536         to ax.h.
6537         (unparse_agent_expr) Rename to ...
6538         (gdb_unparse_agent_expr): ... this, make it non-static and move
6539         to ax.h.
6540         (eval_agent_expr): Rename to ...
6541         (eval_tracepoint_agent_expr): ... this.
6542         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
6543         forward declarations.
6544         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
6545         (agent_get_trace_state_variable_value): New function.
6546         (agent_set_trace_state_variable_value): New function.
6547         (cmd_qtdp): Call gdb_parse_agent_expr (...).
6548         (response_tracepoint): Call gdb_unparse_agent_expr (...).
6549         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
6550         (condition_true_at_tracepoint): Likewise.
6551         (parse_agent_expr): Rename to ...
6552         (gdb_parse_agent_expr): ... this and move to ax.c.
6553         (unparse_agent_expr): Rename to ...
6554         (gdb_unparse_agent_expr): ... this and move to ax.c.
6555         (gdb_agent_op_name): Move to ax.c.
6556         (eval_agent_expr): Rename to ...
6557         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
6558         and move to ax.c.
6559         (eval_tracepoint_agent_expr): New function.
6560         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
6561         non-static.
6562         (current_insn_ptr, emit_error, struct bytecode_address): Move to
6563         ax.c.
6564         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
6565         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
6566         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
6567         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
6568         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
6569         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
6570         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
6571         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
6572         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
6573         (compile_bytecodes): Remove forward declaration.
6574         (is_goto_target): Move to ax.c.
6575         (compile_bytecodes): Move to ax.c and call
6576         agent_get_trace_state_variable_value (...) and
6577         agent_set_trace_state_variable_value (...).
6578
6579         * Makefile.in: Update ax.c and IPA dependencies.
6580
6581 2012-02-24  Pedro Alves  <palves@redhat.com>
6582
6583         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
6584         (cmd_bigqtbuffer_circular): ... this.  Only handle
6585         'QTBuffer:circular:'.
6586         (handle_tracepoint_general_set): Adjust.
6587
6588 2012-02-16  Yao Qi  <yao@codesourcery.com>
6589
6590         * inferiors.c: Move code to ...
6591         * dll.c: .... here.  New.
6592         * server.h: Declare clear_dlls.
6593         * Makefile.in (SFILES): Add dll.c.
6594         (OBS): Add dll.o
6595         (dll.o): New rule.
6596
6597 2012-02-11  Yao Qi  <yao@codesourcery.com>
6598
6599         * server.c: (handle_monitor_command): Add a new parameter
6600         `own_buf'.
6601         (handle_query): Update caller.
6602
6603 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
6604
6605         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
6606         * configure, config.in: Regenerate.
6607         * hostio.c: Provide an alternate implementation if HAVE_READLINK
6608         is not defined.
6609
6610 2012-02-02  Pedro Alves  <palves@redhat.com>
6611
6612         Try SIGKILL first, then PTRACE_KILL.
6613         * linux-low.c (linux_kill_one_lwp): New.
6614         (linux_kill_one_lwp): Rename to ...
6615         (kill_one_lwp_callback): ... this.  Use the new
6616         linux_kill_one_lwp.
6617
6618 2012-02-02  Pedro Alves  <palves@redhat.com>
6619
6620         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
6621         inferior.
6622
6623 2012-01-27  Pedro Alves  <palves@redhat.com>
6624
6625         * linux-low.c (linux_child_pid_to_exec_file): Delete.
6626         (elf_64_file_p): Make static.
6627         (linux_pid_exe_is_elf_64_file): New.
6628         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
6629         Delete declarations.
6630         (linux_pid_exe_is_elf_64_file): Declare.
6631         * linux-x86-low.c (x86_arch_setup): Use
6632         linux_pid_exe_is_elf_64_file.
6633
6634 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6635
6636         * linux-low.c (linux_wait_for_event_1): Rename to ...
6637         (linux_wait_for_event): ... here and merge it with former
6638         linux_wait_for_event - new variable wait_ptid, use it.
6639         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
6640
6641 2012-01-23  Pedro Alves  <palves@redhat.com>
6642
6643         * server.c (main): Avoid yet another case of infinite loop while
6644         detaching/killing after a longjmp.
6645
6646 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
6647
6648         Code cleanup.
6649         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
6650
6651 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
6652
6653         * hostio.c (handle_readlink): New function.
6654         (handle_vFile): Call it to handle "vFile:readlink" packets.
6655
6656 2012-01-20  Pedro Alves  <palves@redhat.com>
6657             Ulrich Weigand  <ulrich.weigand@linaro.org>
6658
6659         * server.c (handle_v_requests): Only support vAttach and vRun to
6660         start multiple processes when in extended protocol mode.
6661
6662 2012-01-17  Pedro Alves  <palves@redhat.com>
6663
6664         * tracepoint.c (initialize_tracepoint): Use mmap instead of
6665         memalign plus mprotect to allocate the scratch buffer.
6666
6667 2012-01-13  Pedro Alves  <palves@redhat.com>
6668
6669         * server.c (attach_inferior): Clear `cont_thread'.
6670
6671 2012-01-13  Pedro Alves  <palves@redhat.com>
6672
6673         * server.c (main): Avoid infinite loop while detaching/killing
6674         after a longjmp.
6675
6676 2012-01-09  Doug Evans  <dje@google.com>
6677
6678         * server.c (start_inferior): Set last_ptid in --wrapper case.
6679
6680 2012-01-06  Yao Qi  <yao@codesourcery.com>
6681
6682         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
6683         defined.
6684         [IN_PROCESS_AGENT] (debug_agent): New global variable.
6685
6686 2012-01-04  Yao Qi  <yao@codesourcery.com>
6687
6688         * tracepoint.c (cmd_qtdp): Print debug message
6689         for static tracepoint.
6690
6691 2012-01-04  Yao Qi  <yao@codesourcery.com>
6692
6693         * tracepoint.c (trace_vdebug): Differentiate debug message
6694         between gdbserver and IPA.
6695
6696 2012-01-03  Yao Qi  <yao@codesourcery.com>
6697
6698         * tracepoint.c (tracepoint_was_hit): Don't collect for
6699         static tracepoint.
6700
6701 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6702
6703         * terminal.h: Reformat copyright header.
6704
6705 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6706
6707         * server.c (gdbserver_version): Update copyright year.
6708         * gdbreplay.c (gdbreplay_version): Likewise.
6709
6710 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
6711
6712         * linux-low.c (linux_create_inferior): Put empty if clause for write.
6713
6714         Revert:
6715         2011-12-18  Hui Zhu  <teawater@gmail.com>
6716         * linux-low.c (linux_create_inferior): Save return value to ret.
6717
6718 2011-12-18  Hui Zhu  <teawater@gmail.com>
6719
6720         * linux-low.c (linux_create_inferior): Save return value to ret.
6721
6722 2011-12-16  Doug Evans  <dje@google.com>
6723
6724         * linux-low.c (linux_create_inferior): If stdio connection,
6725         redirect stdin from /dev/null, stdout to stderr.
6726         * remote-utils.c (remote_is_stdio): New static global.
6727         (remote_connection_is_stdio): New function.
6728         (remote_prepare): Handle stdio connection.
6729         (remote_open): Ditto.
6730         (remote_close): Don't close stdin for stdio connections.
6731         (read_prim,write_prim): New functions.  Replace all calls to
6732         read/write to these.
6733         * server.c (main): Watch for "-" argument.  Move call to
6734         remote_prepare before start_inferior.
6735         * server.h (STDIO_CONNECTION_NAME): New macro.
6736         (remote_connection_is_stdio): Declare.
6737
6738         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
6739         in debugging output.
6740
6741 2011-12-15  Yao Qi  <yao@codesourcery.com>
6742
6743         * tracepoint.c: Include sys/syscall.h.
6744         (gdb_ust_thread): Remove preprocessor conditional.
6745
6746 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
6747
6748         * linux-low.c (linux_detach_one_lwp): Call
6749         the_low_target.prepare_to_resume before detaching.
6750
6751 2011-12-14  Yao Qi  <yao@codesourcery.com>
6752
6753         * tracepoint.c (gdb_ust_thread): Don't ignore return value
6754         of write.
6755
6756 2011-12-14  Yao Qi  <yao@codesourcery.com>
6757
6758         * i386-low.c (i386_low_stopped_data_address): Initialize local
6759         variable `control'.
6760
6761 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
6762
6763         PR remote/13492
6764
6765         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
6766         DR_CONTROL unless necessary.  Extend comments.
6767         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
6768         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
6769
6770 2011-12-13  Yao Qi  <yao@codesourcery.com>
6771
6772         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
6773         macros.
6774         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
6775
6776 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
6777
6778         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
6779         Print new debug message for such case.
6780
6781 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
6782
6783         Fix overlapping memcpy.
6784         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
6785         the read_inferior_memory transfer.
6786         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
6787         write_inferior_memory transfer.
6788         (set_fast_tracepoint_jump): New variable buf.  Use it for the
6789         read_inferior_memory and write_inferior_memory transfers.
6790         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
6791         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
6792         Use it for the write_inferior_memory transfer.
6793         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
6794         buffers.
6795
6796 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6797
6798         * linux-low.c (fetch_register, store_register): Make code
6799         consistent, fix formatting.
6800
6801 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6802
6803         * linux-low.c (usr_store_inferior_registers): Factor out code
6804         to handle individual registers into...
6805         (store_register): ... this new function.
6806
6807 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
6808
6809         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
6810         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
6811         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
6812         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
6813         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
6814         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
6815         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
6816         (srv_xmlfiles): Add new XML files.
6817
6818         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
6819         and <sys/uio.h>.
6820         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
6821         (init_registers_s390_linux32v1): Add prototype.
6822         (init_registers_s390_linux32v2): Likewise.
6823         (init_registers_s390_linux64v1): Likewise.
6824         (init_registers_s390_linux64v2): Likewise.
6825         (init_registers_s390x_linux64v1): Likewise.
6826         (init_registers_s390x_linux64v2): Likewise.
6827         (s390_num_regs): Increment to 52.
6828         (s390_regmap): Add orig_r2 register.
6829         (s390_num_regs_3264): Increment to 68.
6830         (s390_regmap_3264): Add orig_r2 register.
6831         (s390_collect_ptrace_register): Handle orig_r2 register.
6832         (s390_supply_ptrace_register): Likewise.
6833         (s390_fill_last_break): New function.
6834         (s390_store_last_break): Likewise.
6835         (s390_fill_system_call): New function.
6836         (s390_store_system_call): Likewise.
6837         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
6838         register sets.
6839         (s390_check_regset): New function.
6840         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
6841         NT_S390_SYSTEM_CALL regsets and use appropriate description.
6842         Update target_regsets for available register sets.
6843
6844 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
6845             Jan Kratochvil  <jan.kratochvil@redhat.com>
6846
6847         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
6848         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
6849         New.
6850         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
6851         * linux-low.h (struct process_info_private): New member r_debug.
6852         * server.c (handle_qxfer_libraries): Call
6853         the_target->qxfer_libraries_svr4.
6854         (handle_qxfer_libraries_svr4): New function.
6855         (qxfer_packets): New entry "libraries-svr4".
6856         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
6857         * target.h (struct target_ops): New member qxfer_libraries_svr4.
6858         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
6859         PACKET_qXfer_libraries_svr4.
6860
6861 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
6862
6863         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
6864         PSW address/mask between 8-byte and 16-byte formats.
6865         (s390_supply_ptrace_register): Likewise.
6866         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
6867         basic addressing mode bit.
6868
6869 2011-11-24  Stan Shebs  <stan@codesourcery.com>
6870
6871         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
6872
6873 2011-11-17  Stan Shebs  <stan@codesourcery.com>
6874
6875         * tracepoint.c (struct tracepoint): New field traceframe_usage.
6876         (tracing_start_time): New global.
6877         (tracing_stop_time): New global.
6878         (tracing_user_name): New global.
6879         (tracing_notes): New global.
6880         (tracing_stop_note): New global.
6881         (cmd_qtstart): Set traceframe_usage, start_time.
6882         (stop_tracing): Set stop_time.
6883         (cmd_qtstatus): Report additional status.
6884         (cmd_qtp): New function.
6885         (handle_tracepoint_query): Call it.
6886         (cmd_qtnotes): New function.
6887         (handle_tracepoint_general_set): Call it.
6888         (get_timestamp): Rename from tsv_get_timestamp.
6889
6890 2011-11-14  Stan Shebs  <stan@codesourcery.com>
6891             Kwok Cheung Yeung  <kcy@codesourcery.com>
6892
6893         * linux-x86-low.c (small_jump_insn): New.
6894         (i386_install_fast_tracepoint_jump_pad): Add arguments for
6895         trampoline and error message, build a trampoline and issue a small
6896         jump instruction to it.
6897         (x86_install_fast_tracepoint_jump_pad): Add arguments for
6898         trampoline and error message.
6899         (x86_get_min_fast_tracepoint_insn_len): New.
6900         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
6901         * linux-low.h (struct linux_target_ops): Add arguments to
6902         install_fast_tracepoint_jump_pad operation, add new operation.
6903         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
6904         arguments.
6905         (linux_get_min_fast_tracepoint_insn_len): New function.
6906         (linux_target_op): Add new operation.
6907         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
6908         (gdb_trampoline_buffer_end): Ditto.
6909         (gdb_trampoline_buffer_error): Ditto.
6910         (struct ipa_sym_addresses): Add fields for new IPA variables.
6911         (symbol_list): Add entries for new IPA variables.
6912         (struct tracepoint): Add fields to hold the address range of the
6913         trampoline used by the tracepoint.
6914         (trampoline_buffer_head): New static variable.
6915         (trampoline_buffer_tail): Ditto.
6916         (claim_trampoline_space): New function.
6917         (have_fast_tracepoint_trampoline_buffer): New function.
6918         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
6919         structure.
6920         (install_fast_tracepoint): Ditto, also add error buffer argument.
6921         (cmd_qtminftpilen): New function.
6922         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
6923         (fast_tracepoint_from_trampoline_address): New function.
6924         (fast_tracepoint_collecting): Handle trampoline as part of jump
6925         pad space.
6926         (set_trampoline_buffer_space): New function.
6927         (initialize_tracepoint): Initialize new IPA variables.
6928         * target.h (struct target_ops): Add arguments to
6929         install_fast_tracepoint_jump_pad operation, add new
6930         get_min_fast_tracepoint_insn_len operation.
6931         (target_get_min_fast_tracepoint_insn_len): New.
6932         (install_fast_tracepoint_jump_pad): Add arguments.
6933         * server.h (IPA_BUFSIZ): Define.
6934         * linux-i386-ipa.c: Include extra header files.
6935         (initialize_fast_tracepoint_trampoline_buffer): New function.
6936         (initialize_low_tracepoint): Call it.
6937         * server.h (set_trampoline_buffer_space): Declare.
6938         (claim_trampoline_space): Ditto.
6939         (have_fast_tracepoint_trampoline_buffer): Ditto.
6940
6941 2011-11-14  Yao Qi  <yao@codesourcery.com>
6942
6943         * server.c (handle_query): Handle InstallInTrace for qSupported.
6944         * tracepoint.c (add_tracepoint): Sort list.
6945         (install_tracepoint, download_tracepoint): New.
6946         (cmd_qtdp): Call them to install and download tracepoints.
6947         (sort_tracepoints): Removed.
6948         (cmd_qtstart): Update.
6949
6950 2011-11-14  Yao Qi  <yao@codesourcery.com>
6951
6952         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
6953         * mem-break.h: Declare.
6954         * tracepoint.c (cmd_qtstart): Move some code to ...
6955         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
6956         New.
6957         (download_tracepoints): Move some code to ...
6958         (download_tracepoint_1): ... here.  New.
6959
6960 2011-11-08  Yao Qi  <yao@codesourcery.com>
6961
6962         * remote-utils.c (relocate_instruction): A comment fix.
6963
6964 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
6965
6966         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
6967         (i386_dr_low_get_control, i386_dr_low_get_status): Use
6968         dr_status_mirror and dr_control_mirror from debug_reg_state.
6969         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
6970         (i386_initial_stuff): Remove use of deleted globals.
6971         (i386_get_thread_context, i386_set_thread_context,
6972         i386_thread_added): Use dr_status_mirror and dr_control_mirror
6973         from debug_reg_state.
6974
6975 2011-11-05  Yao Qi  <yao@codesourcery.com>
6976
6977         * tracepoint.c (gdb_collect): Loop over tracepoints of same
6978         address as TPOINT's.
6979
6980 2011-11-02  Stan Shebs  <stan@codesourcery.com>
6981
6982         * tracepoint.c (agent_mem_read_string): New function.
6983         (eval_agent_expr): Call it for tracenz.
6984         * server.c (handle_query): Report support for tracenz.
6985
6986 2011-11-02  Yao Qi  <yao@codesourcery.com>
6987
6988         * tracepoint.c (cmd_qtstart): Remove unused local variables.
6989
6990 2011-11-02  Yao Qi  <yao@codesourcery.com>
6991
6992         * target.h: Fix a typo in comment.
6993
6994 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
6995
6996         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
6997         clobber the breakpoints' shadows with fast tracepoint jumps.
6998         * mem-break.h (check_mem_write): Add `myaddr' parameter.
6999         * target.c (write_inferior_memory): Also pass MYADDR down to
7000         check_mem_write.
7001
7002 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
7003
7004         * configure.ac: Check support for personality routine.
7005         * configure: Regenerate.
7006         * config.in: Likewise.
7007         * linux-low.c: Include <sys/personality.h>.
7008         Define ADDR_NO_RANDOMIZE if necessary.
7009         (linux_create_inferior): Disable address space randomization when
7010         forking inferior, if requested.
7011         (linux_supports_disable_randomization): New function.
7012         (linux_target_ops): Install it.
7013         * server.h (disable_randomization): Declare.
7014         * server.c (disable_randomization): New global variable.
7015         (handle_general_set): Handle QDisableRandomization.
7016         (handle_query): Likewise for qSupported.
7017         (main): Support --disable-randomization and --no-disable-randomization
7018         command line arguments.
7019         * target.h (struct target_ops): Add supports_disable_randomization.
7020         (target_supports_disable_randomization): New macro.
7021
7022 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
7023
7024         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
7025         ifdef check.
7026         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
7027         [!PT_GETDSBT] (target_loadmap): New definition.
7028         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
7029         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
7030         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
7031         and PT_GETDSBT to LINUX_LOADMAP.
7032         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
7033         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
7034
7035 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7036
7037         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
7038         (arm_linux_hwbp_cap): New static variable.
7039         (arm_linux_get_hwbp_cap): Replace by ...
7040         (arm_linux_init_hwbp_cap): ... this new function.
7041         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
7042         (arm_linux_get_hw_watchpoint_count): Likewise.
7043         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7044         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
7045         (arm_prepare_to_resume): Use perror_with_name instead of error.
7046
7047 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
7048
7049         * linux-arm-low.c: Include <signal.h>.
7050         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
7051         (struct arm_linux_hwbp_cap): New data type.
7052         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
7053         (struct arm_linux_hw_breakpoint): New data type.
7054         (MAX_BPTS, MAX_WPTS): Define.
7055         (struct arch_process_info, struct arch_lwp_info): New data types.
7056         (arm_linux_get_hwbp_cap): New function.
7057         (arm_linux_get_hw_breakpoint_count): Likewise.
7058         (arm_linux_get_hw_watchpoint_count): Likewise.
7059         (arm_linux_get_hw_watchpoint_max_length): Likewise.
7060         (arm_hwbp_control_initialize): Likewise.
7061         (arm_hwbp_control_is_enabled): Likewise.
7062         (arm_hwbp_control_is_initialized): Likewise.
7063         (arm_hwbp_control_disable): Likewise.
7064         (arm_linux_hw_breakpoint_equal): Likewise.
7065         (arm_linux_hw_point_initialize): Likewise.
7066         (struct update_registers_data): New data structure.
7067         (update_registers_callback: New function.
7068         (arm_insert_point): Likewise.
7069         (arm_remove_point): Likewise.
7070         (arm_stopped_by_watchpoint): Likewise.
7071         (arm_stopped_data_address): Likewise.
7072         (arm_new_process): Likewise.
7073         (arm_new_thread): Likewise.
7074         (arm_prepare_to_resume): Likewise.
7075         (the_low_target): Register arm_insert_point, arm_remove_point,
7076         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
7077         arm_new_thread, and arm_prepare_to_resume.
7078
7079 2011-09-15  Stan Shebs  <stan@codesourcery.com>
7080
7081         * server.h (struct emit_ops): Add compare-goto fields.
7082         * tracepoint.c (gdb_agent_op_sizes): New table.
7083         (emit_eq_goto): New function.
7084         (emit_ne_goto): New function.
7085         (emit_lt_goto): New function.
7086         (emit_le_goto): New function.
7087         (emit_gt_goto): New function.
7088         (emit_ge_goto): New function.
7089         (is_goto_target): New function.
7090         (compile_bytecodes): Recognize special cases of compare-goto
7091         combinations and call specialized emitters for them.
7092         * linux-x86-low.c (amd64_emit_eq_goto): New function.
7093         (amd64_emit_ne_goto): New function.
7094         (amd64_emit_lt_goto): New function.
7095         (amd64_emit_le_goto): New function.
7096         (amd64_emit_gt_goto): New function.
7097         (amd64_emit_ge_goto): New function.
7098         (amd64_emit_ops): Add the new functions.
7099         (i386_emit_eq_goto): New function.
7100         (i386_emit_ne_goto): New function.
7101         (i386_emit_lt_goto): New function.
7102         (i386_emit_le_goto): New function.
7103         (i386_emit_gt_goto): New function.
7104         (i386_emit_ge_goto): New function.
7105         (i386_emit_ops): Add the new functions.
7106
7107 2011-09-08  Stan Shebs  <stan@codesourcery.com>
7108
7109         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
7110         (i386_emit_epilogue): Restore %ebx.
7111
7112 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
7113
7114         * server.c (step_thread): Remove definition.
7115         (process_serial_event): Don't handle Hs.
7116         * server.h (step_thread): Remove declaration.
7117         * target.c (set_desired_inferior): Remove use of step_thread.
7118
7119 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7120
7121         * linux-low.c: Include linux-procfs.h.
7122         (linux_attach_lwp_1): Update comments.
7123         (linux_attach): Scan for existing threads when attaching to a
7124         process that is the tgid.
7125         * Makefile.in: Update dependencies.
7126
7127 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
7128
7129         * configure.srv: Add linux-procfs.o dependencies.
7130
7131 2011-08-14  Yao Qi  <yao@codesourcery.com>
7132
7133         * target.h (struct target_ops): Fix indent.
7134         * win32-low.c (win32_target_ops): Fix comment.
7135
7136 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
7137             Yao Qi  <yao@codesourcery.com>
7138
7139         * Makefile.in (clean): Remove tic6x-*.c files.
7140         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
7141         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
7142         (tic6x-c64xp-linux.c): Likewise.
7143         * configure.srv: Add support for tic6x-*-uclinux.
7144         * linux-tic6x-low.c: New.
7145         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
7146
7147 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
7148             Yao Qi  <yao@codesourcery.com>
7149
7150         * target.h (struct target_ops): Add read_loadmap.
7151         * linux-low.c (struct target_loadseg): New type.
7152         (struct target_loadmap): New type.
7153         (linux_read_loadmap): New function.
7154         (linux_target_ops): Add linux_read_loadmap.
7155         * server.c (handle_query): Support qXfer:fdpic:read packet.
7156         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
7157         to NULL.
7158
7159 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
7160
7161         * win32-low.c: Include <stdint.h>.
7162
7163 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
7164
7165         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
7166         to the inferior here.
7167         (i386_remove_aligned_watchpoint): Ditto.
7168         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
7169         fit part of the watchpoint in the debug registers.
7170         (i386_update_inferior_debug_regs): New.
7171         (i386_low_insert_watchpoint): Work on a local mirror of the debug
7172         registers, and only update the inferior on success.
7173         (i386_low_remove_watchpoint): Ditto.
7174
7175 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
7176
7177         * linux-low.c (compare_ints, unique, list_threads, show_process,
7178         linux_core_of_thread): Delete.
7179         (linux_target_ops): Change linux_core_of_thread to
7180         linux_common_core_of_thread.
7181         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
7182         * utils.c (malloc_failure): Change type of argument.
7183         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
7184         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
7185         common/linux-osdata.c, common/ptid.c and common/buffer.c.
7186         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
7187         (IPA_OBJS): Add common-utils-ipa.o.
7188         (ptid_h, linux_osdata_h): New macros.
7189         (server_h): Add common/common-utils.h, common/xml-utils.h,
7190         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
7191         common/ptid.h.
7192         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
7193         ptid.o, buffer.o): New rules.
7194         (linux-low.o): Add common/linux-osdata.h as a dependency.
7195         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
7196         * configure.ac: Add AC_HEADER_DIRENT check.
7197         * config.in: Regenerate.
7198         * configure: Regenerate.
7199         * remote-utils.c (xml_escape_text): Delete.
7200         (buffer_grow, buffer_free, buffer_init, buffer_finish,
7201         buffer_xml_printf): Move to common/buffer.c.
7202         * server.c (main): Remove call to initialize_inferiors.
7203         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
7204         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
7205         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
7206         internal_error, gdb_assert, gdb_assert_fail): Delete.
7207         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
7208         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
7209         common/buffer.h.
7210         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
7211         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
7212         initialize_inferiors): Delete.
7213
7214 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
7215
7216         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
7217         symbol error.
7218
7219 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
7220
7221         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
7222         assertion.
7223         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
7224
7225 2011-05-26  Yao Qi  <yao@codesourcery.com>
7226
7227         * Makefile.in (thread-db.o): Track dependence to
7228         common/gdb_thread_db.h.
7229         * thread-db.c: include gdb_thread_db.h from right place.
7230
7231 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
7232
7233         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
7234         __FILE__ and __LINE__ to internal_error.
7235
7236 2011-05-13  Doug Evans  <dje@google.com>
7237
7238         * thread-db.c (try_thread_db_load_from_sdir): New function.
7239         (try_thread_db_load_from_dir): New function.
7240         (thread_db_load_search): Handle $sdir, ignore $pdir.
7241         Remove trying of system directories if search of
7242         libthread-db-search-path fails, that is now done via $sdir.
7243
7244 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
7245
7246         * server.c (handle_query): Add EnableDisableTracepoints to the list
7247         of supported features.
7248         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
7249         tracepoints.
7250         (cmd_qtenable_disable): New.
7251         (cmd_qtstart): Install tracepoints even if disabled.
7252         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
7253         receiving a QTEnable or QTDisable packet.
7254         (gdb_collect): Skip data collection if fast tracepoint is disabled.
7255         (ust_marker_to_static_tracepoint): Do not ignore disabled static
7256         tracepoints.
7257         (gdb_probe): Skip data collection if static tracepoint is disabled.
7258
7259 2011-05-10  Doug Evans  <dje@google.com>
7260
7261         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
7262
7263 2011-05-04  Doug Evans  <dje@google.com>
7264
7265         * linux-low.c (linux_join): Skip process lookup.
7266         * spu-low.c (spu_join): Ditto.
7267         * server.c (join_inferiors_callback): Delete.
7268         (process_serial_event): For 'D' packet (detach) call join_inferior
7269         directly.
7270
7271 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
7272
7273         * README: Don't mention xscale*-*-linux*.
7274         * configure.srv (xscale*-*-linux*): Don't handle target.
7275
7276 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
7277
7278         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
7279         casting pointers.
7280         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
7281         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
7282         (i386_emit_void_call_2): Likewise.
7283
7284 2011-04-26  Yao Qi  <yao@codesourcery.com>
7285
7286         * linux-low.c: Move common macros to linux-ptrace.h.
7287         Include linux-ptrace.h.
7288         * Makefile.in (linux_ptrace_h): New.
7289         (linux-low.o): Depends on linux-ptrace.h.
7290
7291 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
7292
7293         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
7294         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
7295         (remote_prepare): New function with most of the TCP code from ...
7296         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
7297         setting transport_is_reliable.
7298         * server.c (run_once): New variable.
7299         (gdbserver_usage): Document it.
7300         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
7301         the first run if RUN_ONCE.
7302         * server.h (run_once, remote_prepare): New declarations.
7303
7304 2011-04-19  Tom Tromey  <tromey@redhat.com>
7305
7306         * win32-low.c (handle_load_dll): Remove duplicate "the".
7307
7308 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
7309
7310         Remove support for old Cygwin 1.5 versions.
7311         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
7312         function to avoid warning.
7313         (win32_add_one_solib): Use cygwin_conv_path function to avoid
7314         warning.
7315
7316 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
7317
7318         * gdbserver/server.h (Macro _): Define it if not available.
7319
7320 2011-03-14  Michael Snyder  <msnyder@vmware.com>
7321
7322         * hostio.c (handle_close): Remove unnecessary null test.
7323
7324 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
7325
7326         * Makefile.in (maintainer-clean realclean distclean): Remove
7327         "make ...  subdir_do" command.
7328
7329 2011-03-10  Michael Snyder  <msnyder@vmware.com>
7330
7331         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
7332
7333         * server.c (handle_v_run): Free alloced buffer on early return.
7334
7335 2011-03-09  Yao Qi  <yao@codesourcery.com>
7336
7337         Revert:
7338         2011-03-04  Yao Qi  <yao@codesourcery.com>
7339
7340         * Makefile.in: Remove GNU make feature --directory.
7341
7342         2011-03-05  Yao Qi  <yao@codesourcery.com>
7343
7344         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7345         (subdir_do): New make target.  Copied from gdb/Makefile.
7346         (maintainer-clean, realclean, distclean, clean): Call corresponding
7347         make targets in common/Makefile.
7348
7349         2011-02-11  Yao Qi  <yao@codesourcery.com>
7350
7351         * configure.ac: Call AC_PROG_RANLIB.
7352         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7353         * configure: Regenerate.
7354
7355 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
7356
7357         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
7358
7359 2011-03-06  Yao Qi  <yao@codesourcery.com>
7360
7361         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
7362
7363 2011-03-05  Yao Qi  <yao@codesourcery.com>
7364
7365         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7366         (subdir_do): New make target.  Copied from gdb/Makefile.
7367         (maintainer-clean, realclean, distclean, clean): Call corresponding
7368         make targets in common/Makefile.
7369
7370 2011-03-04  Yao Qi  <yao@codesourcery.com>
7371
7372         * Makefile.in: Remove GNU make feature --directory.
7373
7374 2011-03-04  Michael Snyder  <msnyder@vmware.com>
7375
7376         * server.c (queue_stop_reply): Call xmalloc not malloc.
7377
7378 2011-03-02  Michael Snyder  <msnyder@vmware.com>
7379
7380         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
7381
7382 2011-02-28  Michael Snyder  <msnyder@vmware.com>
7383
7384         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
7385         (cmd_qtframe): Ditto.
7386         (cmd_qtbuffer): Ditto.
7387         (cmd_bigqtbuffer): Ditto.
7388
7389         * utils.c (decimal2str): Initialize 'width' to nine, then
7390         don't mess with it.
7391
7392 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
7393
7394         * hostio.c (require_data): Free *data, not data.
7395
7396 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
7397
7398         * hostio.c (require_data): Use free, not xfree.
7399
7400 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7401
7402         * server.c (handle_query): Discard unused value.
7403
7404         * hostio.c (require_data): Free malloc memory before returning
7405         error.
7406
7407 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7408
7409         * linux-low.c (list_threads): Call closedir for dirent.
7410
7411 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7412
7413         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
7414         a case statement falls through.
7415
7416         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
7417
7418         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
7419         in comparison.
7420
7421 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7422
7423         * utils.c (decimal2str): Eliminate dead code and dead param.
7424         (pulongest): Drop dead param from call to decimal2str.
7425         (plongest): Ditto.
7426
7427 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
7428
7429         Revert the following patch (not approved yet):
7430         2011-02-21  Hui Zhu  <teawater@gmail.com>
7431         * tracepoint.c (tp_printf): New function.
7432         (eval_agent_expr): Handle gdb_agent_op_printf.
7433
7434 2011-02-21  Hui Zhu  <teawater@gmail.com>
7435
7436         * tracepoint.c (tp_printf): New function.
7437         (eval_agent_expr): Handle gdb_agent_op_printf.
7438
7439 2011-02-18  Tom Tromey  <tromey@redhat.com>
7440
7441         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
7442         (tracepoint.o): Likewise.
7443         * tracepoint.c (enum gdb_agent_op): Use ax.def.
7444         (gdb_agent_op_names): Likewise.
7445
7446 2011-02-18  Tom Tromey  <tromey@redhat.com>
7447
7448         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
7449         gdb_agent_op_rot>: New constants.
7450         (gdb_agent_op_names): Add pick and roll.
7451         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
7452         cases.
7453
7454 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
7455
7456         * aclocal.m4: Regenerated with aclocal-1.11.1.
7457
7458 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
7459
7460         * server.c (handle_qxfer_traceframe_info): New.
7461         (qxfer_packets): Register "traceframe-info".
7462         (handle_query): Report support for qXfer:traceframe-info:read+.
7463         * tracepoint.c (match_blocktype): New.
7464         (traceframe_find_block_type): Rename to ...
7465         (traceframe_walk_blocks): ... this.  Add callback filter argument,
7466         and use it.
7467         (traceframe_find_block_type): New, reimplemented on top of
7468         traceframe_walk_blocks.
7469         (build_traceframe_info_xml): New.
7470         (traceframe_read_info): New.
7471         * server.h (traceframe_read_info): Declare.
7472
7473 2011-02-11  Yao Qi  <yao@codesourcery.com>
7474
7475         * configure.ac: Call AC_PROG_RANLIB.
7476         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7477         * configure: Regenerate.
7478
7479 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
7480
7481         * server.c (gdb_read_memory): Change return semantics to allow
7482         partial transfers.
7483         (handle_search_memory_1): Adjust.
7484         (process_serial_event) <'m' packet>: Handle partial transfers.
7485         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
7486
7487 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7488
7489         * regcache.c (init_register_cache): Initialize
7490         regcache->register_status.
7491         (free_register_cache): Release regcache->register_status.
7492         (regcache_cpy): Copy register_status.
7493         (registers_to_string): Print 'x's for unavailable registers.
7494         (supply_register): Mark the register's status valid or
7495         unavailable, depending on whether a buffer was passed in or not.
7496         (supply_register_zeroed): New.
7497         (supply_regblock): Mark the registers' status valid or
7498         unavailable, depending on whether a buffer was passed in or not.
7499         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
7500         (struct regcache): New `register_status' field.
7501         (supply_register_zeroed): Declare.
7502         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
7503         supply_register_zeroed, rather than passing a NULL buffer to
7504         supply_register.
7505         * tracepoint.c (fetch_traceframe_registers): Update comment.
7506
7507 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7508
7509         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
7510         buffer explicit.
7511
7512 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
7513
7514         * server.h (decode_xfer_write): Change prototype.
7515         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
7516         and don't extract the annex here.
7517         * server.c (decode_xfer_read): Remove `annex' parameter,
7518         and don't extract the annex here.
7519         (decode_xfer): New.
7520         (struct qxfer): New.
7521         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
7522         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
7523         (handle_qxfer_statictrace): New functions, abstracted out from
7524         handle_query, and made to use the struct qxfer interface.
7525         (handle_threads_qxfer_proper): Rename to ...
7526         (handle_qxfer_threads_proper): ... this.
7527         (handle_threads_qxfer): Rename to ...
7528         (handle_qxfer_threads): ... this.  Adjust.
7529         (qxfer_packets): New array.
7530         (handle_qxfer): New function.
7531         (handle_query): Use handle_qxfer.
7532
7533 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
7534
7535         * gdbreplay.c: Shorten lines of >= 80 columns.
7536         * linux-low.c: Ditto.
7537         * linux-ppc-low.c: Ditto.
7538         * linux-s390-low.c: Ditto.
7539         * linux-sparc-low.c: Ditto.
7540         * linux-x86-low.c: Ditto.
7541         * linux-xtensa-low.c: Ditto.
7542         * mem-break.c: Ditto.
7543         * nto-low.c: Ditto.
7544         * regcache.h: Ditto.
7545         * remote-utils.c: Ditto.
7546         * server.c: Ditto.
7547         * server.h: Ditto.
7548         * thread-db.c: Ditto.
7549         * tracepoint.c: Ditto.
7550         * utils.c: Ditto.
7551         * win32-low.h: Ditto.
7552
7553 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
7554
7555         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
7556         update.
7557
7558 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
7559
7560         * server.c (gdbserver_version): Update copyright year in version
7561         output.
7562         * gdbreplay.c (gdbreplay_version): Ditto.
7563
7564 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
7565
7566         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
7567         * linux-bfin-low.c: New file.
7568         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
7569         PT_DATA_ADDR for BFIN targets.
7570         * Makefile.in (SFILES): Add linux-bfin-low.c.
7571         (clean): Remove reg-bfin.c.
7572         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
7573         * README: Mention supported Blackfin targets.
7574
7575 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
7576
7577         * .gitignore: New file.
7578
7579 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
7580
7581         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
7582
7583 2010-10-22  Jie Zhang  <jie@codesourcery.com>
7584
7585         * Makefile.in: Add FLAGS_TO_PASS variable.
7586         (install): Remove dependency of install-only and recursively
7587         invoke make for install-only.
7588
7589 2010-10-04  Doug Evans  <dje@google.com>
7590
7591         * Makefile.in (uninstall): Use $(DESTDIR).
7592
7593 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
7594
7595         PR gdb/11842
7596
7597         * linux-x86-low.c (compat_siginfo_from_siginfo)
7598         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
7599         si_code is < 0.  Check for si_code == SI_TIMER before checking for
7600         si_code < 0.
7601
7602 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7603
7604         * lynx-i386-low.c: New file.
7605         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
7606
7607 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7608
7609         * lynx-low.c (ptrace_request_to_str): Remove handling for
7610         request values that have been removed in LynxOS 5.x.
7611
7612 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7613
7614         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
7615         <ptrace.h>
7616
7617 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
7618
7619         * configure.ac: Add --enable-inprocess-agent option.
7620         * configure: Rebuilt.
7621
7622 2010-09-06  Yao Qi  <yao@codesourcery.com>
7623
7624         * linux-low.c (linux_kill): Remove unused variable.
7625         (linux_stabilize_threads): Likewise.
7626         * server.c (start_inferior): Likewise.
7627         (queue_stop_reply_callback): Likewise.
7628         * tracepoint.c (do_action_at_tracepoint): Likewise.
7629
7630 2010-09-06  Yao Qi  <yao@codesourcery.com>
7631
7632         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
7633         on return.
7634
7635 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7636
7637         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
7638
7639 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
7640
7641         * Makefile.in (install-only): Replace $IPA_DEPFILES with
7642         "$(IPA_DEPFILES)".
7643
7644 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7645
7646         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
7647         gdbserver/lynx-ppc-low.c: New files.
7648         * Makefile.in (lynx_low_h): New variable.
7649         (lynx-low.o, lynx-ppc-low.o): New rules.
7650         * configure.ac: On LynxOS, link with -lnetinet.
7651         * configure.srv: Add handling of powerpc-*-lynxos* targets.
7652         * configure: regenerate.
7653
7654 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7655
7656         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
7657         * configure.ac: Add check for vasprintf and vsnprintf.
7658         * configure, config.in: Regenerate.
7659         * server.h (vasprintf, vsnprintf): Add conditional declarations.
7660
7661 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7662
7663         * gdbreplay.c: Move include of alloca.h up, next to include of
7664         malloc.h.
7665         * server.h: Add include of malloc.h.
7666         * mem-break.c: Remove include of malloc.h.
7667         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
7668
7669 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7670
7671         * Makefile.in (memmem.o): Build with -Wno-error.
7672
7673 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7674
7675         * utils.c (xsnprintf): Make non-static.
7676         * server.h: Add xsnprintf declaration.
7677         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
7678         replace calls to snprintf by calls to xsnprintf throughout.
7679
7680 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7681
7682         * configure.ac: Add configure check for alloca.
7683         * configure, config.in: Regenerate.
7684         * server.h: Include alloca.h if it exists.
7685         * gdbreplay.c: Include alloca.h if it exists.
7686
7687 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7688
7689         * linux-low.c (__SIGRTMIN): Define if not already defined.
7690         (linux_create_inferior): Check for __ANDROID__ rather than
7691         __SIGRTMIN.
7692         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
7693         are already deferred.
7694         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
7695         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
7696         stopped and already has a pending signal to report.
7697         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
7698         a pending signal to report or is moving out of a jump pad.
7699         (linux_init_signals): Check for __ANDROID__ rather than
7700         __SIGRTMIN.
7701
7702 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7703
7704         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
7705         debug_threads check.  Avoid a linear search when not doing debug
7706         output.
7707
7708 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7709
7710         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
7711         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
7712         (struct file_handler) <fd>: Change type to gdb_fildes_t.
7713         (process_event): Change local fd's type to gdb_fildes_t.
7714         (create_file_handler): Adjust prototype.
7715         (delete_file_handler): Adjust prototype.
7716         (handle_file_event): Adjust prototype.  Use pfildes.
7717         (create_file_event): Adjsut prototype.
7718         * remote-utils.c (remote_desc, listen_desc): Change type to
7719         gdb_fildes_t.
7720         * server.h: New gdb_fildes_t typedef.
7721         [USE_WIN32API]: Include winsock2.h.
7722         (delete_file_handler, add_file_handler): Adjust prototypes.
7723         (pfildes): Declare.
7724         * utils.c (pfildes): New.
7725
7726 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7727
7728         * configure.ac (build_warnings): Add -Wno-char-subscripts.
7729         * configure: Regenerate.
7730
7731 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7732
7733         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
7734         (linux_done_accessing_memory): ... this.
7735         (linux_target_ops): Adjust.
7736         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
7737         * nto-low.c (nto_target_ops): Adjust comment.
7738         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
7739         * spu-low.c (spu_target_ops): Adjust comment.
7740         * target.h (target_ops): Rename unprepare_to_access_memory field
7741         to done_accessing_memory.
7742         (unprepare_to_access_memory): Rename to ...
7743         (done_accessing_memory): ... this.
7744
7745 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7746
7747         * linux-low.c (linux_prepare_to_access_memory): New.
7748         (linux_unprepare_to_access_memory): New.
7749         (linux_target_ops): Install them.
7750         * server.c (read_memory): Rename to ...
7751         (gdb_read_memory): ... this.  Use
7752         prepare_to_access_memory/prepare_to_access_memory.
7753         (write_memory): Rename to ...
7754         (gdb_write_memory): ... this.  Use
7755         prepare_to_access_memory/prepare_to_access_memory.
7756         (handle_search_memory_1): Adjust.
7757         (process_serial_event): Adjust.
7758         * target.h (struct target_ops): New fields
7759         prepare_to_access_memory and unprepare_to_access_memory.
7760         (prepare_to_access_memory, unprepare_to_access_memory): New.
7761         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
7762         prepare_to_access_memory/prepare_to_access_memory.
7763         * nto-low.c (nto_target_ops): Adjust.
7764         * spu-low.c (spu_target_ops): Adjust.
7765         * win32-low.c (win32_target_ops): Adjust.
7766
7767 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7768
7769         * Makefile.in (WARN_CFLAGS): Get it from configure.
7770         (WERROR_CFLAGS): New.
7771         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
7772         * configure.ac: Introduce --enable-werror, which adds -Werror to
7773         the compiler command line.  Enabled by default.  Disable with
7774         --disable-werror.  Add -Wdeclaration-after-statement
7775         Wpointer-arith and -Wformat-nonliteral to warning flags.
7776         * configure: Regenerate.
7777
7778 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7779
7780         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
7781
7782 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7783
7784         * gdbreplay.c (remote_error): New.
7785         (gdbchar): New.
7786         (expect): Use gdbchar.  Check for error reading from GDB.
7787         Clarify sync error output.
7788         (play): Check for errors writing to GDB.
7789         * linux-low.c (sigchld_handler): Really ignore `write' errors.
7790         * remote-utils.c (getpkt): Check for errors writing to the remote
7791         descriptor.
7792
7793 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7794
7795         * linux-low.c (linux_wait_1): Move non-debugging code out of
7796         `debug_threads' control.
7797
7798 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7799
7800         * linux-low.c (linux_wait_1): Don't set last_status here.
7801         * server.c (push_event, queue_stop_reply_callback): Assert we're
7802         not pushing a TARGET_WAITKIND_IGNORE event.
7803         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
7804         (myresume, handle_target_event): Set the thread's last_resume_kind
7805         and last_status from the target returned status.
7806
7807 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7808
7809         PR threads/10729
7810
7811         * linux-x86-low.c (update_debug_registers_callback): New.
7812         (i386_dr_low_set_addr): Use it.
7813         (i386_dr_low_get_addr): New.
7814         (i386_dr_low_set_control): Use update_debug_registers_callback.
7815         (i386_dr_low_get_control): New.
7816         (i386_dr_low_get_status): Adjust.
7817         * linux-low.c (linux_stop_lwp): New.
7818         * linux-low.h (linux_stop_lwp): Declare.
7819
7820         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
7821         argument instead of a i386_debug_reg_state.
7822         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
7823         a i386_debug_reg_state.
7824         (i386_insert_aligned_watchpoint): Adjust.
7825         (i386_remove_aligned_watchpoint): Adjust.
7826         (i386_low_stopped_data_address): Read the debug registers from the
7827         inferior instead of from the mirrors.
7828         * i386-low.h (struct i386_debug_reg_state): Extend comment.
7829         (i386_dr_low_get_addr): Declare.
7830         (i386_dr_low_get_control): Declare.
7831         (i386_dr_low_get_status): Change prototype.
7832
7833         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
7834         (i386_dr_low_get_addr): New.
7835         (i386_dr_low_get_control): New.
7836         (i386_dr_low_get_status): Adjust prototype.  Return
7837         dr_status_mirror.
7838         (i386_initial_stuff): Clear dr_status_mirror and
7839         dr_control_mirror.
7840         (i386_get_thread_context): Adjust.
7841         (i386_set_thread_context): Adjust.
7842         (i386_thread_added): Adjust.
7843
7844 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
7845
7846         * linux-low.h (linux_thread_area): Delete declaration.
7847
7848 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
7849
7850         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
7851         after its termination.
7852
7853 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
7854
7855         * linux-low.c (gdb_wants_lwp_stopped): Delete.
7856         (gdb_wants_all_stopped): Delete.
7857         (linux_wait_1): Don't call them.
7858         * server.c (handle_v_cont): Tag all threads as want-stopped.
7859         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
7860         stopped as "client-wants-stopped".
7861
7862 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
7863
7864         * Makefile.in (signals_h): New.
7865         (server_h): Depend on it.
7866         (server.o): Don't depend on $(signals_def).
7867         (signals.o): Depend on $(signals_def).
7868
7869 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
7870
7871         * Makefile.in (signals_def): New.
7872         (server_h): Append include/gdb/signals.h and signals_def.
7873         (server.o): Append signals_def.
7874
7875 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
7876
7877         * server.c (handle_target_event): Use target_signal_to_host for
7878         resume_info.sig initialization.
7879         * target.h (struct thread_resume) <sig>: New comment.
7880
7881 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
7882
7883         * server.c (handle_query): strcpy() the returned string from paddress()
7884         instead of sprintf().
7885         * utils.c (paddress): Return phex_nz().
7886
7887 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
7888
7889         * server.c (handle_v_cont): Call mourn_inferior if process
7890         just exited.
7891         (myresume): Likewise.
7892
7893 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
7894
7895         Static tracepoints, and integration with UST.
7896
7897         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
7898         * mem-break.c (uninsert_all_breakpoints)
7899         (reinsert_all_breakpoints): New.
7900         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
7901         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
7902         (gdb_agent_ust_loaded, helper_thread_id)
7903         (gdb_agent_helper_thread_id): New macros.
7904         (struct ipa_sym_addresses): Add addr_ust_loaded,
7905         addr_helper_thread_id, addr_cmd_buf.
7906         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
7907         (in_process_agent_loaded_ust): New.
7908         (write_e_ust_not_loaded): New.
7909         (maybe_write_ipa_ust_not_loaded): New.
7910         (struct collect_static_trace_data_action): New.
7911         (enum tracepoint_type) <static_tracepoint>: New.
7912         (struct tracepoint) <handle>: Mention static tracepoints.
7913         (struct static_tracepoint_ctx): New.
7914         (CMD_BUF_SIZE): New.
7915         (add_tracepoint_action): Handle static tracepoint actions.
7916         (unprobe_marker_at): New.
7917         (clear_installed_tracepoints): Handle static tracepoints.
7918         (cmd_qtdp): Handle static tracepoints.
7919         (probe_marker_at): New.
7920         (cmd_qtstart): Handle static tracepoints.
7921         (response_tracepoint): Handle static tracepoints.
7922         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
7923         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
7924         (get_context_regcache): Handle static tracepoints.
7925         (do_action_at_tracepoint): Handle static tracepoint actions.
7926         (traceframe_find_block_type): Handle static trace data blocks.
7927         (traceframe_read_sdata): New.
7928         (download_tracepoints): Download static tracepoint actions.
7929         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
7930         (GDB_PROBE_NAME): New.
7931         (ust_ops): New.
7932         (GET_UST_SYM): New.
7933         (USTF): New.
7934         (dlsym_ust): New.
7935         (ust_marker_to_static_tracepoint): New.
7936         (gdb_probe): New.
7937         (collect_ust_data_at_tracepoint): New.
7938         (gdb_ust_probe): New.
7939         (UNIX_PATH_MAX, SOCK_DIR): New.
7940         (gdb_ust_connect_sync_socket): New.
7941         (resume_thread, stop_thread): New.
7942         (run_inferior_command): New.
7943         (init_named_socket): New.
7944         (gdb_ust_socket_init): New.
7945         (cstr_to_hexstr): New.
7946         (next_st): New.
7947         (first_marker, next_marker): New.
7948         (response_ust_marker): New.
7949         (cmd_qtfstm, cmd_qtsstm): New.
7950         (unprobe_marker_at, probe_marker_at): New.
7951         (cmd_qtstmat, gdb_ust_thread): New.
7952         (gdb_ust_init): New.
7953         (initialize_tracepoint_ftlib): Call gdb_ust_init.
7954         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
7955         (ST_REGENTRY): New.
7956         (x86_64_st_collect_regmap): New.
7957         (X86_64_NUM_ST_COLLECT_GREGS): New.
7958         (AMD64_RIP_REGNUM): New.
7959         (supply_static_tracepoint_registers): New.
7960         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
7961         (ST_REGENTRY): New.
7962         (i386_st_collect_regmap): New.
7963         (i386_NUM_ST_COLLECT_GREGS): New.
7964         (supply_static_tracepoint_registers): New.
7965         * server.c (handle_query): Handle qXfer:statictrace:read.
7966         <qSupported>: Report support for StaticTracepoints, and
7967         qXfer:statictrace:read features.
7968         * server.h (traceframe_read_sdata)
7969         (supply_static_tracepoint_registers): Declare.
7970         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
7971         (unpack_varlen_hex): Include in IPA build.
7972         * Makefile.in (ustlibs, ustinc): New.
7973         (IPA_OBJS): Add remote-utils-ipa.o.
7974         ($(IPA_LIB)): Link -ldl and -lpthread.
7975         (UST_CFLAGS): New.
7976         (IPAGENT_CFLAGS): Add UST_CFLAGS.
7977         * config.in, configure: Regenerate.
7978
7979 2010-06-20  Ian Lance Taylor  <iant@google.com>
7980             Pedro Alves  <pedro@codesourcery.com>
7981
7982         * linux-x86-low.c (always_true): Delete.
7983         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
7984         trying to fool the compiler with always_true.
7985
7986 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
7987
7988         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
7989         conditions in gdbserver.
7990
7991 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
7992
7993         * spu-low.c (spu_read_memory): Wrap around local store limit.
7994         (spu_write_memory): Likewise.
7995
7996 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
7997
7998         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
7999         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
8000         LONGEST uses.
8001         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
8002         uses.
8003         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
8004         uses with LONGEST uses.
8005
8006 2010-06-14  Stan Shebs  <stan@codesourcery.com>
8007             Pedro Alves  <pedro@codesourcery.com>
8008
8009         Bytecode compiler.
8010
8011         * linux-x86-low.c: Include limits.h.
8012         (add_insns): New.
8013         (always_true): New.
8014         (EMIT_ASM): New.
8015         (EMIT_ASM32): New.
8016         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
8017         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
8018         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
8019         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
8020         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
8021         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
8022         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
8023         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
8024         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
8025         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
8026         (amd64_emit_void_call_2): New.
8027         (amd64_emit_ops): New.
8028         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
8029         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
8030         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
8031         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
8032         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
8033         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
8034         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
8035         (i386_emit_call, i386_emit_reg, i386_emit_pop)
8036         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
8037         (i386_emit_stack_adjust, i386_emit_int_call_1)
8038         (i386_emit_void_call_2): New.
8039         (i386_emit_ops): New.
8040         (x86_emit_ops): New.
8041         (the_low_target): Install x86_emit_ops.
8042         * server.h (struct emit_ops): New.
8043         (get_raw_reg_func_addr): Declare.
8044         (current_insn_ptr, emit_error): Declare.
8045         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
8046         (set_trace_state_variable_value): New defines.
8047         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
8048         addr_get_trace_state_variable_value and
8049         addr_set_trace_state_variable_value.
8050         (symbol_list): New fields for get_raw_reg,
8051         get_trace_state_variable_value and set_trace_state_variable_value.
8052         (condfn): New typedef.
8053         (struct tracepoint): New field `compiled_cond'.
8054         (do_action_at_tracepoint): Clear compiled_cond.
8055         (get_trace_state_variable_value, set_trace_state_variable_value):
8056         Export in the IPA.
8057         (condition_true_at_tracepoint): If there's a compiled condition,
8058         run that.
8059         (current_insn_ptr, emit_error): New globals.
8060         (struct bytecode_address): New.
8061         (get_raw_reg_func_addr): New.
8062         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
8063         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
8064         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
8065         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
8066         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
8067         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
8068         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
8069         (compile_tracepoint_condition, compile_bytecodes): New.
8070         * target.h (emit_ops): Forward declare.
8071         (struct target_ops): New field emit_ops.
8072         (target_emit_ops): New.
8073         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
8074         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
8075         * linux-low.c (linux_emit_ops): New.
8076         (linux_target_ops): Install it.
8077         * linux-low.h (struct linux_target_ops): New field emit_ops.
8078
8079 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
8080
8081         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
8082         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
8083
8084 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8085             Stan Shebs  <stan@codesourcery.com>
8086
8087         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
8088         (all): Depend on $(extra_libraries).
8089         (install-only): Install the IPA.
8090         (IPA_OBJS, IPA_LIB): New.
8091         (clean): Remove the IPA lib.
8092         (IPAGENT_CFLAGS): New.
8093         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
8094         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
8095         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
8096         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
8097         * configure.ac: Check for atomic builtins support in the compiler.
8098         (IPA_DEPFILES, extra_libraries): Define.
8099         * configure.srv (ipa_obj): Add description.
8100         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
8101         (i[34567]86-*-linux*): Set ipa_obj.
8102         (x86_64-*-linux*): Set ipa_obj.
8103         * linux-low.c (stabilizing_threads): New.
8104         (supports_fast_tracepoints): New.
8105         (linux_detach): Stabilize threads before detaching.
8106         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
8107         the lwp is either not stabilizing, or is moving out of a jump pad.
8108         (linux_fast_tracepoint_collecting): New.
8109         (maybe_move_out_of_jump_pad): New.
8110         (enqueue_one_deferred_signal): New.
8111         (dequeue_one_deferred_signal): New.
8112         (linux_wait_for_event_1): If moving out of a jump pad, defer
8113         pending signals to later.
8114         (linux_stabilize_threads): New.
8115         (linux_wait_1): Check if threads need moving out of jump pads, and
8116         do it if so.
8117         (stuck_in_jump_pad_callback): New.
8118         (move_out_of_jump_pad_callback): New.
8119         (lwp_running): New.
8120         (linux_resume_one_lwp): Handle moving out of jump pads.
8121         (linux_set_resume_request): Dequeue deferred signals.
8122         (need_step_over_p): Also step over fast tracepoint jumps.
8123         (start_step_over): Also uninsert fast tracepoint jumps.
8124         (finish_step_over): Also reinsert fast tracepoint jumps.
8125         (linux_install_fast_tracepoint_jump): New.
8126         (linux_target_ops): Install linux_stabilize_threads and
8127         linux_install_fast_tracepoint_jump_pad.
8128         * linux-low.h (linux_target_ops) <get_thread_area,
8129         install_fast_tracepoint_jump_pad>: New fields.
8130         (struct lwp_info) <collecting_fast_tracepoint,
8131         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
8132         (linux_get_thread_area): Declare.
8133         * linux-x86-low.c (jump_insn): New.
8134         (x86_get_thread_area): New.
8135         (append_insns): New.
8136         (push_opcode): New.
8137         (amd64_install_fast_tracepoint_jump_pad): New.
8138         (i386_install_fast_tracepoint_jump_pad): New.
8139         (x86_install_fast_tracepoint_jump_pad): New.
8140         (the_low_target): Install x86_get_thread_area and
8141         x86_install_fast_tracepoint_jump_pad.
8142         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
8143         (struct fast_tracepoint_jump): New.
8144         (fast_tracepoint_jump_insn): New.
8145         (fast_tracepoint_jump_shadow): New.
8146         (find_fast_tracepoint_jump_at): New.
8147         (fast_tracepoint_jump_here): New.
8148         (delete_fast_tracepoint_jump): New.
8149         (set_fast_tracepoint_jump): New.
8150         (uninsert_fast_tracepoint_jumps_at): New.
8151         (reinsert_fast_tracepoint_jumps_at): New.
8152         (set_breakpoint_at): Use write_inferior_memory.
8153         (uninsert_raw_breakpoint): Use write_inferior_memory.
8154         (check_mem_read): Mask out fast tracepoint jumps.
8155         (check_mem_write): Mask out fast tracepoint jumps.
8156         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
8157         (set_fast_tracepoint_jump): Declare.
8158         (delete_fast_tracepoint_jump)
8159         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
8160         (reinsert_fast_tracepoint_jumps_at): Declare.
8161         * regcache.c: Don't compile many functions when building the
8162         in-process agent library.
8163         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
8164         the register buffer in the heap.
8165         (free_register_cache): If the register buffer isn't owned by the
8166         regcache, don't free it.
8167         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
8168         pre-existing register caches.
8169         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
8170         type.
8171         (convert_ascii_to_int): : Constify `from' parameter type.
8172         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
8173         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
8174         the needed buffer in-place.
8175         (relocate_instruction): New.
8176         * server.c (handle_query) <qSymbols>: If the target supports
8177         tracepoints, give it a chance of looking up symbols.  Report
8178         support for fast tracepoints.
8179         (handle_status): Stabilize threads.
8180         (process_serial_event): Adjust.
8181         * server.h (struct fast_tracepoint_jump): Forward declare.
8182         (struct process_info) <fast_tracepoint_jumps>: New field.
8183         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
8184         (decode_X_packet, decode_M_packet): Adjust.
8185         (relocate_instruction): Declare.
8186         (in_process_agent_loaded): Declare.
8187         (tracepoint_look_up_symbols): Declare.
8188         (struct fast_tpoint_collect_status): Declare.
8189         (fast_tracepoint_collecting): Declare.
8190         (force_unlock_trace_buffer): Declare.
8191         (handle_tracepoint_bkpts): Declare.
8192         (initialize_low_tracepoint)
8193         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
8194         * target.h (struct target_ops) <stabilize_threads,
8195         install_fast_tracepoint_jump_pad>: New fields.
8196         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
8197         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
8198         [HAVE_STDINT_H]: Include stdint.h.
8199         (trace_debug_1): Rename to ...
8200         (trace_vdebug): ... this.
8201         (trace_debug): Rename to ...
8202         (trace_debug_1): ... this.  Add `level' parameter.
8203         (trace_debug): New.
8204         (ATTR_USED, ATTR_NOINLINE): New.
8205         (IP_AGENT_EXPORT): New.
8206         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
8207         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
8208         (about_to_request_buffer_space, trace_buffer_is_full)
8209         (stopping_tracepoint, expr_eval_result, error_tracepoint)
8210         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
8211         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
8212         (traceframe_write_count, traceframes_created)
8213         (trace_state_variables)
8214         New renaming defines.
8215         (struct ipa_sym_addresses): New.
8216         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
8217         (symbol_list): New.
8218         (ipa_sym_addrs): New.
8219         (all_tracepoint_symbols_looked_up): New.
8220         (in_process_agent_loaded): New.
8221         (write_e_ipa_not_loaded): New.
8222         (maybe_write_ipa_not_loaded): New.
8223         (tracepoint_look_up_symbols): New.
8224         (debug_threads) [IN_PROCESS_AGENT]: New.
8225         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
8226         (UNKNOWN_SIDE_EFFECTS): New.
8227         (stop_tracing): New.
8228         (flush_trace_buffer): New.
8229         (stop_tracing_bkpt): New.
8230         (flush_trace_buffer_bkpt): New.
8231         (read_inferior_integer): New.
8232         (read_inferior_uinteger): New.
8233         (read_inferior_data_pointer): New.
8234         (write_inferior_data_pointer): New.
8235         (write_inferior_integer): New.
8236         (write_inferior_uinteger): New.
8237         (struct collect_static_trace_data_action): Delete.
8238         (enum tracepoint_type): New.
8239         (struct tracepoint) <type>: New field `type'.
8240         <actions_str, step_actions, step_actions_str>: Only include in
8241         GDBserver.
8242         <orig_size, obj_addr_on_target, adjusted_insn_addr>
8243         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
8244         (tracepoints): Use IP_AGENT_EXPORT.
8245         (last_tracepoint): Don't include in the IPA.
8246         (stopping_tracepoint): Use IP_AGENT_EXPORT.
8247         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
8248         (alloced_trace_state_variables): New.
8249         (trace_state_variables): Use IP_AGENT_EXPORT.
8250         (traceframe_t): Delete unused variable.
8251         (circular_trace_buffer): Don't include in the IPA.
8252         (trace_buffer_start): Delete.
8253         (struct trace_buffer_control): New.
8254         (trace_buffer_free): Delete.
8255         (struct ipa_trace_buffer_control): New.
8256         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
8257         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
8258         New.
8259         (trace_buffer_ctrl): New.
8260         (TRACE_BUFFER_CTRL_CURR): New.
8261         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
8262         Reimplement as macros.
8263         (trace_buffer_wrap): Delete.
8264         (traceframe_write_count, traceframe_read_count)
8265         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
8266         (struct tracepoint_hit_ctx) <type>: New field.
8267         (struct fast_tracepoint_ctx): New.
8268         (memory_barrier): New.
8269         (cmpxchg): New.
8270         (record_tracepoint_error): Update atomically in the IPA.
8271         (clear_inferior_trace_buffer): New.
8272         (about_to_request_buffer_space): New.
8273         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
8274         updating the same buffer.
8275         (add_tracepoint): Default the tracepoint's type to trap
8276         tracepoint, and orig_size to -1.
8277         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
8278         internal variables.
8279         (create_trace_state_variable): New parameter `gdb'.  Handle it.
8280         (clear_installed_tracepoints): Clear fast tracepoint jumps.
8281         (cmd_qtdp): Handle fast tracepoints.
8282         (cmd_qtdv): Adjust.
8283         (max_jump_pad_size): New.
8284         (gdb_jump_pad_head): New.
8285         (get_jump_space_head): New.
8286         (claim_jump_space): New.
8287         (sort_tracepoints): New.
8288         (MAX_JUMP_SIZE): New.
8289         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
8290         IPA.
8291         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
8292         support.  Upload fast traceframes, and delete internal IPA
8293         breakpoints.
8294         (stop_tracing_handler): New.
8295         (flush_trace_buffer_handler): New.
8296         (cmd_qtstop): Upload fast tracepoints.
8297         (response_tracepoint): Handle fast tracepoints.
8298         (tracepoint_finished_step): Upload fast traceframes.  Set the
8299         tracepoint hit context's tracepoint type.
8300         (handle_tracepoint_bkpts): New.
8301         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
8302         type.  Add comment about fast tracepoints.
8303         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
8304         non-existing action_str field.
8305         (get_context_regcache): Handle fast tracepoints.
8306         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
8307         to the regcache.
8308         (fast_tracepoint_from_jump_pad_address): New.
8309         (fast_tracepoint_from_ipa_tpoint_address): New.
8310         (collecting_t): New.
8311         (force_unlock_trace_buffer): New.
8312         (fast_tracepoint_collecting): New.
8313         (collecting): New.
8314         (gdb_collect): New.
8315         (write_inferior_data_ptr): New.
8316         (target_tp_heap): New.
8317         (target_malloc): New.
8318         (download_agent_expr): New.
8319         (UALIGN): New.
8320         (download_tracepoints): New.
8321         (download_trace_state_variables): New.
8322         (upload_fast_traceframes): New.
8323         (IPA_FIRST_TRACEFRAME): New.
8324         (IPA_NEXT_TRACEFRAME_1): New.
8325         (IPA_NEXT_TRACEFRAME): New.
8326         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
8327         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
8328         (gdb_jump_pad_buffer_end): New.
8329         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
8330         (initialize_tracepoint): Adjust.
8331         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
8332         buffer.  Initialize the low module.
8333         * utils.c (PREFIX, TOOLNAME): New.
8334         (malloc_failure): Use PREFIX.
8335         (error): In the IPA, an error causes an exit.
8336         (fatal, warning): Use PREFIX.
8337         (internal_error): Use TOOLNAME.
8338         (NUMCELLS): Increase to 10.
8339         * configure, config.in: Regenerate.
8340
8341 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8342
8343         * server.c (handle_query) <qSupported>: Do two passes over the
8344         qSupported string to avoid nesting strtok.
8345
8346 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8347
8348         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
8349         (CDEPS): New.
8350         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
8351         -Wl,--dynamic-list.
8352         * configure: Regenerate.
8353         * proc-service.list: New.
8354
8355 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8356
8357         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
8358         New comment.
8359
8360 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
8361
8362         * gdbreplay.c (remote_open): Check error return from socket() call by
8363         its equality to -1 not by it being negative.
8364         * remote-utils.c (remote_open): Likewise.
8365
8366 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
8367
8368         * config.h: Regenerate.
8369
8370 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8371
8372         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
8373         doesn't provide PTRACE_GET_THREAD_AREA.
8374
8375 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8376
8377         * linux-m68k-low.c: Include <asm/ptrace.h>
8378         (ps_get_thread_area): Implement.
8379
8380 2010-05-03  Doug Evans  <dje@google.com>
8381
8382         * event-loop.c (struct callback_event): New struct.
8383         (callback_list): New global.
8384         (append_callback_event, delete_callback_event): New functions.
8385         (process_callback): New function.
8386         (start_event_loop): Call it.
8387         * remote-utils.c (NOT_SCHEDULED): Define.
8388         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
8389         moved out of readchar.
8390         (readchar): Rewrite.  Call reschedule before returning.
8391         (reset_readchar): New function.
8392         (remote_close): Call it.
8393         (process_remaining, reschedule): New functions.
8394         * server.h (callback_handler_func): New typedef.
8395         (append_callback_event, delete_callback_event): Declare.
8396
8397 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8398
8399         * proc-service.c (ps_pglobal_lookup): Use
8400         thread_db_look_up_one_symbol.
8401         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
8402         parameter.  Use it instead of all_symbols_looked_up.
8403         * server.h (struct process_info) <all_symbols_looked_up>: Delete
8404         field.
8405         (all_symbols_looked_up): Don't declare.
8406         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
8407         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
8408         field.
8409         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
8410         Set all_symbols_looked_up here.
8411         (thread_db_look_up_one_symbol): New.
8412         (thread_db_get_tls_address): Adjust.
8413         (thread_db_load_search, try_thread_db_load_1): Always allocate the
8414         thread_db object on the heap, and tentatively set it in the
8415         process structure.
8416         (thread_db_init): Don't set all_symbols_looked_up here.
8417         * linux-low.h (thread_db_look_up_one_symbol): Declare.
8418
8419 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8420
8421         * linux-low.c (linux_kill, linux_detach): Adjust.
8422         (status_pending_p_callback): Remove redundant statement.  Check
8423         for !TARGET_WAITIKIND_IGNORE, instead of
8424         TARGET_WAITKIND_STOPPED.
8425         (handle_tracepoints): Make sure LWP is locked.  Adjust.
8426         (linux_wait_for_event_1): Adjust.
8427         (linux_cancel_breakpoints): New.
8428         (unsuspend_one_lwp): New.
8429         (unsuspend_all_lwps): New.
8430         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
8431         (send_sigstop_callback): Change return type to int, add new
8432         `except' parameter and handle it.
8433         (suspend_and_send_sigstop_callback): New.
8434         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
8435         pass them down.  If SUSPEND, also increment the lwp's suspend
8436         count.
8437         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
8438         (need_step_over_p): Don't consider suspended LWPs.
8439         (start_step_over): Adjust.
8440         (proceed_one_lwp): Change return type to int, add new `except'
8441         parameter and handle it.
8442         (unsuspend_and_proceed_one_lwp): New.
8443         (proceed_all_lwps): Use find_inferior instead of
8444         for_each_inferior.
8445         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
8446         also decrement the suspend count of LWPs.  Pass `except' down,
8447         instead of hacking its suspend count.
8448         (linux_pause_all): Add `freeze' parameter.  Adjust.
8449         (linux_unpause_all): New.
8450         (linux_target_ops): Install linux_unpause_all.
8451         * server.c (handle_status): Adjust.
8452         * target.h (struct target_ops): New fields `unpause_all' and
8453         `cancel_breakpoints'.  Add new parameter to `pause_all'.
8454         (pause_all): Add new `freeze' parameter.
8455         (unpause_all): New.
8456         (cancel_breakpoints): New.
8457         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
8458         cancel breakpoints.
8459         (cmd_qtstart): Pause threads.
8460         (stop_tracing): Pause threads, and cancel breakpoints.
8461         * win32-low.c (win32_target_ops): Adjust.
8462
8463 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8464
8465         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
8466         the inferior right away from here...
8467         (linux_wait_1): ... to here, and adjust to check the thread's
8468         last_resume_kind instead of the lwp's step or stop_expected flags.
8469
8470 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8471
8472         * README: Use consistent `GDB' and `GDBserver' spellings.
8473
8474 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8475
8476         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
8477         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
8478         (linux_detach_one_lwp): Assume the lwp is stopped.
8479         (any_thread_of): Delete.
8480         (linux_detach): Stop all lwps here.  Don't blindly delete all
8481         breakpoints.
8482         (delete_lwp_callback): New.
8483         (linux_mourn): Delete all lwps of the process that is gone.
8484         (linux_wait_1): Don't delete the last lwp of the process here.
8485         * mem-break.h (mark_breakpoints_out): Declare.
8486         * mem-break.c (mark_breakpoints_out): New.
8487         (free_all_breakpoints): Use it.
8488         * server.c (handle_target_event): If the process is gone, mark
8489         breakpoints out.
8490         * thread-db.c (struct thread_db) <create_bp>: New field.
8491         (thread_db_enable_reporting): Fix prototype.  Store a thread event
8492         breakpoint reference in the thread_db struct.
8493         (thread_db_load_search): Clear the thread_db object.
8494         (try_thread_db_load_1): Ditto.
8495         (switch_to_process): New.
8496         (disable_thread_event_reporting): Use it.
8497         (remove_thread_event_breakpoints): New.
8498         (thread_db_detach, thread_db_mourn): Use it.
8499
8500 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
8501
8502         * linux-low.c (linux_enable_event_reporting): New.
8503         (linux_wait_for_event_1, handle_extended_wait): Use it.
8504
8505 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
8506
8507         * linux-low.c (linux_kill_one_lwp, linux_kill)
8508         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
8509         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
8510         SIGSTOP even if the LWP is stopped.
8511         (send_sigstop_callback): New.
8512         (stop_all_lwps): Use send_sigstop_callback instead.
8513         (linux_resume_one_thread): Adjust.
8514         (proceed_one_lwp): Still proceed an LWP that the client has
8515         requested to stop, if we haven't reported it as stopped yet.  Make
8516         sure that LWPs the client want stopped, have a pending SIGSTOP.
8517
8518 2010-04-26  Doug Evans  <dje@google.com>
8519
8520         * server.c (handle_general_set): Make static.
8521
8522         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
8523         Print received char after testing for error/eof instead of before.
8524         (input_interrupt): Tweak comment.
8525
8526 2010-04-23  Doug Evans  <dje@google.com>
8527
8528         * server.c (start_inferior): Print inferior argv if --debug.
8529
8530 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
8531
8532         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
8533         * nto-x86-low.c: Include server.h
8534
8535 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
8536
8537         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
8538         be consistent with other sources of this directory.
8539         (init_registers_amd64): Correct name of source file of this function
8540         in the comment.
8541
8542 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8543
8544         * configure.srv (x86_64-*-mingw*): New configuration for Windows
8545         64-bit executables.
8546
8547 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8548
8549         * win32-i386-low.c: Add 64-bit support.
8550         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
8551         (init_registers_amd64): Declare.
8552         (mappings): Add 64-bit version of array.
8553         (init_windows_x86): New function.
8554         (the_low_target): Change init_arch field to init_windows_x86.
8555
8556 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8557
8558         * win32-low.c: Adapt to support also 64-bit architecture.
8559         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
8560         (get_image_name): Use SIZE_T type for local variable `done'.
8561         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
8562         (toolhelp_get_dll_name): Idem.
8563         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
8564         Use uintptr_t typecast to avoid warning.
8565         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
8566         (handle_exception): Use phex_nz to avoid warning.
8567         (win32_wait): Remove unused local variable `process'.
8568
8569 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8570
8571         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
8572         `amd64-avx.o'.
8573
8574 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
8575
8576         * configure.ac: Use `ws2_32' library for srv_mingw.
8577         * configure: Regenerate.
8578         * gdbreplay.c: Include winsock2.h instead of winsock.h.
8579         * remote-utils.c: Likewise.
8580
8581 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
8582
8583         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
8584         if __x86_64__ is defined.
8585
8586 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8587
8588         * configure: Regenerate.
8589
8590 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8591
8592         * server.c (handle_query): Handle 'qGetTIBAddr' query.
8593         * target.h (target_ops): New get_tib_address field.
8594         * win32-low.h (win32_thread_info): Add thread_local_base field.
8595         * win32-low.c (child_add_thread): Add tlb argument.
8596         Set thread_local_base field to TLB.
8597         (get_child_debug_event): Adapt to child_add_thread change.
8598         (win32_get_tib_address): New function.
8599         (win32_target_ops): Set get_tib_address field to
8600         win32_get_tib_address.
8601         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
8602
8603 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8604
8605         * linux-low.c (linux_mourn): Also remove the process.
8606         * server.c (handle_target_event): Don't remove the process here.
8607         * nto-low.c (nto_mourn): New.
8608         (nto_target_ops): Install it.
8609         * spu-low.c (spu_mourn): New.
8610         (spu_target_ops): Install it.
8611         * win32-low.c (win32_mourn): New.
8612         (win32_target_ops): Install it.
8613
8614 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8615
8616         * server.h (buffer_xml_printf): Remove redundant `;'.
8617
8618 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8619
8620         * regcache.c (set_register_cache): Invalidate regcaches before
8621         changing the register cache layout.
8622         (regcache_invalidate_one): Allow a NULL regcache.
8623         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
8624         regcaches before changing the register cache layout or the target
8625         regsets.
8626
8627 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
8628
8629         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
8630         variable warning on Linux/x86-64.
8631
8632 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8633
8634         GDBserver disconnected tracing support.
8635
8636         * linux-low.c (linux_remove_process): Delete.
8637         (add_lwp): Don't set last_resume_kind here.
8638         (linux_kill): Use `mourn'.
8639         (linux_detach): Use `thread_db_detach', and `mourn'.
8640         (linux_mourn): New.
8641         (linux_attach_lwp_1): Adjust comment.
8642         (linux_attach): last_resume_kind moved the thread_info; adjust.
8643         (status_pending_p_callback): Adjust.
8644         (linux_wait_for_event_1): Adjust.
8645         (count_events_callback, select_singlestep_lwp_callback)
8646         (select_event_lwp_callback, cancel_breakpoints_callback)
8647         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
8648         (proceed_one_lwp): Adjust.
8649         (linux_async): Add debug output.
8650         (linux_thread_stopped): New.
8651         (linux_pause_all): New.
8652         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
8653         linux_pause_all.
8654         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
8655         (thread_db_free): Delete declaration.
8656         (thread_db_detach, thread_db_mourn): Declare.
8657         * thread-db.c (thread_db_init): Use thread_db_mourn.
8658         (thread_db_free): Delete, split in two.
8659         (disable_thread_event_reporting): New.
8660         (thread_db_detach): New.
8661         (thread_db_mourn): New.
8662
8663         * server.h (struct thread_info) <last_resume_kind>: New field.
8664         <attached>: Add comment.
8665         <gdb_detached>: New field.
8666         (handler_func): Change return type to int.
8667         (handle_serial_event, handle_target_event): Ditto.
8668         (gdb_connected): Declare.
8669         (tracing): Delete.
8670         (disconnected_tracing): Declare.
8671         (stop_tracing): Declare.
8672
8673         * server.c (handle_query) <qSupported>: Report support for
8674         disconnected tracing.
8675         (queue_stop_reply_callback): Account for running threads.
8676         (gdb_wants_thread_stopped): New.
8677         (gdb_wants_all_threads_stopped): New.
8678         (gdb_reattached_process): New.
8679         (handle_status): Clear the `gdb_detached' flag of all processes.
8680         In all-stop, stop all threads.
8681         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
8682         (process_serial_event): If the remote connection breaks, or if an
8683         exit was forced with "monitor exit", force an event loop exit.
8684         Handle disconnected tracing on detach.
8685         (handle_serial_event): Adjust.
8686         (handle_target_event): If GDB isn't connected, forward events back
8687         to the inferior, unless the last process exited, in which case,
8688         exit gdbserver.  Adjust interface.
8689
8690         * remote-utils.c (remote_open): Don't block in accept.  Instead
8691         register an event loop source on the listen socket file
8692         descriptor.  Refactor bits into ...
8693         (listen_desc): ... this new global.
8694         (gdb_connected): ... this new function.
8695         (enable_async_notification): ... this new function.
8696         (handle_accept_event): ... this new function.
8697         (remote_close): Clear remote_desc.
8698
8699         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
8700
8701         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
8702         New fields.
8703         (mourn_inferior): Define.
8704         (target_process_qsupported): Avoid the dangling else problem.
8705         (thread_stopped): Define.
8706         (pause_all): Define.
8707         (target_waitstatus_to_string): Declare.
8708         * target.c (target_waitstatus_to_string): New.
8709
8710         * tracepoint.c (tracing): Make extern.
8711         (disconnected_tracing): New.
8712         (stop_tracing): Make extern.  Handle tracing stops due to GDB
8713         disconnecting.
8714         (cmd_qtdisconnected): New.
8715         (cmd_qtstatus): Report disconnected tracing status in trace reply.
8716         (handle_tracepoint_general_set): Handle QTDisconnected.
8717
8718         * event-loop.c (event_handler_func): Change return type to int.
8719         (process_event): Bail out if the event handler wants the event
8720         loop to stop.
8721         (handle_file_event): Ditto.
8722         (start_event_loop): Bail out if the event handler wants the event
8723         loop to stop.
8724
8725         * nto-low.c (nto_target_ops): Adjust.
8726         * spu-low.c (spu_wait): Don't remove the process here.
8727         (spu_target_ops): Adjust.
8728         * win32-low.c (win32_wait): Don't remove the process here.
8729         (win32_target_ops): Adjust.
8730
8731 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8732
8733         * regcache.c (realloc_register_cache): Invalidate inferior's
8734         regcache before recreating it.
8735
8736 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
8737
8738         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
8739
8740 2010-04-09  Stan Shebs  <stan@codesourcery.com>
8741             Pedro Alves  <pedro@codesourcery.com>
8742
8743         * server.h (LONGEST): New.
8744         (struct thread_info) <while_stepping>: New field.
8745         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
8746         Declare.
8747         (initialize_tracepoint, handle_tracepoint_general_set)
8748         (handle_tracepoint_query, tracepoint_finished_step)
8749         (tracepoint_was_hit, release_while_stepping_state_list):
8750         (current_traceframe): Declare.
8751         * server.c (handle_general_set): Handle tracepoint packets.
8752         (read_memory): New.
8753         (write_memory): New.
8754         (handle_search_memory_1): Use read_memory.
8755         (handle_query): Report support for conditional tracepoints, trace
8756         state variables, and tracepoint sources.  Handle tracepoint
8757         queries.
8758         (main): Initialize the tracepoints module.
8759         (process_serial_event): Handle traceframe reads/writes.
8760
8761         * linux-low.c (handle_tracepoints): New.
8762         (linux_wait_1): Call it.
8763         (linux_resume_one_lwp): Handle while-stepping.
8764         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
8765         (linux_target_ops): Install them.
8766         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
8767         New field.
8768         * linux-x86-low.c (x86_supports_tracepoints): New.
8769         (the_low_target). Install it.
8770
8771         * mem-break.h (delete_breakpoint): Declare.
8772         * mem-break.c (delete_breakpoint): Make external.
8773
8774         * target.h (struct target_ops): Add `supports_tracepoints',
8775         `read_pc', and `write_pc' fields.
8776         (target_supports_tracepoints): Define.
8777         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
8778         (phex_nz): New.
8779
8780         * regcache.h (struct regcache) <registers_owned>: New field.
8781         (init_register_cache, regcache_cpy): Declare.
8782         (regcache_read_pc, regcache_write_pc): Declare.
8783         (register_cache_size): Declare.
8784         (supply_regblock): Declare.
8785         * regcache.c (init_register_cache): New.
8786         (new_register_cache): Use it.
8787         (regcache_cpy): New.
8788         (register_cache_size): New.
8789         (supply_regblock): New.
8790         (regcache_read_pc, regcache_write_pc): New.
8791
8792         * tracepoint.c: New.
8793
8794         * Makefile.in (OBS): Add tracepoint.o.
8795         (tracepoint.o): New rule.
8796
8797 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
8798
8799         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
8800         (i386-mmx.o): New.
8801         (i386-mmx.c): Likewise.
8802         (i386-mmx-linux.o): Likewise.
8803         (i386-mmx-linux.c): Likewise.
8804
8805         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
8806         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
8807         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
8808         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
8809
8810         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
8811         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
8812         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
8813
8814 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
8815
8816         * Makefile.in (clean): Updated.
8817         (i386-avx.o): New.
8818         (i386-avx.c): Likewise.
8819         (i386-avx-linux.o): Likewise.
8820         (i386-avx-linux.c): Likewise.
8821         (amd64-avx.o): Likewise.
8822         (amd64-avx.c): Likewise.
8823         (amd64-avx-linux.o): Likewise.
8824         (amd64-avx-linux.c): Likewise.
8825
8826         * configure.srv (srv_i386_regobj): Add i386-avx.o.
8827         (srv_i386_linux_regobj): Add i386-avx-linux.o.
8828         (srv_amd64_regobj): Add amd64-avx.o.
8829         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
8830         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
8831         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
8832         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
8833         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
8834         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
8835         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
8836
8837         * i387-fp.c: Include "i386-xstate.h".
8838         (i387_xsave): New.
8839         (i387_cache_to_xsave): Likewise.
8840         (i387_xsave_to_cache): Likewise.
8841         (x86_xcr0): Likewise.
8842
8843         * i387-fp.h (i387_cache_to_xsave): Likewise.
8844         (i387_xsave_to_cache): Likewise.
8845         (x86_xcr0): Likewise.
8846
8847         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
8848         * linux-crisv32-low.c (target_regsets): Likewise.
8849         * linux-m68k-low.c (target_regsets): Likewise.
8850         * linux-mips-low.c (target_regsets): Likewise.
8851         * linux-ppc-low.c (target_regsets): Likewise.
8852         * linux-s390-low.c (target_regsets): Likewise.
8853         * linux-sh-low.c (target_regsets): Likewise.
8854         * linux-sparc-low.c (target_regsets): Likewise.
8855         * linux-xtensa-low.c (target_regsets): Likewise.
8856
8857         * linux-low.c: Include <sys/uio.h>.
8858         (regsets_fetch_inferior_registers): Support nt_type.
8859         (regsets_store_inferior_registers): Likewise.
8860         (linux_process_qsupported): New.
8861         (linux_target_ops): Add linux_process_qsupported.
8862
8863         * linux-low.h (regset_info): Add nt_type.
8864         (linux_target_ops): Add process_qsupported.
8865
8866         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
8867         and <sys/uio.h>.
8868         (init_registers_i386_avx_linux): New.
8869         (init_registers_amd64_avx_linux): Likewise.
8870         (xmltarget_i386_linux_no_xml): Likewise.
8871         (xmltarget_amd64_linux_no_xml): Likewise.
8872         (PTRACE_GETREGSET): Likewise.
8873         (PTRACE_SETREGSET): Likewise.
8874         (x86_fill_xstateregset): Likewise.
8875         (x86_store_xstateregset): Likewise.
8876         (use_xml): Likewise.
8877         (x86_linux_update_xmltarget): Likewise.
8878         (x86_linux_process_qsupported): Likewise.
8879         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
8880         (x86_arch_setup): Don't call init_registers_amd64_linux nor
8881         init_registers_i386_linux here.  Call
8882         x86_linux_update_xmltarget.
8883         (the_low_target): Add x86_linux_process_qsupported.
8884
8885         * server.c (handle_query): Call target_process_qsupported.
8886
8887         * target.h (target_ops): Add process_qsupported.
8888         (target_process_qsupported): New.
8889
8890 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
8891
8892         * inferiors.c (add_thread): Set last_status kind to
8893         TARGET_WAITKIND_IGNORE.
8894         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
8895         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
8896         (linux_wait_1): Move `thread' local definition to block that uses
8897         it.  Don't NULL initialize `event_child'.
8898         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
8899         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
8900         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
8901
8902 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8903
8904         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
8905         an extended waitstatus, or by a watchpoint.
8906         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
8907         thread was stepping or has been stopped by a watchpoint.
8908
8909 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8910
8911         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
8912         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
8913         of another, then delete the previous, and validate all
8914         breakpoints.
8915         (validate_inserted_breakpoint): New.
8916         (delete_disabled_breakpoints): New.
8917         (validate_breakpoints): New.
8918         (check_mem_read): Validate breakpoints before trusting their
8919         shadow.  Delete disabled breakpoints.
8920         (check_mem_write): Validate breakpoints before trusting they
8921         should be inserted.  Delete disabled breakpoints.
8922         * mem-break.h (validate_breakpoints):
8923         * server.c (handle_query): Validate breakpoints when we see a
8924         qSymbol query.
8925
8926 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8927
8928         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
8929         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
8930         if we could tell there's a GDB breakpoint at stop_pc.
8931         (need_step_over_p): Don't do a step over if we find a GDB
8932         breakpoint at the resume PC.
8933
8934         * mem-break.c (struct raw_breakpoint): New.
8935         (enum bkpt_type): New type `gdb_breakpoint'.
8936         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
8937         fields.  New field `raw'.
8938         (find_raw_breakpoint_at): New.
8939         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
8940         breakpoint instead.
8941         (set_breakpoint_at): Adjust.
8942         (delete_raw_breakpoint): New.
8943         (release_breakpoint): New.
8944         (delete_breakpoint): Rename to...
8945         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
8946         release_breakpoint.  Return ENOENT.
8947         (delete_breakpoint): Reimplement.
8948         (find_breakpoint_at): Delete.
8949         (find_gdb_breakpoint_at): New.
8950         (delete_breakpoint_at): Delete.
8951         (set_gdb_breakpoint_at): New.
8952         (delete_gdb_breakpoint_at): New.
8953         (gdb_breakpoint_here): New.
8954         (set_reinsert_breakpoint): Use release_breakpoint.
8955         (uninsert_breakpoint): Rename to ...
8956         (uninsert_raw_breakpoint): ... this.
8957         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
8958         (reinsert_raw_breakpoint): Change parameter type to
8959         raw_breakpoint.
8960         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
8961         instead.
8962         (check_breakpoints): Adjust.  Use release_breakpoint.
8963         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
8964         (breakpoint_inserted_here): Ditto.
8965         (check_mem_read): Adjust to iterate over raw breakpoints instead.
8966         Don't trust the breakpoint's shadow if it is not inserted.
8967         (check_mem_write): Adjust to iterate over raw breakpoints instead.
8968         (delete_all_breakpoints): Adjust.
8969         (free_all_breakpoints): Mark all breakpoints as uninserted, and
8970         use delete_breakpoint_1.
8971
8972         * mem-break.h (breakpoints_supported): Delete declaration.
8973         (set_gdb_breakpoint_at): Declare.
8974         (gdb_breakpoint_here): Declare.
8975         (delete_breakpoint_at): Delete.
8976         (delete_gdb_breakpoint_at): Declare.
8977
8978         * server.h (struct raw_breakpoint): Forward declare.
8979         (struct process_info): New field `raw_breakpoints'.
8980
8981         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
8982         breakpoints.
8983
8984 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8985
8986         * linux-low.c (status_pending_p_callback): Fix comment.
8987         (linux_wait_for_event_1): Move most of the internal breakpoint
8988         handling from here...
8989         (linux_wait_1): ... to here.
8990         (count_events_callback): New.
8991         (select_singlestep_lwp_callback): New.
8992         (select_event_lwp_callback): New.
8993         (cancel_breakpoints_callback): New.
8994         (select_event_lwp): New.
8995         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
8996         priority to all LWPs that have had events that should be reported
8997         to the client.  Cancel breakpoints when about to reporting the
8998         event to the client, not while stopping lwps.  No longer cancel
8999         finished single-steps here.
9000         (cancel_finished_single_step): Delete.
9001         (cancel_finished_single_steps): Delete.
9002
9003 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9004
9005         * mem-break.c (enum bkpt_type): New.
9006         (struct breakpoint): New field `type'.
9007         (set_breakpoint_at): Change return type to struct breakpoint
9008         pointer.  Set type to `other_breakpoint' by default.
9009         (delete_breakpoint): Rewrite, supporting more than one breakpoint
9010         in the breakpoint list.
9011         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
9012         (reinsert_breakpoint): Rename to ...
9013         (reinsert_raw_breakpoint): ... this.
9014         (reinsert_breakpoints_at): Adjust.
9015         * mem-break.h (struct breakpoint): Declare.
9016         (set_breakpoint_at): Change return type to struct breakpoint
9017         pointer.
9018
9019 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9020
9021         * server.c (handle_query): Assign, not compare.
9022
9023 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
9024
9025         Teach linux gdbserver to step-over-breakpoints.
9026
9027         * linux-low.c (can_hardware_single_step): New.
9028         (supports_breakpoints): New.
9029         (handle_extended_wait): If stopping threads, read the stop pc of
9030         the new cloned LWP.
9031         (get_pc): New.
9032         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
9033         low target doesn't support retrieving the PC.
9034         (add_lwp): Set last_resume_kind to resume_continue.
9035         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
9036         (linux_attach): Don't clear stop_expected.  Set the lwp's
9037         last_resume_kind to resume_stop.
9038         (linux_detach_one_lwp): Don't check for removed breakpoints.
9039         (check_removed_breakpoint): Delete.
9040         (status_pending_p): Rename to ...
9041         (status_pending_p_callback): ... this.  Don't check for removed
9042         breakpoints.  Don't consider threads that are stopped from GDB's
9043         perspective.
9044         (linux_wait_for_lwp): Always read the stop_pc here.
9045         (cancel_breakpoint): New.
9046         (step_over_bkpt): New global.
9047         (linux_wait_for_event_1): Implement stepping over breakpoints.
9048         (gdb_wants_lwp_stopped): New.
9049         (gdb_wants_all_stopped): New.
9050         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
9051         single-step traps here.  Store the thread's last reported target
9052         wait status.
9053         (send_sigstop): Don't clear stop_expected.  Always set it,
9054         instead.
9055         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
9056         (cancel_finished_single_step): New.
9057         (cancel_finished_single_steps): New.
9058         (wait_for_sigstop): Don't cancel finished single-step traps here.
9059         (linux_resume_one_lwp): Don't check for removed breakpoints.
9060         Don't set `step' on non-hardware step archs.
9061         (linux_set_resume_request): Ignore resume_stop requests if already
9062         stopping or stopped.  Set the lwp's last_resume_kind.
9063         (resume_status_pending_p): Don't check for removed breakpoints.
9064         (need_step_over_p): New.
9065         (start_step_over): New.
9066         (finish_step_over): New.
9067         (linux_resume_one_thread): Always queue a sigstop for resume_stop
9068         requests.  Clear the thread's last reported target waitstatus.
9069         Don't use the `suspended' flag.  Don't consider pending breakpoints.
9070         (linux_resume): Start a step-over if necessary.
9071         (proceed_one_lwp): New.
9072         (proceed_all_lwps): New.
9073         (unstop_all_lwps): New.
9074         * linux-low.h (struct lwp_info): Rewrite comment for the
9075         `suspended' flag.  Add the `stop_pc' field.  Delete the
9076         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
9077         Add `'last_resume_kind' and `need_step_over' fields.
9078         * inferiors.c (struct thread_info): Delete, moved elsewhere.
9079         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
9080         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
9081         (set_raw_breakpoint_at): New.
9082         (set_breakpoint_at): Rewrite to use it.
9083         (reinsert_breakpoint_handler): Delete.
9084         (set_reinsert_breakpoint): New.
9085         (reinsert_breakpoint_by_bp): Delete.
9086         (delete_reinsert_breakpoints): New.
9087         (uninsert_breakpoint): Rewrite.
9088         (uninsert_breakpoints_at): New.
9089         (reinsert_breakpoint): Rewrite.
9090         (reinsert_breakpoints_at): New.
9091         (check_breakpoints): Rewrite.
9092         (breakpoint_here): New.
9093         (breakpoint_inserted_here): New.
9094         (check_mem_read): Adjust.
9095         * mem-break.h (breakpoints_supported, breakpoint_here)
9096         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
9097         (reinsert_breakpoint_by_bp): Delete declaration.
9098         (delete_reinsert_breakpoints): Declare.
9099         (reinsert_breakpoint): Delete declaration.
9100         (reinsert_breakpoints_at): Declare.
9101         (uninsert_breakpoint): Delete declaration.
9102         (uninsert_breakpoints_at): Declare.
9103         (check_breakpoints): Adjust prototype.
9104         * server.h: Adjust include order.
9105         (struct thread_info): Declare here.  Add a `last_status' field.
9106
9107 2010-03-23  Michael Snyder  <msnyder@vmware.com>
9108
9109         * server.c (crc32): New function.
9110         (handle_query): Add handling for 'qCRC:' request.
9111
9112 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
9113
9114         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
9115         lwp had been stopped by a watchpoint.
9116
9117 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
9118
9119         * server.h (internal_error): Declare.
9120         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
9121         * utils.c (internal_error): New function.
9122
9123 2010-03-15  Andreas Schwab  <schwab@redhat.com>
9124
9125         * configure.srv: Fix typo setting srv_regobj.
9126
9127 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
9128
9129         * linux-low.c (fetch_register): Avoid passing a non string literal
9130         format to `error'.
9131         (usr_store_inferior_registers): Ditto.
9132
9133 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9134
9135         * linux-low.c (linux_write_memory): Bail out early if peeking
9136         memory failed.
9137
9138 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
9139
9140         * linux-low.h (struct lwp_info): New fields
9141         `stopped_by_watchpoint' and `stopped_data_address'.
9142         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
9143         here, and cache them in the lwp object.
9144         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
9145         directly.
9146         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
9147         field.
9148         (linux_stopped_by_watchpoint): Rewrite.
9149         (linux_stopped_data_address): Rewrite.
9150
9151 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
9152
9153         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
9154         switching the current inferior, not before.
9155
9156 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
9157
9158         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
9159         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
9160         i386-linux.c and amd64-linux.c.
9161         (reg-i386.o): Removed.
9162         (reg-i386.c): Likewise.
9163         (reg-i386-linux.o): Likewise.
9164         (reg-i386-linux.c): Likewise.
9165         (reg-x86-64.o): Likewise.
9166         (reg-x86-64.c): Likewise.
9167         (reg-x86-64-linux.o): Likewise.
9168         (reg-x86-64-linux.c): Likewise.
9169         (i386.o): New.
9170         (i386.c): Likewise.
9171         (i386-linux.o): Likewise.
9172         (i386-linux.c): Likewise.
9173         (amd64.o): Likewise.
9174         (amd64.c): Likewise.
9175         (amd64-linux.o): Likewise.
9176         (amd64-linux.c): Likewise.
9177
9178         * configure.srv (srv_i386_regobj): New.
9179         (srv_i386_linux_regobj): Likewise.
9180         (srv_amd64_regobj): Likewise.
9181         (srv_amd64_linux_regobj): Likewise.
9182         (srv_i386_32bit_xmlfiles): Likewise.
9183         (srv_i386_64bit_xmlfiles): Likewise.
9184         (srv_i386_xmlfiles): Likewise.
9185         (srv_amd64_xmlfiles): Likewise.
9186         (srv_i386_linux_xmlfiles): Likewise.
9187         (srv_amd64_linux_xmlfiles): Likewise.
9188         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
9189         srv_xmlfiles to $srv_i386_xmlfiles.
9190         (i[34567]86-*-mingw32ce*): Likewise.
9191         (i[34567]86-*-mingw*): Likewise.
9192         (i[34567]86-*-nto*): Likewise.
9193         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
9194         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
9195         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
9196         (x86_64-*-linux*): Likewise.
9197
9198         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
9199         (init_registers_amd64_linux): New.
9200         (x86_arch_setup): Replace init_registers_x86_64_linux with
9201         init_registers_amd64_linux.
9202
9203 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
9204
9205         * configure.ac: Check for libdl.  If it is not available link against
9206         static libthread_db.
9207         * configure: Regenerate.
9208
9209 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
9210
9211         PR9605
9212
9213         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
9214         handing a read watchpoint.
9215         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
9216
9217 2010-02-12  Doug Evans  <dje@google.com>
9218
9219         * linux-low.c (linux_supports_tracefork_flag): Document.
9220         (linux_look_up_symbols): Add comment.
9221
9222 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
9223
9224         * regcache.c (supply_register): Clear regcache if buf is NULL.
9225
9226 2010-02-02  Nicolas Roche  <roche@sourceware.org>
9227             Joel Brobecker  <brobecker@adacore.com>
9228
9229         * inferiors.c (find_inferior): Add function documentation.
9230         (unloaded_dll): Handle the case where the unloaded dll has not
9231         been previously registered in the dll list.
9232
9233 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
9234
9235         * linux-arm-low.c (thumb_breakpoint_len): Delete.
9236         (thumb2_breakpoint): New.
9237         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
9238
9239 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9240
9241         * linux-low.c (get_stop_pc): Check for SIGTRAP.
9242         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
9243         breakpoints.
9244
9245 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9246
9247         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
9248
9249 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
9250
9251         * linux-s390-low.c (s390_collect_ptrace_register)
9252         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
9253
9254 2010-01-21  Doug Evans  <dje@google.com>
9255
9256         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
9257         (PTRACE_ARG4_TYPE): New macro.
9258         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
9259         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
9260         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
9261         (usr_store_inferior_registers): Ditto.
9262         (linux_read_memory, linux_write_memory): Ditto.
9263         (linux_test_for_tracefork): Ditto.
9264
9265         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
9266         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
9267
9268 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9269
9270         * proc-service.c (ps_lgetregs): Don't refetch registers from the
9271         target.
9272
9273 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9274
9275         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
9276         prototype to take a regcache.  Adjust.
9277
9278 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
9279
9280         * regcache.h (struct thread_info): Forward declare.
9281         (struct regcache): New.
9282         (new_register_cache): Adjust prototype.
9283         (get_thread_regcache): Declare.
9284         (free_register_cache): Adjust prototype.
9285         (registers_to_string, registers_from_string): Ditto.
9286         (supply_register, supply_register_by_name, collect_register)
9287         (collect_register_as_string, collect_register_by_name): Ditto.
9288         * regcache.c (struct inferior_regcache_data): Delete.
9289         (get_regcache): Rename to ...
9290         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
9291         fetching registers.
9292         (regcache_invalidate_one): Adjust.
9293         (regcache_invalidate): Fix prototype.
9294         (new_register_cache): Return the new register cache.
9295         (free_register_cache): Change prototype.
9296         (realloc_register_cache): Adjust.
9297         (registers_to_string): Change prototype to take a regcache.  Adjust.
9298         (registers_from_string): Ditto.
9299         (register_data): Ditto.
9300         (supply_register): Ditto.
9301         (supply_register_by_name): Ditto.
9302         (collect_register): Ditto.
9303         (collect_register_as_string): Ditto.
9304         (collect_register_by_name): Ditto.
9305         * server.c (process_serial_event): Adjust.
9306         * linux-low.h (regset_fill_func, regset_store_func): Change
9307         prototype.
9308         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
9309         Change prototype.
9310         * linux-low.c (get_stop_pc): Adjust.
9311         (check_removed_breakpoint): Adjust.
9312         (linux_wait_for_event): Adjust.
9313         (linux_resume_one_lwp): Adjust.
9314         (fetch_register): Add regcache parameter.  Adjust.
9315         (usr_store_inferior_registers): Ditto.
9316         (regsets_fetch_inferior_registers): Ditto.
9317         (regsets_store_inferior_registers): Ditto.
9318         (linux_fetch_registers, linux_store_registers): Ditto.
9319         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
9320         regcache.  Adjust.
9321         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
9322         Ditto.
9323         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
9324         prototype to take a regcache.
9325         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
9326         * remote-utils.c (convert_ascii_to_int, outreg)
9327         (prepare_resume_reply): Change prototype to take a regcache.
9328         Adjust.
9329         * target.h (struct target_ops) <fetch_registers, store_registers>:
9330         Change prototype to take a regcache.
9331         (fetch_inferior_registers, store_inferior_registers): Change
9332         prototype to take a regcache.  Adjust.
9333         * proc-service.c (ps_lgetregs): Adjust.
9334         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
9335         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
9336         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
9337         take a regcache.  Adjust.
9338         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
9339         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
9340         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
9341         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
9342         * linux-cris-low.c (cris_get_pc, cris_set_pc)
9343         (cris_cannot_fetch_register):
9344         (cris_breakpoint_at): Change prototype to take a regcache.
9345         Adjust.
9346         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
9347         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
9348         to take a regcache.  Adjust.
9349         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
9350         Adjust.
9351         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
9352         take a regcache.  Adjust.
9353         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
9354         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
9355         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
9356         * linux-mips-low.c (mips_get_pc):
9357         (mips_set_pc): Change prototype to take a regcache.  Adjust.
9358         (mips_reinsert_addr): Adjust.
9359         (mips_collect_register): Change prototype to take a regcache.
9360         Adjust.
9361         (mips_supply_register):
9362         (mips_collect_register_32bit, mips_supply_register_32bit)
9363         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9364         (mips_store_fpregset): Ditto.
9365         * linux-ppc-low.c (ppc_supply_ptrace_register)
9366         (ppc_supply_ptrace_register): Ditto.
9367         (parse_spufs_run): Adjust.
9368         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
9369         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
9370         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
9371         take a regcache.  Adjust.
9372         * linux-s390-low.c (s390_collect_ptrace_register)
9373         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
9374         (s390_set_pc): Change prototype to take a regcache.  Adjust.
9375         (s390_arch_setup): Adjust.
9376         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
9377         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
9378         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
9379         (sparc_fill_gregset, sparc_store_gregset_from_stack)
9380         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
9381         regcache.  Adjust.
9382         (sparc_breakpoint_at): Adjust.
9383         * linux-xtensa-low.c (xtensa_fill_gregset):
9384         (xtensa_store_gregset):
9385         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
9386         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
9387         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
9388         prototype to take a regcache.  Adjust.
9389         * win32-arm-low.c (arm_fetch_inferior_register)
9390         (arm_store_inferior_register): Change prototype to take a
9391         regcache.  Adjust.
9392         * win32-i386-low.c (i386_fetch_inferior_register)
9393         (i386_store_inferior_register): Change prototype to take a
9394         regcache.  Adjust.
9395         * win32-low.c (child_fetch_inferior_registers)
9396         (child_store_inferior_registers): Change prototype to take a
9397         regcache.  Adjust.
9398         (win32_wait): Adjust.
9399         (win32_fetch_inferior_registers): Change prototype to take a
9400         regcache.  Adjust.
9401         (win32_store_inferior_registers): Adjust.
9402         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
9403         store_inferior_register>: Change prototype to take a regcache.
9404
9405 2010-01-20  Doug Evans  <dje@google.com>
9406
9407         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
9408         #ifdef.
9409         (linux_wait_for_event1, linux_init_signals): Ditto.
9410         (W_STOPCODE): Provide definition if missing.
9411
9412 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
9413
9414         * linux-low.c (linux_core_of_thread): New.
9415         (compare_ints, show_process, list_threads): New.
9416         (linux_qxfer_osdata): Report threads and cores.
9417         (linux_target_op): Register linux_core_of_thread.
9418         * remote-utils.c (prepare_resume_reply): Report the core.
9419         (buffer_xml_printf): Support %d specifier.
9420         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
9421         New.
9422         (handle_query): Handle qXfer:threads.  Announce availability
9423         thereof.
9424         * target.h (struct target_ops): New field core_of_thread.
9425
9426 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
9427
9428         * Makefile.in (clean): Remove new generated files.
9429         (reg-s390.o, reg-s390.c): Remove rules.
9430         (reg-s390x.o, reg-s390x.c): Likewise.
9431         (s390-linux32.o, s390-linux32.c): Add rules.
9432         (s390-linux64.o, s390-linux64.c): Likewise.
9433         (s390x-linux64.o, s390x-linux64.c): Likewise.
9434         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
9435         * linux-s390-low.c: Include <elf.h>.
9436         (HWCAP_S390_HIGH_GPRS): Define if undefined.
9437         (init_registers_s390): Remove prototype.
9438         (init_registers_s390x): Likewise.
9439         (init_registers_s390_linux32): Add prototype.
9440         (init_registers_s390_linux64): Likewise.
9441         (init_registers_s390x_linux64): Likewise.
9442         (s390_num_regs_3264): New define.
9443         (s390_regmap_3264): New global variable.
9444         (s390_cannot_fetch_register): Remove obsolete check.
9445         (s390_cannot_store_register): Likewise.
9446         (s390_collect_ptrace_register): Handle upper/lower register halves.
9447         (s390_supply_ptrace_register): Likewise.
9448         (s390_fill_gregset): Update to register number changes.
9449         (s390_get_hwcap): New routine.
9450         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
9451         Install appropriate regmap and register set.
9452
9453 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
9454
9455         * server.c (gdbserver_version): Update copyright year to 2010.
9456         * gdbreplay.c (gdbreplay_version): Likewise.
9457
9458 2009-12-28  Doug Evans  <dje@google.com>
9459
9460         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
9461         elf/external.h.  Include <elf.h> instead but only if necessary.
9462
9463 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
9464
9465         * linux-low.c (linux_remove_process): Remove `detaching'
9466         parameter.  Don't release/detach from thread_db here.
9467         (linux_kill): Release/detach from thread_db here, ...
9468         (linux_detach): ... and here, before actually detaching.
9469         (linux_wait_1): ... and here, when a process exits.
9470         * thread-db.c (any_thread_of): New.
9471         (thread_db_free): Switch the current inferior to a thread of the
9472         passed in process.
9473
9474 2009-12-21  Doug Evans  <dje@google.com>
9475
9476         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
9477
9478         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
9479         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
9480         warning ifndef __NR_tkill.  Move setting of errno there too.
9481         Delete unnecessary resetting of errno after syscall.
9482         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
9483
9484         * configure.ac: Check for dladdr.
9485         * config.in: Regenerate.
9486         * configure: Regenerate.
9487         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
9488         (try_thread_db_load): Update.
9489
9490         * linux-low.c (my_waitpid): Delete unnecessary prototype.
9491
9492 2009-12-18  Doug Evans  <dje@google.com>
9493
9494         * event-loop.c: Include unistd.h if it exists.
9495
9496         * linux-low.c (my_waitpid): Move definition away from being in
9497         between linux_tracefork_child/linux_test_for_tracefork.
9498
9499         * gdb_proc_service.h (psaddr_t): Fix type.
9500         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
9501         signature to match glibc.
9502
9503 2009-12-16  Doug Evans  <dje@google.com>
9504
9505         * linux-low.c (linux_read_memory): Fix argument to read.
9506
9507 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9508
9509         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
9510         events, don't leave current_inferior pointing at null.
9511
9512 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9513
9514         * win32-low.c (LOG): Delete.
9515         (OUTMSG): Output to stderr.
9516         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
9517         on compile time LOG macro.
9518         (win32_wait): Fix debug output.
9519
9520 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9521
9522         * win32-low.c (win32_add_one_solib): If the dll name is
9523         "ntdll.dll", prepend the system directory to the dll path.
9524
9525 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
9526
9527         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
9528
9529 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
9530             Vladimir Prus  <vladimir@codesourcery.com>
9531
9532         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
9533         * configure.ac: Check for __mcoldfire__ and set
9534         gdb_cv_m68k_is_coldfire.
9535         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
9536         reg-cf.o and reg-m68k.o.
9537         * configure: Regenerated.
9538
9539 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
9540
9541         * linux-low.c (linux_remove_process): Add `detaching' parameter.
9542         Pass it to thread_db_free.
9543         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
9544         proper `detaching' argument to linux_remove_process.
9545         * linux-low.h (thread_db_free): Add `detaching' parameter.
9546         * thread-db.c (thread_db_init): Pass false as `detaching' argument
9547         to thread_db_free.
9548         (thread_db_free): Add `detaching' parameter.  Only
9549         call td_ta_clear_event if detaching from process.
9550
9551 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
9552
9553         * thread-db.c (thread_db_free): Fix typo.
9554
9555 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
9556
9557         PR gdb/10838
9558         * thread-db.c (thread_db_free): Call td_ta_clear_event.
9559
9560 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
9561
9562         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
9563         with an i686 compiler.
9564         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
9565         needed.
9566         * configure: Rebuilt.
9567
9568 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
9569
9570         PR gdb/10783
9571
9572         * server.c (handle_search_memory_1): Correct read_addr initialization
9573         in loop for searching subsequent chunks.
9574
9575 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
9576
9577         * configure.ac: New --with-libthread-db option.
9578         * thread-db.c: Allow direct dependence on libthread_db.
9579         (thread_db_free): Adjust.
9580         * config.in: Regenerate.
9581         * configure: Likewise.
9582
9583 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
9584
9585         PR gdb/10757
9586         * thread-db.c (attach_thread): New function.
9587         (maybe_attach_thread): Return success/failure.
9588         (find_new_threads_callback): Adjust.
9589         (thread_db_find_new_threads): Loop until no new threads.
9590
9591 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
9592
9593         * proc-service.c (ps_lgetregs): Formatting.
9594
9595 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
9596
9597         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
9598         * configure.ac: Adjust.
9599         * linux-low.h (struct process_info_private): Move members to struct
9600         thread_db.
9601         (thread_db_free, thread_db_handle_monitor_command): New prototype.
9602         * linux-low.c (linux_remove_process): Adjust.
9603         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
9604         * server.c (handle_query): Move code ...
9605         (handle_monitor_command): ... here. New function.
9606         * target.h (struct target_ops): New member.
9607         * thread-db.c (struct thread_db): New.
9608         (libthread_db_search_path): New variable.
9609         (thread_db_create_event, thread_db_enable_reporting)
9610         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
9611         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
9612         (try_thread_db_load_1, dladdr_to_soname): New functions.
9613         (try_thread_db_load, thread_db_load_search): New functions.
9614         (thread_db_init): Search for libthread_db.
9615         (thread_db_free): New function.
9616         (thread_db_handle_monitor_command): Likewise.
9617         * config.in: Regenerate.
9618         * configure: Regenerate.
9619
9620 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
9621
9622         * spu-low.c (spu_kill): Wait for inferior to terminate.
9623         Call clear_inferiors.
9624         (spu_detach): Call clear_inferiors.
9625
9626 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9627
9628         * aclocal.m4: Regenerate.
9629         * config.in: Likewise.
9630         * configure: Likewise.
9631
9632 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9633
9634         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
9635         (parse_spufs_run): New function.
9636         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
9637         (ppc_breakpoint_at): Handle SPU breakpoints.
9638
9639 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9640
9641         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
9642         (SPUFS_MAGIC): Define.
9643         (spu_enumerate_spu_ids): New function.
9644         (linux_qxfer_spu): New function.
9645         (linux_target_ops): Install linux_qxfer_spu.
9646
9647 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9648
9649         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
9650         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
9651         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
9652         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
9653         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
9654         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
9655         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
9656         (init_registers_powerpc_cell32l): Add prototype.
9657         (init_registers_powerpc_cell64l): Likewise.
9658         (ppc_arch_setup): Detect Cell/B.E. architecture.
9659
9660 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9661
9662         * Makefile.in (datarootdir): New variable.
9663
9664 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9665
9666         * linux-low.c (linux_write_memory): Update debugging output.
9667         * Makefile.in (clean): Add new descriptions.
9668         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
9669         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
9670         * configure.srv: Add new files for arm*-*-linux*.
9671         * linux-arm-low.c: Add new declarations.
9672         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
9673         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
9674         (HWCAP_VFPv3D16): New.
9675         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
9676         instead of __IWMMXT__.
9677         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
9678         (arm_arch_setup): New.
9679         (target_regsets): Remove #ifdef.  Add VFP regset.
9680         (the_low_target): Use arm_arch_setup.
9681
9682 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9683
9684         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
9685         the main thread again.
9686
9687 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
9688
9689         Adding Neutrino gdbserver.
9690         * configure: Regenerated.
9691         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
9692         * configure.srv (i[34567]86-*-nto*): New target.
9693         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
9694         * remote-utils.c [__QNX__]: Include sys/iomgr.h
9695         (nto_comctrl) [__QNX__]: New function.
9696         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
9697
9698 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
9699
9700         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
9701         srv_tgtobj.
9702
9703 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
9704             Pedro Alves  <pedro@codesourcery.com>
9705
9706         * win32-i386-low.c (i386_get_thread_context): Handle systems that
9707         don't support CONTEXT_EXTENDED_REGISTERS.
9708         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
9709         (the_low_target): Install them.
9710         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
9711         failing with ERROR_PIPE_NOT_CONNECTED.
9712
9713 2009-06-30  Doug Evans  <dje@google.com>
9714             Pierre Muller  <muller@ics.u-strasbg.fr>
9715
9716         Add h/w watchpoint support to x86-linux, win32-i386.
9717         * Makefile.in (SFILES): Add i386-low.c
9718         (i386_low_h): Define.
9719         (i386-low.o): Add dependencies.
9720         (linux-x86-low.o): Add i386-low.h dependency.
9721         (win32-i386-low.o): Ditto.
9722         * i386-low.c: New file.
9723         * i386-low.h: New file.
9724         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
9725         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
9726         * linux-low.c (linux_add_process): Initialize arch_private.
9727         (linux_remove_process): Free arch_private.
9728         (add_lwp): Initialize arch_private.
9729         (delete_lwp): Free arch_private.
9730         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
9731         provided.
9732         * linux-low.h (process_info_private): New member arch_private.
9733         (lwp_info): New member arch_private.
9734         (linux_target_ops): New members new_process, new_thread,
9735         prepare_to_resume.
9736         (ptid_of): New macro.
9737         * linux-x86-low.c: Include stddef.h, i386-low.h.
9738         (arch_process_info): New struct.
9739         (arch_lwp_info): New struct.
9740         (x86_linux_dr_get, x86_linux_dr_set): New functions.
9741         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9742         (i386_dr_low_get_status): New function.
9743         (x86_insert_point, x86_remove_point): New functions.
9744         (x86_stopped_by_watchpoint): New function.
9745         (x86_stopped_data_address): New function.
9746         (x86_linux_new_process, x86_linux_new_thread): New functions.
9747         (x86_linux_prepare_to_resume): New function.
9748         (the_low_target): Add entries for insert_point, remove_point,
9749         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
9750         prepare_to_resume.
9751         * server.c (debug_hw_points): New global.
9752         (monitor_show_help): Document set debug-hw-points.
9753         (handle_query): Process "set debug-hw-points".
9754         * server.h (debug_hw_points): Declare.
9755         (paddress): Declare.
9756         * utils.c (NUMCELLS, CELLSIZE): New macros.
9757         (get_sell, xsnprintf, paddress): New functions.
9758         * win32-arm-low.c (the_low_target): Add entries for insert_point,
9759         remove_point, stopped_by_watchpoint, stopped_data_address.
9760         * win32-i386-low.c: Include i386-low.h.
9761         (debug_reg_state): Replaces dr.
9762         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9763         (i386_dr_low_get_status): New function.
9764         (i386_insert_point, i386_remove_point): New functions.
9765         (i386_stopped_by_watchpoint): New function.
9766         (i386_stopped_data_address): New function.
9767         (i386_initial_stuff): Update.
9768         (get_thread_context,set_thread_context,i386_thread_added): Update.
9769         (the_low_target): Add entries for insert_point,
9770         remove_point, stopped_by_watchpoint, stopped_data_address.
9771         * win32-low.c (win32_insert_watchpoint): New function.
9772         (win32_remove_watchpoint): New function.
9773         (win32_stopped_by_watchpoint): New function.
9774         (win32_stopped_data_address): New function.
9775         (win32_target_ops): Add entries for insert_watchpoint,
9776         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
9777         * win32-low.h (win32_target_ops): New members insert_point,
9778         remove_point, stopped_by_watchpoint, stopped_data_address.
9779
9780 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
9781
9782         * server.c (process_serial_event): Re-return unsupported, not
9783         error, if the type isn't recognized.  Re-allow supporting only
9784         insert or remove packets.  Also call require_running for
9785         breakpoints.  Add missing break statement to default case.  Tidy.
9786         * target.h (struct target_ops): Rename insert_watchpoint to
9787         insert_point, and remove_watchpoint to remove_point.
9788
9789         * linux-low.h (struct linux_target_ops): Likewise.
9790         * linux-low.c (linux_insert_watchpoint): Rename to ...
9791         (linux_insert_point): ... this.  Adjust.
9792         (linux_remove_watchpoint): Rename to ...
9793         (linux_remove_point): ... this.  Adjust.
9794         (linux_target_ops): Adjust.
9795         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
9796         (cris_insert_point): ... this.
9797         (cris_remove_watchpoint): Rename to ...
9798         (cris_remove_point): ... this.
9799         (the_low_target): Adjust.
9800
9801 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
9802
9803         * server.c (handle_v_kill): Pass signal_pid to
9804         kill_inferior if multi_process is zero.
9805
9806 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
9807
9808         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
9809         * target.h (target_ops): Comment for *_watchpoint to make it clear
9810         the functions can get types '0' and '1'.
9811
9812 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
9813
9814         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
9815         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
9816         * regcache.c (get_regcache): Likewise.
9817         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
9818         * win32-low.c (child_fetch_inferior_registers): Remove check for
9819         regno 0.
9820
9821 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
9822             Pedro Alves <pedro@codesourcery.com>
9823
9824         * target.h (struct target_ops) <supports_multi_process>: New
9825         callback.
9826         (target_supports_multi_process): New.
9827         * server.c (handle_query): Even if GDB reports support, only
9828         enable multi-process if the target also supports it.  Report
9829         multi-process support only if the target backend supports it.
9830         * linux-low.c (linux_supports_multi_process): New function.
9831         (linux_target_ops): Install it as target_supports_multi_process
9832         callback.
9833
9834 2009-05-24  Doug Evans  <dje@google.com>
9835
9836         Global renaming of find_thread_pid to find_thread_ptid.
9837         * server.h (find_thread_ptid): Renamed from find_thread_pid.
9838         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
9839         All callers updated.
9840
9841         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
9842         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
9843         directly.
9844
9845         * linux-low.c (get_stop_pc): Print pc if debug_threads.
9846         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
9847         (linux_resume_one_lwp): Ditto.
9848
9849 2009-05-23  Doug Evans  <dje@google.com>
9850
9851         * linux-low.c (linux_resume_one_lwp): Change type of first arg
9852         from struct inferior_list_entry * to struct lwp_info *.
9853         All callers updated.
9854
9855 2009-05-13  Doug Evans  <dje@google.com>
9856
9857         * linux-x86-low.c: Don't include assert.h.
9858         (x86_siginfo_fixup): Use fatal, not assert.
9859         (x86_arch_setup): Fix comment.
9860
9861 2009-05-12  Doug Evans  <dje@google.com>
9862
9863         Biarch support for i386/amd64 gdbserver.
9864         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
9865         Add linux-x86-low.c.
9866         (linux-i386-low.o, linux-x86-64-low.o): Delete.
9867         (linux-x86-low.o): Add.
9868         * linux-x86-64-low.c: Delete.
9869         * linux-i386-low.c: Delete.
9870         * linux-x86-low.c: New file.
9871         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
9872         linux-x86-low.o.
9873         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
9874         linux-x86-low.o.
9875         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
9876         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
9877         (linux_child_pid_to_exec_file): New function.
9878         (elf_64_header_p, elf_64_file_p): New functions.
9879         (siginfo_fixup): New function.
9880         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
9881         give target a chance to convert layout.
9882         * linux-low.h (linux_target_ops): New member siginfo_fixup.
9883         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
9884
9885 2009-05-07  Doug Evans  <dje@google.com>
9886
9887         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
9888         (regsets_store_inferior_registers): Ditto.
9889
9890 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
9891
9892         PR server/10048
9893
9894         * linux-low.c (must_set_ptrace_flags): Delete.
9895         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
9896         of the global.
9897         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
9898         `lwp->must_set_ptrace_flags' instead.
9899         (linux_wait_for_event_1): Set ptrace options here.
9900         (linux_wait_1): ... not here.
9901
9902 2009-04-30  Doug Evans  <dje@google.com>
9903
9904         * inferiors.c (started_inferior_callback): New function.
9905         (attached_inferior_callback): New function.
9906         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
9907         * server.c (print_started_pid, print_attached_pid): New functions.
9908         (detach_or_kill_for_exit): New function.
9909         (main): Call it instead of for_each_inferior (kill_inferior_callback).
9910         * server.h (have_started_inferiors_p): Declare.
9911         (have_attached_inferiors_p): Declare.
9912
9913         * inferiors.c (remove_process): Fix memory leak, free process.
9914         * linux-low.c (linux_remove_process): New function.
9915         (linux_kill): Call it instead of remove_process.
9916         (linux_detach, linux_wait_1): Ditto.
9917
9918 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
9919
9920         * configure.srv: Add x86 Windows CE target.
9921
9922 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9923
9924         * inferiors.c (get_thread_process): Make global.
9925         * server.h (get_thread_process): Add prototype.
9926         * thread-db.c (find_one_thread): Use get_thread_process
9927         instead of current_process.
9928         (thread_db_get_tls_address): Do not crash if called when
9929         thread layer is not yet initialized.
9930
9931 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9932
9933         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
9934         * spu-low.c (current_tid): Rename to ...
9935         (current_ptid): ... this.
9936         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
9937         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
9938         ptid_get_lwp (current_ptid) instead of current_tid.
9939         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
9940         instead of current_tid.  Use find_process_pid to verify pid
9941         argument is valid.  Pass proper argument to remove_process.
9942         (spu_thread_alive): Compare current_ptid instead of current_tid.
9943         (spu_resume): Likewise.
9944
9945 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
9946
9947         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
9948         variable.
9949
9950 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
9951
9952         Implement the multiprocess extensions, and add linux multiprocess
9953         support.
9954
9955         * server.h (ULONGEST): Declare.
9956         (struct ptid, ptid_t): New.
9957         (minus_one_ptid, null_ptid): Declare.
9958         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9959         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
9960         (struct inferior_list_entry): Change `id' type from unsigned from
9961         to ptid_t.
9962         (struct sym_cache, struct breakpoint, struct
9963         process_info_private): Forward declare.
9964         (struct process_info): Declare.
9965         (current_process): Declare.
9966         (all_processes): Declare.
9967         (initialize_inferiors): Declare.
9968         (add_thread): Adjust to use ptid_t.
9969         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
9970         (add_process, remove_process, find_thread_pid): Declare.
9971         (find_inferior_id): Adjust to use ptid_t.
9972         (cont_thread, general_thread, step_thread): Change type to ptid_t.
9973         (multi_process): Declare.
9974         (push_event): Adjust to use ptid_t.
9975         (read_ptid, write_ptid): Declare.
9976         (prepare_resume_reply): Adjust to use ptid_t.
9977         (clear_symbol_cache): Declare.
9978         * inferiors.c (all_processes): New.
9979         (null_ptid, minus_one_ptid): New.
9980         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9981         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
9982         (add_thread): Change unsigned long to ptid.  Remove gdb_id
9983         parameter.  Adjust.
9984         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
9985         (gdb_id_to_thread): Rename to ...
9986         (find_thread_pid): ... this.  Change unsigned long to ptid.
9987         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
9988         (loaded_dll, pull_pid_from_list): Adjust.
9989         (add_process, remove_process, find_process_pid)
9990         (get_thread_process, current_process, initialize_inferiors): New.
9991         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
9992         (struct target_waitstatus) <related_pid>: Ditto.
9993         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
9994         return type to int.
9995         (struct target_ops) <join>: Add `pid' argument.
9996         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
9997         (struct target_ops) <wait>: Add `ptid' field.  Change return type
9998         to ptid.
9999         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
10000         (mywait): Add `ptid' argument.  Change return type to ptid_t.
10001         (target_pid_to_str): Declare.
10002         * target.c (set_desired_inferior): Adjust to use ptids.
10003         (mywait): Add new `ptid' argument.  Adjust.
10004         (target_pid_to_str): New.
10005         * mem-break.h (free_all_breakpoints): Declare.
10006         * mem-break.c (breakpoints): Delelete.
10007         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
10008         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
10009         to use per-process breakpoint list.
10010         (free_all_breakpoints): New.
10011         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
10012         (symbol_cache, all_symbols_looked_up): Delete.
10013         (hexchars): New.
10014         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
10015         read_ptid): New.
10016         (prepare_resume_reply): Change ptid argument's type from unsigned
10017         long to ptid_t.  Adjust.  Implement W;process and X;process.
10018         (free_sym_cache, clear_symbol_cache): New.
10019         (look_up_one_symbol): Adjust to per-process symbol cache.  *
10020         * server.c (cont_thread, general_thread, step_thread): Change type
10021         to ptid_t.
10022         (attached): Delete.
10023         (multi_process): New.
10024         (last_ptid): Change type to ptid_t.
10025         (struct vstop_notif) <ptid>: Change type to ptid_t.
10026         (queue_stop_reply, push_event): Change `ptid' argument's type to
10027         ptid_t.
10028         (discard_queued_stop_replies): Add `pid' argument.
10029         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
10030         changes.  Don't reference the `attached' global.
10031         (attach_inferior): Adjust to mywait interface changes.
10032         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
10033         features.  Handle and report "multiprocess+".  Handle
10034         "qAttached:PID".
10035         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
10036         changes.
10037         (handle_v_kill): New.
10038         (handle_v_stopped): Adjust to use target_pid_to_str.
10039         (handle_v_requests): Allow multiple attaches and runs when
10040         multiprocess extensions are in effect.  Handle "vKill".
10041         (myresume): Adjust to use ptids.
10042         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
10043         (handle_status): Adjust to discard_queued_stop_replies interface
10044         change.
10045         (first_thread_of, kill_inferior_callback)
10046         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
10047         (main): Call initialize_inferiors.  Adjust to use ptids, killing
10048         and detaching from all inferiors.  Handle multiprocess packet
10049         variants.
10050         * linux-low.h: Include gdb_proc_service.h.
10051         (struct process_info_private): New.
10052         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
10053         <lwpid_of>: Use ptid_get_lwp.
10054         (get_lwp_thread): Adjust.
10055         (struct lwp_info): Add `dead' member.
10056         (find_lwp_pid): Declare.
10057         * linux-low.c (thread_db_active): Delete.
10058         (new_inferior): Adjust comment.
10059         (inferior_pid): Delete.
10060         (linux_add_process): New.
10061         (handle_extended_wait): Adjust.
10062         (add_lwp): Change unsigned long to ptid.
10063         (linux_create_inferior): Add process to processes table.  Adjust
10064         to use ptids.  Don't set new_inferior here.
10065         (linux_attach_lwp): Rename to ...
10066         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
10067         it.  Adjust to use ptids.
10068         (linux_attach_lwp): New.
10069         (linux_attach): Add process to processes table.  Don't set
10070         new_inferior here.
10071         (struct counter): New.
10072         (second_thread_of_pid_p, last_thread_of_process_p): New.
10073         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
10074         multiple processes.
10075         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
10076         processes.  Remove process from process table.
10077         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
10078         to multiple processes.
10079         (any_thread_of): New.
10080         (linux_detach): Add `pid' argument, and handle it.  Remove process
10081         from processes table.
10082         (linux_join): Add `pid' argument.  Handle it.
10083         (linux_thread_alive): Change unsighed long argument to ptid_t.
10084         Consider dead lwps as not being alive.
10085         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
10086         threads we're not interested in.
10087         (same_lwp, find_lwp_pid): New.
10088         (linux_wait_for_lwp): Change `pid' argument's type from int to
10089         ptid_t.  Adjust.
10090         (linux_wait_for_event): Rename to ...
10091         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
10092         from int to ptid_t.  Adjust.
10093         (linux_wait_for_event): New.
10094         (linux_wait_1): Add `ptid' argument.  Change return type to
10095         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
10096         that exit from the process table.
10097         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
10098         Adjust.
10099         (mark_lwp_dead): New.
10100         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
10101         stopping all threads, mark its main lwp as dead.
10102         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
10103         ptids.
10104         (fetch_register, usr_store_inferior_registers)
10105         (regsets_fetch_inferior_registers)
10106         (regsets_store_inferior_registers, linux_read_memory)
10107         (linux_write_memory): Inline `inferior_pid'.
10108         (linux_look_up_symbols): Adjust to use per-process
10109         `thread_db_active'.
10110         (linux_request_interrupt): Adjust to use ptids.
10111         (linux_read_auxv): Inline `inferior_pid'.
10112         (initialize_low): Don't reference thread_db_active.
10113         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
10114         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
10115         (ps_getpid): Return the pid of the current inferior.
10116         * thread-db.c (proc_handle, thread_agent): Delete.
10117         (thread_db_create_event, thread_db_enable_reporting): Adjust to
10118         per-process data.
10119         (find_one_thread): Change argument type to ptid_t.  Adjust to
10120         per-process data.
10121         (maybe_attach_thread): Adjust to per-process data and ptids.
10122         (thread_db_find_new_threads): Ditto.
10123         (thread_db_init): Ditto.
10124         * spu-low.c (spu_create_inferior, spu_attach): Add process to
10125         processes table.  Adjust to use ptids.
10126         (spu_kill, spu_detach): Adjust interface.  Remove process from
10127         processes table.
10128         (spu_join, spu_thread_alive): Adjust interface.
10129         (spu_wait): Adjust interface.  Remove process from processes
10130         table.  Adjust to use ptids.
10131         * win32-low.c (current_inferior_tid): Delete.
10132         (current_inferior_ptid): New.
10133         (debug_event_ptid): New.
10134         (thread_rec): Take a ptid.  Adjust.
10135         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
10136         (child_delete_thread): Ditto.
10137         (do_initial_child_stuff): Add `attached' argument.  Add process to
10138         processes table.
10139         (child_fetch_inferior_registers, child_store_inferior_registers):
10140         Adjust.
10141         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
10142         (win32_attach): Pass 1 to do_initial_child_stuff.
10143         (win32_kill): Adjust interface.  Remove process from processes
10144         table.
10145         (win32_detach): Ditto.
10146         (win32_join): Adjust interface.
10147         (win32_thread_alive): Take a ptid.
10148         (win32_resume): Adjust to use ptids.
10149         (get_child_debug_event): Ditto.
10150         (win32_wait): Adjust interface.  Remove exiting process from
10151         processes table.
10152
10153 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10154
10155         Non-stop mode support.
10156
10157         * server.h (non_stop): Declare.
10158         (gdb_client_data, handler_func): Declare.
10159         (delete_file_handler, add_file_handler, start_event_loop):
10160         Declare.
10161         (handle_serial_event, handle_target_event, push_event)
10162         (putpkt_notif): Declare.
10163         * target.h (enum resume_kind): New.
10164         (struct thread_resume): Replace `step' field by `kind' field.
10165         (TARGET_WNOHANG): Define.
10166         (struct target_ops) <wait>: Add `options' argument.
10167         <supports_non_stop, async, start_non_stop>: New fields.
10168         (target_supports_non_stop, target_async): New.
10169         (start_non_stop): Declare.
10170         (mywait): Add `options' argument.
10171         * target.c (mywait): Add `options' argument.  Print child exit
10172         notifications here.
10173         (start_non_stop): New.
10174         * server.c (non_stop, own_buf, mem_buf): New globals.
10175         (struct vstop_notif): New.
10176         (notif_queue): New global.
10177         (queue_stop_reply, push_event, discard_queued_stop_replies)
10178         (send_next_stop_reply): New.
10179         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
10180         interface changes.
10181         (attach_inferior): In non-stop mode, don't wait for the target
10182         here.
10183         (handle_general_set): Handle QNonStop.
10184         (handle_query): When handling qC, return the current general
10185         thread, instead of the first thread of the list.
10186         (handle_query): If the backend supports non-stop mode, include
10187         QNonStop+ in the qSupported query response.
10188         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
10189         and non-stop mode.
10190         (handle_v_attach, handle_v_run): Handle non-stop mode.
10191         (handle_v_stopped): New.
10192         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
10193         (myresume): Adjust to use resume_kind.  Handle non-stop.
10194         (queue_stop_reply_callback): New.
10195         (handle_status): Handle non-stop mode.
10196         (main): Clear non_stop flag on reconnection.  Use the event-loop.
10197         Refactor serial protocol handling from here ...
10198         (process_serial_event): ... to this new function.  When GDB
10199         selects any thread, select one here.  In non-stop mode, wait until
10200         GDB acks all pending events before exiting.
10201         (handle_serial_event, handle_target_event): New.
10202         * remote-utils.c (remote_open): Install remote_desc in the event
10203         loop.
10204         (remote_close): Remove remote_desc from the event loop.
10205         (putpkt_binary): Rename to...
10206         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
10207         (putpkt_binary): New as wrapper around putpkt_binary_1.
10208         (putpkt_notif): New.
10209         (prepare_resume_reply): In non-stop mode, don't change the
10210         general_thread.
10211         * event-loop.c: New.
10212         * Makefile.in (OBJ): Add event-loop.o.
10213         (event-loop.o): New rule.
10214
10215         * linux-low.h (pid_of): Moved here.
10216         (lwpid_of): New.
10217         (get_lwp_thread): Use lwpid_of.
10218         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
10219         * linux-low.c (pid_of): Delete.
10220         (inferior_pid): Use lwpid_of.
10221         (linux_event_pipe): New.
10222         (target_is_async_p): New.
10223         (delete_lwp): New.
10224         (handle_extended_wait): Use lwpid_of.
10225         (add_lwp): Don't set lwpid field.
10226         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
10227         (linux_kill_one_lwp): If killing a running lwp, stop it first.
10228         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
10229         (linux_detach_one_lwp): If detaching from a running lwp, stop it
10230         first.  Adjust to linux_wait_for_event interface changes.  Use
10231         lwpid_of.
10232         (linux_detach): Don't delete the main lwp here.
10233         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
10234         (status_pending_p): Don't consider explicitly suspended lwps.
10235         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
10236         pointer.  Add OPTIONS argument.  Change return type to int.  Use
10237         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
10238         (linux_wait_for_event): Take an integer pid instead of a lwp_info
10239         pointer.  Add status pointer argument.  Return a pid instead of a
10240         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
10241         changes.  In non-stop mode, don't switch to a random thread.
10242         (linux_wait): Rename to...
10243         (linux_wait_1): ... this.  Add target_options argument, and handle
10244         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
10245         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
10246         clean exit and signal exit code.  Don't stop all threads in
10247         non-stop mode.  In all-stop mode, only stop all threads when
10248         reporting a stop to GDB.  Handle explicit thread stop requests.
10249         (async_file_flush, async_file_mark): New.
10250         (linux_wait): New.
10251         (send_sigstop): Use lwpid_of.
10252         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
10253         interface changes.  In non-stop mode, don't switch to a random
10254         thread.
10255         (linux_resume_one_lwp): Use lwpid_of.
10256         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
10257         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
10258         non-stop mode, don't look for pending flag in all threads.
10259         (resume_status_pending_p): Don't consider explicitly suspended
10260         threads.
10261         (my_waitpid): Reimplement.  Emulate __WALL.
10262         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10263         Use lwpid_of.
10264         (sigchld_handler, linux_supports_non_stop, linux_async)
10265         (linux_start_non_stop): New.
10266         (linux_target_ops): Register linux_supports_non_stop, linux_async
10267         and linux_start_non_stop.
10268         (initialize_low): Install SIGCHLD handler.
10269         * thread-db.c (thread_db_create_event, find_one_thread)
10270         (thread_db_get_tls_address): Use lwpid_of.
10271         * win32-low.c (win32_detach): Adjust to use resume_kind.
10272         (win32_wait): Add `options' argument.
10273         * spu-low.c (spu_resume): Adjust to use resume_kind.
10274         (spu_wait): Add `options' argument.
10275
10276 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10277
10278         Decouple target code from remote protocol.
10279
10280         * target.h (enum target_waitkind): New.
10281         (struct target_waitstatus): New.
10282         (struct target_ops) <wait>: Return an unsigned long.  Take a
10283         target_waitstatus pointer instead of a char pointer.
10284         (mywait): Likewise.
10285         * target.c (mywait): Change prototype to return an unsigned long.
10286         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
10287         * server.h (thread_from_wait, old_thread_from_wait): Delete
10288         declarations.
10289         (prepare_resume_reply): Change prototype to take a
10290         target_waitstatus.
10291         * server.c (thread_from_wait, old_thread_from_wait): Delete.
10292         (last_status, last_ptid): New.
10293         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
10294         pid instead of a signal.
10295         (attach_inferior): Remove "status" and "signal" parameters.
10296         Adjust.
10297         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
10298         not as an address.
10299         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
10300         (handle_v_requests, myresume): Remove "status" and "signal"
10301         parameters.  Adjust.
10302         (handle_status): New.
10303         (main): Delete local `status'.  Adjust.
10304         * remote-utils.c: Include target.h.
10305         (prepare_resume_reply): Change prototype to take a
10306         target_waitstatus.  Adjust.
10307
10308         * linux-low.c (linux_wait): Adjust to new target_ops->wait
10309         interface.
10310         * spu-low.c (spu_wait): Adjust.
10311         * win32-low.c (enum target_waitkind, struct target_waitstatus):
10312         Delete.
10313         (win32_wait): Adjust.
10314
10315 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10316
10317         * target.h (struct thread_resume): Delete leave_stopped member.
10318         (struct target_ops): Add a `n' argument to the `resume' callback.
10319         * server.c (start_inferior): Adjust.
10320         (handle_v_cont, myresume): Adjust.
10321         * linux-low.c (check_removed_breakpoint): Adjust to resume
10322         interface change, and to removed leave_stopped field.
10323         (resume_ptr): Delete.
10324         (struct thread_resume_array): New.
10325         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
10326         resume interface change.
10327         (linux_continue_one_thread, linux_queue_one_thread)
10328         (resume_status_pending_p): Check if the resume field is NULL
10329         instead of checking the leave_stopped member.
10330         (linux_resume): Adjust to the target resume interface change.
10331         * spu-low.c (spu_resume): Adjust to the target resume interface
10332         change.
10333         * win32-low.c (win32_detach, win32_resume): Ditto.
10334
10335 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10336
10337         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
10338         flag.
10339         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
10340         pending.
10341         (linux_continue_one_thread): Only preserve the stepping flag if
10342         there's a pending breakpoint.
10343
10344 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
10345
10346         * server.c (main): After the inferior having exited, call
10347         remote_close before exiting gdbserver.
10348
10349 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10350
10351         Fix size of FPSCR in Power 7 processors.
10352         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
10353         (PPC_FEATURE_HAS_DFP): New #define.
10354         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
10355         size of the FPSCR.
10356
10357 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
10358
10359         * server.c (handle_query) Whitespace and formatting.
10360
10361 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10362
10363         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
10364         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
10365         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
10366         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
10367         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
10368         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
10369         Makefile.in, configure.ac: Fix whitespace throughout.
10370         * configure: Regenerate.
10371
10372 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10373
10374         * inferiors.c (find_inferior): Make it safe for the callback
10375         function to delete the currently iterated inferior.
10376
10377 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10378
10379         * Makefile.in (linuw_low_h): Move higher.
10380         (thread-db.o): Depend on $(linux_low_h).
10381
10382 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
10383
10384         Rename "process" to "lwp" throughout.
10385
10386         * linux-low.c (all_processes): Rename to...
10387         (all_lwps): ... this.
10388         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
10389         (add_process): Rename to ...
10390         (add_lwp): ... this.  Adjust.
10391         (linux_create_inferior): Adjust.
10392         (linux_attach_lwp): Adjust.
10393         (linux_attach): Adjust.
10394         (linux_kill_one_process): Rename to ...
10395         (linux_kill_one_lwp): ... this.  Adjust.
10396         (linux_kill): Adjust.
10397         (linux_detach_one_process): Rename to ...
10398         (linux_detach_one_lwp): ... this.  Adjust.
10399         (linux_detach): Adjust.
10400         (check_removed_breakpoint): Adjust.
10401         (status_pending_p): Adjust.
10402         (linux_wait_for_process): Rename to ...
10403         (linux_wait_for_lwp): ... this.  Adjust.
10404         (linux_wait_for_event): Adjust.
10405         (send_sigstop): Adjust.
10406         (wait_for_sigstop): Adjust.
10407         (stop_all_processes): Rename to ...
10408         (stop_all_lwps): ... this.
10409         (linux_resume_one_process): Rename to ...
10410         (linux_resume_one_lwp): ... this.  Adjust.
10411         (linux_set_resume_request, linux_continue_one_thread)
10412         (linux_queue_one_thread, resume_status_pending_p)
10413         (usr_store_inferior_registers, regsets_store_inferior_registers)
10414         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10415         Adjust.
10416         * linux-low.h (get_process): Rename to ...
10417         (get_lwp): ... this.  Adjust.
10418         (get_thread_process): Rename to ...
10419         (get_thread_lwp): ... this.  Adjust.
10420         (get_process_thread): Rename to ...
10421         (get_lwp_thread): ... this.  Adjust.
10422         (struct process_info): Rename to ...
10423         (struct lwp_info): ... this.
10424         (all_processes): Rename to ...
10425         (all_lwps): ... this.
10426         * proc-service.c (ps_lgetregs): Adjust.
10427         * thread-db.c (thread_db_create_event, find_one_thread)
10428         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
10429
10430 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
10431
10432         * server.c (handle_query): Handle "qAttached".
10433
10434 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
10435
10436         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
10437         GPLv3, update license URL.
10438
10439 2009-03-01  Doug Evans  <dje@google.com>
10440
10441         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
10442         (server_h): Add gdb_signals.h.
10443         (signals.o): Update.
10444         * server.h (target_signal_from_host,target_signal_to_host_p)
10445         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
10446
10447 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
10448
10449         * remote-utils.c (getpkt): Also generate remote-debug
10450         information if noack_mode is set.
10451
10452 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
10453
10454         * server.c (handle_query): Report qXfer:siginfo:read and
10455         qXfer:siginfo:write as supported and handle them.
10456         * target.h (struct target_ops) <qxfer_siginfo>: New field.
10457         * linux-low.c (linux_xfer_siginfo): New.
10458         (linux_target_ops): Set it.
10459
10460 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
10461
10462         * server.c (gdbserver_usage): Mention --remote-debug.
10463         (main): Accept '--remote-debug' switch.
10464
10465 2009-01-18  Doug Evans  <dje@google.com>
10466
10467         * regcache.c (new_register_cache): No need to check result of xcalloc.
10468         * server.c (handle_search_memory): Back out calls to xmalloc,
10469         result is checked and error is returned to user upon failure.
10470         (handle_query): Ditto.  Add more checks for result of malloc.
10471         (handle_v_cont): Check result of malloc, report error back to
10472         user upon failure.
10473         (handle_v_run): Ditto.  Call freeargv.
10474         * server.h (freeargv): Declare.
10475         * utils.c (freeargv): New fn.
10476
10477 2009-01-15  Doug Evans  <dje@google.com>
10478
10479         * gdbreplay.c (perror_with_name): Make arg const char *.
10480         * server.h (target_signal_to_name): Make return type const char *.
10481         * thread-db.c (thread_db_err_str): Make return type const char *.
10482         * utils.c (perror_with_name): Make arg const char *.
10483
10484 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
10485
10486         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
10487         when handling a EXIT_PROCESS_DEBUG_EVENT.
10488
10489 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
10490
10491         * gdbreplay.c (gdbreplay_version): Update copyright year.
10492         * server.c (gdbserver_version): Likewise.
10493
10494 2009-01-05  Doug Evans  <dje@google.com>
10495
10496         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
10497         (handle_extended_wait): Improve comment.
10498
10499 2008-12-13  Doug Evans  <dje@google.com>
10500
10501         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
10502         * server.h (ATTR_MALLOC): New macro.
10503         (xmalloc,xcalloc,xstrdup): Declare.
10504         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
10505         * inferiors.c: Ditto.
10506         * linux-low.c: Ditto.
10507         * mem-break.c: Ditto.
10508         * regcache.c: Ditto.
10509         * remote-utils.c: Ditto.
10510         * server.c: Ditto.
10511         * target.c: Ditto.
10512         * win32-low.c: Ditto.
10513
10514 2008-12-12  Doug Evans  <dje@google.com>
10515
10516         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
10517         in debugging printf.
10518
10519         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
10520
10521 2008-12-09  Doug Evans  <dje@google.com>
10522
10523         * linux-low.h (struct process_info): Delete member tid, unused.
10524         * thread-db.c (find_one_thread): Update.
10525         (maybe_attach_thread): Update.
10526
10527 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
10528
10529         * target.h (struct target_ops): Add qxfer_osdata member.
10530         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
10531         and dirent.h.
10532         (linux_qxfer_osdata): New functions.
10533         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
10534         callback.
10535         * server.c (handle_query): Handle "qXfer:osdata:read:".
10536         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
10537         (buffer_xml_printf): New functions.
10538         * server.h (struct buffer): New.
10539         (buffer_grow_str, buffer_grow_str0): New macros.
10540         (buffer_grow, buffer_free, buffer_init, buffer_finish)
10541         (buffer_xml_printf): Declare.
10542
10543 2008-11-24  Doug Evans  <dje@google.com>
10544
10545         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
10546
10547 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
10548
10549         * server.c (handle_v_run): Always use the supplied argument list.
10550
10551 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
10552
10553         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
10554         (xtensa_regmap_table): Add entry for scompare1.
10555
10556 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10557
10558         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
10559         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
10560         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
10561         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
10562         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
10563         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
10564         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
10565         XML target descriptions.
10566         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
10567         when inferior is running on an ISA 2.05 or later processor.  Add
10568         special case to return offset for full 64-bit slot of FPSCR when
10569         in 32-bits.
10570
10571 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
10572
10573         * Makefile.in (SFILES, clean): Added sparc64 files.
10574         (reg-sparc64.o, reg-sparc64.c): New.
10575         * configure.srv (sparc*-*-linux*): New configuration.
10576         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
10577         syscall arguments for SPARC.
10578         (regsets_store_inferior_registers): Likewise.
10579         * linux-sparc-low.c: New file.
10580
10581 2008-10-21  Doug Evans  <dje@google.com>
10582
10583         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
10584         (READLINE_DIR,READLINE_DEP): Delete.
10585         (INTERNAL_CFLAGS): Update.
10586         (LINTFLAGS): Update.
10587
10588 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
10589
10590         * server.c (handle_v_run): If GDB didn't specify an argv, use the
10591         whole argv from the last run, not just argv[0].
10592
10593 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
10594
10595         * regcache.c (new_register_cache): Return NULL if the register
10596         cache size isn't known yet.
10597         (free_register_cache): Avoid dereferencing a NULL regcache.
10598
10599 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
10600
10601         * configure.srv: Merge MIPS and MIPS64.
10602
10603 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
10604
10605         * Makefile.in (uninstall): Apply $(EXEEXT) too.
10606
10607 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
10608
10609         * Makefile.in: Add required vsx dependencies.
10610
10611         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
10612         Declare init_registers_powerpc_vsx32l.
10613         Declare init_registers_powerpc_vsx64l.
10614         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
10615         (ppc_arch_setup): Check for VSX in hwcap.
10616         (ppc_fill_vsxregset): New function.
10617         (ppc_store_vsxregset): New function.
10618         Add new VSX entry in regset_info target_regsets.
10619
10620         * configure.srv: Add new VSX dependencies.
10621
10622 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
10623
10624         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
10625         (remote_open): Set or clear transport_is_reliable.
10626         (putpkt_binary): Don't expect acks in noack mode.
10627         (getpkt): Don't send ack/nac in noack mode.
10628         * server.c (handle_general_set): Handle QStartNoAckMode.
10629         (handle_query): If connected by tcp pass QStartNoAckMode+ in
10630         qSupported.
10631         (main): Reset noack_mode on every connection.
10632         * server.h (noack_mode): Declare.
10633
10634 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10635
10636         * Makefile.in (GDBREPLAY_OBS): New variable.
10637         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
10638
10639 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
10640             Daniel Jacobowitz  <dan@codesourcery.com>
10641
10642         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
10643         (usr_store_inferior_registers): Likewise.
10644         (regsets_store_inferior_registers): Likewise.
10645
10646 2008-07-31  Rolf Jansen  <rj@surtec.com>
10647             Pedro Alves  <pedro@codesourcery.com>
10648
10649         * configure.ac: Check for memmem declaration.
10650         * server.c [HAVE_MALLOC_H]: Include malloc.h.
10651         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
10652         (disable_packet_qfThreadInfo): Unconditionally compile.
10653         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
10654         * configure, config.in: Regenerate.
10655
10656 2008-07-28  Doug Kwan  <dougkwan@google.com>
10657
10658         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
10659         (linux_write_memory): Remove declaration of errno.
10660
10661 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
10662
10663         * linux-low.c (handle_extended_wait): Do not use "status"
10664         variable uninitialized.
10665
10666 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
10667
10668         * server.c (handle_v_attach): Inhibit reporting dll changes.
10669
10670 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
10671
10672         * remote-utils.c (prepare_resume_reply): If requested, don't
10673         output "thread:TID" in the T stop reply.
10674
10675         * server.c (disable_packet_vCont, disable_packet_Tthread)
10676         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
10677         (handle_query): If requested, disable support for qC, qfThreadInfo
10678         and qsThreadInfo.
10679         (handle_v_requests): If requested, disable support for vCont.
10680         (gdbserver_show_disableable): New.
10681         (main): Handle --disable-packet and --disable-packet=LIST.
10682
10683         * server.h (disable_packet_vCont, disable_packet_Tthread)
10684         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
10685
10686 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
10687
10688         * server.c (gdbserver_usage): Mention --version.
10689
10690 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
10691
10692         * Makefile.in (gdbreplay.o): New rule.
10693
10694 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
10695
10696         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
10697         message, not gdbserver.
10698
10699 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
10700             Nathan Sidwell  <nathan@codesourcery.com>
10701             Joseph Myers  <joseph@codesourcery.com>
10702
10703         * acinclude.m4: Include ../../config/acx.m4.
10704         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
10705         * configure, config.in: Regenerate.
10706         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
10707         * server.c (gdbserver_version): Print PKGVERSION.
10708         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
10709         (main): Adjust gdbserver_usage calls.
10710         * gdbreplay.c (version, host_name): Add declarations.
10711         (gdbreplay_version, gdbreplay_usage): New.
10712         (main): Accept --version and --help options.
10713
10714 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
10715
10716         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
10717         (arm_breakpoint_at): Handle Thumb.
10718         (the_low_target): Add comment.
10719
10720 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
10721
10722         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
10723
10724 2008-05-09  Doug Evans  <dje@google.com>
10725
10726         * server.h (decode_search_memory_packet): Declare.
10727         * remote-utils.c (decode_search_memory_packet): New fn.
10728         * server.c (handle_search_memory_1): New fn.
10729         (handle_search_memory): New fn.
10730         (handle_query): Process qSearch:memory packets.
10731
10732 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
10733
10734         * regcache.c (registers_length): Remove.
10735         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
10736         full register packet.
10737         * regcache.h (registers_length): Remove prototype.
10738         * server.h (PBUFSIZ): Define to 16384.
10739
10740 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
10741
10742         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
10743         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
10744         powerpc-64l.o, and powerpc-altivec64l.o.
10745         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
10746         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
10747         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
10748         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
10749         rs6000/power-linux.xml, and rs6000/power64-linux.xml
10750         to srv_xmlfiles.
10751
10752         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
10753         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
10754         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
10755         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
10756         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
10757         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
10758         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
10759         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
10760         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
10761         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
10762         (clean): Update.
10763
10764         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
10765         (init_registers_powerpc_32l): ... this new prototype.
10766         (init_registers_powerpc_32): Remove, replace by ...
10767         (init_registers_powerpc_altivec32l): ... this new prototype.
10768         (init_registers_powerpc_e500): Remove, replace by ...
10769         (init_registers_powerpc_e500l): ... this new prototype.
10770         (init_registers_ppc64): Remove, replace by ...
10771         (init_registers_powerpc_64l): ... this new prototype.
10772         (init_registers_powerpc_64): Remove, replace by ...
10773         (init_registers_powerpc_altivec64l): ... this new prototype.
10774         (ppc_num_regs): Set to 73.
10775         (PT_ORIG_R3, PT_TRAP): Define if necessary.
10776         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
10777         (ppc_cannot_store_register): Handle orig_r3 and trap.
10778         (ppc_arch_setup): Update init_registers_... calls.
10779         (ppc_fill_gregset): Handle orig_r3 and trap.
10780
10781         * inferiors.c (clear_inferiors): Reset current_inferior.
10782
10783 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
10784
10785         * acinclude.m4: Add override.m4.
10786         * configure: Regenerate.
10787
10788 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10789
10790         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
10791         initial call to init_register_ppc64.
10792
10793 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10794
10795         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
10796         single powerpc*-*-linux* case.
10797         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
10798
10799 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
10800
10801         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
10802         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
10803         from reg_xmlfiles.
10804         * linux-ppc-low.c: Include <elf.h>.
10805         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
10806         (ppc_hwcap): New global variable.
10807         (ppc_regmap): Remove __SPE__ #ifdef sections.
10808         (ppc_regmap_e500): New global variable.
10809         (ppc_cannot_store_register): Update __SPE__ special case.
10810         (ppc_get_hwcap): New function.
10811         (ppc_arch_setup): Use it to determine whether inferior supports
10812         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
10813         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
10814         Do not access registers if target does not support AltiVec.
10815         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
10816         Do not access registers if target does not support SPE.
10817         (target_regsets): Unconditionally include AltiVec and SPE regsets.
10818
10819 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
10820
10821         * linux-low.c (disabled_regsets, num_regsets): New.
10822         (use_regsets_p): Delete.
10823         (linux_wait_for_process): Clear disabled_regsets.
10824         (regsets_fetch_inferior_registers): Check and set it.
10825         (regsets_store_inferior_registers): Likewise.
10826         (linux_fetch_registers, linux_store_registers): Do not use
10827         use_regsets_p.
10828         (initialize_low): Allocate disabled_regsets.
10829
10830 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
10831
10832         * Makefile.in (LIBOBJS): New.
10833         (OBS): Use LIBOBJS.
10834         (memmem.o): New rule.
10835         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
10836         * configure: Regenerated.
10837
10838 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
10839
10840         * server.c (handle_query): Never return "unsupported" for
10841         qXfer:features:read queries.
10842
10843 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
10844
10845         * server.c (get_features_xml): Fix inverted condition.
10846         (handle_query): Always support qXfer:feature:read.
10847
10848 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
10849
10850         * server.c (wrapper_argv): New.
10851         (start_inferior): Handle wrapper_argv.  If set, expect an extra
10852         trap.
10853         (gdbserver_usage): Document --wrapper.
10854         (main): Parse --wrapper.
10855
10856 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10857
10858         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
10859         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
10860         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
10861         (ppc_set_pc): Likewise.
10862         (ppc_arch_setup): New function.
10863         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
10864         of collect_register.
10865         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
10866
10867 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10868
10869         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
10870         instead of linux-ppc64-low.o.
10871         * linux-ppc64-low.c: Remove file.
10872         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
10873         (linux-ppc64-low.o): Remove rule.
10874
10875         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
10876         (init_registers_powerpc_64): Likewise.
10877         (ppc_regmap): Conditionally define depending on __powerpc64__.
10878         (ppc_cannot_store_register): Do not special-case "fpscr" when
10879         compiled on __powerpc64__.
10880         (ppc_collect_ptrace_register): New function.
10881         (ppc_supply_ptrace_register): New function.
10882         (ppc_breakpoint): Change type to "unsigned int".
10883         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
10884         (the_low_target): Conditionally provide initializers for the
10885         arch_setup member depending on __powerpc64__.  Install
10886         collect_ptrace_register and supply_ptrace_register members.
10887
10888 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10889
10890         * regcache.h (gdbserver_xmltarget): Add extern declaration.
10891         * server.c (gdbserver_xmltarget): Define.
10892         (get_features_xml): Use it to replace "target.xml" and arch_string.
10893
10894         * configure.srv: Remove srv_xmltarget.  Add XML files that were
10895         mentioned there to srv_xmlfiles instead.  Remove conditional tests
10896         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
10897         srv_xmlfiles and srv_regobj to include all possible choices.
10898         * configure.ac (srv_xmltarget): Remove.
10899         (srv_xmlfiles): Do not add "target.xml".
10900         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
10901         checks for supplementary target information.
10902         * configure: Regenerate.
10903         * Makefile.in (XML_TARGET): Remove.
10904         (target.xml): Remove rule.
10905         (clean): Do not clean up target.xml.
10906         (.PRECIOUS): Do not mention target.xml.
10907
10908         * target.h (struct target_ops): Remove arch_string member.
10909         * linux-low.c (linux_arch_string): Remove.
10910         (linux_target_ops): Remove arch_string initializer.
10911         * linux-low.h (struct linux_target_ops): Remove arch_string member.
10912         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
10913         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
10914         * spu-low.c (spu_arch_string): Remove.
10915         (spu_target_ops): Remove arch_string initializer.
10916         * win32-low.c (win32_arch_string): Remove.
10917         (win32_target_ops): Remove arch_string initializer.
10918         * win32-low.h (struct win32_target_ops): Remove arch_string member.
10919         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
10920         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
10921
10922 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10923
10924         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
10925         by collect_ptrace_register and supply_ptrace_register hooks.
10926         * linux-low.c (fetch_register): Use supply_ptrace_register callback
10927         instead of checking for the_low_target.left_pad_xfer.
10928         (usr_store_inferior_registers): Use collect_ptrace_register callback
10929         instead of checking for the_low_target.left_pad_xfer.
10930
10931         * linux-s390-low.c (s390_collect_ptrace_register): New function.
10932         (s390_supply_ptrace_register): Likewise.
10933         (s390_fill_gregset): Call s390_collect_ptrace_register.
10934         (the_low_target): Update.
10935
10936         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
10937         (ppc_supply_ptrace_register): Likewise.
10938         (the_low_target): Update.
10939
10940         * linux-i386-low.c (the_low_target): Update.
10941         * linux-x86-64-low.c (the_low_target): Update.
10942
10943 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10944
10945         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
10946         reg-s390.o and reg-s390x.o.
10947
10948         * linux-low.c (new_inferior): New global variable.
10949         (linux_create_inferior, linux_attach): Set it.
10950         (linux_wait_for_process): Call the_low_target.arch_setup after the
10951         target has stopped for the first time.
10952         (initialize_low): Do not call the_low_target.arch_setup.
10953
10954         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
10955         (s390_set_pc): Likewise.
10956         (s390_arch_setup): New function.
10957         (the_low_target): Use s390_arch_setup as arch_setup routine.
10958
10959         * regcache.c (realloc_register_cache): New function.
10960         (set_register_cache): Call it for each existing regcache.
10961
10962 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10963
10964         * server.h (init_registers): Remove prototype.
10965
10966         * linux-low.h (struct linux_target_ops): Add arch_setup field.
10967         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
10968         instead of init_registers ().
10969         * linux-arm-low.c (init_registers_arm): Add prototype.
10970         (init_registers_arm_with_iwmmxt): Likewise.
10971         (the_low_target): Add initializer for arch_setup field.
10972         * linux-cris-low.c (init_registers_cris): Add prototype.
10973         (the_low_target): Add initializer for arch_setup field.
10974         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
10975         (the_low_target): Add initializer for arch_setup field.
10976         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
10977         (the_low_target): Add initializer for arch_setup field.
10978         * linux-ia64-low.c (init_registers_ia64): Add prototype.
10979         (the_low_target): Add initializer for arch_setup field.
10980         * linux-m32r-low.c (init_registers_m32r): Add prototype.
10981         (the_low_target): Add initializer for arch_setup field.
10982         * linux-m68k-low.c (init_registers_m68k): Add prototype.
10983         (the_low_target): Add initializer for arch_setup field.
10984         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
10985         (init_registers_mips64_linux): Likewise.
10986         (the_low_target): Add initializer for arch_setup field.
10987         * linux-ppc-low.c (init_registers_ppc): Add prototype.
10988         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
10989         (the_low_target): Add initializer for arch_setup field.
10990         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
10991         (init_registers_powerpc_64): Likewise.
10992         (the_low_target): Add initializer for arch_setup field.
10993         * linux-s390-low.c (init_registers_s390): Add prototype.
10994         (init_registers_s390x): Likewise.
10995         (the_low_target): Add initializer for arch_setup field.
10996         * linux-sh-low.c (init_registers_sh): Add prototype.
10997         (the_low_target): Add initializer for arch_setup field.
10998         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
10999         (the_low_target): Add initializer for arch_setup field.
11000         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
11001         (the_low_target): Add initializer for arch_setup field.
11002
11003         * win32-low.h (struct win32_target_ops): Add arch_setup field.
11004         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
11005         instead of init_registers ().
11006         * win32-arm-low.c (init_registers_arm): Add prototype.
11007         (the_low_target): Add initializer for arch_setup field.
11008         * win32-i386-low.c (init_registers_i386): Add prototype.
11009         (the_low_target): Add initializer for arch_setup field.
11010
11011         * spu-low.c (init_registers_spu): Add prototype.
11012         (initialize_low): Call initialie_registers_spu () instead of
11013         initialize_registers ().
11014
11015 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
11016
11017         * server.c (handle_v_requests): When handling the vRun and vAttach
11018         packets, if already debugging a process, don't kill it.  Return an
11019         error instead.
11020
11021 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
11022
11023         * server.c (handle_query): Correct length check.
11024
11025 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
11026
11027         * win32-low.c (do_initial_child_stuff): Add process handle
11028         parameter.  Set current_process_handle and current_process_id from the
11029         parameters. Clear globals.
11030         (win32_create_inferior): Don't set current_process_handle and
11031         current_process_id here.  Instead pass them on the call to
11032         do_initial_child_stuff.
11033         (win32_attach): Likewise.
11034         (win32_clear_inferiors): New.
11035         (win32_kill): Don't close the current process handle or the
11036         current thread handle here.  Instead call win32_clear_inferiors.
11037         (win32_detach): Don't open a new handle to the process.  Call
11038         win32_clear_inferiors.
11039         (win32_join): Don't rely on current_process_handle; open a new
11040         handle using the process id.
11041         (win32_wait): Call win32_clear_inferiors when the inferior process
11042         has exited.
11043
11044 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
11045
11046         * server.c (monitor_show_help): Add "exit".
11047
11048 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
11049
11050         * Makefile.in (SFILES): Add linux-xtensa-low.c.
11051         (clean): Add reg-xtensa.c.
11052         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
11053         * configure.srv (xtensa*-*-linux*) New target.
11054         * linux-xtensa-low.c: New.
11055         * xtensa-xtregs.c: New.
11056
11057 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
11058
11059         * hostio.c: Don't include errno.h.
11060         (errno_to_fileio_errno): Move to hostio-errno.
11061         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
11062         error number outputting to the target->hostio_last_error callback.
11063         (hostio_packet_error): Use FILEIO_EINVAL directly.
11064         (handle_open, handle_pread, hostio_error, handle_unlink): Update
11065         calls to hostio_error.
11066         * hostio-errno.c: New.
11067         * server.h (hostio_last_error_from_errno): Declare.
11068         * target.h (target_ops): Add hostio_last_error member.
11069         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
11070         as hostio_last_error handler.
11071         * spu-low.c (spu_target_ops): Likewise.
11072         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
11073         (wince_hostio_last_error): New functions.
11074         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
11075         as hostio_last_error handler.
11076         (win32_target_ops) [!_WIN32_WCE]: Register
11077         hostio_last_error_from_errno as hostio_last_error handler.
11078         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
11079         (hostio-errno.o): New rule.
11080         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
11081         * configure.srv (srv_hostio_err_objs): New variable.  Default to
11082         hostio-errno.o.
11083         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
11084         * configure: Regenerate.
11085
11086 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11087
11088         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
11089         (linux_kill, linux_detach): Clean up the process list.
11090         * remote-utils.c (remote_open): Improve port number parsing.
11091         (putpkt_binary, input_interrupt): Only send interrupts if the target
11092         is running.
11093         * server.c (extended_protocol): Make static.
11094         (attached): Define earlier.
11095         (exit_requested, response_needed, program_argv): New variables.
11096         (target_running): New.
11097         (start_inferior): Clear attached here.
11098         (attach_inferior): Set attached here.
11099         (require_running): Define.
11100         (handle_query): Use require_running and target_running.  Implement
11101         "monitor exit".
11102         (handle_v_attach, handle_v_run): New.
11103         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
11104         (gdbserver_usage): Update.
11105         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
11106         --attach along with other options or after the port.  Save
11107         program_argv.  Support no initial program.  Resynchronize
11108         communication with GDB after an error.  Handle "monitor exit".
11109         Use require_running and target_running.  Always allow the extended
11110         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
11111         restart in extended mode.
11112         * README: Refer to the GDB manual.  Update --attach usage.
11113
11114 2007-12-20  Andreas Schwab  <schwab@suse.de>
11115
11116         * linux-low.c (STACK_SIZE): Define.
11117         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
11118         (linux_test_for_tracefork): Likewise.
11119
11120 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
11121
11122         * linux-low.c (linux_wait_for_event): Update messages.  Do not
11123         reinsert auto-delete breakpoints.
11124         * mem-break.c (struct breakpoint): Change return type of handler to
11125         int.
11126         (set_breakpoint_at): Update handler type.
11127         (reinsert_breakpoint_handler): Return 1 instead of calling
11128         delete_breakpoint.
11129         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
11130         setting a new one.
11131         (check_breakpoints): Delete auto-delete breakpoints and return 2.
11132         * mem-break.h (set_breakpoint_at): Update handler type.
11133         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
11134         * win32-low.c (auto_delete_breakpoint): New.
11135         (get_child_debug_event): Use it.
11136
11137 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
11138
11139         * configure.ac: Check for pread and pwrite.
11140         * hostio.c (handle_pread): Fall back to lseek and read.
11141         (handle_pwrite): Fall back to lseek and write.
11142         * config.in, configure: Regenerated.
11143
11144 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
11145
11146         * server.c (myresume): Add own_buf argument.
11147         (main): Update calls.
11148
11149 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
11150
11151         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
11152         * remote-utils.c (remote_open): Do not call disable_async_io.
11153         (block_async_io): Delete.
11154         (unblock_async_io): Make static.
11155         (initialize_async_io): New.
11156         * server.c (handle_v_cont): Handle async I/O here.
11157         (myresume): Likewise.  Move other common resume tasks here...
11158         (main): ... from here.  Call initialize_async_io.  Disable async
11159         I/O before the main loop.
11160         * server.h (initialize_async_io): Declare.
11161         (block_async_io, unblock_async_io): Delete prototypes.
11162         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
11163
11164 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
11165
11166         * remote-utils.c (readchar): Allow binary data in received messages.
11167
11168 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11169
11170         * win32-low.c (attaching): New global.
11171         (win32_create_inferior): Clear the `attaching' global.
11172         (win32_attach): Set the `attaching' global.
11173         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
11174         attaching.  Only set a breakpoint at the entry point if not
11175         attaching.
11176
11177 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11178
11179         * server.c (main): Don't report dll events on the initial
11180         connection on attaches.
11181
11182 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11183
11184         * server.c (main): Relax numerical bases supported for the pid of
11185         the --attach command line argument.
11186
11187 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11188
11189         * win32-low.c (win32_attach): Call OpenProcess before
11190         DebugActiveProcess, not after.  Add last error output to error
11191         call.
11192
11193 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11194
11195         * win32-low.c (win32_get_thread_context)
11196         (win32_set_thread_context): New functions.
11197         (thread_rec): Use win32_get_thread_context.
11198         (continue_one_thread, win32_resume): Use win32_set_thread_context.
11199         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
11200         field.
11201
11202 2007-12-03  Leo Zayas
11203             Pedro Alves  <pedro_alves@portugalmail.pt>
11204
11205         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
11206         global variables.
11207         (child_add_thread): Minor cleanup.
11208         (child_continue): Resume artificially suspended threads before
11209         calling ContinueDebugEvent.
11210         (suspend_one_thread): New.
11211         (fake_breakpoint_event): New.
11212         (get_child_debug_event): Change return type to int.  Check here if
11213         gdb sent an interrupt request.  If a soft interrupt was requested,
11214         fake a breakpoint event.  Return 0 if there is no event to handle,
11215         and 1 otherwise.
11216         (win32_wait): Don't check here if gdb sent an interrupt request.
11217         Ensure there is a valid event to handle.
11218         (win32_request_interrupt): Add soft interruption method as last
11219         resort.
11220
11221 2007-12-03  Leo Zayas
11222             Pedro Alves  <pedro_alves@portugalmail.pt>
11223
11224         * win32-low.h (win32_thread_info): Add descriptions to the
11225         structure members.  Replace `suspend_count' counter by a
11226         `suspended' flag.
11227         * win32-low.c (thread_rec): Update condition of when to get the
11228         context from the inferior.  Rely on ContextFlags being set if it
11229         has already been retrieved.  Only suspend the inferior thread if
11230         we haven't already.  Warn if that fails.
11231         (continue_one_thread): s/suspend_count/suspended/.  Only call
11232         ResumeThread once.  Warn if that fails.
11233
11234 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11235
11236         * win32-low.c (win32_wait): Don't read from the inferior when it
11237         has already exited.
11238
11239 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11240
11241         * Makefile.in (win32_low_h): New variable.
11242         (win32-low.o): Add dependency on $(win32_low_h).
11243         (win32-arm-low.o, win32-i386-low.o): New rules.
11244
11245 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11246
11247         * hostio.c: Correct copyright year.
11248
11249 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11250
11251         * Makefile.in (OBS): Add hostio.o.
11252         (hostio.o): New rule.
11253         * server.h (handle_vFile): Declare.
11254         * hostio.c: New file.
11255         * server.c (handle_v_requests): Take packet_len and new_packet_len
11256         for binary packets.  Call handle_vFile.
11257         (main): Update call to handle_v_requests.
11258
11259 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
11260
11261         * linux-low.c: Include <sched.h>.
11262
11263 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
11264
11265         * linux-low.c (linux_tracefork_grandchild): New.
11266         (linux_tracefork_child): Use clone.
11267         (linux_test_for_tracefork): Use clone; allocate and free a stack.
11268
11269 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
11270
11271         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
11272
11273 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
11274
11275         * linux-low.c (handle_extended_wait): Handle unexpected signals.
11276
11277 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
11278
11279         * inferiors.c (change_inferior_id): Delete.
11280         (add_pid_to_list, pull_pid_from_list): New.
11281         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
11282         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
11283         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
11284         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
11285         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
11286         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
11287         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
11288         (using_threads): Always set to 1.
11289         (handle_extended_wait): New.
11290         (add_process): Do not set TID.
11291         (linux_create_inferior): Set must_set_ptrace_flags.
11292         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
11293         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
11294         (linux_thread_alive): Rename TID argument to LWPID.
11295         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
11296         (linux_wait_for_event): Do not use TID or check using_threads.  Update
11297         call to dead_thread_notify.  Call handle_extended_wait.
11298         (linux_create_inferior): Use PTRACE_SETOPTIONS.
11299         (send_sigstop): Delete sigstop_sent.
11300         (wait_for_sigstop): Avoid TID.
11301         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
11302         (linux_test_for_tracefork): New.
11303         (linux_lookup_signals): Use thread_db_active and
11304         linux_supports_tracefork_flag.
11305         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
11306         * linux-low.h (get_process_thread): Avoid TID.
11307         (struct process_ifo): Move thread_known and tid to the end.  Remove
11308         sigstop_sent.
11309         (linux_attach_lwp, thread_db_init): Update prototypes.
11310         * server.h (change_inferior_id): Delete prototype.
11311         (add_pid_to_list, pull_pid_from_list): New prototypes.
11312         * thread-db.c (thread_db_use_events): New.
11313         (find_first_thread): Rename to...
11314         (find_one_thread): ...this.  Update callers and messages.  Do not
11315         call fatal.  Check thread_db_use_events.  Do not call
11316         change_inferior_id or new_thread_notify.
11317         (maybe_attach_thread): Update.  Do not call new_thread_notify.
11318         (thread_db_init): Set thread_db_use_events.  Check use_events.
11319         * utils.c (fatal, warning): Correct message prefix.
11320
11321 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
11322
11323         * Makefile.in (clean): Remove new files.
11324         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
11325         (powerpc-64.o, powerpc-64.c): New rules.
11326         * configure.srv: Use alternate register sets for powerpc64-*-linux*
11327         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
11328         with SPE.
11329         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
11330         SPE targets.
11331         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
11332         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
11333         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
11334         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
11335         (target_regsets): Add AltiVec and SPE register sets.
11336         * configure.ac: Check for AltiVec and SPE.
11337         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
11338         (ppc_fill_vrregset, ppc_store_vrregset): New.
11339         (target_regsets): Add AltiVec register set.
11340         * configure: Regenerated.
11341
11342 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
11343
11344         * linux-low.c (O_LARGEFILE): Define.
11345         (linux_read_memory): Use /proc/PID/mem.
11346         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
11347         * configure, config.in: Regenerated.
11348
11349 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
11350
11351         * linux-low.c (linux_wait_for_event): Do not pass signals while
11352         single-stepping.
11353
11354 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11355
11356         * win32-low.c (create_process): New.
11357         (win32_create_inferior): Use create_process instead of
11358         CreateProcess.  If create_process failed retry appending an ".exe"
11359         suffix.  Store the GetLastError result immediatelly after
11360         create_process calls and use it on the call to error.
11361
11362 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11363
11364         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
11365
11366 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
11367
11368         * configure.ac: Switch license to GPLv3.
11369
11370 2007-08-01  Michael Snyder  <msnyder@access-company.com>
11371
11372         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
11373
11374 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
11375
11376         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
11377         typedef.
11378         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
11379         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
11380         CloseToolhelp32Snapshot.
11381         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
11382         CloseToolhelp32Snapshot.
11383
11384 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
11385
11386         * server.c (main): Check for inferior exit before main loop.
11387
11388 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
11389
11390         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
11391         instead of on tmp_desc.
11392
11393 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
11394             Daniel Jacobowitz  <dan@codesourcery.com>
11395
11396         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
11397         (add_thread): Minor cleanups.
11398         (clear_inferiors): Move lower in the file.  Clear the DLL
11399         list.
11400         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
11401         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
11402         (xml_escape_text): New.
11403         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
11404         for qSupported.
11405         (handle_v_cont): Report errors.
11406         (gdbserver_version): Update.
11407         (main): Correct size of own_buf.  Do not report initial DLL events.
11408         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
11409         (unloaded_dll, xml_escape_text): New.
11410         * win32-low.c (enum target_waitkind): Update comments.
11411         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
11412         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
11413         (win32_EnumProcessModules, win32_GetModuleInformation)
11414         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
11415         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
11416         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
11417         (win32_Module32First, win32_Module32Next, load_toolhelp)
11418         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
11419         (get_child_debug_event): Handle DLL events.
11420         (win32_wait): Likewise.
11421
11422 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11423
11424         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
11425         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
11426
11427 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11428
11429         * win32-low.c (handle_output_debug_string): Ignore event if not
11430         waiting.
11431
11432 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11433
11434         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
11435
11436 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
11437
11438         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
11439
11440 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
11441
11442         * inferiors.c (change_inferior_id): Add comment.
11443         * linux-low.c (check_removed_breakpoint): Add an early
11444         prototype.  Improve debug output.
11445         (linux_attach): Doc update.
11446         (linux_detach_one_process, linux_detach): Clean up before releasing
11447         each process.
11448         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
11449         * linux-low.h (struct process_info): Doc improvement.
11450         * mem-break.c (delete_all_breakpoints): New.
11451         * mem-break.h (delete_all_breakpoints): New prototype.
11452         * thread-db.c (find_first_thread): New.
11453         (thread_db_create_event): Call it instead of
11454         thread_db_find_new_threads.  Clean up unused variables.
11455         (maybe_attach_thread): Remove first thread handling.
11456         (thread_db_find_new_threads): Use find_first_thread.
11457         (thread_db_get_tls_address): Likewise.
11458
11459 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
11460
11461         * thread-db.c (thread_db_find_new_threads): Add prototype.
11462         (thread_db_create_event): Check for the main thread before adding
11463         a new thread.
11464         (maybe_attach_thread): Only enable event reporting if TID == 0.
11465         (thread_db_get_tls_address): Check for new threads.
11466
11467 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
11468
11469         * linux-low.c (linux_create_inferior): Try execv before execvp.
11470         * spu-low.c (spu_create_inferior): Likewise.
11471
11472 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
11473
11474         * linux-low.c (linux_create_inferior): Change execv to execvp.
11475         * spu-low.c (spu_create_inferior): Likewies.
11476
11477 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
11478
11479         * Makefile.in (clean): Clean new files instead of deleted ones.
11480         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
11481         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
11482         rules.
11483         * configure.srv: Specify XML files and new regformats for MIPS and
11484         MIPS64 GNU/Linux.
11485         * linux-mips-low.c (mips_num_regs): Set to only used registers.
11486         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
11487         an entry for the restart register.
11488         (mips_cannot_fetch_register, mips_cannot_store_register)
11489         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
11490         register names to match the XML descriptions.
11491         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
11492         restart register instead of $0.
11493
11494 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11495             Markus Deuling  <deuling@de.ibm.com>
11496
11497         * remote-utils.c (decode_xfer_write): New function.
11498         * server.h (decode_xfer_write): Add prototype.
11499         * server.c (handle_query): Add PACKET_LEN argument.  Support
11500         qXfer:spu:read and qXfer:spu:write packets.
11501         (main): Pass packet_len to handle_query.
11502         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
11503         * target.h (target_ops): Add qxfer_spu.
11504
11505 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11506
11507         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
11508         accessing non-seekable spufs files.
11509
11510 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
11511
11512         * server.c (handle_query): Add reply for qC packet.
11513
11514 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11515             Leo Zayas  <lerele@champenstudios@com>
11516
11517         * server.h (check_remote_input_interrupt_request): New function.
11518         * remote_utils.c (INVALID_DESCRIPTOR): New define.
11519         (remote_desc): Initialize with INVALID_DESCRIPTOR.
11520         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
11521         (check_remote_input_interrupt_request): New function.
11522         * server.h (check_remote_input_interrupt_request): Declare.
11523         * win32-low.c (winapi_DebugBreakProcess,
11524         winapi_GenerateConsoleCtrlEvent): New typedefs.
11525         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
11526         to 250 ms.
11527         (win32_wait): Check for remote interrupt request
11528         with check_remote_input_interrupt_request.
11529         (win32_request_interrupt): New function.
11530         (win32_target_op): Set request_interrupt to win32_request_interrupt.
11531
11532 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11533
11534         * win32-low.c (debug_registers_changed,
11535         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
11536         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
11537         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
11538         (thread_rec): Get context using the low target.
11539         (child_add_thread): Call thread_added on the low target,
11540         which does the same thing.
11541         (regptr): Delete.
11542         (do_initial_child_stuff): Remove debug registers references.
11543         Set context using the low target.  Resume threads after
11544         setting the contexts.
11545         (child_continue): Remove dead variable.  Remove debug
11546         registers references.
11547         (child_fetch_inferior_registers): Go through the low target.
11548         (do_child_store_inferior_registers): Remove.
11549         (child_store_inferior_registers): Go through the low target.
11550         (win32_resume): Remove debug registers references.
11551         Set context using the low target.
11552         (handle_exception): Change return type to void.  Don't record
11553         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
11554         first chance exception.
11555         (get_child_debug_event): Change return type to void.  Remove
11556         goto loop.  Always return after waiting for debug event.
11557         (win32_wait): Convert to switch statement.  Handle spurious
11558         events.
11559
11560         * win32-i386-low.c (debug_registers_changed,
11561         debug_registers_used): New.
11562         (initial_stuff): Rename to ...
11563         (i386_initial_stuff): ... this.  Clear debug registers
11564         state variables.
11565         (store_debug_registers): Delete.
11566         (i386_get_thread_context): New.
11567         (load_debug_registers): Delete.
11568         (i386_set_thread_context): New.
11569         (i386_thread_added): New.
11570         (single_step): Rename to ...
11571         (i386_single_step): ... this.
11572         (do_fetch_inferior_registers): Rename to ...
11573         (i386_fetch_inferior_register): ... this.
11574         (i386_store_inferior_register): New.
11575         (the_low_target): Adapt to new interface.
11576
11577         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
11578         (arm_get_thread_context): New.
11579         (arm_set_thread_context): New.
11580         (regptr): New.
11581         (do_fetch_inferior_registers): Rename to ...
11582         (arm_fetch_inferior_register): ... this.
11583         (arm_store_inferior_register): New.
11584         (arm_wince_breakpoint): Reimplement as unsigned long.
11585         (arm_wince_breakpoint_len): Define.
11586         (the_low_target): Adapt to new interface.
11587
11588         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
11589         load_debug_registers.  Add get_thread_context, set_thread_context,
11590         thread_added and store_inferior_register.  Rename
11591         fetch_inferior_registers to fetch_inferior_register.
11592         (regptr): Remove declaration.
11593
11594 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11595
11596         * linux-low.c (linux_detach): Change return type to int.  Return 0.
11597         * spu-low.c (spu_detach): Likewise.
11598
11599 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11600
11601         * target.h (target_ops): Change return type of detach to int.
11602         Add join.
11603         (join_inferior): New.
11604         * server.c (main): Don't skip detach support on mingw32.
11605         If the inferior doesn't support detaching return error.
11606         Call join_inferior instead of using waitpid.
11607         * linux-low.c (linux_join): New.
11608         (linux_target_op): Add linux_join.
11609         * spu-low.c (spu_join): New.
11610         (spu_target_ops): Add spu_join.
11611         * win32-low.c (win32_detach): Adapt to new interface.
11612         Reopen current_process_handle before detaching.  Issue a child
11613         resume before detaching.
11614         (win32_join): New.
11615         (win32_target_op): Add win32_join.
11616
11617 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11618
11619         * win32-low.c (win32-attach): Fix return value.
11620         * target.h (target_ops): Describe ATTACH return values.
11621
11622 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11623
11624         * win32-low.c (GETPROCADDRESS): Define.
11625         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
11626         (winapi_DebugSetProcessKillOnExit): Likewise.
11627         (win32_create_inferior): Force usage of ansi CreateProcessA.
11628         (win32_attach): Use GETPROCADDRESS.
11629         (win32_detach): Likewise.
11630
11631 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11632
11633         * win32-low.c (win32_wait): Don't use WSTOPSIG.
11634
11635 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
11636
11637         * win32-low.c: Commit leftover changes from 2007-03-29.
11638
11639 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11640
11641         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
11642         fields short instead of int.  Add explicit padding.
11643         (i387_cache_to_fsave): Remove unnecessary casts.
11644         (i387_fsave_to_cache): Doc fix.
11645         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
11646
11647 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11648
11649         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
11650         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
11651
11652 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11653
11654         * configure.srv (arm*-*-mingw32ce*): Move near the other
11655         arm targets.
11656
11657 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11658
11659         * configure.ac: Add errno checking.
11660         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
11661         sys/file.h and malloc.h.
11662         (AC_CHECK_DECLS): Add perror.
11663         (srv_mingwce): Handle.
11664         * configure.srv (i[34567]86-*-cygwin*): Add
11665         win32-i386-low.o to srv_tgtobj.
11666         (i[34567]86-*-mingw*): Likewise.
11667         (arm*-*-mingw32ce*): Add case.
11668         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11669         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
11670         [__MINGW32CE__] (strerror): New function.
11671         [__MINGW32CE__] (errno): Define to GetLastError.
11672         [__MINGW32CE__] (COUNTOF): New macro.
11673         (remote_open): Remove extra close call.
11674         * mem-break.c (delete_breakpoint_at): New function.
11675         * mem-break.h (delete_breakpoint_at): Declare.
11676         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11677         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
11678         [USE_WIN32API] (read, write): Add char* casts.
11679         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
11680         * server.h: Include wincecompat.h on Windows CE.
11681         [HAVE_ERRNO_H]: Check.
11682         (perror): Declare if not declared.
11683         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
11684         (perror_with_name): Remove errno declaration.
11685         * wincecompat.h: New.
11686         * wincecompat.c: New.
11687         * win32-low.h: New.
11688         * win32-arm-low.c: New.
11689         * win32-i386-low.c: New.
11690         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
11691         (OUTMSG2): Make it safe.
11692         (_T): New macro.
11693         (COUNTOF): New macro.
11694         (NUM_REGS): Get it from the low target.
11695         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
11696         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
11697         (thread_rec): Let low target handle debug registers.
11698         (child_add_thread): Likewise.
11699         (child_init_thread_list): Likewise.
11700         (continue_one_thread): Likewise.
11701         (regptr): New.
11702         (do_child_fetch_inferior_registers): Move to ...
11703         * win32-i386-low.c: ... here, and rename to ...
11704         (do_fetch_inferior_registers): ... this.
11705         * win32-low.c (child_fetch_inferior_registers):
11706         Go through the low target.
11707         (do_child_store_inferior_registers): Use regptr.
11708         (strwinerror): New function.
11709         (win32_create_inferior): Handle Windows CE.
11710         Use strwinerror instead of strerror on Windows error
11711         codes.  Add program to the error output.
11712         Don't close the main thread handle on Windows CE.
11713         (win32_attach): Use coredll.dll on Windows CE.
11714         (win32_kill): Close current process and current
11715         thread handles.
11716         (win32_detach): Use coredll.dll on Windows CE.
11717         (win32_resume): Let low target handle debug registers, and
11718         step request.
11719         (handle_exception): Add/Remove initial breakpoint.  Avoid
11720         non-existant WSTOPSIG on Windows CE.
11721         (win32_read_inferior_memory): Cast to remove warning.
11722         (win32_arch_string): Go through the low target.
11723         (initialize_low): Call set_breakpoint_data with the low
11724         target's breakpoint.
11725         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
11726         FOP_REGNUM, mappings): Move to ...
11727         * win32-i386-low.c: ... here.
11728         * win32-low.c (win32_thread_info): Move to ...
11729         * win32-low.h: ... here.
11730         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
11731         win32-arm-low.c and wincecompat.c.
11732         (all:): Add $EXEEXT.
11733         (install-only:): Likewise.
11734         (gdbserver:): Likewise.
11735         (gdbreplay:): Likewise.
11736         * config.in: Regenerate.
11737         * configure: Regenerate.
11738
11739 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11740
11741         * win32-low.c: Rename typedef thread_info to
11742         win32_thread_info throughout.
11743
11744 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11745
11746         * win32-i386-low.c: Rename to ...
11747         * win32-low.c: ... this.
11748         * configure.srv: Replace win32-i386-low.o with win32-low.o.
11749         * Makefile.in: Likewise.
11750
11751 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
11752
11753         * remote-utils.c (monitor_output): Constify msg parameter.
11754         * server.h (monitor_output): Likewise.
11755         * win32-i386-low.c (handle_output_debug_string): New.
11756         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
11757         handle_output_debug_string.
11758         (get_child_debug_event): Likewise.
11759
11760 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
11761
11762         * server.c (main): Correct strtoul check.
11763
11764 2007-03-27  Jon Ringle  <jon@ringle.org>
11765
11766         * linux-low.c: Check __ARCH_HAS_MMU__ also.
11767
11768 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
11769
11770         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
11771
11772 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
11773
11774         * terminal.h: Check HAVE_SGTTY_H.
11775
11776 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
11777
11778         * remote-utils.c (remote_open): Print out the assigned port number.
11779
11780 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
11781
11782         * remote-utils.c (monitor_output): New function.
11783         * server.c (debug_threads): Define here.
11784         (monitor_show_help): New function.
11785         (handle_query): Handle qRcmd.
11786         (main): Do not handle 'd' packet.
11787         * server.h (debug_threads, remote_debug, monitor_output): Declare.
11788         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
11789         of debug_threads.
11790
11791 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11792
11793         * Makefile.in (EXEEXT): New.
11794         (clean): Use $(EXEEXT).
11795
11796 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11797
11798         * target.h (target_ops): Rename send_signal to request_interrupt,
11799         and remove enum target_signal parameter.
11800         * linux-low.c (linux_request_interrupt): Rename from
11801         linux_send_signal, and always send SIGINT.
11802         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
11803         and always send SIGINT.
11804         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
11805         of send_signal.
11806         (input_interrupt): Likewise.
11807
11808 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11809
11810         * server.c (get_features_xml): Check if target implemented
11811         arch_string.
11812         * win32-i386-low.c (win32_arch_string): New.
11813         (win32_target_ops): Add win32_arch_string as arch_string member.
11814
11815 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
11816
11817         * spu-low.c (spu_arch_string): New.
11818         (spu_target_ops): Add spu_arch_string.
11819
11820 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
11821
11822         * remote-utils.c: Remove HAVE_TERMINAL_H check.
11823         * configure.ac: Do not check for terminal.h.
11824         * configure, config.in: Regenerated.
11825
11826 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
11827
11828         * Makefile.in (OBS): Add $(XML_BUILTIN).
11829         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
11830         (clean): Update.
11831         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
11832         (arm-with-iwmmxt.c): New.
11833         * config.in, configure: Regenerate.
11834         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
11835         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
11836         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
11837         (arm*-*-linux*): Add iWMMXt and regset support.
11838         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
11839         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
11840         (arm_store_wmmxregset, target_regsets): New.
11841         * server.c (get_features_xml): Take annex argument.  Check builtin
11842         XML documents.
11843         (handle_query): Handle multiple annexes.
11844
11845 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11846
11847         * remote-utils.c [USE_WIN32API] (read, write): Define.
11848         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
11849         write.
11850
11851 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
11852
11853         * linux-i386-low.c (the_low_target): Set arch_string.
11854         * linux-x86-64-low.c (the_low_target): Likewise.
11855         * linux-low.c (linux_arch_string): New.
11856         (linux_target_ops): Add it.
11857         * linux-low.h (struct linux_target_ops): Add arch_string.
11858         * server.c (write_qxfer_response): Use const void * for DATA.
11859         (get_features_xml): New.
11860         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
11861         * target.h (struct target_ops): Add arch_string method.
11862
11863 2007-01-03  Denis Pilat  <denis.pilat@st.com>
11864             Daniel Jacobowitz  <dan@codesourcery.com>
11865
11866         * linux-low.c (linux_kill): Handle being called with no threads.
11867         * win32-i386-low.c (win32_kill): Likewise.
11868         (get_child_debug_event): Clear current_process_handle.
11869
11870 2006-12-30  Denis PILAT  <denis.pilat@st.com>
11871             Daniel Jacobowitz  <dan@codesourcery.com>
11872
11873         * remote-utils.c (remote_open): Check the type of specified
11874         serial port devices before opening them.
11875         * server.c (main): Kill the inferior if an error occurs during
11876         the first remote_open.
11877
11878 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
11879
11880         * README: Update supported targets.
11881
11882 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
11883
11884         * Makefile.in (clean): Remove reg-mips64.c.
11885         (reg-mips64.c, reg-mips64.o): New rules.
11886         * configure.srv: Handle mips64.  Include regset support for mips.
11887         * linux-mips-low.c (union mips_register): New.
11888         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
11889         (mips_breakpoint, mips_breakpoint_at): Use int.
11890         (mips_collect_register, mips_supply_register)
11891         (mips_collect_register_32bit, mips_supply_register_32bit)
11892         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
11893         (mips_store_fpregset, target_regsets): New.
11894         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
11895
11896 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
11897
11898         * configure.srv: Add target "spu*-*-*".
11899         * Makefile.in (clean): Remove reg-spu.c.
11900         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
11901         * spu-low.c: New file.
11902
11903 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11904
11905         * configure.ac: Correct td_thr_tls_get_addr test.
11906         * configure: Regenerated.
11907
11908 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11909
11910         * linux-low.c (linux_wait_for_event): Reformat.  Use the
11911         pass_signals array.
11912         * remote-utils.c (decode_address_to_semicolon): New.
11913         * server.c (pass_signals, handle_general_set): New.
11914         (handle_query): Mention QPassSignals for qSupported.
11915         (main): Call handle_general_set.
11916         * server.h (pass_signals, decode_address_to_semicolon): New.
11917
11918 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
11919
11920         * server.c (handle_query): Correct error handling for read_auxv.
11921
11922 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
11923
11924         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
11925         and srv_linux_thread_db to yes.
11926         * linux-s390-low.c (s390_fill_gregset): New function.
11927         (target_regsets): Define data structure.
11928
11929 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
11930
11931         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
11932         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
11933         * config.in, configure: Regenerated.
11934         * inferiors.c (gdb_id_to_thread): New function.
11935         (gdb_id_to_thread_id): Use it.
11936         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
11937         * linux-low.h (struct process_info): Add th member.
11938         (thread_db_get_tls_address): New prototype.
11939         * remote-utils.c (decode_address): Make non-static.
11940         * server.c (handle_query): Handle qGetTLSAddr.
11941         * server.h (gdb_id_to_thread, decode_address): New prototypes.
11942         * target.h (struct target_ops): Add get_tls_address.
11943         * thread-db.c (maybe_attach_thread): Save the thread handle.
11944         (thread_db_get_tls_address): New.
11945
11946 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
11947
11948         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
11949         (linux_resume_one_process): Take a siginfo_t *.  Update all
11950         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
11951         (struct pending_signals): Add a siginfo_t.
11952         (linux_wait_for_process): Always set last_status.
11953         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
11954         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
11955         * linux-low.h (struct process_info): Add last_status.
11956
11957 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
11958
11959         * remote-utils.c (try_rle): New function.
11960         (putpkt_binary): Use it.
11961
11962 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
11963
11964         * Makefile.in (clean): Clean reg-x86-64-linux.c.
11965         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
11966         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
11967         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
11968         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
11969         point registers.
11970
11971 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
11972
11973         * server.c (terminal_fd): New variable.
11974         (old_foreground_pgrp): Likewise.
11975         (restore_old_foreground_pgrp): New function.
11976         (start_inferior): Record the terminal file descriptor in terminal_fd
11977         and its original foreground group in old_foreground_pgrp.  Register
11978         restore_old_foreground_pgrp with atexit().
11979
11980 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
11981
11982         * server.c (handle_query): Correct qPart to qXfer.
11983
11984 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
11985
11986         * configure.ac: Check for more headers which are missing on
11987         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
11988         * configure.srv: Add Cygwin and mingw32.
11989         * remote-utils.c: Don't include headers unconditionally which
11990         are missing on mingw32.  Include <winsock.h> for mingw32.
11991         (remote_open): Adjust for mingw32 support.  Flush
11992         standard error after writing to it.
11993         (remote_close, putpkt_binary, input_interrupt, block_async_io)
11994         (unblock_async_io, enable_async_io, disable_async_io)
11995         (readchar, getpkt): Update for Winsock support.
11996         (prepare_resume_reply): Expect a protocol signal number.
11997         * server.c: Disable <sys/wait.h> on mingw32.
11998         (start_inferior): Adjust for mingw32 support.  Flush
11999         standard error after writing to it.
12000         (attach_inferior): Likewise.  Use protocol signal
12001         numbers.
12002         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
12003         and names.
12004         * win32-i386-low.c: New file.
12005         * Makefile.in (XM_CLIBS): Set.
12006         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
12007         (win32-i386-low.o): New dependency rule.
12008         * linux-low.c (linux_wait): Use target signal numbers.
12009         * target.h (struct target_ops): Doc fix.
12010         * server.h (target_signal_to_name): New prototype.
12011         * gdbreplay.c: Don't include headers unconditionally which
12012         are missing on mingw32.  Include <winsock.h> for mingw32.
12013         (remote_close, remote_open): Adjust for Winsock support.
12014         * configure, config.in: Regenerated.
12015
12016 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
12017
12018         * server.c (decode_xfer_read, write_qxfer_response): New.
12019         (handle_query): Take a packet length argument.  Handle
12020         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
12021         the qSupported response.
12022         (main): Update call to handle_query.
12023
12024 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
12025
12026         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
12027         (putpkt_binary): Renamed from putpkt and adjusted for binary
12028         data.
12029         (putpkt): New wrapper for putpkt_binary.
12030         (readchar): Don't mask off the high bit.
12031         (decode_X_packet): New function.
12032         * server.c (main): Call putpkt_binary if a handler sets the packet
12033         length.  Save the length of the incoming packet.  Handle 'X'.
12034         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
12035
12036 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
12037
12038         * server.c (handle_query): Handle qSupported.
12039
12040 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12041
12042         * remote-utils.c (all_symbols_looked_up): New variable.
12043         (look_up_one_symbol): Check it.
12044         * server.h (look_up_one_symbol): New declaration.
12045         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
12046
12047 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
12048
12049         * Makefile.in (linux-arm-low.o): Update dependencies.
12050         * linux-arm-low.c: Include "gdb_proc_service.h".
12051         (PTRACE_GET_THREAD_AREA): Define.
12052         (ps_get_thread_area): New function.
12053
12054 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
12055
12056         * configure.srv (m68k*-*-uclinux*): New target.
12057         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
12058         (linux_resume_one_process): Remove extraneous cast.
12059         (linux_read_offsets): New.
12060         (linux_target_op): Add linux_read_offsets on mmuless systems.
12061         * server.c (handle_query): Add qOffsets logic.
12062         * target.h (struct target_ops): Add read_offsets.
12063
12064 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12065
12066         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
12067         (PTRACE_GET_THREAD_AREA): Define.
12068         (ps_get_thread_area): New function.
12069         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
12070         (linux-x86-64-low.o): Update.
12071
12072 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
12073
12074         * configure.ac: Remove checks for prfpregset_t.
12075         * gdb_proc_service.h: New file.
12076         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
12077         new "gdb_proc_service.h".
12078         * proc-service.c: Likewise.
12079         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
12080         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
12081         * Makefile.in (gdb_proc_service_h): Updated.
12082         * configure, config.in: Regenerated.
12083
12084 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12085
12086         * remote-utils.c (prepare_resume_reply): Move declaration
12087         of gdb_id_from_wait to the top of the block.
12088
12089 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
12090
12091         * linux-low.c (regsets_store_inferior_registers): Read the regset
12092         from the target before filling it.
12093
12094 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
12095
12096         * server.c (attach_inferior): Return SIGTRAP for a successful
12097         attach.
12098
12099 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
12100
12101         * Makefile.in (OBS): Add version.o.
12102         (STAGESTUFF): Delete.
12103         (version.o): Add dependencies.
12104         (version.c): Replace rule.
12105         (clean): Remove version.c.
12106         * server.c (gdbserver_version): New.
12107         (gdbserver_usage): Use printf.
12108         (main): Handle --version and --help.
12109         * server.h (version, host_name): Add declarations.
12110
12111 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
12112
12113         * linux-arm-low.c:
12114         * linux-arm-low.c:
12115         * inferiors.c:
12116         * i387-fp.h:
12117         * i387-fp.c:
12118         * gdbreplay.c:
12119         * regcache.c:
12120         * proc-service.c:
12121         * mem-break.h:
12122         * mem-break.c:
12123         * linux-x86-64-low.c:
12124         * linux-sh-low.c:
12125         * linux-s390-low.c:
12126         * linux-ppc64-low.c:
12127         * linux-ppc-low.c:
12128         * linux-mips-low.c:
12129         * linux-m68k-low.c:
12130         * linux-m32r-low.c:
12131         * linux-low.h:
12132         * linux-low.c:
12133         * linux-ia64-low.c:
12134         * linux-i386-low.c:
12135         * linux-crisv32-low.c:
12136         * thread-db.c:
12137         * terminal.h:
12138         * target.h:
12139         * target.c:
12140         * server.h:
12141         * server.c:
12142         * remote-utils.c:
12143         * regcache.h:
12144         * utils.c:
12145         * Makefile.in:
12146         * configure.ac:
12147         * gdbserver.1: Add (C) after Copyright.  Update the FSF
12148         address.
12149
12150 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
12151
12152         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
12153         (arm_breakpoint_at): Recognize both breakpoints.
12154         (the_low_target): Use the correct breakpoint instruction.
12155
12156 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
12157
12158         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
12159         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
12160         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
12161         (the_low_target): Update.
12162
12163 2005-10-25  Andreas Schwab  <schwab@suse.de>
12164
12165         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
12166
12167         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
12168         (ia64_num_regs): Reduce to 462.
12169
12170 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
12171
12172         * acinclude.m4: Correct quoting.
12173         * aclocal.m4: Regenerated.
12174
12175         Suggested by SZOKOVACS Robert <szo@ies.hu>:
12176         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
12177         (thread_db_init): Call thread_db_err_str.
12178         * configure.ac: Check for TD_VERSION.
12179         * config.in, configure: Regenerated.
12180
12181 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12182
12183         * server.h (error, fatal, warning): Add ATTR_FORMAT.
12184
12185 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12186
12187         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
12188         is not available.  Define HAVE_PTRACE_GETREGS if it is.
12189         * config.in, configure: Regenerated.
12190         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
12191         * linux-i386-low.c, linux-m68k-low.c: Update to use
12192         HAVE_PTRACE_GETREGS.
12193         * linux-low.c (regsets_fetch_inferior_registers)
12194         (regsets_store_inferior_registers): Only return 0 if we processed
12195         GENERAL_REGS.
12196         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
12197         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
12198
12199 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12200
12201         * inferiors.c (struct thread_info): Add gdb_id.
12202         (add_thread): Add gdb_id argument.
12203         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
12204         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
12205         calls to add_thread.
12206         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
12207         * server.c (handle_query): Use thread_to_gdb_id.
12208         (handle_v_cont, main): Use gdb_id_to_thread_id.
12209         * server.h (add_thread): Update prototype.
12210         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
12211         prototypes.
12212
12213 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12214
12215         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
12216         left-padded registers.
12217         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
12218         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
12219
12220 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
12221
12222         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
12223         * configure: Regenerate.
12224         * config.in: Regenerate.
12225         * server.h (NEED_DECLARATION_STRERROR):
12226         Replace with !HAVE_DECL_STRERROR.
12227
12228 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
12229
12230         * linux-low.c (linux_wait, linux_send_signal): Don't test
12231         an unsigned long variable for > 0 if it could be MAX_ULONG.
12232         * server.c (myresume): Likewise.
12233         * target.c (set_desired_inferior): Likewise.
12234
12235 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
12236
12237         * configure.ac: Simplify and improve check for socklen_t.
12238         * configure, config.in: Regenerate.
12239
12240 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
12241
12242         * acconfig.h: Remove.
12243         * configure.ac: Add a test for socklen_t.  Use three-argument
12244         AC_DEFINE throughout.
12245         * config.in: Regenerated using autoheader 2.59.
12246         * configure: Regenerated.
12247
12248         * gdbreplay.c (socklen_t): Provide a default.
12249         (remote_open): Use socklen_t.
12250         * remote-utils.c (socklen_t): Provide a default.
12251         (remote_open): Use socklen_t.
12252         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
12253         unsigned char.
12254
12255         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
12256         char for buffers.
12257         * linux-low.c (linux_read_memory, linux_write_memory)
12258         (linux_read_auxv): Likewise.
12259         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
12260         (check_mem_write): Likewise.
12261         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
12262         Likewise.
12263         * regcache.c (struct inferior_rgcache_data, registers_to_string)
12264         (registers_from_string, register_data): Likewise.
12265         * server.c (handle_query, main): Likewise.
12266         * server.h (convert_ascii_to_int, convert_int_to_ascii)
12267         (decode_M_packet): Likewise.
12268         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
12269         * target.h (struct target_ops): Update read_memory, write_memory,
12270         and read_auxv.
12271         (read_inferior_memory, write_inferior_memory): Update.
12272         * linux-low.h (struct linux_target_ops): Change type of breakpoint
12273         to unsigned char *.
12274         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
12275         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
12276         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
12277         linux-s390-low.c, linux-sh-low.c: Update for changes in
12278         read_inferior_memory and the_low_target->breakpoint.
12279
12280 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
12281
12282         * Makefile.in (SFILES): Add linux-ppc64-low.c.
12283         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
12284         * configure.srv: Add powerpc64-*-linux*.
12285         * linux-ppc64-low.c: New file.
12286
12287 2005-05-23  Orjan Friberg  <orjanf@axis.com>
12288
12289         * linux-cris-low.c: New file with support for CRIS.
12290         * linux-crisv32-low.c: Ditto for CRISv32.
12291         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
12292         (clean): Add reg-cris.c and reg-crisv32.c.
12293         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
12294         reg-crisv32.o, and reg-crisv32.c to make rules.
12295         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
12296         recognized targets.
12297
12298 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
12299
12300         * linux-low.c (fetch_register): Ensure buffer size is a multiple
12301         of sizeof (PTRACE_XFER_TYPE).
12302         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
12303
12304 2005-05-12  Orjan Friberg  <orjanf@axis.com>
12305
12306         * target.h (struct target_ops): Add insert_watchpoint,
12307         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
12308         pointers for hardware watchpoint support.
12309         * linux-low.h (struct linux_target_ops): Ditto.
12310         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
12311         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
12312         to linux_target_ops.
12313         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
12314         reply packet.
12315         * server.c (main): Recognize 'Z' and 'z' packets.
12316
12317 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
12318
12319         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
12320         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
12321         (the_low_target): Add new members.
12322
12323 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12324
12325         * proc-service.c (ps_lgetregs): Search all_processes instead of
12326         all_threads.
12327
12328 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12329
12330         * server.c (start_inferior): Change return type to int.
12331         (attach_inferior): Change sigptr to int *.
12332         (handle_v_cont, handle_v_requests): Change signal to int *.
12333         (main): Change signal to int.
12334
12335 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
12336
12337         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
12338         * configure.srv: Add m32r*-*-linux*.
12339         * linux-m32r-low.c: New file.
12340
12341 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
12342
12343         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
12344
12345 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12346
12347         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
12348         Take unsigned long arguments for PIDs.
12349         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
12350         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
12351         (wait_for_sigstop, linux_resume_one_process)
12352         (regsets_fetch_inferior_registers, linux_send_signal)
12353         (linux_read_auxv): Likewise.  Update the types of variables holding
12354         PIDs.  Update format string specifiers.
12355         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
12356         * remote-utils.c (prepare_resume_reply): Likewise.
12357         * server.c (cont_thread, general_thread, step_thread)
12358         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
12359         unsigned long.
12360         (handle_query): Update format specifiers.
12361         (handle_v_cont, main): Use strtoul for thread IDs.
12362         * server.h (struct inferior_list_entry): Use unsigned long for ID.
12363         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
12364         (general_thread, step_thread, thread_from_wait)
12365         (old_thread_from_wait): Update.
12366         * target.h (struct thread_resume): Use unsigned long for THREAD.
12367         (struct target_ops): Use unsigned long for arguments to attach and
12368         thread_alive.
12369
12370 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
12371
12372         * acinclude.m4: Include bfd/bfd.m4 directly.
12373         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
12374         <agriffis@toolchain.org>.
12375         * aclocal.m4, configure: Regenerated.
12376
12377 2005-01-07  Andrew Cagney  <cagney@gnu.org>
12378
12379         * configure.ac: Rename configure.in, require autoconf 2.59.
12380         * configure: Re-generate.
12381
12382 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
12383
12384         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
12385         LIBS when finished.
12386         * aclocal.m4: Regenerated.
12387         * configure: Regenerated.
12388
12389 2004-11-21  Andreas Schwab  <schwab@suse.de>
12390
12391         * linux-m68k-low.c (m68k_num_gregs): Define.
12392         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
12393         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
12394         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
12395         (m68k_breakpoint_at): New.  Add to the_low_target.
12396
12397         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
12398         srv_linux_thread_db to yes.
12399
12400 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
12401
12402         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
12403         (ARCH_SET_FS): Likewise.
12404         (ARCH_GET_FS): Likewise.
12405         (ARCH_GET_GS): Likewise.
12406
12407 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12408
12409         * linux-i386-low.c (ps_get_thread_area): New.
12410         * linux-x86-64-low.c (ps_get_thread_area): New.
12411         * linux-low.c: Include <sys/syscall.h>.
12412         (linux_kill_one_process): Don't kill the first thread here.
12413         (linux_kill): Kill the first thread here.
12414         (kill_lwp): New function.
12415         (send_sigstop, linux_send_signal): Use it.
12416         * proc-service.c: Clean up #ifdefs.
12417         (fpregset_info): Delete.
12418         (ps_lgetregs): Update and enable implementation.
12419         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
12420         implementations.
12421         * remote-utils.c (struct sym_cache, symbol_cache): New.
12422         (input_interrupt): Print a clearer message.
12423         (async_io_enabled): New variable.
12424         (enable_async_io, disable_async_io): Use it.  Update comments.
12425         (look_up_one_symbol): Use the symbol cache.
12426         * thread-db.c (thread_db_look_up_symbols): New function.
12427         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
12428
12429 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12430
12431         * configure.in: Test for -rdynamic.
12432         * configure: Regenerated.
12433         * Makefile (INTERNAL_LDFLAGS): New.
12434         (gdbserver, gdbreplay): Use it.
12435
12436 2004-09-02  Andrew Cagney  <cagney@gnu.org>
12437
12438         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
12439
12440 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
12441
12442         * linux-low.c (linux_wait): Clear all_processes list also.
12443
12444 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12445
12446         * linux-low.c: Include <errno.h>.  Remove extern declaration of
12447         errno.
12448
12449 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12450
12451         * gdbreplay.c, server.h, utils.c: Update copyright years.
12452
12453 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12454
12455         * server.c (main): Print child status or termination signal from
12456         variable 'signal', not 'sig'.
12457
12458 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12459
12460         * linux-low.c (linux_read_memory): Change return type to
12461         int.  Check for and return error from ptrace().
12462         * target.c (read_inferior_memory): Change return type to int.  Pass
12463         back return status from the_target->read_memory().
12464         * target.h (struct target_ops): Adapt *read_memory() prototype.
12465         Update comment.
12466         (read_inferior_memory): Adapt prototype.
12467         * server.c (main): Return an error packet if
12468         read_inferior_memory() returns an error.
12469
12470 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
12471
12472         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
12473         Unify with other clean targets.
12474
12475 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12476
12477         * server.c (handle_v_cont): Call set_desired_inferior.
12478
12479 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12480
12481         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
12482
12483 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12484
12485         * linux-low.c (linux_wait): Unblock async I/O.
12486         (linux_resume): Block and enable async I/O.
12487         * remote-utils.c (block_async_io, unblock_async_io): New functions.
12488         * server.h (block_async_io, unblock_async_io): Add prototypes.
12489
12490 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12491
12492         * remote-utils.c (remote_open): Print a status notice after
12493         opening a TCP port.
12494         * server.c (attach_inferior): Print a status notice after
12495         attaching.
12496
12497 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12498
12499         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
12500
12501 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
12502
12503         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
12504         error packet.
12505         * server.c, target.h: Update copyright years.
12506
12507 2004-02-25  Roland McGrath  <roland@redhat.com>
12508
12509         * target.h (struct target_ops): New member `read_auxv'.
12510         * server.c (handle_query): Handle qPart:auxv:read: query using that.
12511         * linux-low.c (linux_read_auxv): New function.
12512         (linux_target_ops): Initialize `read_auxv' member to that.
12513
12514 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
12515
12516         Committed by Jim Blandy  <jimb@redhat.com>.
12517
12518         * linux-s390-low.c (s390_num_regs): Update.
12519         (s390_regmap): Remove control registers.  Use __s390x__ predefine
12520         instead of GPR_SIZE to distiguish s390 and s390x targets.
12521
12522 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
12523
12524         * linux-low.c: Update copyright year.
12525         (check_removed_breakpoint): Clear pending_is_breakpoint.
12526         (linux_set_resume_request, linux_queue_one_thread)
12527         (resume_status_pending_p): New functions.
12528         (linux_continue_one_thread): Use process->resume.
12529         (linux_resume): Only resume threads if there are no pending events.
12530         * linux-low.h (struct process_info): Add resume request
12531         pointer.
12532
12533 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
12534
12535         * regcache.c (new_register_cache): Clear the allocated register
12536         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
12537
12538 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
12539
12540         * linux-low.c (linux_resume): Take a struct thread_resume *
12541         argument.
12542         (linux_wait): Update call.
12543         (resume_ptr): New static variable.
12544         (linux_continue_one_thread): Renamed from
12545         linux_continue_one_process.  Use resume_ptr.
12546         (linux_resume): Use linux_continue_one_thread.
12547         * server.c (handle_v_cont, handle_v_requests): New functions.
12548         (myresume): New function.
12549         (main): Handle 'v' case.
12550         * target.h (struct thread_resume): New type.
12551         (struct target_ops): Change argument of "resume" to struct
12552         thread_resume *.
12553         (myresume): Delete macro.
12554
12555 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
12556
12557         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
12558         (uninstall): Support DESTDIR.
12559
12560 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
12561
12562         * configure.srv: Add xscale*linux copy of arm*linux entry.
12563
12564 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
12565
12566         * linux-arm-low.c (arm_reinsert_addr): New function.
12567         (the_low_target): Add arm_reinsert_addr.
12568
12569 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
12570
12571         * mem-break.c: Remove whitespace at end of file.
12572
12573 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12574
12575         * configure.in: Check whether we need to prototype strerror.
12576         * server.h: Optionally prototype strerror.
12577         * gdbreplay.c (perror_with_name): Use strerror.
12578         * linux-low.c (linux_attach_lwp): Use strerror.
12579         * utils.c (perror_with_name): Use strerror.
12580         * config.in, configure: Regenerated.
12581
12582 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12583
12584         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
12585         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
12586
12587 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
12588
12589         * Makefile.in (SFILES): Update.
12590         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
12591         low-sun3.c: Remove files.
12592
12593 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
12594
12595         * linux-low.c: Move comment to linux_thread_alive where it belonged.
12596         (linux_detach_one_process, linux_detach): New functions.
12597         (linux_target_ops): Add linux_detach.
12598         * server.c (main): Handle 'D' packet.
12599         * target.h (struct target_ops): Add "detach" member.
12600         (detach_inferior): Define.
12601
12602 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
12603
12604         From Kelley Cook  <kelleycook@wideopenwest.com>:
12605         * configure.srv: Accept i[34567]86 variants.
12606
12607 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
12608
12609         * linux-low.c (linux_wait_for_event): Correct comment typos.
12610         (linux_resume_one_process): Call check_removed_breakpoint.
12611         (linux_send_signal): New function.
12612         (linux_target_ops): Add linux_send_signal.
12613         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
12614         of kill.
12615         * target.h (struct target_ops): Add send_signal.
12616
12617 2003-05-29  Jim Blandy  <jimb@redhat.com>
12618
12619         * linux-low.c (usr_store_inferior_registers): Transfer buf in
12620         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
12621         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
12622         away part of the register's value.
12623
12624 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
12625
12626         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
12627         (linux_wait_for_event, linux_init_signals): Likewise.
12628
12629 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
12630
12631         * configure.in: Check for stdlib.h.
12632         * configure: Regenerated.
12633         * config.in: Regenerated.
12634
12635 2003-01-04  Andreas Schwab  <schwab@suse.de>
12636
12637         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
12638
12639 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
12640
12641         * Makefile.in: Remove obsolete code.
12642
12643 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
12644
12645         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
12646         defined(PT_FPR0_HI).
12647
12648 2002-11-17  Stuart Hughes  <seh@zee2.com>
12649
12650         * linux-arm-low.c (arm_num_regs): Increase.
12651         (arm_regmap): Include status register.
12652
12653 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
12654
12655         * linux-low.c (register_addr): Remove incorrect -1 check.
12656
12657 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
12658
12659         * linux-low.c (linux_create_inferior): Call setpgid.  Return
12660         the new PID.
12661         (unstopped_p, linux_signal_pid): Remove.
12662         (linux_target_ops): Remove linux_signal_pid.
12663         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
12664         global instead of target method.
12665         * target.h (struct target_ops): Remove signal_pid.  Update comment
12666         for create_inferior.
12667         * server.c (signal_pid): New variable.
12668         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
12669         gdbserver.  Set the child to be the foreground process group.
12670         (attach_inferior): Set signal_pid.
12671
12672 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
12673
12674         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
12675
12676 2002-08-20  Jim Blandy  <jimb@redhat.com>
12677
12678         * Makefile.in (LDFLAGS): Allow the configure script to establish a
12679         default for this.
12680
12681 2002-08-01  Andrew Cagney  <cagney@redhat.com>
12682
12683         * Makefile.in: Make chill references obsolete.
12684
12685 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
12686
12687         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
12688         * configure: Regenerate.
12689         * config.in: Regenerate.
12690
12691 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
12692
12693         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
12694         (perror_with_name, remote_close, remote_open, expect, play): Static.
12695
12696 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
12697
12698         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
12699         byte offsets instead of an array of indexes.
12700         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
12701
12702 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
12703
12704         * regcache.c: Add comment.
12705
12706 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
12707
12708         * thread-db.c: New file.
12709         * proc-service.c: New file.
12710         * acinclude.m4: New file.
12711         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
12712         proc-service.o, and thread-db.o.
12713         (linux-low.o): Add USE_THREAD_DB.
12714         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
12715         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
12716         * aclocal.m4: Regenerated.
12717         * config.in: Regenerated.
12718         * configure: Regenerated.
12719         * configure.in: Check for proc_service.h, sys/procfs.h,
12720         thread_db.h, and linux/elf.h headrs.
12721         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
12722         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
12723         Check for -lthread_db and thread support.
12724         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
12725         PowerPC, and SuperH.
12726         * i387-fp.c: Constify arguments.
12727         * i387-fp.h: Likewise.
12728         * inferiors.c: (struct thread_info): Renamed from
12729         `struct inferior_info'.  Remove PID member.  Use generic inferior
12730         list header.  All uses updated.
12731         (inferiors, signal_pid): Removed.
12732         (all_threads): New variable.
12733         (get_thread): Define.
12734         (add_inferior_to_list): New function.
12735         (for_each_inferior): New function.
12736         (change_inferior_id): New function.
12737         (add_inferior): Removed.
12738         (remove_inferior): New function.
12739         (add_thread): New function.
12740         (free_one_thread): New function.
12741         (remove_thread): New function.
12742         (clear_inferiors): Use for_each_inferior and free_one_thread.
12743         (find_inferior): New function.
12744         (find_inferior_id): New function.
12745         (inferior_target_data): Update argument type.
12746         (set_inferior_target_data): Likewise.
12747         (inferior_regcache_data): Likewise.
12748         (set_inferior_regcache_data): Likewise.
12749         * linux-low.c (linux_bp_reinsert): Remove.
12750         (all_processes, stopping_threads, using_thrads)
12751         (struct pending_signals, debug_threads, pid_of): New.
12752         (inferior_pid): Replace with macro.
12753         (struct inferior_linux_data): Remove.
12754         (get_stop_pc, add_process): New functions.
12755         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
12756         Use add_process and add_thread.
12757         (linux_attach_lwp): New function, based on old linux_attach.  Use
12758         add_process and add_thread.  Set stop_expected for new threads.
12759         (linux_attach): New function.
12760         (linux_kill_one_process): New function.
12761         (linux_kill): Kill all LWPs.
12762         (linux_thread_alive): Use find_inferior_id.
12763         (check_removed_breakpoints, status_pending_p): New functions.
12764         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
12765         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
12766         struct for the found process.
12767         (linux_wait_for_event): New function.
12768         (linux_wait): Use it.  Support LWPs.
12769         (send_sigstop, wait_for_sigstop, stop_all_processes)
12770         (linux_resume_one_process, linux_continue_one_process): New functions.
12771         (linux_resume): Support LWPs.
12772         (REGISTER_RAW_SIZE): Remove.
12773         (fetch_register): Use register_size instead.  Call supply_register.
12774         (usr_store_inferior_registers): Likewise.  Call collect_register.
12775         Fix recursive case.
12776         (regsets_fetch_inferior_registers): Improve error message.
12777         (regsets_store_inferior_registers): Add debugging.
12778         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
12779         (unstopped_p, linux_signal_pid): New functions.
12780         (linux_target_ops): Add linux_signal_pid.
12781         (linux_init_signals): New function.
12782         (initialize_low): Call it.  Initialize using_threads.
12783         * regcache.c (inferior_regcache_data): Add valid
12784         flag.
12785         (get_regcache): Fetch registers lazily.  Add fetch argument
12786         and update all callers.
12787         (regcache_invalidate_one, regcache_invalidate): New
12788         functions.
12789         (new_register_cache): Renamed from create_register_cache.
12790         Return the new regcache.
12791         (free_register_cache): Change argument to a void *.
12792         (registers_to_string, registers_from_string): Call get_regcache
12793         with fetch flag set.
12794         (register_data): Make static.  Pass fetch flag to get_regcache.
12795         (supply_register): Call get_regcache with fetch flag clear.
12796         (collect_register): Call get_regcache with fetch flag set.
12797         (collect_register_as_string): New function.
12798         * regcache.h: Update.
12799         * remote-utils.c (putpkt): Flush after debug output and use
12800         stderr.
12801         Handle input interrupts while waiting for an ACK.
12802         (input_interrupt): Use signal_pid method.
12803         (getpkt): Flush after debug output and use stderr.
12804         (outreg): Use collect_register_as_string.
12805         (new_thread_notify, dead_thread_notify): New functions.
12806         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
12807         and general_thread.
12808         (look_up_one_symbol): Flush after debug output.
12809         * server.c (step_thread, server_waiting): New variables.
12810         (start_inferior): Don't use signal_pid.  Update call to mywait.
12811         (attach_inferior): Update call to mywait.
12812         (handle_query): Handle qfThreadInfo and qsThreadInfo.
12813         (main): Don't fetch/store registers explicitly.  Use
12814         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
12815         calls to mywait.
12816         * server.h: Update.
12817         (struct inferior_list, struct_inferior_list_entry): New.
12818         * target.c (set_desired_inferior): New.
12819         (write_inferior_memory): Constify.
12820         (mywait): New function.
12821         * target.h: Update.
12822         (struct target_ops): New signal_pid method.
12823         (mywait): Removed macro, added prototype.
12824
12825         * linux-low.h (regset_func): Removed.
12826         (regset_fill_func, regset_store_func): New.
12827         (enum regset_type): New.
12828         (struct regset_info): Add type field.  Use new operation types.
12829         (struct linux_target_ops): stop_pc renamed to get_pc.
12830         Add decr_pc_after_break and breakpoint_at.
12831         (get_process, get_thread_proess, get_process_thread)
12832         (strut process_info, all_processes, linux_attach_lwp)
12833         (thread_db_init): New.
12834
12835         * linux-arm-low.c (arm_get_pc, arm_set_pc,
12836         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
12837         (the_low_target): Add new members.
12838         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
12839         (i386_store_fpxregset): Constify.
12840         (target_regsets): Add new kind identifier.
12841         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
12842         (i386_set_pc): Add debugging.
12843         (i386_breakpoint_at): New function.
12844         (the_low_target): Add new members.
12845         * linux-mips-low.c (mips_get_pc, mips_set_pc)
12846         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
12847         (mips_breakpoint_at): New.
12848         (the_low_target): Add new members.
12849         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
12850         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
12851         (the_low_target): Add new members.
12852         * linux-sh-low.c (sh_get_pc, sh_set_pc)
12853         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
12854         (the_low_target): Add new members.
12855         * linux-x86-64-low.c (target_regsets): Add new kind
12856         identifier.
12857
12858 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
12859
12860         From Martin Pool <mbp@samba.org>:
12861         * server.c (gdbserver_usage): New function.
12862         (main): Call it.
12863
12864 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
12865
12866         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
12867         stop_at -> stop_pc.
12868
12869 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
12870
12871         * Makefile.in: Remove obsolete code.
12872
12873 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
12874
12875         * linux-low.c (regsets_fetch_inferior_registers),
12876         (regsets_store_inferior_registers): Removed cast to int from
12877         ptrace() calls.
12878         * regcache.h: Added declaration of struct inferior_info.
12879
12880 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12881
12882         * inferiors.c (struct inferior_info): Add regcache_data.
12883         (add_inferior): Call create_register_cache.
12884         (clear_inferiors): Call free_register_cache.
12885         (inferior_regcache_data, set_inferior_regcache_data): New functions.
12886         * regcache.c (struct inferior_regcache_data): New.
12887         (registers): Remove.
12888         (get_regcache): New function.
12889         (create_register_cache, free_register_cache): New functions.
12890         (set_register_cache): Don't initialize the register cache here.
12891         (registers_to_string, registers_from_string, register_data): Call
12892         get_regcache.
12893         * regcache.h: Add prototypes.
12894         * server.h: Likewise.
12895
12896 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12897
12898         * mem-break.c: New file.
12899         * mem-break.h: New file.
12900         * Makefile.in: Add mem-break.o rule; update server.h
12901         dependencies.
12902         * inferiors.c (struct inferior_info): Add target_data
12903         member.
12904         (clear_inferiors): Free target_data member if set.
12905         (inferior_target_data, set_inferior_target_data): New functions.
12906         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
12907         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
12908         * linux-low.c (linux_bp_reinsert): New variable.
12909         (struct inferior_linux_data): New.
12910         (linux_create_inferior): Use set_inferior_target_data.
12911         (linux_attach): Likewise.  Call add_inferior.
12912         (linux_wait_for_one_inferior): New function.
12913         (linux_wait): Call it.
12914         (linux_write_memory): Add const.
12915         (initialize_low): Call set_breakpoint_data.
12916         * linux-low.h (struct linux_target_ops): Add breakpoint
12917         handling members.
12918         * server.c (attach_inferior): Remove extra add_inferior
12919         call.
12920         * server.h: Include mem-break.h.  Update inferior.c
12921         prototypes.
12922         * target.c (read_inferior_memory)
12923         (write_inferior_memory): New functions.
12924         * target.h (read_inferior_memory)
12925         (write_inferior_memory): Change macros to prototypes.
12926         (struct target_ops): Update comments.  Add const to write_memory
12927         definition.
12928
12929 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
12930
12931         * linux-low.c (usr_store_inferior_registers): Support
12932         registers which are allowed to fail to store.
12933         * linux-low.h (linux_target_ops): Likewise.
12934         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
12935         (ppc_cannot_store_register): FPSCR may not be storable.
12936
12937 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12938
12939         * server.h: Include <string.h> if HAVE_STRING_H.
12940         * ChangeLog: Correct paths in last ChangeLog entry.
12941
12942 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12943
12944         * linux-low.h: Remove obsolete prototypes.
12945         (struct linux_target_ops): New.
12946         (extern the_low_target): New.
12947         * linux-low.c (num_regs, regmap): Remove declarations.
12948         (register_addr): Use the_low_target explicitly.
12949         (fetch_register): Likewise.
12950         (usr_fetch_inferior_registers): Likewise.
12951         (usr_store_inferior_registers): Likewise.
12952         * linux-arm-low.c (num_regs): Remove.
12953         (arm_num_regs): Define.
12954         (arm_regmap): Renamed from regmap, made static.
12955         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
12956         made static.
12957         (arm_cannot_store_register): Renamed from cannot_store_register,
12958         made static.
12959         (the_low_target): New.
12960         * linux-i386-low.c (num_regs): Remove.
12961         (i386_num_regs): Define.
12962         (i386_regmap): Renamed from regmap, made static.
12963         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
12964         made static.
12965         (i386_cannot_store_register): Renamed from cannot_store_register,
12966         made static.
12967         (the_low_target): New.
12968         * linux-ia64-low.c (num_regs): Remove.
12969         (ia64_num_regs): Define.
12970         (ia64_regmap): Renamed from regmap, made static.
12971         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
12972         made static.
12973         (ia64_cannot_store_register): Renamed from cannot_store_register,
12974         made static.
12975         (the_low_target): New.
12976         * linux-m68k-low.c (num_regs): Remove.
12977         (m68k_num_regs): Define.
12978         (m68k_regmap): Renamed from regmap, made static.
12979         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
12980         made static.
12981         (m68k_cannot_store_register): Renamed from cannot_store_register,
12982         made static.
12983         (the_low_target): New.
12984         * linux-mips-low.c (num_regs): Remove.
12985         (mips_num_regs): Define.
12986         (mips_regmap): Renamed from regmap, made static.
12987         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
12988         made static.
12989         (mips_cannot_store_register): Renamed from cannot_store_register,
12990         made static.
12991         (the_low_target): New.
12992         * linux-ppc-low.c (num_regs): Remove.
12993         (ppc_num_regs): Define.
12994         (ppc_regmap): Renamed from regmap, made static.
12995         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
12996         made static.
12997         (ppc_cannot_store_register): Renamed from cannot_store_register,
12998         made static.
12999         (the_low_target): New.
13000         * linux-s390-low.c (num_regs): Remove.
13001         (s390_num_regs): Define.
13002         (s390_regmap): Renamed from regmap, made static.
13003         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
13004         made static.
13005         (s390_cannot_store_register): Renamed from cannot_store_register,
13006         made static.
13007         (the_low_target): New.
13008         * linux-sh-low.c (num_regs): Remove.
13009         (sh_num_regs): Define.
13010         (sh_regmap): Renamed from regmap, made static.
13011         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
13012         made static.
13013         (sh_cannot_store_register): Renamed from cannot_store_register,
13014         made static.
13015         (the_low_target): New.
13016         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
13017         (the_low_target): New.
13018
13019 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13020
13021         * Makefile.in: Add stamp-h target.
13022         * configure.in: Create stamp-h.
13023         * configure: Regenerated.
13024
13025 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13026
13027         * inferiors.c: New file.
13028         * target.c: New file.
13029         * target.h: New file.
13030         * Makefile.in:  Add target.o and inferiors.o.  Update
13031         dependencies.
13032         * linux-low.c (inferior_pid): New static variable,
13033         moved from server.c.
13034         (linux_create_inferior): Renamed from create_inferior.
13035         Call add_inferior.  Return 0 on success instead of a PID.
13036         (linux_attach): Renamed from myattach.
13037         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
13038         (linux_thread_alive): Renamed from mythread_alive.
13039         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
13040         child dies.
13041         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
13042         (regsets_store_inferior_registers): Correct error message.
13043         Add missing ``return 0''.
13044         (linux_fetch_registers): Renamed from fetch_inferior_registers.
13045         (linux_store_registers): Renamed from store_inferior_registers.
13046         (linux_read_memory): Renamed from read_inferior_memory.
13047         (linux_write_memory): Renamed from write_inferior_memory.
13048         (linux_target_ops): New structure.
13049         (initialize_low): Call set_target_ops ().
13050         * remote-utils.c (unhexify): New function.
13051         (hexify): New function.
13052         (input_interrupt): Send signals to ``signal_pid''.
13053         * server.c (inferior_pid): Remove.
13054         (start_inferior): Update create_inferior call.
13055         (attach_inferior): Call add_inferior.
13056         (handle_query): New function.
13057         (main): Call handle_query for `q' packets.
13058         * server.h: Include "target.h".  Remove obsolete prototypes.
13059         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
13060
13061 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
13062
13063         * Makefile.in: Add WARN_CFLAGS.  Update configury
13064         dependencies.
13065         * configure.in: Check for <string.h>
13066         * configure: Regenerate.
13067         * config.in: Regenerate.
13068         * gdbreplay.c: Include needed system headers.
13069         (remote_open): Remove strchr prototype.
13070         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
13071         * regcache.c (supply_register): Change buf argument to const void *.
13072         (supply_register_by_name): Likewise.
13073         (collect_register): Change buf argument to void *.
13074         (collect_register_by_name): Likewise.
13075         * regcache.h: Add missing prototypes.
13076         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
13077         * server.c (handle_query): New function.
13078         (attached): New static variable, moved out of main.
13079         (main): Quiet longjmp clobber warnings.
13080         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
13081         * utils.c (error): Remove NORETURN.
13082         (fatal): Likewise.