Refactor start_inferior
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2015-07-24  Yao Qi  <yao.qi@linaro.org>
2
3         * server.c (start_inferior): Code refactor.
4
5 2015-07-24  Yao Qi  <yao.qi@linaro.org>
6
7         * server.c (process_serial_event): Set general_thread.
8
9 2015-07-21  Yao Qi  <yao.qi@linaro.org>
10
11         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
12         aarch64_linux_get_debug_reg_capacity.
13
14 2015-07-17  Yao Qi  <yao.qi@linaro.org>
15
16         * Makefile.in (aarch64-linux-hw-point.o): New rule.
17         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
18         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
19         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
20         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
21         (AARCH64_HWP_ALIGNMENT): Likewise.
22         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
23         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
24         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
25         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
26         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
27         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
28         (struct aarch64_debug_reg_state): Likewise.
29         (struct arch_lwp_info): Likewise.
30         (aarch64_align_watchpoint): Likewise.
31         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
32         (aarch64_watchpoint_length): Likewise.
33         (aarch64_point_encode_ctrl_reg): Likewise
34         (aarch64_point_is_aligned): Likewise.
35         (aarch64_align_watchpoint): Likewise.
36         (aarch64_linux_set_debug_regs):
37         (aarch64_dr_state_insert_one_point): Likewise.
38         (aarch64_dr_state_remove_one_point): Likewise.
39         (aarch64_handle_breakpoint): Likewise.
40         (aarch64_handle_aligned_watchpoint): Likewise.
41         (aarch64_handle_unaligned_watchpoint): Likewise.
42         (aarch64_handle_watchpoint): Likewise.
43
44 2015-07-17  Yao Qi  <yao.qi@linaro.org>
45
46         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
47         and don't aarch64_get_debug_reg_state.  All callers update.
48         (aarch64_handle_aligned_watchpoint): Likewise.
49         (aarch64_handle_unaligned_watchpoint): Likewise.
50         (aarch64_handle_watchpoint): Likewise.
51         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
52         (aarch64_remove_point): Likewise.
53
54 2015-07-17  Yao Qi  <yao.qi@linaro.org>
55
56         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
57         debug_printf.
58         (aarch64_handle_unaligned_watchpoint): Likewise.
59
60 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
61
62         Revert the previous 3 commits:
63         Move gdb_regex* to common/
64         Move linux_find_memory_regions_full & co.
65         gdbserver build-id attribute generator
66
67 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
68             Jan Kratochvil  <jan.kratochvil@redhat.com>
69
70         gdbserver build-id attribute generator.
71         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
72         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
73         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
74         (find_phdr): New.
75         (get_dynamic): Use find_pdhr to traverse program headers.
76         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
77         (compare_mapping_entry_range, struct find_memory_region_callback_data)
78         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
79         (get_hex_build_id): New.
80         (linux_qxfer_libraries_svr4): Add optional build-id attribute
81         to reply XML document.
82
83 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
84             Jan Kratochvil  <jan.kratochvil@redhat.com>
85
86         * target.c: Include target/target-utils.h and fcntl.h.
87         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
88         (target_fileio_read_stralloc): New functions.
89
90 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
91
92         * Makefile.in (OBS): Add gdb_regex.o.
93         (gdb_regex.o): New.
94         * config.in: Rebuilt.
95         * configure: Rebuilt.
96
97 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
98             Jan Kratochvil  <jan.kratochvil@redhat.com>
99
100         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
101         * Makefile.in (OBS): Add target-utils.o.
102         (linux-maps.o, target-utils.o): New.
103         * configure.srv (srv_linux_obj): Add linux-maps.o.
104
105 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
106
107         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
108         function, return 1.
109         (the_low_target): Install it.
110
111 2015-07-14  Pedro Alves  <palves@redhat.com>
112
113         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
114         Instead, ignore ECHILD, and throw an error for other errnos.
115
116 2015-07-10  Pedro Alves  <palves@redhat.com>
117
118         * event-loop.c (struct callback_event) <data>: Change type to
119         gdb_client_data instance instead of gdb_client_data pointer.
120         (append_callback_event): Adjust.
121
122 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
123
124         * linux-aarch64-low.c: Add comments for each linux_target_ops
125         method.  Remove comments already covered in target_ops and
126         linux_target_ops definitions.
127         (the_low_target): Add comments for each unimplemented method.
128
129 2015-07-09  Yao Qi  <yao.qi@linaro.org>
130
131         * linux-aarch64-low.c (aarch64_regmap): Remove.
132         (aarch64_usrregs_info): Remove.
133         (regs_info): Set field usrregs to NULL.
134
135 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
136
137         * linux-low.c: Include "rsp-low.h"
138         (linux_low_encode_pt_config, linux_low_encode_raw): New.
139         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
140         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
141         (handle_btrace_enable_pt): New.
142         (handle_btrace_general_set): Support "pt".
143         (handle_btrace_conf_general_set): Support "pt:size".
144
145 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
146
147         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
148         Z_PACKET_SW_BP.
149
150 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
151
152         * linux-aarch64-low.c: Remove comment about endianness.
153         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
154         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
155         memcmp.
156
157 2015-06-24  Gary Benson  <gbenson@redhat.com>
158
159         * linux-i386-ipa.c (stdint.h): Do not include.
160         * lynx-i386-low.c (stdint.h): Likewise.
161         * lynx-ppc-low.c (stdint.h): Likewise.
162         * mem-break.c (stdint.h): Likewise.
163         * thread-db.c (stdint.h): Likewise.
164         * tracepoint.c (stdint.h): Likewise.
165         * win32-low.c (stdint.h): Likewise.
166
167 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
168
169         * server.c (write_qxfer_response): Update call to
170         remote_escape_output.
171
172 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
173             Jan Kratochvil  <jan.kratochvil@redhat.com>
174
175         Merge multiple hex conversions.
176         * gdbreplay.c (tohex): Rename to 'fromhex'.
177         (logchar): Use fromhex.
178
179 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
180
181         * server.c (handle_qxfer_libraries): Set `version' attribute for
182         <library-list>.
183
184 2015-06-10  Gary Benson  <gbenson@redhat.com>
185
186         * target.h (struct target_ops) <multifs_open>: New field.
187         <multifs_unlink>: Likewise.
188         <multifs_readlink>: Likewise.
189         * linux-low.c (nat/linux-namespaces.h): New include.
190         (linux_target_ops): Initialize the_target->multifs_open,
191         the_target->multifs_unlink and the_target->multifs_readlink.
192         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
193         * hostio.c (hostio_fs_pid): New static variable.
194         (hostio_handle_new_gdb_connection): New function.
195         (handle_setfs): Likewise.
196         (handle_open): Use the_target->multifs_open as appropriate.
197         (handle_unlink): Use the_target->multifs_unlink as appropriate.
198         (handle_readlink): Use the_target->multifs_readlink as
199         appropriate.
200         (handle_vFile): Handle vFile:setfs packets.
201         * server.c (handle_query): Call hostio_handle_new_gdb_connection
202         after target_handle_new_gdb_connection.
203
204 2015-06-10  Gary Benson  <gbenson@redhat.com>
205
206         * configure.ac (AC_CHECK_FUNCS): Add setns.
207         * config.in: Regenerate.
208         * configure: Likewise.
209         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
210         (linux-namespaces.o): New rule.
211         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
212
213 2015-06-09  Gary Benson <gbenson@redhat.com>
214
215         * hostio.c (handle_open): Process mode argument with
216         fileio_to_host_mode.
217
218 2015-06-01  Yao Qi  <yao.qi@linaro.org>
219
220         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
221         * linux-x86-low.c: Likewise.
222
223 2015-05-28  Don Breazeal  <donb@codesourcery.com>
224
225         * linux-low.c (handle_extended_wait): Initialize
226         thread_info.last_resume_kind for new fork children.
227
228 2015-05-15  Pedro Alves  <palves@redhat.com>
229
230         * target.h (target_handle_new_gdb_connection): Rewrite using if
231         wrapped in do/while.
232
233 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
234
235         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
236         * configure, config.in: Regenerate.
237         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
238         Declare typedef.
239
240 2015-05-12  Don Breazeal  <donb@codesourcery.com>
241
242         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
243         PTRACE_EVENT_VFORK_DONE.
244         (linux_low_ptrace_options, extended_event_reported): Add vfork
245         events.
246         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
247         and "vforkdone" for RSP 'T' Stop Reply Packet.
248         * server.h (report_vfork_events): Declare
249         global variable.
250
251 2015-05-12  Don Breazeal  <donb@codesourcery.com>
252
253         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
254         (the_low_target) <new_fork>: Initialize new member.
255         * linux-arm-low.c (arm_new_fork): New function.
256         (the_low_target) <new_fork>: Initialize new member.
257         * linux-low.c (handle_extended_wait): Call new target function
258         new_fork.
259         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
260         * linux-mips-low.c (mips_add_watchpoint): New function
261         extracted from mips_insert_point.
262         (the_low_target) <new_fork>: Initialize new member.
263         (mips_linux_new_fork): New function.
264         (mips_insert_point): Call mips_add_watchpoint.
265         * linux-x86-low.c (x86_linux_new_fork): New function.
266         (the_low_target) <new_fork>: Initialize new member.
267
268 2015-05-12  Don Breazeal  <donb@codesourcery.com>
269
270         * linux-low.c (handle_extended_wait): Implement return value,
271         rename argument 'event_child' to 'event_lwp', handle
272         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
273         (linux_low_ptrace_options): New function.
274         (linux_low_filter_event): Call linux_low_ptrace_options,
275         use different argument fo linux_enable_event_reporting,
276         use return value from handle_extended_wait.
277         (extended_event_reported): New function.
278         (linux_wait_1): Call extended_event_reported and set
279         status to report fork events.
280         (linux_write_memory): Add pid to debug message.
281         (reset_lwp_ptrace_options_callback): New function.
282         (linux_handle_new_gdb_connection): New function.
283         (linux_target_ops): Initialize new structure member.
284         * linux-low.h (struct lwp_info) <waitstatus>: New member.
285         * lynx-low.c: Initialize new structure member.
286         * remote-utils.c (prepare_resume_reply): Implement stop reason
287         "fork" for "T" stop message.
288         * server.c (handle_query): Call handle_new_gdb_connection.
289         * server.h (report_fork_events): Declare global flag.
290         * target.h (struct target_ops) <handle_new_gdb_connection>:
291         New member.
292         (target_handle_new_gdb_connection): New macro.
293         * win32-low.c: Initialize new structure member.
294
295 2015-05-12  Don Breazeal  <donb@codesourcery.com>
296
297         * mem-break.c (APPEND_TO_LIST): Define macro.
298         (clone_agent_expr): New function.
299         (clone_one_breakpoint): New function.
300         (clone_all_breakpoints): New function.
301         * mem-break.h: Declare new functions.
302
303 2015-05-12  Don Breazeal  <donb@codesourcery.com>
304
305         * linux-low.c (linux_supports_fork_events): New function.
306         (linux_supports_vfork_events): New function.
307         (linux_target_ops): Initialize new structure members.
308         (initialize_low): Call linux_check_ptrace_features.
309         * lynx-low.c (lynx_target_ops): Initialize new structure
310         members.
311         * server.c (report_fork_events, report_vfork_events):
312         New global flags.
313         (handle_query): Add new features to qSupported packet and
314         response.
315         (captured_main): Initialize new global variables.
316         * target.h (struct target_ops) <supports_fork_events>:
317         New member.
318         <supports_vfork_events>: New member.
319         (target_supports_fork_events): New macro.
320         (target_supports_vfork_events): New macro.
321         * win32-low.c (win32_target_ops): Initialize new structure
322         members.
323
324 2015-05-12  Gary Benson <gbenson@redhat.com>
325
326         * server.c (handle_qxfer_exec_file): Use current process
327         if annex is empty.
328
329 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
330
331         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
332         Remove HAVE_PTRACE_GETREGS conditionals.
333         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
334         instead of PTRACE_GETREGS and PTRACE_SETREGS.
335
336 2015-05-08  Yao Qi  <yao.qi@linaro.org>
337
338         * linux-low.c (linux_supports_conditional_breakpoints): New
339         function.
340         (linux_target_ops): Install new target method.
341         * lynx-low.c (lynx_target_ops): Install NULL hook for
342         supports_conditional_breakpoints.
343         * nto-low.c (nto_target_ops): Likewise.
344         * spu-low.c (spu_target_ops): Likewise.
345         * win32-low.c (win32_target_ops): Likewise.
346         * server.c (handle_query): Check
347         target_supports_conditional_breakpoints.
348         * target.h (struct target_ops) <supports_conditional_breakpoints>:
349         New field.
350         (target_supports_conditional_breakpoints): New macro.
351
352 2015-05-06  Pedro Alves  <palves@redhat.com>
353
354         PR server/18081
355         * server.c (start_inferior): If the process exits, mourn it.
356
357 2015-04-21  Gary Benson <gbenson@redhat.com>
358
359         * hostio.c (fileio_open_flags_to_host): Factored out to
360         fileio_to_host_openflags in common/fileio.c.  Single use
361         updated.
362
363 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
364
365         * linux-xtensa-low.c (xtensa_fill_gregset)
366         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
367         XCHAL_HAVE_LOOP.
368
369 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
370
371         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
372         (regs_info): Replace usrregs pointer with NULL.
373
374 2015-04-17  Gary Benson  <gbenson@redhat.com>
375
376         * target.h (struct target_ops) <pid_to_exec_file>: New field.
377         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
378         * server.c (handle_qxfer_exec_file): New function.
379         (qxfer_packets): Add exec-file entry.
380         (handle_query): Report qXfer:exec-file:read as supported packet.
381
382 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
383
384         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
385
386 2015-04-09  Gary Benson <gbenson@redhat.com>
387
388         * hostio-errno.c (errno_to_fileio_error): Remove function.
389         Update caller to use remote_fileio_to_fio_error.
390
391 2015-04-09  Yao Qi  <yao.qi@linaro.org>
392
393         * linux-low.c (linux_insert_point): Call
394         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
395         (linux_remove_point): Call remove_memory_breakpoint if type is
396         raw_bkpt_type_sw.
397         * linux-x86-low.c (x86_insert_point): Don't call
398         insert_memory_breakpoint.
399         (x86_remove_point): Don't call remove_memory_breakpoint.
400
401 2015-04-01  Pedro Alves  <palves@redhat.com>
402             Cleber Rosa  <crosa@redhat.com>
403
404         * server.c (gdbserver_usage): Reorganize and extend the usage
405         message.
406
407 2015-03-24  Pedro Alves  <palves@redhat.com>
408
409         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
410         output.  Also dump TRAP_TRACE.
411         (linux_low_filter_event): In debug output, distinguish a
412         resume_stop SIGSTOP from a delayed SIGSTOP.
413
414 2015-03-24  Gary Benson  <gbenson@redhat.com>
415
416         * linux-x86-low.c (x86_linux_new_thread): Moved to
417         nat/x86-linux.c.
418         (x86_linux_prepare_to_resume): Likewise.
419
420 2015-03-24  Gary Benson  <gbenson@redhat.com>
421
422         * Makefile.in (x86-linux-dregs.o): New rule.
423         * configure.srv: Add x86-linux-dregs.o to relevant targets.
424         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
425         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
426         (x86_linux_dr_get): Likewise.
427         (x86_linux_dr_set): Likewise.
428         (update_debug_registers_callback): Likewise.
429         (x86_linux_dr_set_addr): Likewise.
430         (x86_linux_dr_get_addr): Likewise.
431         (x86_linux_dr_set_control): Likewise.
432         (x86_linux_dr_get_control): Likewise.
433         (x86_linux_dr_get_status): Likewise.
434         (x86_linux_update_debug_registers): Likewise.
435
436 2015-03-24  Gary Benson  <gbenson@redhat.com>
437
438         * linux-x86-low.c (x86_linux_update_debug_registers):
439         New function, factored out from...
440         (x86_linux_prepare_to_resume): ...this.
441
442 2015-03-24  Gary Benson  <gbenson@redhat.com>
443
444         * linux-x86-low.c (x86_linux_dr_get): Update comments.
445         (x86_linux_dr_set): Likewise.
446         (update_debug_registers_callback): Likewise.
447         (x86_linux_dr_set_addr): Likewise.
448         (x86_linux_dr_get_addr): Likewise.
449         (x86_linux_dr_set_control): Likewise.
450         (x86_linux_dr_get_control): Likewise.
451         (x86_linux_dr_get_status): Likewise.
452         (x86_linux_prepare_to_resume): Likewise.
453
454 2015-03-24  Gary Benson  <gbenson@redhat.com>
455
456         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
457         Use perror_with_name.  Pass string through gettext.
458         (x86_linux_dr_set): Likewise.
459
460 2015-03-24  Gary Benson  <gbenson@redhat.com>
461
462         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
463         (x86_linux_dr_set_addr): ...this.
464         (x86_dr_low_get_addr): Rename to...
465         (x86_linux_dr_get_addr): ...this.
466         (x86_dr_low_set_control): Rename to...
467         (x86_linux_dr_set_control): ...this.
468         (x86_dr_low_get_control): Rename to...
469         (x86_linux_dr_get_control): ...this.
470         (x86_dr_low_get_status): Rename to...
471         (x86_linux_dr_get_status): ...this.
472         (x86_dr_low): Update with new function names.
473
474 2015-03-24  Gary Benson  <gbenson@redhat.com>
475
476         * Makefile.in (x86-linux.o): New rule.
477         * configure.srv: Add x86-linux.o to relevant targets.
478         * linux-low.c (lwp_set_arch_private_info): New function.
479         (lwp_arch_private_info): Likewise.
480         * linux-x86-low.c: Include nat/x86-linux.h.
481         (arch_lwp_info): Removed structure.
482         (update_debug_registers_callback):
483         Use lwp_set_debug_registers_changed.
484         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
485         and lwp_set_debug_registers_changed.
486         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
487
488 2015-03-24  Gary Benson  <gbenson@redhat.com>
489
490         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
491         * linux-arm-low.c (arm_new_thread): Likewise.
492         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
493         * linux-mips-low.c (mips_linux_new_thread): Likewise.
494         * linux-x86-low.c (x86_linux_new_thread): Likewise.
495         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
496
497 2015-03-24  Gary Benson  <gbenson@redhat.com>
498
499         * linux-low.c (ptid_of_lwp): New function.
500         (lwp_is_stopped): Likewise.
501         (lwp_stop_reason): Likewise.
502         * linux-x86-low.c (update_debug_registers_callback):
503         Use lwp_is_stopped.
504         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
505         lwp_stop_reason.
506
507 2015-03-24  Gary Benson  <gbenson@redhat.com>
508
509         * linux-low.h (linux_stop_lwp): Remove declaration.
510
511 2015-03-24  Gary Benson  <gbenson@redhat.com>
512
513         * linux-low.h: Include nat/linux-nat.h.
514         * linux-low.c (iterate_over_lwps_args): New structure.
515         (iterate_over_lwps_filter): New function.
516         (iterate_over_lwps): Likewise.
517         * linux-x86-low.c (update_debug_registers_callback):
518         Update signature to what iterate_over_lwps expects.
519         Remove PID check that iterate_over_lwps now performs.
520         (x86_dr_low_set_addr): Use iterate_over_lwps.
521         (x86_dr_low_set_control): Likewise.
522
523 2015-03-24  Gary Benson  <gbenson@redhat.com>
524
525         * linux-x86-low.c (x86_debug_reg_state): New function.
526         (x86_linux_prepare_to_resume): Use the above.
527
528 2015-03-24  Gary Benson  <gbenson@redhat.com>
529
530         * linux-low.c (current_lwp_ptid): New function.
531         * linux-x86-low.c: Include nat/linux-nat.h.
532         (x86_dr_low_get_addr): Use current_lwp_ptid.
533         (x86_dr_low_get_control): Likewise.
534         (x86_dr_low_get_status): Likewise.
535
536 2015-03-20  Pedro Alves  <palves@redhat.com>
537
538         * tracepoint.c (cmd_qtstatus): Make "str" const.
539
540 2015-03-20  Pedro Alves  <palves@redhat.com>
541
542         * server.c (handle_general_set): Make "req_str" const.
543
544 2015-03-19  Pedro Alves  <palves@redhat.com>
545
546         * linux-low.c (linux_resume_one_lwp): Rename to ...
547         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
548         instead call perror_with_name.
549         (check_ptrace_stopped_lwp_gone): New function.
550         (linux_resume_one_lwp): Reimplement as wrapper around
551         linux_resume_one_lwp_throw that swallows errors if the LWP is
552         gone.
553
554 2015-03-19  Pedro Alves  <palves@redhat.com>
555
556         * linux-low.c (count_events_callback, select_event_lwp_callback):
557         No longer check whether the thread has resume_stop as last resume
558         kind.
559
560 2015-03-19 Pedro Alves  <palves@redhat.com>
561
562         * linux-low.c (count_events_callback, select_event_lwp_callback):
563         Use the lwp's status_pending_p field, not the thread's.
564
565 2015-03-19  Pedro Alves  <palves@redhat.com>
566
567         * linux-low.c (select_event_lwp_callback): Update comments to
568         no longer mention SIGTRAP.
569
570 2015-03-18  Gary Benson  <gbenson@redhat.com>
571
572         * server.c (handle_query): Do not report vFile:fstat as supported.
573
574 2015-03-11  Gary Benson  <gbenson@redhat.com>
575
576         * hostio.c (sys/types.h): New include.
577         (sys/stat.h): Likewise.
578         (common-remote-fileio.h): Likewise.
579         (handle_fstat): New function.
580         (handle_vFile): Handle vFile:fstat packets.
581
582 2015-03-11  Gary Benson  <gbenson@redhat.com>
583
584         * configure.ac (AC_CHECK_MEMBERS): Add checks for
585         struct stat.st_blocks and struct stat.st_blksize.
586         * configure: Regenerate.
587         * config.in: Likewise.
588         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
589         (OBS): Add common-remote-fileio.o.
590         (common-remote-fileio.o): New rule.
591
592 2015-03-09  Pedro Alves  <palves@redhat.com>
593
594         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
595         'struct sockaddr' pointer in 'accept' call.
596
597 2015-03-09  Pedro Alves  <palves@redhat.com>
598
599         Revert:
600         2015-03-07  Pedro Alves  <palves@redhat.com>
601         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
602         or <winsock2.h> here.  Instead include "gdb_socket.h".
603         (remote_open): Use union gdb_sockaddr_u.
604         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
605         or <winsock2.h> here.  Instead include "gdb_socket.h".
606         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
607         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
608         or <sys/un.h>.
609         (init_named_socket, gdb_agent_helper_thread): Use union
610         gdb_sockaddr_u.
611
612 2015-03-07  Pedro Alves  <palves@redhat.com>
613
614         * configure.ac (build_warnings): Move
615         -Wdeclaration-after-statement to the C-specific set.
616         * configure: Regenerate.
617
618 2015-03-07  Pedro Alves  <palves@redhat.com>
619
620         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
621         or <winsock2.h> here.  Instead include "gdb_socket.h".
622         (remote_open): Use union gdb_sockaddr_u.
623         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
624         or <winsock2.h> here.  Instead include "gdb_socket.h".
625         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
626         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
627         or <sys/un.h>.
628         (init_named_socket, gdb_agent_helper_thread): Use union
629         gdb_sockaddr_u.
630
631 2015-03-07  Pedro Alves  <palves@redhat.com>
632
633         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
634         instead.
635
636 2015-03-06  Yao Qi  <yao.qi@linaro.org>
637
638         * linux-aarch64-low.c (aarch64_insert_point): Use
639         show_debug_regs as a boolean.
640         (aarch64_remove_point): Likewise.
641
642 2015-03-05  Pedro Alves  <palves@redhat.com>
643
644         * lynx-low.c (lynx_target_ops): Install NULL hooks for
645         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
646         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
647         * nto-low.c (nto_target_ops): Likewise.
648         * spu-low.c (spu_target_ops): Likewise.
649         * win32-low.c (win32_target_ops): Likewise.
650
651 2015-03-04  Pedro Alves  <palves@redhat.com>
652
653         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
654         Decide whether a breakpoint triggered based on the SIGTRAP's
655         siginfo.si_code.
656         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
657         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
658         (linux_low_filter_event): Check for breakpoints before checking
659         watchpoints.
660         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
661         siginfo.si_code.
662         (linux_stopped_by_sw_breakpoint)
663         (linux_supports_stopped_by_sw_breakpoint)
664         (linux_stopped_by_hw_breakpoint)
665         (linux_supports_stopped_by_hw_breakpoint): New functions.
666         (linux_target_ops): Install new target methods.
667
668 2015-03-04  Pedro Alves  <palves@redhat.com>
669
670         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
671         * server.c (swbreak_feature, hwbreak_feature): New globals.
672         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
673         (captured_main): Clear swbreak_feature and hwbreak_feature.
674         * server.h (swbreak_feature, hwbreak_feature): Declare.
675         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
676         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
677         supports_stopped_by_hw_breakpoint>: New fields.
678         (target_supports_stopped_by_sw_breakpoint)
679         (target_stopped_by_sw_breakpoint)
680         (target_supports_stopped_by_hw_breakpoint)
681         (target_stopped_by_hw_breakpoint): Declare.
682
683 2015-03-04  Pedro Alves  <palves@redhat.com>
684
685         enum lwp_stop_reason -> enum target_stop_reason
686         * linux-low.c (check_stopped_by_breakpoint): Adjust.
687         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
688         (linux_wait_1, stuck_in_jump_pad_callback)
689         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
690         (linux_stopped_by_watchpoint):
691         * linux-low.h (enum lwp_stop_reason): Delete.
692         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
693         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
694
695 2015-03-04  Yao Qi  <yao.qi@linaro.org>
696
697         * Makefile.in (SFILES): Add linux-aarch64-low.c.
698
699 2015-03-03  Gary Benson  <gbenson@redhat.com>
700
701         * hostio.c (handle_vFile): Fix prefix lengths.
702
703 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
704
705         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
706         ptr_bits.
707
708 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
709
710         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
711         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
712         (clean): Add "rm -f" for above C files.
713         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
714         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
715         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
716         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
717         * linux-s390-low.c (HWCAP_S390_VX): New macro.
718         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
719         (init_registers_s390x_vx_linux64)
720         (init_registers_s390x_tevx_linux64)
721         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
722         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
723         declarations.
724         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
725         (s390_store_vxrs_high): New functions.
726         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
727         NT_S390_VXRS_HIGH.
728         (s390_arch_setup): Add logic for selecting one of the new target
729         descriptions.  Activate the new vector regsets if applicable.
730         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
731         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
732         and init_registers_s390x_tevx_linux64.
733
734 2015-03-01  Pedro Alves  <palves@redhat.com>
735
736         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
737         parameter.
738
739 2015-02-27  Pedro Alves  <palves@redhat.com>
740
741         * linux-x86-low.c (u_debugreg_offset): New function.
742         (x86_linux_dr_get, x86_linux_dr_set): Use it.
743
744 2015-02-27  Pedro Alves  <palves@redhat.com>
745
746         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
747         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
748         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
749         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
750         (ps_lsetfpregs, ps_getpid)
751         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
752         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
753         (ps_lsetxregs, ps_plog): Declare.
754
755 2015-02-27  Pedro Alves  <palves@redhat.com>
756
757         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
758         IP_AGENT_EXPORT_FUNC.
759         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
760         IP_AGENT_EXPORT_FUNC.
761         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
762         (IP_AGENT_EXPORT): Delete.
763         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
764         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
765         (gdb_trampoline_buffer_error, collecting, gdb_collect)
766         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
767         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
768         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
769         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
770         (traceframe_read_count, traceframe_write_count)
771         (traceframes_created, trace_state_variables, get_raw_reg)
772         (get_trace_state_variable_value, set_trace_state_variable_value)
773         (ust_loaded, helper_thread_id, cmd_buf): Use
774         IPA_SYM_EXPORTED_NAME.
775         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
776         (tracepoints) Use IP_AGENT_EXPORT_VAR.
777         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
778         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
779         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
780         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
781         EXTERN_C_PUSH/EXTERN_C_POP.
782         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
783         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
784         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
785         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
786         (traceframe_write_count, traceframe_read_count)
787         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
788         (about_to_request_buffer_space, get_trace_state_variable_value)
789         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
790         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
791         EXTERN_C_PUSH/EXTERN_C_POP.
792         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
793         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
794         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
795         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
796         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
797         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
798         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
799         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
800         Define.
801         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
802         (IP_AGENT_EXPORT_VAR_DECL): Define.
803         (tracing): Declare.
804         (gdb_agent_get_raw_reg): Declare.
805
806 2015-02-27  Tom Tromey  <tromey@redhat.com>
807             Pedro Alves  <palves@redhat.com>
808
809         Rename symbols whose names are reserved C++ keywords throughout.
810
811 2015-02-27  Pedro Alves  <palves@redhat.com>
812
813         * Makefile.in (COMPILER): New, get it from autoconf.
814         (CXX): Get from autoconf instead.
815         (COMPILE.pre): Use COMPILER.
816         (CC-LD): Rename to ...
817         (CC_LD): ... this.  Use COMPILER.
818         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
819         (CXX_FOR_TARGET): Default to g++ instead of gcc.
820         * acinclude.m4: Include build-with-cxx.m4.
821         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
822         Disable -Werror by default if building in C++ mode.
823         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
824         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
825         the C++ compiler.  Save/restore CXXFLAGS too.
826         * configure: Regenerate.
827
828 2015-02-27  Pedro Alves  <palves@redhat.com>
829
830         * acinclude.m4: Include libiberty.m4.
831         * configure.ac: Call libiberty_INIT.
832         * config.in, configure: Regenerate.
833
834 2015-02-26  Pedro Alves  <palves@redhat.com>
835
836         * linux-low.c (linux_wait_1): When incrementing the PC past a
837         program breakpoint always use the_low_target.breakpoint_len as
838         increment, rather than the maximum between that and
839         the_low_target.decr_pc_after_break.
840
841 2015-02-23  Pedro Alves  <palves@redhat.com>
842
843         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
844         thread was doing a step-over; always adjust the PC if
845         we stepped over a permanent breakpoint.
846         (linux_wait_1): If we stepped over breakpoint that was on top of a
847         permanent breakpoint, manually advance the PC past it.
848
849 2015-02-23  Pedro Alves  <palves@redhat.com>
850
851         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
852         modes.
853         (x86_fill_gregset, x86_store_gregset): Use it when handling
854         $orig_eax.
855
856 2015-02-20  Pedro Alves  <palves@redhat.com>
857
858         * thread-db.c: Include "nat/linux-procfs.h".
859         (thread_db_init): Skip listing new threads if the kernel supports
860         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
861
862 2015-02-20  Pedro Alves  <palves@redhat.com>
863
864         * linux-low.c (status_pending_p_callback): Use ptid_match.
865
866 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
867
868         PR breakpoints/16812
869         * linux-low.c (wstatus_maybe_breakpoint): Remove.
870         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
871         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
872
873 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
874
875         PR breakpoints/15956
876         * tracepoint.c (cmd_qtinit): Add check for current_thread.
877
878 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
879
880         * linux-low.c (linux_low_btrace_conf): Print size.
881         * server.c (handle_btrace_conf_general_set): New.
882         (hanle_general_set): Call handle_btrace_conf_general_set.
883         (handle_query): Report Qbtrace-conf:bts:size as supported.
884
885 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
886
887         * linux-low.c (linux_low_enable_btrace): Update parameters.
888         (linux_low_btrace_conf): New.
889         (linux_target_ops)<to_btrace_conf>: Initialize.
890         * server.c (current_btrace_conf): New.
891         (handle_btrace_enable): Rename to ...
892         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
893         to target_enable_btrace.  Update comment.  Update users.
894         (handle_qxfer_btrace_conf): New.
895         (qxfer_packets): Add btrace-conf entry.
896         (handle_query): Report qXfer:btrace-conf:read as supported packet.
897         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
898         (target_ops)<read_btrace_conf>: New.
899         (target_enable_btrace): Update parameters.
900         (target_read_btrace_conf): New.
901
902 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
903
904         * server.c (handle_btrace_general_set): Remove call to
905         target_supports_btrace.
906         (supported_btrace_packets): New.
907         (handle_query): Call supported_btrace_packets.
908         * target.h: include btrace-common.h.
909         (btrace_target_info): Removed.
910         (supports_btrace, target_supports_btrace): Update parameters.
911
912 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
913
914         * Makefile.in (SFILES): Add common/btrace-common.c.
915         (OBS): Add common/btrace-common.o.
916         (btrace-common.o): Add build rules.
917         * linux-low: Include btrace-common.h.
918         (linux_low_read_btrace): Use struct btrace_data.  Call
919         btrace_data_init and btrace_data_fini.
920
921 2015-02-06  Pedro Alves  <palves@redhat.com>
922
923         * thread-db.c (find_new_threads_callback): Add debug output.
924
925 2015-02-04  Pedro Alves  <palves@redhat.com>
926
927         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
928         (resume_stopped_resumed_lwps): New function.
929         (linux_wait_for_event_filtered): Use it.
930
931 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
932
933         * Makefile.in (SFILES): Add linux-personality.c.
934         (linux-personality.o): New rule.
935         * configure.srv (srv_linux_obj): Add linux-personality.o to the
936         list of objects to be built.
937         * linux-low.c: Include nat/linux-personality.h.
938         (linux_create_inferior): Remove code to disable address space
939         randomization (moved to ../nat/linux-personality.c).  Create
940         cleanup to disable address space randomization.
941
942 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
943
944         * Makefile.in (posix-strerror.o): New rule.
945         (mingw-strerror.o): Likewise.
946         * configure: Regenerated.
947         * configure.ac: Source file ../common/common.host.  Initialize new
948         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
949
950 2015-01-14  Yao Qi  <yao@codesourcery.com>
951
952         * Makefile.in (SFILES): Add nat/ppc-linux.c.
953         (ppc-linux.o): New rule.
954         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
955         * configure.ac: AC_CHECK_FUNCS(getauxval).
956         * config.in: Re-generated.
957         * configure: Re-generated.
958         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
959         ppc64_64bit_inferior_p
960
961 2015-01-14  Yao Qi  <yao@codesourcery.com>
962
963         * linux-ppc-low.c: Include "nat/ppc-linux.h".
964          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
965         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
966         (PT_ORIG_R3, PT_TRAP): Likewise.
967         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
968         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
969         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
970
971 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
972
973         * i387-fp.c (i387_cache_to_xsave): In look over
974         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
975         zmmh_low_space field by use of zmmh_high_space.
976
977 2015-01-09  Pedro Alves  <palves@redhat.com>
978
979         * linux-low.c (step_over_bkpt): Move higher up in the file.
980         (handle_extended_wait): Don't store the stop_pc here.
981         (get_stop_pc): Adjust comments and rename to ...
982         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
983         stopped for a software breakpoint or hardware breakpoint.
984         (thread_still_has_status_pending_p): New function.
985         (status_pending_p_callback): Use
986         thread_still_has_status_pending_p.  If the event is no longer
987         interesting, resume the LWP.
988         (handle_tracepoints): Add assert.
989         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
990         (wstatus_maybe_breakpoint): New function.
991         (cancel_breakpoint): Delete function.
992         (check_stopped_by_watchpoint): New function, factored out from
993         linux_low_filter_event.
994         (lp_status_maybe_breakpoint): Delete function.
995         (linux_low_filter_event): Remove filter_ptid argument.
996         Leave thread group exits pending here.  Store the LWP's stop PC.
997         Always leave events pending.
998         (linux_wait_for_event_filtered): Pull all events out of the
999         kernel, and leave them all pending.
1000         (count_events_callback, select_event_lwp_callback): Consider all
1001         events.
1002         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
1003         (select_event_lwp): Only give preference to the stepping LWP in
1004         all-stop mode.  Adjust comments.
1005         (ignore_event): New function.
1006         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
1007         references to cancel_breakpoints.  Adjust to renames.  Also give
1008         equal priority to all LWPs that have had events in non-stop mode.
1009         If reporting a software breakpoint event, unadjust the LWP's PC.
1010         (linux_wait): If linux_wait_1 returned an ignored event, retry.
1011         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
1012         Adjust.
1013         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
1014         (resume_status_pending_p): Use thread_still_has_status_pending_p.
1015         (linux_stopped_by_watchpoint): Adjust.
1016         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
1017         * linux-low.h (enum lwp_stop_reason): New.
1018         (struct lwp_info) <stop_pc>: Adjust comment.
1019         <stopped_by_watchpoint>: Delete field.
1020         <stop_reason>: New field.
1021         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
1022         * mem-break.c (software_breakpoint_inserted_here)
1023         (hardware_breakpoint_inserted_here): New function.
1024         * mem-break.h (software_breakpoint_inserted_here)
1025         (hardware_breakpoint_inserted_here): Declare.
1026         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
1027         (cancel_breakpoints): Delete.
1028         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
1029         (upload_fast_traceframes): Remove references to
1030         cancel_breakpoints.
1031
1032 2015-01-09  Pedro Alves  <palves@redhat.com>
1033
1034         * thread-db.c (find_new_threads_callback): Ignore thread if the
1035         kernel thread ID is -1.
1036
1037 2015-01-09  Pedro Alves  <palves@redhat.com>
1038
1039         * linux-low.c (linux_attach_fail_reason_string): Move to
1040         nat/linux-ptrace.c, and rename.
1041         (linux_attach_lwp): Update comment.
1042         (attach_proc_task_lwp_callback): New function.
1043         (linux_attach): Adjust to rename and use
1044         linux_proc_attach_tgid_threads.
1045         (linux_attach_fail_reason_string): Delete declaration.
1046
1047 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
1048
1049         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
1050         * server.c (gdbserver_version): Likewise.
1051
1052 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
1053
1054         * remote-utils.c: Include ctype.h.
1055         (input_interrupt): Explicitly handle the case when the char
1056         received is the NUL byte.  Improve the printing of non-ASCII
1057         characters.
1058
1059 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
1060
1061         * linux-low.c (linux_low_filter_event): Update call to
1062         linux_enable_event_reporting following the addition of
1063         a new parameter to that function.
1064
1065 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
1066
1067         PR server/17457
1068         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
1069         (AARCH64_FPCR_REGNO): Likewise.
1070         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
1071         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
1072         (aarch64_store_fpregset): Likewise.
1073
1074 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
1075
1076         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
1077         Remove FIXME comment about assumption about N.
1078
1079 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
1080
1081         * configure.ac: If large-file support is disabled in GDBserver,
1082         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
1083         * configure: Regenerate.
1084
1085 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1086
1087         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
1088         warning upon ENODATA from ptrace.
1089         * linux-s390-low.c (s390_store_tdb): New.
1090         (s390_regsets): Add regset for NT_S390_TDB.
1091
1092 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1093
1094         * linux-low.c (regsets_store_inferior_registers): Skip regsets
1095         without a fill_function.
1096         * linux-s390-low.c (s390_fill_last_break): Remove.
1097         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
1098         (s390_arch_setup): Use regset's size instead of fill_function for
1099         loop end condition.
1100
1101 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1102
1103         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
1104         the regset's store function when ptrace returned an error.
1105         * regcache.c (get_thread_regcache): Invalidate register cache
1106         before fetching inferior's registers.
1107
1108 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1109
1110         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
1111         while-loop as for-loop.
1112         (regsets_store_inferior_registers): Likewise.
1113
1114 2014-11-28  Yao Qi  <yao@codesourcery.com>
1115
1116         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
1117         * config.in, configure: Re-generate.
1118         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
1119         is defined.
1120
1121 2014-11-21  Yao Qi  <yao@codesourcery.com>
1122
1123         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
1124         (AC_CHECK_HEADERS): Remove malloc.h.
1125         * configure: Re-generated.
1126         * config.in: Re-generated.
1127         * server.h: Don't include alloca.h and malloc.h.
1128         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
1129         Don't include malloc.h.
1130
1131 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
1132
1133         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
1134         corresponding ERRNO check in same block.
1135
1136 2014-11-12  Pedro Alves  <palves@redhat.com>
1137
1138         * server.c (cont_thread): Update comment.
1139         (start_inferior, attach_inferior): No longer clear cont_thread.
1140         (handle_v_cont): No longer set cont_thread.
1141         (captured_main): Clear cont_thread each time a GDB connects.
1142
1143 2014-11-12  Pedro Alves  <palves@redhat.com>
1144
1145         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
1146         thread, and don't resume all threads if the Hc thread has exited.
1147
1148 2014-11-12  Pedro Alves  <palves@redhat.com>
1149
1150         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
1151         the process group instead of to a specific LWP.
1152
1153 2014-10-15  Pedro Alves  <palves@redhat.com>
1154
1155         PR server/17487
1156         * win32-arm-low.c (arm_set_thread_context): Remove current_event
1157         parameter.
1158         (arm_set_thread_context): Delete.
1159         (the_low_target): Adjust.
1160         * win32-i386-low.c (debug_registers_changed)
1161         (debug_registers_used): Delete.
1162         (update_debug_registers_callback): New function.
1163         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
1164         needing to update their debug registers.
1165         (win32_get_current_dr): New function.
1166         (x86_dr_low_get_addr, x86_dr_low_get_control)
1167         (x86_dr_low_get_status): Fetch the debug register from the thread
1168         record's context.
1169         (i386_initial_stuff): Adjust.
1170         (i386_get_thread_context): Remove current_event parameter.  Don't
1171         clear debug_registers_changed nor copy DR values to
1172         debug_reg_state.
1173         (i386_set_thread_context): Delete.
1174         (i386_prepare_to_resume): New function.
1175         (i386_thread_added): Mark the thread as needing to update irs
1176         debug registers.
1177         (the_low_target): Remove i386_set_thread_context and install
1178         i386_prepare_to_resume.
1179         * win32-low.c (win32_get_thread_context): Adjust.
1180         (win32_set_thread_context): Use SetThreadContext
1181         directly.
1182         (win32_prepare_to_resume): New function.
1183         (win32_require_context): New function, factored out from ...
1184         (thread_rec): ... this.
1185         (continue_one_thread): Call win32_prepare_to_resume on each thread
1186         we're about to continue.
1187         (win32_resume): Call win32_prepare_to_resume on the event thread.
1188         * win32-low.h (struct win32_thread_info)
1189         <debug_registers_changed>: New field.
1190         (struct win32_target_ops): Change prototype of set_thread_context,
1191         delete set_thread_context and add prepare_to_resume.
1192         (win32_require_context): New declaration.
1193
1194 2014-10-08  Gary Benson  <gbenson@redhat.com>
1195
1196         * server.h: Do not include common-exceptions.h.
1197
1198 2014-10-08  Gary Benson  <gbenson@redhat.com>
1199
1200         * server.h: Do not include cleanups.h.
1201
1202 2014-09-30  James Hogan  <james.hogan@imgtec.com>
1203
1204         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
1205         mips64-dsp-linux.c.
1206
1207 2014-09-23  Yao Qi  <yao@codesourcery.com>
1208
1209         * linux-low.c (lp_status_maybe_breakpoint): New function.
1210         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
1211         (count_events_callback): Likewise.
1212         (select_event_lwp_callback): Likewise.
1213         (cancel_breakpoints_callback): Likewise.
1214
1215 2014-09-19  Don Breazeal  <donb@codesourcery.com>
1216
1217         * linux-low.c (handle_extended_wait): Call
1218         linux_ptrace_get_extended_event.
1219         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
1220         linux_is_extended_waitstatus.
1221
1222 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
1223
1224         * Makefile.in (CPPFLAGS): Define.
1225         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
1226         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
1227
1228 2014-09-16  Gary Benson  <gbenson@redhat.com>
1229
1230         * inferiors.h (current_inferior): Renamed as...
1231         (current_thread): New variable.  All uses updated.
1232         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
1233         (maybe_move_out_of_jump_pad): Likewise.
1234         (cancel_breakpoint): Likewise.
1235         (linux_low_filter_event): Likewise.
1236         (wait_for_sigstop): Likewise.
1237         (linux_resume_one_lwp): Likewise.
1238         (need_step_over_p): Likewise.
1239         (start_step_over): Likewise.
1240         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
1241         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
1242         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
1243         and save_inferior as saved_thread.
1244         * regcache.c (get_thread_regcache): Renamed saved_inferior as
1245         saved_thread.
1246         (regcache_invalidate_thread): Likewise.
1247         * remote-utils.c (prepare_resume_reply): Likewise.
1248         * thread-db.c (thread_db_get_tls_address): Likewise.
1249         (disable_thread_event_reporting): Likewise.
1250         (remove_thread_event_breakpoints): Likewise.
1251         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
1252         as saved_thread.
1253         * target.h (set_desired_inferior): Renamed as...
1254         (set_desired_thread): New declaration.  All uses updated.
1255         * server.c (myresume): Updated comment to reference thread instead
1256         of inferior.
1257         (handle_serial_event): Likewise.
1258         (handle_target_event): Likewise.
1259
1260 2014-09-12  Tom Tromey  <tromey@redhat.com>
1261             Gary Benson  <gbenson@redhat.com>
1262
1263         * regcache.h: Include common-regcache.h.
1264         (regcache_read_pc): Don't declare.
1265         * regcache.c (get_thread_regcache_for_ptid): New function.
1266
1267 2014-09-11  Tom Tromey  <tromey@redhat.com>
1268             Gary Benson  <gbenson@redhat.com>
1269
1270         * symbol.c: New file.
1271         * Makefile.in (SFILES): Add symbol.c.
1272         (OBS): Add symbol.o.
1273
1274 2014-09-11  Gary Benson  <gbenson@redhat.com>
1275
1276         * target.c (target_stop_ptid, target_continue_ptid): New
1277         functions.
1278
1279 2014-09-11  Tom Tromey  <tromey@redhat.com>
1280             Gary Benson  <gbenson@redhat.com>
1281
1282         * target.h: Include target/target.h.
1283         * target.c (target_read_memory, target_read_uint32)
1284         (target_write_memory): New functions.
1285
1286 2014-09-11  Gary Benson  <gbenson@redhat.com>
1287
1288         * server.h (debug_hw_points): Don't declare.
1289         * server.c (debug_hw_points): Don't define.  Replace all uses
1290         with show_debug_regs.
1291         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
1292         all uses with show_debug_regs.
1293
1294 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
1295
1296         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
1297         endianness into account.
1298         (ppc_supply_ptrace_register): Likewise.
1299
1300 2014-09-03  James Hogan  <james.hogan@imgtec.com>
1301
1302         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
1303         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
1304
1305 2014-09-03  Gary Benson  <gbenson@redhat.com>
1306
1307         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
1308         ALL_DEBUG_ADDRESS_REGISTERS.
1309
1310 2014-09-02  Gary Benson  <gbenson@redhat.com>
1311
1312         * i386-low.h: Renamed as...
1313         * x86-low.h: New file.  All type, function and variable name
1314         prefixes changed from "i386_" to "x86_".  All references updated.
1315         * i386-low.c: Renamed as...
1316         * x86-low.c: New file.  All type, function and variable name
1317         prefixes changed from "i386_" to "x86_".  All references updated.
1318
1319 2014-09-02  Gary Benson  <gbenson@redhat.com>
1320
1321         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
1322         (x86_linux_new_thread): Likewise.
1323
1324 2014-08-29  Gary Benson  <gbenson@redhat.com>
1325
1326         * server.h (setjmp.h): Do not include.
1327         (toplevel): Do not declare.
1328         (common-exceptions.h): Include.
1329         (cleanups.h): Likewise.
1330         * server.c (toplevel): Do not define.
1331         (exit_code): New static global.
1332         (detach_or_kill_for_exit_cleanup): New function.
1333         (main): New function.  Original main renamed to...
1334         (captured_main): New function.
1335         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
1336
1337 2014-08-29  Gary Benson  <gbenson@redhat.com>
1338
1339         * Makefile.in (SFILES): Add common/common-exceptions.c.
1340         (OBS): Add common-exceptions.o.
1341         (common-exceptions.o): New rule.
1342         * utils.c (prepare_to_throw_exception): New function.
1343
1344 2014-08-29  Gary Benson  <gbenson@redhat.com>
1345
1346         * config.in: Regenerate.
1347         * configure: Likewise.
1348
1349 2014-08-29  Gary Benson  <gbenson@redhat.com>
1350
1351         * Makefile.in (SFILES): Add common/cleanups.c.
1352         (OBS): cleanups.o.
1353         (cleanups.o): New rule.
1354
1355 2014-08-29  Gary Benson  <gbenson@redhat.com>
1356
1357         * utils.c (internal_vwarning): New function.
1358
1359 2014-08-28  Gary Benson  <gbenson@redhat.com>
1360
1361         * utils.h (fatal): Remove declaration.
1362         * utils.c (fatal): Remove function.
1363
1364 2014-08-28  Gary Benson  <gbenson@redhat.com>
1365
1366         * tracepoint.c (gdb_agent_init): Replace fatal with
1367         perror_with_name.
1368         (initialize_tracepoint): Likewise.
1369
1370 2014-08-28  Gary Benson  <gbenson@redhat.com>
1371
1372         * remote-utils.c (remote_prepare): Replace fatal with error.
1373
1374 2014-08-28  Gary Benson  <gbenson@redhat.com>
1375
1376         * linux-low.c (linux_async): Replace fatal with warning.
1377         Tidy up and return.
1378         (linux_start_non_stop): Return -1 if linux_async failed.
1379
1380 2014-08-28  Gary Benson  <gbenson@redhat.com>
1381
1382         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
1383         gdb_assert.
1384         (i386_dr_low_get_addr): Remove vague comment.
1385         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
1386         gdb_assert.
1387
1388 2014-08-28  Gary Benson  <gbenson@redhat.com>
1389
1390         * inferiors.c (get_thread_process): Replace check with gdb_assert.
1391         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
1392         internal_error.
1393         (linux_resume_one_lwp): Likewise.
1394         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
1395         gdb_assert.
1396         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
1397         with internal_error.
1398         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
1399         (init_register_cache): Replace fatal with gdb_assert_not_reached.
1400         (find_register_by_name): Replace fatal with internal_error.
1401         (find_regno): Likewise.
1402         * tdesc.c (init_target_desc): Replace check with gdb_assert.
1403         * thread-db.c (thread_db_create_event): Likewise.
1404         (thread_db_load_search): Likewise.
1405         (try_thread_db_load_1): Likewise.
1406         * tracepoint.c (get_jump_space_head): Replace fatal with
1407         internal_error.
1408         (claim_trampoline_space): Likewise.
1409         (have_fast_tracepoint_trampoline_buffer): Likewise.
1410         (cmd_qtstart): Likewise.
1411         (stop_tracing): Likewise.
1412         (fast_tracepoint_collecting): Likewise.
1413         (target_malloc): Likewise.
1414         (download_tracepoint): Likewise.
1415         (download_trace_state_variables): Replace check with gdb_assert.
1416         (upload_fast_traceframes): Replace fatal with internal_error.
1417
1418 2014-08-19  Tom Tromey  <tromey@redhat.com>
1419             Gary Benson  <gbenson@redhat.com>
1420
1421         * Makefile.in (SFILES): Add common/common-debug.c.
1422         (OBS): Add common-debug.o.
1423         (common-debug.o): New rule.
1424         * debug.h (debug_printf): Don't declare.
1425         * debug.c (debug_printf): Renamed and rewritten as...
1426         (debug_vprintf): New function.
1427
1428 2014-08-19  Gary Benson  <gbenson@redhat.com>
1429
1430         * utils.h: Do not include print-utils.h.
1431
1432 2014-08-19  Tom Tromey  <tromey@redhat.com>
1433             Gary Benson  <gbenson@redhat.com>
1434
1435         * server.h: Add static assertion.
1436         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
1437
1438 2014-08-19  Tom Tromey  <tromey@redhat.com>
1439             Gary Benson  <gbenson@redhat.com>
1440
1441         * Makefile.in (SFILES): Add common/errors.c.
1442         (OBS): Add errors.o.
1443         (IPA_OBS): Add errors-ipa.o.
1444         (errors.o): New rule.
1445         (errors-ipa.o): Likewise.
1446         * utils.h (perror_with_name, error, warning): Don't declare.
1447         * utils.c (warning): Renamed and rewritten as...
1448         (vwarning): New function.
1449         (error): Renamed and rewritten as...
1450         (verror): New function.
1451         (internal_error): Renamed and rewritten as...
1452         (internal_verror): New function.
1453
1454 2014-08-07  Gary Benson  <gbenson@redhat.com>
1455
1456         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
1457         * configure: Regenerate.
1458         * config.in: Likewise.
1459         * server.h: Do not include errno.h.
1460         * event-loop.c: Likewise.
1461         * hostio-errno.c: Likewise.
1462         * linux-low.c: Likewise.
1463         * remote-utils.c: Likewise.
1464         * spu-low.c: Likewise.
1465         * utils.c: Likewise.
1466         * gdbreplay.c: Unconditionally include errno.h.
1467
1468 2014-08-07  Gary Benson  <gbenson@redhat.com>
1469
1470         * server.h: Do not include string.h.
1471         * event-loop.c: Likewise.
1472         * linux-low.c: Likewise.
1473         * regcache.c: Likewise.
1474         * remote-utils.c: Likewise.
1475         * spu-low.c: Likewise.
1476         * utils.c: Likewise.
1477
1478 2014-08-07  Gary Benson  <gbenson@redhat.com>
1479
1480         * server.h: Do not include gdb_assert.h.
1481
1482 2014-08-07  Gary Benson  <gbenson@redhat.com>
1483
1484         * server.h: Do not include common-utils.h.
1485
1486 2014-08-07  Gary Benson  <gbenson@redhat.com>
1487
1488         * server.h: Do not include ptid.h.
1489         * notif.h: Likewise.
1490
1491 2014-08-07  Gary Benson  <gbenson@redhat.com>
1492
1493         * server.h: Do not include gdb_locale.h.
1494
1495 2014-08-07  Gary Benson  <gbenson@redhat.com>
1496
1497         * server.h: Do not include gdb/signals.h.
1498         * win32-low.c: Likewise.
1499
1500 2014-08-07  Gary Benson  <gbenson@redhat.com>
1501
1502         * server.h: Do not include pathmax.h.
1503
1504 2014-08-07  Gary Benson  <gbenson@redhat.com>
1505
1506         * server.h: Do not include libiberty.h.
1507         * linux-bfin-low.c: Likewise.
1508
1509 2014-08-07  Gary Benson  <gbenson@redhat.com>
1510
1511         * server.h: Do not include ansidecl.h.
1512
1513 2014-08-07  Gary Benson  <gbenson@redhat.com>
1514
1515         * linux-x86-low.c: Do not include stddef.h.
1516         * lynx-ppc-low.c: Likewise.
1517         * tracepoint.c: Likewise.
1518
1519 2014-08-07  Gary Benson  <gbenson@redhat.com>
1520
1521         * server.h: Do not include stdarg.h.
1522         * nto-low.c: Likewise.
1523
1524 2014-08-07  Gary Benson  <gbenson@redhat.com>
1525
1526         * server.h: Do not include stdlib.h.
1527         * inferiors.c: Likewise.
1528         * linux-low.c: Likewise.
1529         * regcache.c: Likewise.
1530         * spu-low.c: Likewise.
1531         * tracepoint.c: Likewise.
1532         * utils.c: Likewise.
1533
1534 2014-08-07  Gary Benson  <gbenson@redhat.com>
1535
1536         * server.h: Do not include stdio.h.
1537         * linux-low.c: Likewise.
1538         * remote-utils.c: Likewise.
1539         * spu-low.c: Likewise.
1540         * utils.c: Likewise.
1541         * wincecompat.c: Likewise.
1542
1543 2014-08-06  Gary Benson  <gbenson@redhat.com>
1544
1545         * regcache.c (init_register_cache): Move conditionals inside if.
1546
1547 2014-08-06  Gary Benson  <gbenson@redhat.com>
1548
1549         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
1550
1551 2014-07-31  Gary Benson  <gbenson@redhat.com>
1552
1553         * ax.h: Do not include server.h.
1554         * gdbthread.h: Likewise.
1555         * lynx-low.h: Likewise.
1556         * notif.h: Likewise.
1557
1558 2014-07-30  Gary Benson  <gbenson@redhat.com>
1559
1560         * server.h: Include common-defs.h.
1561         Do not include config.h or build-gnulib-gdbserver/config.h.
1562
1563 2014-07-30  Gary Benson  <gbenson@redhat.com>
1564
1565         * hostio-errno.c: Move server.h to top of includes list.
1566         * inferiors.c: Likewise.
1567         * linux-x86-low.c: Likewise.
1568         * notif.c: Include server.h.
1569
1570 2014-07-24  Tom Tromey  <tromey@redhat.com>
1571             Gary Benson  <gbenson@redhat.com>
1572
1573         * server.h (CORE_ADDR): Now unsigned.
1574
1575 2014-07-16  Pedro Alves  <palves@redhat.com>
1576
1577         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
1578
1579 2014-07-15  Pedro Alves  <palves@redhat.com>
1580
1581         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
1582         copy.
1583
1584 2014-07-11  Pedro Alves  <palves@redhat.com>
1585
1586         * linux-low.c (kill_wait_lwp): New function, based on
1587         kill_one_lwp_callback, but use my_waitpid directly.
1588         (kill_one_lwp_callback, linux_kill): Use it.
1589
1590 2014-06-23  Pedro Alves  <palves@redhat.com>
1591
1592         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
1593         before setting DR0..DR3.
1594
1595 2014-06-20  Gary Benson  <gbenson@redhat.com>
1596
1597         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
1598         * configure: Regenerated.
1599         * config.in: Likewise.
1600
1601 2014-06-20  Gary Benson  <gbenson@redhat.com>
1602
1603         * Makefile.in (SFILES): Update locations for files moved
1604         from common to nat.
1605         (object file files): Reordered.
1606
1607 2014-06-20  Gary Benson  <gbenson@redhat.com>
1608
1609         * i386-low.h (i386_dr_low_can_set_addr): Removed.
1610         (i386_dr_low_set_addr): Likewise.
1611         (i386_dr_low_get_addr): Likewise.
1612         (i386_dr_low_can_set_control): Likewise.
1613         (i386_dr_low_set_control): Likewise.
1614         (i386_dr_low_get_control): Likewise.
1615         (i386_dr_low_get_status): Likewise.
1616         (i386_get_debug_register_length): Likewise.
1617         * linux-x86-low.c (i386_dr_low_set_addr):
1618         Changed signature.  Made static.
1619         (i386_dr_low_get_addr): Likewise.
1620         (i386_dr_low_set_control): Likewise.
1621         (i386_dr_low_get_control): Likewise.
1622         (i386_dr_low_get_status): Likewise.
1623         (i386_dr_low): New global variable.
1624         * win32-i386-low.c (i386_dr_low_set_addr):
1625         Changed signature.  Made static.
1626         (i386_dr_low_get_addr): Likewise.
1627         (i386_dr_low_set_control): Likewise.
1628         (i386_dr_low_get_control): Likewise.
1629         (i386_dr_low_get_status): Likewise.
1630         (i386_dr_low): New global variable.
1631
1632 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
1633
1634         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
1635         * Makefile.in (AR, AR_FLAGS): Define.
1636         * configure: Regenerate.
1637
1638 2014-06-19  Gary Benson  <gbenson@redhat.com>
1639
1640         * Makefile.in (i386-dregs.o): New rule.
1641         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
1642         * i386-low.c (target.h): Remove include.
1643         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
1644         (DR_CONTROL_SHIFT): Likewise.
1645         (DR_CONTROL_SIZE): Likewise.
1646         (DR_RW_EXECUTE): Likewise.
1647         (DR_RW_WRITE): Likewise.
1648         (DR_RW_READ): Likewise.
1649         (DR_RW_IORW): Likewise.
1650         (DR_LEN_1): Likewise.
1651         (DR_LEN_2): Likewise.
1652         (DR_LEN_4): Likewise.
1653         (DR_LEN_8): Likewise.
1654         (DR_LOCAL_ENABLE_SHIFT): Likewise.
1655         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
1656         (DR_ENABLE_SIZE): Likewise.
1657         (DR_LOCAL_SLOWDOWN): Likewise.
1658         (DR_GLOBAL_SLOWDOWN): Likewise.
1659         (DR_CONTROL_RESERVED): Likewise.
1660         (I386_DR_CONTROL_MASK): Likewise.
1661         (I386_DR_VACANT): Likewise.
1662         (I386_DR_LOCAL_ENABLE): Likewise.
1663         (I386_DR_GLOBAL_ENABLE): Likewise.
1664         (I386_DR_DISABLE): Likewise.
1665         (I386_DR_SET_RW_LEN): Likewise.
1666         (I386_DR_GET_RW_LEN): Likewise.
1667         (I386_DR_WATCH_HIT): Likewise.
1668         (i386_wp_op_t): Likewise.
1669         (i386_show_dr): Likewise.
1670         (i386_length_and_rw_bits): Likewise.
1671         (i386_insert_aligned_watchpoint): Likewise.
1672         (i386_remove_aligned_watchpoint): Likewise.
1673         (i386_handle_nonaligned_watchpoint): Likewise.
1674         i386_update_inferior_debug_regs(): Likewise.
1675         (i386_dr_insert_watchpoint): Likewise.
1676         (i386_dr_remove_watchpoint): Likewise.
1677         (i386_dr_region_ok_for_watchpoint): Likewise.
1678         (i386_dr_stopped_data_address): Likewise.
1679         (i386_dr_stopped_by_watchpoint): Likewise.
1680
1681 2014-06-19  Gary Benson  <gbenson@redhat.com>
1682
1683         * i386-low.c (i386_dr_show): Renamed to
1684         i386_show_dr and made static.  All uses updated.
1685         (i386_dr_length_and_rw_bits): Renamed to
1686         i386_length_and_rw_bits and made static.
1687         All uses updated.
1688         (i386_dr_insert_aligned_watchpoint): Renamed to
1689         i386_insert_aligned_watchpoint and made static.
1690         All uses updated.
1691         (i386_dr_remove_aligned_watchpoint): Renamed to
1692         i386_remove_aligned_watchpoint and made static.
1693         All uses updated.
1694         (i386_dr_update_inferior_debug_regs): Renamed to
1695         i386_update_inferior_debug_regs and made static.
1696         All uses updated.
1697
1698 2014-06-18  Gary Benson  <gbenson@redhat.com>
1699
1700         * i386-low.h (i386_dr_low_can_set_addr): New macro.
1701         (i386_dr_low_can_set_control): Likewise.
1702         (i386_get_debug_register_length): Likewise.
1703         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
1704         (i386_dr_low_can_set_control): Likewise.
1705         (i386_get_debug_register_length): Likewise.
1706
1707 2014-06-17  Gary Benson  <gbenson@redhat.com>
1708
1709         * i386-low.h (i386-dregs.h): New include.
1710         (DR_FIRSTADDR): Now in i386-dregs.h.
1711         (DR_LASTADDR): Likewise.
1712         (DR_NADDR): Likewise.
1713         (DR_STATUS): Likewise.
1714         (DR_CONTROL): Likewise.
1715         (i386_debug_reg_state): Likewise.
1716         (i386_dr_insert_watchpoint): Likewise.
1717         (i386_dr_remove_watchpoint): Likewise.
1718         (i386_dr_region_ok_for_watchpoint): Likewise.
1719         (i386_dr_stopped_data_address): Likewise.
1720         (i386_dr_stopped_by_watchpoint): Likewise.
1721         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
1722
1723 2014-06-18  Gary Benson  <gbenson@redhat.com>
1724
1725         * i386-low.h (i386_low_insert_watchpoint): Renamed to
1726         i386_dr_insert_watchpoint.
1727         (i386_low_remove_watchpoint): Renamed to
1728         i386_dr_remove_watchpoint.
1729         (i386_low_region_ok_for_watchpoint): Renamed to
1730         i386_dr_region_ok_for_watchpoint.
1731         (i386_low_stopped_data_address): Renamed to
1732         i386_dr_stopped_data_address.
1733         (i386_low_stopped_by_watchpoint): Renamed to
1734         i386_dr_stopped_by_watchpoint.
1735         * i386-low.c (i386_show_dr): Renamed to
1736         i386_dr_show and made nonstatic.  All uses updated.
1737         (i386_length_and_rw_bits): Renamed to
1738         i386_dr_length_and_rw_bits and made nonstatic.
1739         All uses updated.
1740         (i386_insert_aligned_watchpoint): Renamed to
1741         i386_dr_insert_aligned_watchpoint and made nonstatic.
1742         All uses updated.
1743         (i386_remove_aligned_watchpoint): Renamed to
1744         i386_dr_remove_aligned_watchpoint and made nonstatic.
1745         All uses updated.
1746         (i386_update_inferior_debug_regs): Renamed to
1747         i386_dr_update_inferior_debug_regs and made nonstatic.
1748         All uses updated.
1749         (i386_low_insert_watchpoint): Renamed to
1750         i386_dr_insert_watchpoint.  All uses updated.
1751         (i386_low_remove_watchpoint): Renamed to
1752         i386_dr_remove_watchpoint.  All uses updated.
1753         (i386_low_region_ok_for_watchpoint): Renamed to
1754         i386_dr_region_ok_for_watchpoint.  All uses updated.
1755         (i386_low_stopped_data_address): Renamed to
1756         i386_dr_stopped_data_address.  All uses updated.
1757         (i386_low_stopped_by_watchpoint): Renamed to
1758         i386_dr_stopped_by_watchpoint.  All uses updated.
1759
1760 2014-06-18  Gary Benson  <gbenson@redhat.com>
1761
1762         * i386-low.c (i386_dr_low_can_set_addr): New macro.
1763         (i386_dr_low_can_set_control): Likewise.
1764         (i386_insert_aligned_watchpoint): New check.
1765
1766 2014-06-18  Gary Benson  <gbenson@redhat.com>
1767
1768         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
1769         Renamed to state.
1770
1771 2014-06-18  Gary Benson  <gbenson@redhat.com>
1772
1773         * i386-low.c (i386_length_and_rw_bits): Use internal_error
1774         instead of fatal and error.
1775         (i386_handle_nonaligned_watchpoint): Likewise.
1776
1777 2014-06-18  Gary Benson  <gbenson@redhat.com>
1778
1779         * i386-low.c (i386_get_debug_register_length): New macro.
1780         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
1781         (i386_show_dr): Use debug_printf instead of fprintf.  Use
1782         phex to format values.
1783
1784 2014-06-18  Gary Benson  <gbenson@redhat.com>
1785
1786         * i386-low.h: Comment changes.
1787         * i386-low.c: Likewise.
1788
1789 2014-06-18  Gary Benson  <gbenson@redhat.com>
1790
1791         * i386-low.c: Whitespace changes.
1792
1793 2014-06-12  Tom Tromey  <tromey@redhat.com>
1794
1795         * utils.c (freeargv): Remove.
1796
1797 2014-06-12  Tom Tromey  <tromey@redhat.com>
1798
1799         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
1800         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
1801         (parse_debug_format_options): Likewise.
1802         (gdbserver_usage): Likewise.
1803         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
1804         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
1805         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
1806         against libiberty.
1807         ($(LIBGNU)): Depend on libiberty.
1808         (all-lib): Recurse into all subdirs.
1809         (install-only): Invoke "install" target in subdirs.
1810         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
1811         targets.
1812         * configure: Rebuild.
1813         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
1814         for vasprintf, vsnprintf, or gettimeofday.
1815         * configure.srv: Don't add safe-ctype.o or lbasename.o to
1816         srv_tgtobj.
1817
1818 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
1819
1820         * development.sh: Delete.
1821         * Makefile.in (config.status): Adjust dependency on development.sh.
1822         * configure.ac: Adjust development.sh source call.
1823         * configure: Regenerate.
1824
1825 2014-06-02  Pedro Alves  <palves@redhat.com>
1826
1827         * ax.c (gdb_free_agent_expr): New function.
1828         * ax.h (gdb_free_agent_expr): New declaration.
1829         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
1830         list.
1831         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
1832         static.
1833         (clear_breakpoint_conditions_and_commands): New function.
1834         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
1835         (clear_breakpoint_conditions_and_commands): New declaration.
1836
1837 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
1838
1839         * linux-aarch64-low.c (asm/ptrace.h): Include.
1840
1841 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
1842
1843         Fix TLS access for -static -pthread.
1844         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
1845         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
1846         (thread_db_load_search, try_thread_db_load_1): Initialize it.
1847
1848 2014-05-20  Pedro Alves  <palves@redhat.com>
1849
1850         * linux-aarch64-low.c (aarch64_insert_point)
1851         (aarch64_remove_point): No longer check whether the type is
1852         supported here.  Adjust to new interface.
1853         (the_low_target): Install aarch64_supports_z_point_type as
1854         supports_z_point_type method.
1855         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
1856         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
1857         instead of a Z packet char.  Adjust.
1858         (arm_supports_z_point_type): New function.
1859         (arm_insert_point, arm_remove_point): Adjust to new interface.
1860         (the_low_target): Install arm_supports_z_point_type.
1861         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
1862         (cris_insert_point, cris_remove_point): Adjust to new interface.
1863         Don't check whether the type is supported here.
1864         (the_low_target): Install cris_supports_z_point_type.
1865         * linux-low.c (linux_supports_z_point_type): New function.
1866         (linux_insert_point, linux_remove_point): Adjust to new interface.
1867         * linux-low.h (struct linux_target_ops) <insert_point,
1868         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
1869         raw_breakpoint pointer parameter.
1870         <supports_z_point_type>: New method.
1871         * linux-mips-low.c (mips_supports_z_point_type): New function.
1872         (mips_insert_point, mips_remove_point): Adjust to new interface.
1873         Use mips_supports_z_point_type.
1874         (the_low_target): Install mips_supports_z_point_type.
1875         * linux-ppc-low.c (the_low_target): Install NULL as
1876         supports_z_point_type method.
1877         * linux-s390-low.c (the_low_target): Install NULL as
1878         supports_z_point_type method.
1879         * linux-sparc-low.c (the_low_target): Install NULL as
1880         supports_z_point_type method.
1881         * linux-x86-low.c (x86_supports_z_point_type): New function.
1882         (x86_insert_point): Adjust to new insert_point interface.  Use
1883         insert_memory_breakpoint.  Adjust to new
1884         i386_low_insert_watchpoint interface.
1885         (x86_remove_point): Adjust to remove_point interface.  Use
1886         remove_memory_breakpoint.  Adjust to new
1887         i386_low_remove_watchpoint interface.
1888         (the_low_target): Install x86_supports_z_point_type.
1889         * lynx-low.c (lynx_target_ops): Install NULL as
1890         supports_z_point_type callback.
1891         * nto-low.c (nto_supports_z_point_type): New.
1892         (nto_insert_point, nto_remove_point): Adjust to new interface.
1893         (nto_target_ops): Install nto_supports_z_point_type.
1894         * mem-break.c: Adjust intro comment.
1895         (struct raw_breakpoint) <raw_type, size>: New fields.
1896         <inserted>: Update comment.
1897         <shlib_disabled>: Delete field.
1898         (enum bkpt_type) <gdb_breakpoint>: Delete value.
1899         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
1900         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
1901         (raw_bkpt_type_to_target_hw_bp_type): New function.
1902         (find_enabled_raw_code_breakpoint_at): New function.
1903         (find_raw_breakpoint_at): New type and size parameters.  Use them.
1904         (insert_memory_breakpoint): New function, based off
1905         set_raw_breakpoint_at.
1906         (remove_memory_breakpoint): New function.
1907         (set_raw_breakpoint_at): Reimplement.
1908         (set_breakpoint): New, based on set_breakpoint_at.
1909         (set_breakpoint_at): Reimplement.
1910         (delete_raw_breakpoint): Go through the_target->remove_point
1911         instead of assuming memory breakpoints.
1912         (find_gdb_breakpoint_at): Delete.
1913         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
1914         (find_gdb_breakpoint): New function.
1915         (set_gdb_breakpoint_at): Delete.
1916         (z_type_supported): New function.
1917         (set_gdb_breakpoint_1): New function, loosely based off
1918         set_gdb_breakpoint_at.
1919         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
1920         (delete_gdb_breakpoint_at): Delete.
1921         (delete_gdb_breakpoint_1): New function, loosely based off
1922         delete_gdb_breakpoint_at.
1923         (delete_gdb_breakpoint): New function.
1924         (clear_gdb_breakpoint_conditions): Rename to ...
1925         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
1926         breakpoint.
1927         (add_condition_to_breakpoint): Make static.
1928         (add_breakpoint_condition): Take a struct breakpoint pointer
1929         instead of an address.  Adjust.
1930         (gdb_condition_true_at_breakpoint): Rename to ...
1931         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
1932         z_type parameter.
1933         (gdb_condition_true_at_breakpoint): Reimplement.
1934         (add_breakpoint_commands): Take a struct breakpoint pointer
1935         instead of an address.  Adjust.
1936         (gdb_no_commands_at_breakpoint): Rename to ...
1937         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
1938         parameter.  Return true if no breakpoint was found.  Change debug
1939         output.
1940         (gdb_no_commands_at_breakpoint): Reimplement.
1941         (run_breakpoint_commands): Rename to ...
1942         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
1943         and change return type to boolean.
1944         (run_breakpoint_commands): New function.
1945         (gdb_breakpoint_here): Also check for Z1 breakpoints.
1946         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
1947         breakpoint.  Go through the_target->remove_point instead of
1948         assuming memory breakpoint.
1949         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
1950         software and hardware breakpoints.
1951         (reinsert_raw_breakpoint): Go through the_target->insert_point
1952         instead of assuming memory breakpoint.
1953         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
1954         software and hardware breakpoints.
1955         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
1956         Check both software and hardware breakpoints.
1957         (validate_inserted_breakpoint): Assert the breakpoint is a
1958         software breakpoint.  Set the inserted flag to -1 instead of
1959         setting shlib_disabled.
1960         (delete_disabled_breakpoints): Adjust.
1961         (validate_breakpoints): Only validate software breakpoints.
1962         Adjust to inserted flag change.
1963         (check_mem_read, check_mem_write): Skip breakpoint types other
1964         than software breakpoints.  Adjust to inserted flag change.
1965         * mem-break.h (enum raw_bkpt_type): New enum.
1966         (raw_breakpoint, struct process_info): Forward declare.
1967         (Z_packet_to_target_hw_bp_type): Delete declaration.
1968         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
1969         (set_gdb_breakpoint, delete_gdb_breakpoint)
1970         (clear_breakpoint_conditions): New declarations.
1971         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
1972         (breakpoint_inserted_here): Update comment.
1973         (add_breakpoint_condition, add_breakpoint_commands): Replace
1974         address parameter with a breakpoint pointer parameter.
1975         (gdb_breakpoint_here): Update comment.
1976         (delete_gdb_breakpoint_at): Delete.
1977         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
1978         * server.c (process_point_options): Take a struct breakpoint
1979         pointer instead of an address.  Adjust.
1980         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
1981         delete_gdb_breakpoint.
1982         * spu-low.c (spu_target_ops): Install NULL as
1983         supports_z_point_type method.
1984         * target.h: Include mem-break.h.
1985         (struct target_ops) <prepare_to_access_memory>: Update comment.
1986         <supports_z_point_type>: New field.
1987         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
1988         instead of a char.  Also take a raw breakpoint pointer.
1989         * win32-arm-low.c (the_low_target): Install NULL as
1990         supports_z_point_type.
1991         * win32-i386-low.c (i386_supports_z_point_type): New function.
1992         (i386_insert_point, i386_remove_point): Adjust to new interface.
1993         (the_low_target): Install i386_supports_z_point_type.
1994         * win32-low.c (win32_supports_z_point_type): New function.
1995         (win32_insert_point, win32_remove_point): Adjust to new interface.
1996         (win32_target_ops): Install win32_supports_z_point_type.
1997         * win32-low.h (struct win32_target_ops):
1998         <supports_z_point_type>: New method.
1999         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
2000         instead of a char.  Also take a raw breakpoint pointer.
2001
2002 2014-05-20  Pedro Alves  <palves@redhat.com>
2003
2004         * mem-break.h: Include break-common.h.
2005         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
2006         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
2007         (Z_packet_to_target_hw_bp_type): New declaration.
2008         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
2009         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
2010         (Z_PACKET_ACCESS_WP): Delete macros.
2011         (Z_packet_to_hw_type): Delete function.
2012         * i386-low.h: Don't include break-common.h here.
2013         (Z_packet_to_hw_type): Delete declaration.
2014         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
2015         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
2016         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
2017         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
2018         * linux-aarch64-low.c: Don't include break-common.h here.
2019         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
2020         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
2021         (Z_packet_to_target_hw_bp_type): Delete function.
2022         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
2023         function.
2024         (mips_insert_point, mips_remove_point): Use
2025         Z_packet_to_target_hw_bp_type.
2026
2027 2014-05-20  Pedro Alves  <palves@redhat.com>
2028
2029         * linux-aarch64-low.c: Include break-common.h.
2030         (enum target_point_type): Delete.
2031         (Z_packet_to_point_type): Rename to ...
2032         (Z_packet_to_target_hw_bp_type): ... this, and return a
2033         target_hw_bp_type instead.
2034         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
2035         instead of an enum target_point_type.
2036         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
2037         breakpoint type.
2038         (aarch64_dr_state_insert_one_point)
2039         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
2040         (aarch64_handle_aligned_watchpoint)
2041         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
2042         Take an enum target_hw_bp_type instead of an enum
2043         target_point_type.
2044         (aarch64_supports_z_point_type): New function.
2045         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
2046         use Z_packet_to_target_hw_bp_type.
2047
2048 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
2049
2050         * configure.ac: Only use -Werror by default when DEVELOPMENT
2051         is true.
2052         * configure: Regenerate.
2053
2054 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
2055
2056         Fix gdbserver qGetTLSAddr for x86_64 -m32.
2057         * linux-x86-low.c (X86_64_USER_REGS): New.
2058         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
2059
2060 2014-04-28  Yao Qi  <yao@codesourcery.com>
2061
2062         * Makefile.in (i386-avx512.c): Fix the typo of generated file
2063         name.
2064
2065 2014-04-25  Pedro Alves  <palves@redhat.com>
2066
2067         PR server/16255
2068         * linux-low.c (linux_attach_fail_reason_string): New function.
2069         (linux_attach_lwp): Delete.
2070         (linux_attach_lwp_1): Rename to ...
2071         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
2072         argument.  Remove "initial" parameter.  Return int instead of
2073         void.  Don't error or warn here.
2074         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
2075         failure to attach to the tgid.  Call warning when failing to
2076         attach to an lwp.
2077         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
2078         argument.  Remove "initial" parameter.  Return int instead of
2079         void.  Don't error or warn here.
2080         (linux_attach_fail_reason_string): New declaration.
2081         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
2082         interface change.  Use linux_attach_fail_reason_string.
2083
2084 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
2085             Walfred Tedeschi  <walfred.tedeschi@intel.com>
2086
2087         * Makefile.in: Added rules to handle new files
2088         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
2089         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
2090         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
2091         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
2092         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
2093         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
2094         x32-avx512-linux.o.
2095         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
2096         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
2097         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
2098         i386/x32-avx512.xml.
2099         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
2100         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
2101         i386/x32-avx512-linux.xml.
2102         * i387-fp.c (num_avx512_k_registers): New constant for number
2103         of K registers.
2104         (num_avx512_zmmh_low_registers): New constant for number of
2105         lower ZMM registers (0-15).
2106         (num_avx512_zmmh_high_registers): New constant for number of
2107         higher ZMM registers (16-31).
2108         (num_avx512_ymmh_registers): New contant for number of higher
2109         YMM registers (ymm16-31 added by avx521 on x86_64).
2110         (num_avx512_xmm_registers): New constant for number of higher
2111         XMM registers (xmm16-31 added by AVX512 on x86_64).
2112         (struct i387_xsave): Add space for AVX512 registers.
2113         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
2114         Add code to handle AVX512 registers.
2115         (i387_xsave_to_cache): Add code to handle AVX512 registers.
2116         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
2117         prototypei from generated file.
2118         (tdesc_amd64_avx512_linux): Likewise.
2119         (init_registers_x32_avx512_linux): Likewise.
2120         (tdesc_x32_avx512_linux): Likewise.
2121         (init_registers_i386_avx512_linux): Likewise.
2122         (tdesc_i386_avx512_linux): Likewise.
2123         (x86_64_regmap): Add AVX512 registers.
2124         (x86_linux_read_description): Add code to handle AVX512 XSTATE
2125         mask.
2126         (initialize_low_arch): Add code to initialize AVX512 registers.
2127
2128 2014-04-23  Pedro Alves  <palves@redhat.com>
2129
2130         * mem-break.c (find_gdb_breakpoint_at): Make static.
2131         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
2132
2133 2014-04-23  Pedro Alves  <palves@redhat.com>
2134
2135         * i386-low.c: Don't include break-common.h here.
2136         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
2137         prototype to take target_hw_bp_type as argument instead of a Z
2138         packet char.
2139         * i386-low.h: Include break-common.h here.
2140         (Z_packet_to_hw_type): Declare.
2141         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
2142         prototypes.
2143         * linux-x86-low.c (x86_insert_point): Convert the packet number to
2144         a target_hw_bp_type before calling i386_low_insert_watchpoint.
2145         (x86_remove_point): Convert the packet number to a
2146         target_hw_bp_type before calling i386_low_remove_watchpoint.
2147         * win32-i386-low.c (i386_insert_point): Convert the packet number
2148         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
2149         (i386_remove_point): Convert the packet number to a
2150         target_hw_bp_type before calling i386_low_remove_watchpoint.
2151
2152 2014-04-23  Pedro Alves  <palves@redhat.com>
2153
2154         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
2155
2156 2014-04-10  Pedro Alves  <palves@redhat.com>
2157
2158         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
2159         Check if the condition or command is NULL before checking if the
2160         breakpoint is known.  On success, return true.
2161         * mem-break.h (add_breakpoint_condition): Document return.
2162         (add_breakpoint_commands): Add describing comment.
2163         * server.c (skip_to_semicolon): New function.
2164         (process_point_options): Use it.
2165
2166 2014-04-09  Pedro Alves  <palves@redhat.com>
2167
2168         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
2169         to lwpid_of.
2170
2171 2014-02-27  Pedro Alves  <palves@redhat.com>
2172
2173         PR 12702
2174         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
2175         macros.
2176         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
2177         output.
2178         (last_thread_of_process_p): Take a PID argument instead of a
2179         thread pointer.
2180         (linux_wait_for_lwp): Delete.
2181         (num_lwps, check_zombie_leaders, not_stopped_callback): New
2182         functions.
2183         (linux_low_filter_event): New function, party factored out from
2184         linux_wait_for_event.
2185         (linux_wait_for_event): Rename to ...
2186         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
2187         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
2188         sigsuspend.  Check for zombie leaders.
2189         (linux_wait_for_event): Reimplement as wrapper around
2190         linux_wait_for_event_filtered.
2191         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
2192         a normal or signal exit is seen, it's the whole process exiting.
2193         (wait_for_sigstop): No longer a for_each_inferior callback.
2194         Rewrite on top of linux_wait_for_event_filtered.
2195         (stop_all_lwps): Call wait_for_sigstop directly.
2196         * server.c (resume, handle_target_event): Handle
2197         TARGET_WAITKIND_NO_RESUMED.
2198
2199 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
2200
2201         * win32-low.c (psapi_get_dll_name,
2202         * win32_CreateToolhelp32Snapshot): Delete.
2203         (win32_CreateToolhelp32Snapshot, win32_Module32First)
2204         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
2205         Delete.
2206         (handle_load_dll): Add function description.
2207         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
2208
2209 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
2210
2211         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
2212         Add comment.
2213         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
2214         base address when calling win32_add_one_solib.
2215         (handle_load_dll): Delete local variable load_addr.
2216         Remove 0x1000 offset applied to DLL base address when calling
2217         win32_add_one_solib.
2218         (handle_unload_dll): Add comment.
2219
2220 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
2221
2222         * win32-low.c (win32_add_all_dlls): Renames
2223         win32_ensure_ntdll_loaded.  Rewrite function documentation.
2224         Adjust implementation to always load all DLLs.
2225         Add 0x1000 offset to DLL base address when calling
2226         win32_add_one_solib.
2227         (child_initialization_done): New static global.
2228         (do_initial_child_stuff): Set child_initialization_done to
2229         zero during child initialization, and 1 after.  Replace call
2230         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
2231         Add comment.
2232         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
2233         (handle_unload_dll): Add function documentation.
2234         (get_child_debug_event): Ignore load and unload DLL events
2235         during child initialization.
2236
2237 2014-02-20  Doug Evans  <dje@google.com>
2238
2239         Remove global all_lwps.
2240         * inferiors.h (ptid_of): Move here from linux-low.h.
2241         (pid_of, lwpid_of): Ditto.
2242         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
2243         parameter is a struct thread_info * now.
2244         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
2245         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
2246         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
2247         directly.
2248         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
2249         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
2250         * linux-arm-low.c (update_registers_callback): Update, "entry"
2251         parameter is a struct thread_info * now.
2252         Fetch lwpid from current_inferior directly.
2253         (arm_insert_point): Pass &all_threads to find_inferior instead of
2254         &all_lwps.
2255         (arm_remove_point): Ditto.
2256         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
2257         (arm_prepare_to_resume): Fetch pid from thread.
2258         (arm_read_description): Fetch lwpid from current_inferior directly.
2259         * linux-low.c (all_lwps): Delete.
2260         (delete_lwp): Delete call to remove_inferior.
2261         (handle_extended_wait): Fetch lwpid from thread.
2262         (add_lwp): Don't set lwp->entry.id.  Remove call to
2263         add_inferior_to_list.
2264         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
2265         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
2266         (kill_one_lwp_callback): Ditto.
2267         (linux_kill): Don't dereference NULL pointer.
2268         Fetch ptid,lwpid from thread.
2269         (get_detach_signal): Fetch ptid from thread.
2270         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
2271         Simplify call to regcache_invalidate_thread.
2272         (delete_lwp_callback): Update, "entry" parameter is a
2273         struct thread_info * now.  Fetch pid from thread.
2274         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
2275         (status_pending_p_callback): Update, "entry" parameter is a
2276         struct thread_info * now.  Fetch ptid from thread.
2277         (find_lwp_pid): Update, "entry" parameter is a
2278         struct thread_info * now.
2279         (linux_wait_for_lwp): Fetch pid from thread.
2280         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
2281         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
2282         (enqueue_one_deferred_signal): Fetch lwpid from thread.
2283         (dequeue_one_deferred_signal): Ditto.
2284         (cancel_breakpoint): Fetch ptid from current_inferior.
2285         (linux_wait_for_event): Pass &all_threads to find_inferior,
2286         not &all_lwps.  Fetch ptid, lwpid from thread.
2287         (count_events_callback): Update, "entry" parameter is a
2288         struct thread_info * now.
2289         (select_singlestep_lwp_callback): Ditto.
2290         (select_event_lwp_callback): Ditto.
2291         (cancel_breakpoints_callback): Ditto.
2292         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
2293         not &all_lwps.
2294         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
2295         (unsuspend_one_lwp): Update, "entry" parameter is a
2296         struct thread_info * now.
2297         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
2298         not &all_lwps.
2299         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
2300         Fetch lwpid from thread, not lwp.
2301         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
2302         Pass &all_threads to find_inferior, not &all_lwps.
2303         (send_sigstop): Fetch lwpid from thread, not lwp.
2304         (send_sigstop_callback): Update, "entry" parameter is a
2305         struct thread_info * now.
2306         (suspend_and_send_sigstop_callback): Ditto.
2307         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
2308         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
2309         struct thread_info * now.
2310         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
2311         from thread, lwp.
2312         (lwp_running): Update, "entry" parameter is a
2313         struct thread_info * now.
2314         (stop_all_lwps): Fetch ptid from thread.
2315         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
2316         (linux_resume_one_lwp): Fetch lwpid from thread.
2317         (linux_set_resume_request): Update, "entry" parameter is a
2318         struct thread_info * now.  Fetch pid, lwpid from thread.
2319         (resume_status_pending_p): Update, "entry" parameter is a
2320         struct thread_info * now.
2321         (need_step_over_p): Ditto.  Fetch lwpid from thread.
2322         (start_step_over): Fetch lwpid from thread.
2323         (linux_resume_one_thread): Update, "entry" parameter is a
2324         struct thread_info * now.  Fetch lwpid from thread.
2325         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
2326         (proceed_one_lwp): Update, "entry" parameter is a
2327         struct thread_info * now.  Fetch lwpid from thread.
2328         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
2329         struct thread_info * now.
2330         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
2331         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
2332         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
2333         directly.
2334         (regsets_store_inferior_registers): Ditto.
2335         (fetch_register, store_register): Ditto.
2336         (linux_read_memory, linux_write_memory): Ditto.
2337         (linux_request_interrupt): Ditto.
2338         (linux_read_auxv): Ditto.
2339         (linux_xfer_siginfo): Ditto.
2340         (linux_qxfer_spu): Ditto.
2341         (linux_qxfer_libraries_svr4): Ditto.
2342         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
2343         moved to inferiors.h.
2344         (get_lwp): Delete.
2345         (get_thread_lwp): Update.
2346         (struct lwp_info): Delete member "entry".  Simplify comment for
2347         member "thread".
2348         (all_lwps): Delete.
2349         * linux-mips-low.c (mips_read_description): Fetch lwpid from
2350         current_inferior directly.
2351         (update_watch_registers_callback): Update, "entry" parameter is a
2352         struct thread_info * now.  Fetch pid from thread.
2353         (mips_linux_prepare_to_resume): Fetch ptid from thread.
2354         (mips_insert_point): Fetch lwpid from current_inferior.
2355         Pass &all_threads to find_inferior, not &all_lwps.
2356         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
2357         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
2358         directly.
2359         (mips_stopped_data_address): Ditto.
2360         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
2361         directly.
2362         * linux-tile-low.c (tile_arch_setup): Ditto.
2363         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
2364         (update_debug_registers_callback): Update, "entry" parameter is a
2365         struct thread_info * now.  Fetch pid from thread.
2366         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
2367         Pass &all_threads to find_inferior, not &all_lwps.
2368         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
2369         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
2370         Pass &all_threads to find_inferior, not &all_lwps.
2371         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
2372         (i386_dr_low_get_status): Ditto.
2373         (x86_linux_prepare_to_resume): Fetch ptid from thread.
2374         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
2375         (x86_linux_read_description): Ditto.
2376         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
2377
2378 2014-02-20  Doug Evans  <dje@google.com>
2379
2380         * inferiors.c (get_first_inferior): Fix buglet.
2381
2382 2014-02-19  Doug Evans  <dje@google.com>
2383
2384         * gdbthread.h (add_thread): Change result type to struct thread_info *.
2385         * inferiors.c (add_thread): Change result type to struct thread_info *.
2386         All callers updated.
2387         (add_lwp): Call add_thread here instead of in callers.
2388         All callers updated.
2389         * linux-low.h (get_lwp_thread): Rewrite.
2390         (struct lwp_info): New member "thread".
2391
2392 2014-02-19  Doug Evans  <dje@google.com>
2393
2394         * linux-low.c (add_lwp): Change result to struct lwp_info *.
2395         All callers updated.
2396
2397 2014-02-19  Doug Evans  <dje@google.com>
2398
2399         * inferiors.c (add_thread): Fix whitespace.
2400
2401 2014-02-19  Doug Evans  <dje@google.com>
2402
2403         * dll.c (clear_dlls): Replace accessing list implemention details
2404         with API function.
2405         * gdbthread.h (get_first_thread): Declare.
2406         * inferiors.c (for_each_inferior_with_data): New function.
2407         (get_first_thread): New function.
2408         (find_thread_ptid): Simplify.
2409         (get_first_inferior): New function.
2410         (clear_list): Delete.
2411         (one_inferior_p): New function.
2412         (clear_inferior_list): New function.
2413         (clear_inferiors): Update.
2414         * inferiors.h (for_each_inferior_with_data): Declare.
2415         (clear_inferior_list): Declare.
2416         (one_inferior_p): Declare.
2417         (get_first_inferior): Declare.
2418         * linux-low.c (linux_wait_for_event): Replace accessing list
2419         implemention details with API function.
2420         * server.c (target_running): Ditto.
2421         (accumulate_file_name_length): New function.
2422         (emit_dll_description): New function.
2423         (handle_qxfer_libraries): Replace accessing list implemention
2424         details with API function.
2425         (handle_qxfer_threads_worker): New function.
2426         (handle_qxfer_threads_proper): Replace accessing list implemention
2427         details with API function.
2428         (handle_query): Ditto.
2429         (visit_actioned_threads_callback_ftype): New typedef.
2430         (visit_actioned_threads_data): New struct.
2431         (visit_actioned_threads): Rewrite to be find_inferior callback.
2432         (resume): Call find_inferior.
2433         (handle_status): Replace accessing list implemention
2434         details with API function.
2435         (process_serial_event): Replace accessing list implemention details
2436         with API function.
2437         * target.c (set_desired_inferior): Replace accessing list implemention
2438         details with API function.
2439         * tracepoint.c (same_process_p): New function.
2440         (gdb_agent_about_to_close): Replace accessing list implemention
2441         details with API function.
2442         * win32-low.c (child_delete_thread): Replace accessing list
2443         implemention details with API function.
2444         (match_dll_by_basename): New function.
2445         (dll_is_loaded_by_basename): New function.
2446         (win32_ensure_ntdll_loaded): Replace accessing list implemention
2447         details call to dll_is_loaded_by_basename.
2448
2449 2014-02-19  Doug Evans  <dje@google.com>
2450
2451         * dll.h (struct dll_info): Add comment.
2452         * gdbthread.h (struct thread_info): Add comment.
2453         (current_ptid): Simplify.
2454         * inferiors.c (add_process): Update.
2455         (remove_process): Update.
2456         * inferiors.h (struct process_info): Rename member "head" to "entry".
2457         * linux-low.c (delete_lwp): Update.
2458         (add_lwp): Update.
2459         (last_thread_of_process_p): Update.
2460         (kill_one_lwp_callback, linux_kill): Update.
2461         (status_pending_p_callback): Update.
2462         (wait_for_sigstop): Update.  Simplify read of ptid.
2463         (start_step_over): Update.
2464         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
2465         (get_lwp_thread): Update.
2466         (struct lwp_info): Rename member "head" to "entry".
2467         * regcache.h (inferior_list_entry): Delete.
2468         * server.c (kill_inferior_callback): Update.
2469         (detach_or_kill_inferior_callback): Update.
2470         (print_started_pid): Update.
2471         (print_attached_pid): Update.
2472         (process_serial_event): Simplify read of ptid.
2473         * thread-db.c (thread_db_create_event): Update.
2474         (thread_db_get_tls_address): Update.
2475         * win32-low.c (current_inferior_ptid): Simplify.
2476
2477 2014-02-19  Tom Tromey  <tromey@redhat.com>
2478
2479         * target.h (struct target_ops) <supports_btrace>: Add target_ops
2480         argument.
2481         (target_supports_btrace): Update.
2482
2483 2014-02-14  Yao Qi  <yao@codesourcery.com>
2484
2485         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
2486         (rsp-low-ipa.o): New target.
2487
2488 2014-02-12  Tom Tromey  <tromey@redhat.com>
2489
2490         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
2491         convert_ascii_to_int.
2492         * regcache.c (registers_to_string): Likewise.
2493         * remote-utils.c (decode_M_packet): Likewise.
2494         * server.c (process_serial_event): Likewise.
2495
2496 2014-02-12  Tom Tromey  <tromey@redhat.com>
2497
2498         * server.c (handle_query, handle_v_run): Use hex2bin, not
2499         unhexify.
2500         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
2501
2502 2014-02-12  Tom Tromey  <tromey@redhat.com>
2503
2504         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
2505         convert_int_to_ascii.
2506         * regcache.c (registers_to_string, collect_register_as_string):
2507         Likewise.
2508         * remote-utils.c (look_up_one_symbol, relocate_instruction):
2509         Likewise.
2510         * server.c (process_serial_event): Likewise.
2511         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
2512         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
2513
2514 2014-02-12  Tom Tromey  <tromey@redhat.com>
2515
2516         * remote-utils.c (look_up_one_symbol, monitor_output): Use
2517         bin2hex, not hexify.
2518         * tracepoint.c (cmd_qtstatus): Likewise.
2519
2520 2014-02-12  Tom Tromey  <tromey@redhat.com>
2521
2522         * remote-utils.c (monitor_output): Pass explicit length to
2523         hexify.
2524
2525 2014-02-12  Tom Tromey  <tromey@redhat.com>
2526
2527         * tracepoint.c: Include rsp-low.h.
2528         * server.c: Include rsp-low.h.
2529         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
2530         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
2531         declare.
2532         * remote-utils.c: Include rsp-low.h.
2533         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
2534         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
2535         (convert_int_to_ascii, convert_ascii_to_int): Move to
2536         common/rsp-low.c.
2537         * regcache.c: Include rsp-low.h.
2538         * ax.c: Include rsp-low.h.
2539         * Makefile.in (SFILES): Add common/rsp-low.c.
2540         (OBS): Add rsp-low.o.
2541         (rsp-low.o): New target.
2542
2543 2014-02-12  Tom Tromey  <tromey@redhat.com>
2544
2545         * utils.h (pulongest, plongest, phex_nz): Don't declare.
2546         Include print-utils.h.
2547         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
2548         (plongest, thirty_two, phex_nz): Remove.
2549         * Makefile.in (SFILES): Add common/print-utils.c.
2550         (OBS): Add print-utils.o.
2551         (print-utils-ipa.o): New target.
2552         (print-utils.o): New target.
2553         (IPA_OBJS): Add print-utils-ipa.o.
2554
2555 2014-02-06  Tom Tromey  <tromey@redhat.com>
2556
2557         * Makefile.in (SFILES): Fix indentation.
2558
2559 2014-02-05  Doug Evans  <dje@google.com>
2560
2561         * linux-low.c (linux_wait_for_event): Improve comment.
2562         (linux_wait_1): Keep current_inferior in sync with event_child.
2563
2564 2014-01-22  Doug Evans  <dje@google.com>
2565
2566         * gdbthread.h (gdb_id_to_thread): Delete, unused.
2567
2568 2014-01-22  Doug Evans  <dje@google.com>
2569
2570         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
2571         * configure: Regenerate.
2572         * config.in: Regenerate.
2573         * Makefile.in (SFILES): Add debug.c.
2574         (OBS): Add debug.o.
2575         * debug.c: New file.
2576         * debug.h: New file.
2577         * linux-aarch64-low.c (*): Update all debugging printfs to use
2578         debug_printf instead of fprintf.
2579         * linux-arm-low.c (*): Ditto.
2580         * linux-cris-low.c (*): Ditto.
2581         * linux-crisv32-low.c (*): Ditto.
2582         * linux-m32r-low.c (*): Ditto.
2583         * linux-sparc-low.c (*): Ditto.
2584         * linux-x86.c (*): Ditto.
2585         * linux-low.c (*): Ditto.
2586         (linux_wait_1): Add calls to debug_enter, debug_exit.
2587         (linux_wait): Remove redundant debugging printf.
2588         (stop_all_lwps): Add calls to debug_enter, debug_exit.
2589         (linux_resume, unstop_all_lwps): Ditto.
2590         * mem-break.c (*): Update all debugging printfs to use
2591         debug_printf instead of fprintf.
2592         * remote-utils.c (*): Ditto.
2593         * thread-db.c (*): Ditto.
2594         * server.c #include <ctype.h>, "gdb_vecs.h".
2595         (debug_threads): Moved to debug.c.
2596         (*): Update all debugging printfs to use debug_printf instead of
2597         fprintf.
2598         (start_inferior): Replace call to fflush with call to debug_flush.
2599         (monitor_show_help): Mention set debug-format.
2600         (parse_debug_format_options): New function.
2601         (handle_monitor_command): Handle "monitor set debug-format".
2602         (gdbserver_usage): Mention --debug-format.
2603         (main): Parse --debug-format.
2604         * server.h (debug_threads): Declaration moved to debug.h.
2605         #include "debug.h".
2606         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
2607         trace_debug_1 that uses debug_printf.
2608         (tracepoint_look_up_symbols): Update all debugging printfs to use
2609         debug_printf instead of fprintf.
2610
2611 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
2612
2613         * linux-xtensa-low.c: Include asm/ptrace.h instead of
2614         sys/ptrace.h.
2615
2616 2014-01-17  Pedro Alves  <palves@redhat.com>
2617
2618         PR build/16445
2619         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
2620         defined after including gdb_proc_service.h.
2621
2622 2014-01-16  Doug Evans  <dje@google.com>
2623
2624         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
2625         (match_dll): Use it.
2626
2627 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
2628
2629         * target.h (target_ops) <read_btrace>: Change parameters and
2630         return type to allow error reporting.
2631         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
2632         trace reading errors on.
2633         * linux-low.c (linux_low_read_btrace): Pass trace reading
2634         errors on.
2635         (linux_low_disable_btrace): New.
2636
2637 2014-01-15  Doug Evans  <dje@google.com>
2638
2639         * inferiors.c (thread_id_to_gdb_id): Delete.
2640         * inferiors.h (thread_id_to_gdb_id): Delete.
2641
2642 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
2643
2644         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
2645         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
2646         versions.
2647
2648 2014-01-08  Pedro Alves  <palves@redhat.com>
2649
2650         * server.c (handle_status): Don't discard previous queued stop
2651         replies or thread's pending status here.
2652         (main) <disconnection>: Do it here instead.
2653
2654 2014-01-08  Pedro Alves  <palves@redhat.com>
2655
2656         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
2657         * server.c (visit_actioned_threads, handle_pending_status): New
2658         function.
2659         (handle_v_cont): Factor out parts to ...
2660         (resume): ... this new function.  If in all-stop, and a thread
2661         being resumed has a pending status, report it without actually
2662         resuming.
2663         (myresume): Adjust to use the new 'resume' function.
2664         (clear_pending_status_callback, set_pending_status_callback)
2665         (find_status_pending_thread_callback): New functions.
2666         (handle_status): Handle the case of multiple threads having
2667         interesting statuses to report.  Report threads' real last signal
2668         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
2669         with an interesting thread to report the status for, instead of
2670         always reporting the status of the first thread.
2671
2672 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
2673
2674         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
2675         * gdbreplay.c (gdbreplay_version): Likewise.
2676
2677 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
2678
2679         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
2680         iov.iov_len with the real length in use.
2681
2682 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
2683
2684         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
2685         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
2686         for all targets that use win32-low.c.
2687         * win32-low.c (win32_ensure_ntdll_loaded): New function.
2688         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
2689
2690 2013-12-13  Pedro Alves  <palves@redhat.com>
2691
2692         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
2693         if equal to TARGET_WAITKIND_LOADED.
2694         * win32-low.c (cached_status): New static global.
2695         (win32_wait): Add declaration.
2696         (do_initial_child_stuff): Flush all initial pending debug events
2697         up to the initial breakpoint.
2698         (win32_wait): If CACHED_STATUS was set, return that instead
2699         of doing a real wait.  Remove the code resuming the execution
2700         of the inferior after receiving a TARGET_WAITKIND_LOADED event
2701         during the initial phase.  Also remove the code changing
2702         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
2703         TARGET_WAITKIND_STOPPED.
2704
2705 2013-12-11  Yao Qi  <yao@codesourcery.com>
2706
2707         * notif.c (handle_notif_ack): Return 0 if no notification
2708         matches.
2709
2710 2013-11-20  Doug Evans  <dje@google.com>
2711
2712         * linux-low.c (linux_set_resume_request): Fix comment.
2713
2714 2013-11-20  Doug Evans  <dje@google.com>
2715
2716         * linux-low.c (resume_status_pending_p): Tweak comment.
2717
2718 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
2719
2720         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
2721         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
2722         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
2723         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
2724         (srv_amd64_regobj): Add amd64-mpx.o.
2725         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
2726         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
2727         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
2728         * i387-fp.c (num_pl_bnd_register) Added constant.
2729         (num_pl_bnd_cfg_registers) Added constant.
2730         (struct i387_xsave) Added reserved area and MPX fields.
2731         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
2732         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
2733         function.
2734         (tdesc_i386_mpx_linux): Add MPX amd64 target.
2735         (init_registers_amd64_mpx_linux): Declare new function.
2736         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
2737         (x86_64_regmap): Add MPX registers.
2738         (x86_linux_read_description): Add MPX case.
2739         (initialize_low_arch): Initialize MPX targets.
2740
2741 2013-11-18  Tom Tromey  <tromey@redhat.com>
2742
2743         * configure: Rebuild.
2744         * configure.ac: Don't check for stdlib.h.
2745         * gdbreplay.c: Unconditionally include stdlib.h.
2746
2747 2013-11-18  Tom Tromey  <tromey@redhat.com>
2748
2749         * config.in: Rebuild.
2750         * configure: Rebuild.
2751         * configure.ac: Don't use AC_HEADER_DIRENT.
2752
2753 2013-11-18  Tom Tromey  <tromey@redhat.com>
2754
2755         * server.h: Don't check HAVE_STRING_H.
2756         * gdbreplay.c: Don't check HAVE_STRING_H.
2757         * configure: Rebuild.
2758
2759 2013-11-18  Tom Tromey  <tromey@redhat.com>
2760
2761         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
2762         LIBGNU.
2763
2764 2013-11-08  Tom Tromey  <tromey@redhat.com>
2765
2766         * configure, config.in: Rebuild.
2767         * configure.ac: Remove unused configury.
2768
2769 2013-11-08  Tom Tromey  <tromey@redhat.com>
2770
2771         * acinclude.m4: Include common.m4, codeset.m4.
2772         * configure, config.in: Rebuild.
2773         * configure.ac: Use GDB_AC_COMMON.
2774
2775 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2776
2777         * linux-s390-low.c (HWCAP_S390_TE): New define.
2778         (s390_arch_setup): Consider the TE field in the HWCAP for
2779         determining 'have_regset_tdb'.
2780
2781 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
2782
2783         PR gdb/16014
2784         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
2785         call to sizeof.
2786
2787 2013-10-02  Pedro Alves  <palves@redhat.com>
2788
2789         * server.c (process_serial_event): Don't output "GDBserver
2790         exiting" if GDB is connected through stdio.
2791         * target.c (mywait): Likewise, be silent if GDB is connected
2792         through stdio.
2793
2794 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
2795
2796         * lynx-low.c (lynx_add_threads_after_attach): New function.
2797         (lynx_attach): Remove call to add_thread.  Add call to
2798         lynx_add_threads_after_attach instead.
2799
2800 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
2801
2802         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
2803         * config.in, configure: Regenerated.
2804
2805 2013-09-18  Yao Qi  <yao@codesourcery.com>
2806
2807         PR server/15959
2808         * server.c (start_inferior): Clear 'resume_info'.
2809
2810 2013-09-16  Jiong Wang  <jiwang@tilera.com>
2811
2812         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
2813         for each register.
2814
2815 2013-09-16  Jiong Wang  <jiwang@tilera.com>
2816
2817         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
2818         linux-tile-low.o to srv_tgtobj.
2819
2820 2013-09-16  Will Newton  <will.newton@linaro.org>
2821
2822         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
2823         out regs.
2824
2825 2013-09-06  Pedro Alves  <palves@redhat.com>
2826
2827         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
2828         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
2829         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
2830         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
2831         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
2832         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
2833
2834 2013-09-06  Pedro Alves  <palves@redhat.com>
2835
2836         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
2837         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
2838
2839 2013-09-06  Pedro Alves  <palves@redhat.com>
2840
2841         * linux-amd64-ipa.c: Include tracepoint.h.
2842         * linux-i386-ipa.c: Include tracepoint.h.
2843
2844 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
2845
2846         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
2847         (ps_get_thread_area): New function.
2848
2849 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
2850
2851         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
2852         (initialize_low_arch): Call init_registers_crisv32 rather than
2853         init_register_crisv32.
2854
2855 2013-09-05  Pedro Alves  <palves@redhat.com>
2856
2857         * server.h (handle_vFile, hostio_last_error_from_errno): Move
2858         to ...
2859         * hostio.h: ... this new file.
2860         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
2861         win32-low.c: Include hostio.h.
2862
2863 2013-09-05  Pedro Alves  <palves@redhat.com>
2864
2865         * server.h (gdb_client_data, handler_func, callback_handler_func)
2866         (delete_file_handler, add_file_handler, append_callback_event)
2867         (delete_callback_event, start_event_loop, initialize_event_loop):
2868         Move to event-loop.h and include it.
2869         * event-loop.h: New file.
2870
2871 2013-09-05  Pedro Alves  <palves@redhat.com>
2872
2873         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
2874         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
2875         (loaded_dll, unloaded_dll): Move to ...
2876         * dll.h: ... this new file.
2877         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
2878
2879 2013-09-05  Pedro Alves  <palves@redhat.com>
2880
2881         * server.h (current_process, get_thread_process, all_processes)
2882         (add_inferior_to_list, for_each_inferior, current_inferior)
2883         (remove_inferior, add_process, remove_process, find_process_pid)
2884         (have_started_inferiors_p, have_attached_inferiors_p)
2885         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
2886         (clear_inferiors, find_inferior, find_inferior_id)
2887         (inferior_target_data, set_inferior_target_data)
2888         (inferior_regcache_data, set_inferior_regcache_data): Move to
2889         inferiors.h, and include it.
2890         * inferiors.h: New file.
2891
2892 2013-09-05  Pedro Alves  <palves@redhat.com>
2893
2894         * server.h (struct emit_ops, current_insn_ptr, emit_error):
2895         Move ...
2896         * ax.h: ... here.
2897
2898 2013-09-05  Pedro Alves  <palves@redhat.com>
2899
2900         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
2901         tracepoint.h.
2902         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
2903         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
2904         (handle_tracepoint_general_set, handle_tracepoint_query)
2905         (tracepoint_finished_step, tracepoint_was_hit)
2906         (release_while_stepping_state_list, current_traceframe)
2907         (in_readonly_region, traceframe_read_mem)
2908         (fetch_traceframe_registers, traceframe_read_sdata)
2909         (traceframe_read_info, struct fast_tpoint_collect_status)
2910         (fast_tracepoint_collecting, force_unlock_trace_buffer)
2911         (handle_tracepoit_bkpts, initialize_low_tracepoint)
2912         (supply_fast_tracepoint_registers)
2913         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
2914         (ipa_tdesc, claim_trampoline_space)
2915         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
2916         (agent_mem_read, agent_get_trace_state_variable_value)
2917         (agent_set_trace_state_variable_value, agent_tsv_read)
2918         (agent_mem_read_string, get_raw_reg_func_addr)
2919         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
2920         * tracepoint.h: ... this new file.
2921
2922 2013-09-05  Pedro Alves  <palves@redhat.com>
2923
2924         * server.h (perror_with_name, error, fatal, warning, paddress)
2925         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
2926         include it.
2927         * utils.h: New file.
2928
2929 2013-09-05  Pedro Alves  <palves@redhat.com>
2930
2931         * server.h (remote_debug, noack_mode, transport_is_reliable)
2932         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
2933         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
2934         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
2935         (write_enn, initialize_async_io, enable_async_io)
2936         (disable_async_io, check_remote_input_interrupt_request)
2937         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
2938         (dead_thread_notify, prepare_resume_reply)
2939         (decode_address_to_semicolon, decode_address, decode_m_packet)
2940         (decode_M_packet, decode_X_packet, decode_xfer_write)
2941         (decode_search_memory_packet, unhexify, hexify)
2942         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
2943         (look_up_one_symbol, relocate_instruction)
2944         (monitor_output): Move to remote-utils.h, and include it.
2945         * remote-utils.h: New file.
2946
2947 2013-09-05  Pedro Alves  <palves@redhat.com>
2948
2949         * server.h (_): Delete.
2950
2951 2013-09-02  Pedro Alves  <palves@redhat.com>
2952
2953         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
2954         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
2955         allocated.
2956         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
2957
2958 2013-09-02  Pierre Muller  <muller@sourceware.org>
2959
2960         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
2961         or WriteProcessMemory complete successfully and handle
2962         ERROR_PARTIAL_COPY error.
2963
2964 2013-09-02  Pedro Alves  <palves@redhat.com>
2965
2966         * server.c (gdb_read_memory): Return -1 on traceframe memory read
2967         error instead of EIO.
2968
2969 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
2970
2971         PR server/15604
2972         * linux-low.c: Include filestuff.h.
2973         (linux_create_inferior) <pid == 0>: Call close_most_fds.
2974         * lynx-low.c: Include filestuff.h.
2975         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
2976         * server.c: Include filestuff.h.
2977         (main): Call notice_open_fds.
2978         * spu-low.c: Include filestuff.h.
2979         (spu_create_inferior) <pid == 0>: Call close_most_fds.
2980
2981 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
2982
2983         * Makefile.in: Explain why ../target and ../nat are not
2984         listed as include file search paths.
2985         (linux-waitpid.o): New object file rule.
2986         * configure.srv (srv_native_linux_obj): New variable.
2987         Replace all occurrences of linux native object files with
2988         $srv_native_linux_obj.
2989         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
2990         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
2991         (linux_enable_event_reporting): Remove declaration.
2992         (my_waitpid): Moved to common/linux-waitpid.c.
2993         (linux_wait_for_event): Pass ptid when calling
2994         linux_enable_event_reporting.
2995         (linux_supports_tracefork_flag): Remove.
2996         (linux_enable_event_reporting): Likewise.
2997         (linux_tracefork_grandchild): Remove.
2998         (STACK_SIZE): Moved to common/linux-ptrace.c.
2999         (linux_tracefork_child): Remove.
3000         (linux_test_for_tracefork): Remove.
3001         (linux_look_up_symbols): Call linux_supports_traceclone.
3002         (initialize_low): Remove call to linux_test_for_tracefork.
3003         * linux-low.h (PTRACE_TYPE_ARG3): Move to
3004         common/linux-ptrace.h.
3005         (PTRACE_TYPE_ARG4): Likewise.
3006         Include linux-ptrace.h.
3007
3008 2013-08-21  Pedro Alves  <palves@redhat.com>
3009
3010         * config.in: Renegerate.
3011
3012 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
3013
3014         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
3015         (SFILES): Remove $(srcdir)/common/target-common.c and
3016         add $(srcdir)/target/waitstatus.c.
3017         (OBS): Remove target-common.o and add waitstatus.o.
3018         (server_h): Remove $(srcdir)/../common/target-common.h and
3019         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
3020         and $(srcdir)/../target/waitstatus.h.
3021         (target-common.o): Remove.
3022         (waitstatus.o): New target object file.
3023         * target.h: Do not include target-common.h and
3024         include target/resume.h, target/wait.h and
3025         target/waitstatus.h.
3026
3027 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
3028
3029         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
3030         to PTRACE_TYPE_ARG3.
3031         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
3032         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
3033         PTRACE_TYPE_ARG4.
3034         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
3035         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
3036
3037 2013-07-27  Jie Zhang  <jie@codesourcery.com>
3038             Daniel Jacobowitz  <dan@codesourcery.com>
3039             Yao Qi  <yao@codesourcery.com>
3040
3041         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
3042         (mips-linux-watch.o): New rule.
3043         (mips_linux_watch_h): New variable.
3044         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
3045         srv_tgtobj.
3046         * linux-mips-low.c: Include mips-linux-watch.h.
3047         (struct arch_process_info, struct arch_lwp_info): New.
3048         (update_watch_registers_callback): New function.
3049         (mips_linux_new_process, mips_linux_new_thread) New functions.
3050         (mips_linux_prepare_to_resume, mips_insert_point): New
3051         functions.
3052         (mips_remove_point, mips_stopped_by_watchpoint): New
3053         functions.
3054         (rsp_bp_type_to_target_hw_bp_type): New function.
3055         (mips_stopped_data_address): New function.
3056         (the_low_target): Add watchpoint support functions.
3057
3058 2013-07-27  Yao Qi  <yao@codesourcery.com>
3059
3060         * i386-low.c: Include break-common.h.
3061         (enum target_hw_bp_type): Remove.
3062
3063 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
3064
3065         * Makefile.in (SFILES): /common/target-common.c.
3066         (OBS): Add target-common.o.
3067         (server_h): Add $(srcdir)/../common/target-common.h.
3068         (target-common.o): New target.
3069         * server.c (queue_stop_reply_callback): Free
3070         status string after use.
3071         * target.c (target_waitstatus_to_string): Remove.
3072         * target.h: Include target-common.h.
3073         (resume_kind): Likewise.
3074         (target_waitkind): Likewise.
3075         (target_waitstatus): Likewise.
3076         (TARGET_WNOHANG): Likewise.
3077
3078 2013-07-04  Yao Qi  <yao@codesourcery.com>
3079
3080         * Makefile.in (host_alias): Use @host_noncanonical@.
3081         (target_alias): Use @target_noncanonical@.
3082         * configure.ac: Use ACX_NONCANONICAL_TARGET and
3083         ACX_NONCANONICAL_HOST.
3084         * configure: Regenerated.
3085
3086         Revert:
3087         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
3088
3089         * configure.ac (version_host, version_target): Set and AC_SUBST them.
3090         * configure: Rebuild.
3091         * Makefile.in (version_host, version_target): Get from configure.
3092         (version.c): Use $(version_host) and $(version_target).
3093
3094 2013-07-03  Pedro Alves  <palves@redhat.com>
3095
3096         * Makefile.in (config.status): Depend on development.sh.
3097         * acinclude.m4: Include libmcheck.m4.
3098         * configure: Regenerate.
3099
3100 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
3101
3102         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
3103         attribute inside the parentheses.
3104         (winapi_DebugSetProcessKillOnExit): Ditto.
3105         (winapi_DebugBreakProcess): Ditto.
3106         (winapi_GenerateConsoleCtrlEvent): Ditto.
3107
3108 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
3109
3110         * notif.h (notif_event): Add a dummy member to avoid compiler
3111         errors.
3112
3113 2013-07-01  Pedro Alves  <palves@redhat.com>
3114
3115         * hostio.c (HOSTIO_PATH_MAX): Define.
3116         (require_filename, handle_open, handle_unlink, handle_readlink):
3117         Use it.
3118
3119 2013-07-01  Pedro Alves  <palves@redhat.com>
3120
3121         * server.h: Include "pathmax.h".
3122         * linux-low.c: Don't include sys/param.h.
3123         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
3124         MAXPATHLEN.
3125         * win32-low.c: Don't include sys/param.h.
3126         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
3127
3128 2013-07-01  Pedro Alves  <palves@redhat.com>
3129
3130         * event-loop.c: Don't check HAVE_UNISTD_H before including
3131         <unistd.h>.
3132         * gdbreplay.c: Likewise.
3133         * remote-utils.c: Likewise.
3134         * server.c: Likewise.
3135         * configure.ac: Don't check for unistd.h.
3136         * configure: Regenerate.
3137
3138 2013-06-28  Tom Tromey  <tromey@redhat.com>
3139
3140         * Makefile.in (version.c): Use version.in, not
3141         common/version.in.
3142
3143 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
3144
3145         * configure.ac (version_host, version_target): Set and AC_SUBST them.
3146         * configure: Rebuild.
3147         * Makefile.in (version_host, version_target): Get from configure.
3148         (version.c): Use $(version_host) and $(version_target).
3149
3150 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
3151
3152         Fix trace-status to output user name without trailing colon.
3153         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
3154
3155 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
3156
3157         Fix trace-status to output proper start-time and stop-time.
3158         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
3159         output start time and stop time in hex as gdb expects.
3160
3161 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
3162
3163         * tracepoint.c (build_traceframe_info_xml): Output trace state
3164         variables present in the trace buffer.
3165
3166 2013-06-24  Tom Tromey  <tromey@redhat.com>
3167
3168         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
3169         create-version.sh.
3170         (version.o): Remove.
3171         * gdbreplay.c: Include version.h.
3172         (version, host_name): Don't declare.
3173         * server.h: Include version.h.
3174         (version, host_name): Don't declare.
3175
3176 2013-06-12  Pedro Alves  <palves@redhat.com>
3177
3178         * linux-x86-low.c (linux_is_elf64): Delete global.
3179         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
3180         with local linux_pid_exe_is_elf_64_file use.
3181
3182 2013-06-11  Pedro Alves  <palves@redhat.com>
3183
3184         * linux-low.c (regset_disabled, disable_regset): New functions.
3185         (regsets_fetch_inferior_registers)
3186         (regsets_store_inferior_registers): Use them.
3187         (initialize_regsets_info); Don't allocate the disabled_regsets
3188         array here.
3189         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
3190         comment.
3191
3192 2013-06-11  Pedro Alves  <palves@redhat.com>
3193
3194         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
3195         xmalloc.
3196
3197 2013-06-11  Pedro Alves  <palves@redhat.com>
3198
3199         * linux-x86-low.c (initialize_low_arch): Call
3200         init_registers_x32_avx_linux.
3201
3202 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
3203
3204         Fix compatibility with Android Bionic.
3205         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
3206         it is not empty.
3207
3208 2013-06-07  Pedro Alves  <palves@redhat.com>
3209
3210         PR server/14823
3211         * Makefile.in (OBS): Add tdesc.o.
3212         (IPA_OBJS): Add tdesc-ipa.o.
3213         (tdesc-ipa.o): New rule.
3214         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
3215         interface.
3216         * linux-low.c (new_inferior): Delete.
3217         (disabled_regsets, num_regsets): Delete.
3218         (linux_add_process): Adjust to set the new per-process
3219         new_inferior flag.
3220         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
3221         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
3222         was a stop.  When calling arch_setup, switch the current inferior
3223         to the thread that got an event.
3224         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
3225         (regsets_fetch_inferior_registers)
3226         (regsets_store_inferior_registers): New regsets_info parameter.
3227         Adjust to use it.
3228         (linux_register_in_regsets): New regs_info parameter.  Adjust to
3229         use it.
3230         (register_addr, fetch_register, store_register): New usrregs_info
3231         parameter.  Adjust to use it.
3232         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
3233         parameter regs_info.  Adjust to use it.
3234         (linux_fetch_registers): Get the current inferior's regs_info, and
3235         adjust to use it.
3236         (linux_store_registers): Ditto.
3237         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
3238         (initialize_low): Don't initialize the target_regsets here.  Call
3239         initialize_low_arch.
3240         * linux-low.h (target_regsets): Delete declaration.
3241         (struct regsets_info): New.
3242         (struct usrregs_info): New.
3243         (struct regs_info): New.
3244         (struct process_info_private) <new_inferior>: New field.
3245         (struct linux_target_ops): Delete the num_regs, regmap, and
3246         regset_bitmap fields.  New field regs_info.
3247         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
3248         * i387-fp.c (num_xmm_registers): Delete.
3249         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
3250         calls to new interface.
3251         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
3252         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
3253         Infer the number of xmm registers from the regcache's target
3254         description.
3255         * i387-fp.h (num_xmm_registers): Delete.
3256         * inferiors.c (add_thread): Don't install the thread's regcache
3257         here.
3258         * proc-service.c (gregset_info): Fetch the current inferior's
3259         regs_info.  Adjust to use it.
3260         * regcache.c: Include tdesc.h.
3261         (register_bytes, reg_defs, num_registers)
3262         (gdbserver_expedite_regs): Delete.
3263         (get_thread_regcache): If the thread doesn't have a regcache yet,
3264         create one, instead of aborting gdbserver.
3265         (regcache_invalidate_one): Rename to ...
3266         (regcache_invalidate_thread): ... this.
3267         (regcache_invalidate_one): New.
3268         (regcache_invalidate): Only invalidate registers of the current
3269         process.
3270         (init_register_cache): Add target_desc parameter, and use it.
3271         (new_register_cache): Ditto.  Assert the target description has a
3272         non zero registers_size.
3273         (regcache_cpy): Add assertions.  Adjust.
3274         (realloc_register_cache, set_register_cache): Delete.
3275         (registers_to_string, registers_from_string): Adjust.
3276         (find_register_by_name, find_regno, find_register_by_number)
3277         (register_cache_size): Add target_desc parameter, and use it.
3278         (free_register_cache_thread, free_register_cache_thread_one)
3279         (regcache_release, register_cache_size): New.
3280         (register_size): Add target_desc parameter, and use it.
3281         (register_data, supply_register, supply_register_zeroed)
3282         (supply_regblock, supply_register_by_name, collect_register)
3283         (collect_register_as_string, collect_register_by_name): Adjust.
3284         * regcache.h (struct target_desc): Forward declare.
3285         (struct regcache) <tdesc>: New field.
3286         (init_register_cache, new_register_cache): Add target_desc
3287         parameter.
3288         (regcache_invalidate_thread): Declare.
3289         (regcache_invalidate_one): Delete declaration.
3290         (regcache_release): Declare.
3291         (find_register_by_number, register_cache_size, register_size)
3292         (find_regno): Add target_desc parameter.
3293         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
3294         declarations.
3295         * remote-utils.c: Include tdesc.h.
3296         (outreg, prepare_resume_reply): Adjust.
3297         * server.c: Include tdesc.h.
3298         (gdbserver_xmltarget): Delete declaration.
3299         (get_features_xml, process_serial_event): Adjust.
3300         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
3301         declare.
3302         (struct process_info) <tdesc>: New field.
3303         (ipa_tdesc): Declare.
3304         * tdesc.c: New file.
3305         * tdesc.h: New file.
3306         * tracepoint.c: Include tdesc.h.
3307         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
3308         (get_context_regcache): Adjust to pass ipa_tdesc down.
3309         (do_action_at_tracepoint): Adjust to get the register cache size
3310         from the context regcache's description.
3311         (traceframe_walk_blocks): Adjust to get the register cache size
3312         from the current trace frame's description.
3313         (traceframe_get_pc): Adjust to get current trace frame's
3314         description and pass it down.
3315         (gdb_collect): Adjust to get the register cache size from the
3316         IPA's description.
3317         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
3318         (gdbserver_xmltarget): Delete.
3319         (initialize_low_tracepoint): Set the ipa's target description.
3320         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
3321         (initialize_low_tracepoint): Set the ipa's target description.
3322         * linux-x86-low.c: Include tdesc.h.
3323         [__x86_64__] (is_64bit_tdesc): New.
3324         (ps_get_thread_area, x86_get_thread_area): Use it.
3325         (i386_cannot_store_register): Rename to ...
3326         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
3327         (i386_cannot_fetch_register): Rename to ...
3328         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
3329         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
3330         to new interface.
3331         (target_regsets): Rename to ...
3332         (x86_regsets): ... this.
3333         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
3334         interface.
3335         (x86_siginfo_fixup): Use is_64bit_tdesc.
3336         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
3337         (tdesc_x32_avx_linux, tdesc_x32_linux)
3338         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
3339         Declare.
3340         (x86_linux_update_xmltarget): Delete.
3341         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
3342         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
3343         (AMD64_LINUX_USER64_CS): New.
3344         (x86_linux_read_description): New, based on
3345         x86_linux_update_xmltarget.
3346         (same_process_callback): New.
3347         (x86_arch_setup_process_callback): New.
3348         (x86_linux_update_xmltarget): New.
3349         (x86_regsets_info): New.
3350         (amd64_linux_regs_info): New.
3351         (i386_linux_usrregs_info): New.
3352         (i386_linux_regs_info): New.
3353         (x86_linux_regs_info): New.
3354         (x86_arch_setup): Reimplement.
3355         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
3356         (x86_emit_ops): Ditto.
3357         (the_low_target): Adjust.  Install x86_linux_regs_info,
3358         x86_cannot_fetch_register, and x86_cannot_store_register.
3359         (initialize_low_arch): New.
3360         * linux-ia64-low.c (tdesc_ia64): Declare.
3361         (ia64_fetch_register): Adjust.
3362         (ia64_usrregs_info, regs_info): New globals.
3363         (ia64_regs_info): New function.
3364         (the_low_target): Adjust.
3365         (initialize_low_arch): New function.
3366         * linux-sparc-low.c (tdesc_sparc64): Declare.
3367         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
3368         Adjust.
3369         (sparc_arch_setup): New function.
3370         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
3371         (the_low_target): Adjust.
3372         (initialize_low_arch): New function.
3373         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
3374         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
3375         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
3376         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
3377         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
3378         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
3379         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
3380         (tdesc_powerpc_isa205_vsx64l): Declare.
3381         (ppc_cannot_store_register, ppc_collect_ptrace_register)
3382         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
3383         (ppc_set_pc, ppc_get_hwcap): Adjust.
3384         (ppc_usrregs_info): Forward declare.
3385         (!__powerpc64__) ppc_regmap_adjusted: New global.
3386         (ppc_arch_setup): Adjust to the current process'es target
3387         description.
3388         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
3389         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
3390         (ppc_store_evrregset): Adjust.
3391         (target_regsets): Rename to ...
3392         (ppc_regsets): ... this, and make static.
3393         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
3394         (ppc_regs_info): New function.
3395         (the_low_target): Adjust.
3396         (initialize_low_arch): New function.
3397         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
3398         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
3399         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
3400         (tdesc_s390x_linux64v2): Declare.
3401         (s390_collect_ptrace_register, s390_supply_ptrace_register)
3402         (s390_fill_gregset, s390_store_last_break): Adjust.
3403         (target_regsets): Rename to ...
3404         (s390_regsets): ... this, and make static.
3405         (s390_get_pc, s390_set_pc): Adjust.
3406         (s390_get_hwcap): New target_desc parameter, and use it.
3407         [__s390x__] (have_hwcap_s390_high_gprs): New global.
3408         (s390_arch_setup): Adjust to set the current process'es target
3409         description.  Don't adjust the regmap.
3410         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
3411         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
3412         (regs_info_3264): New globals.
3413         (s390_regs_info): New function.
3414         (the_low_target): Adjust.
3415         (initialize_low_arch): New function.
3416         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
3417         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
3418         [__mips64] (init_registers_mips_linux)
3419         (init_registers_mips_dsp_linux): Delete defines.
3420         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
3421         (have_dsp): New global.
3422         (mips_read_description): New, based on mips_arch_setup.
3423         (mips_arch_setup): Reimplement.
3424         (get_usrregs_info): New function.
3425         (mips_cannot_fetch_register, mips_cannot_store_register)
3426         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
3427         (mips_fill_fpregset, mips_store_fpregset): Adjust.
3428         (target_regsets): Rename to ...
3429         (mips_regsets): ... this, and make static.
3430         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
3431         (dsp_regs_info, regs_info): New globals.
3432         (mips_regs_info): New function.
3433         (the_low_target): Adjust.
3434         (initialize_low_arch): New function.
3435         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
3436         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
3437         Declare.
3438         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
3439         (arm_read_description): New, with bits factored from
3440         arm_arch_setup.
3441         (arm_arch_setup): Reimplement.
3442         (target_regsets): Rename to ...
3443         (arm_regsets): ... this, and make static.
3444         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
3445         (arm_regs_info): New function.
3446         (the_low_target): Adjust.
3447         (initialize_low_arch): New function.
3448         * linux-m68k-low.c (tdesc_m68k): Declare.
3449         (target_regsets): Rename to ...
3450         (m68k_regsets): ... this, and make static.
3451         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
3452         (m68k_regs_info): New function.
3453         (m68k_arch_setup): New function.
3454         (the_low_target): Adjust.
3455         (initialize_low_arch): New function.
3456         * linux-sh-low.c (tdesc_sharch): Declare.
3457         (target_regsets): Rename to ...
3458         (sh_regsets): ... this, and make static.
3459         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
3460         (sh_regs_info, sh_arch_setup): New functions.
3461         (the_low_target): Adjust.
3462         (initialize_low_arch): New function.
3463         * linux-bfin-low.c (tdesc_bfin): Declare.
3464         (bfin_arch_setup): New function.
3465         (bfin_usrregs_info, regs_info): New globals.
3466         (bfin_regs_info): New function.
3467         (the_low_target): Adjust.
3468         (initialize_low_arch): New function.
3469         * linux-cris-low.c (tdesc_cris): Declare.
3470         (cris_arch_setup): New function.
3471         (cris_usrregs_info, regs_info): New globals.
3472         (cris_regs_info): New function.
3473         (the_low_target): Adjust.
3474         (initialize_low_arch): New function.
3475         * linux-cris-low.c (tdesc_crisv32): Declare.
3476         (cris_arch_setup): New function.
3477         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
3478         (cris_regs_info): New function.
3479         (the_low_target): Adjust.
3480         (initialize_low_arch): New function.
3481         * linux-m32r-low.c (tdesc_m32r): Declare.
3482         (m32r_arch_setup): New function.
3483         (m32r_usrregs_info, regs_info): New globals.
3484         (m32r_regs_info): Adjust.
3485         (initialize_low_arch): New function.
3486         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
3487         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
3488         (tic6x_usrregs_info): Forward declare.
3489         (tic6x_read_description): New function, based on ...
3490         (tic6x_arch_setup): ... this.  Reimplement.
3491         (target_regsets): Rename to ...
3492         (tic6x_regsets): ... this, and make static.
3493         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
3494         (tic6x_regs_info): New function.
3495         (the_low_target): Adjust.
3496         (initialize_low_arch): New function.
3497         * linux-xtensa-low.c (tdesc_xtensa): Declare.
3498         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
3499         (target_regsets): Rename to ...
3500         (xtensa_regsets): ... this, and make static.
3501         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
3502         globals.
3503         (xtensa_arch_setup, xtensa_regs_info): New functions.
3504         (the_low_target): Adjust.
3505         (initialize_low_arch): New function.
3506         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
3507         (nios2_arch_setup): Set the current process'es tdesc.
3508         (target_regsets): Rename to ...
3509         (nios2_regsets): ... this.
3510         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
3511         (nios2_regs_info): New function.
3512         (the_low_target): Adjust.
3513         (initialize_low_arch): New function.
3514         * linux-aarch64-low.c (tdesc_aarch64): Declare.
3515         (aarch64_arch_setup): Set the current process'es tdesc.
3516         (target_regsets): Rename to ...
3517         (aarch64_regsets): ... this.
3518         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
3519         (aarch64_regs_info): New function.
3520         (the_low_target): Adjust.
3521         (initialize_low_arch): New function.
3522         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
3523         globals.
3524         (target_regsets): Rename to ...
3525         (tile_regsets): ... this.
3526         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
3527         (tile_regs_info): New function.
3528         (tile_arch_setup): Set the current process'es tdesc.
3529         (the_low_target): Adjust.
3530         (initialize_low_arch): New function.
3531         * spu-low.c (tdesc_spu): Declare.
3532         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
3533         * win32-arm-low.c (tdesc_arm): Declare.
3534         (arm_arch_setup): New function.
3535         (the_low_target): Install arm_arch_setup instead of
3536         init_registers_arm.
3537         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
3538         (init_windows_x86): Rename to ...
3539         (i386_arch_setup): ... this.  Set `win32_tdesc'.
3540         (the_low_target): Adjust.
3541         * win32-low.c (win32_tdesc): New global.
3542         (child_add_thread): Don't create the thread cache here.
3543         (do_initial_child_stuff): Set the new process'es tdesc.
3544         * win32-low.h (struct target_desc): Forward declare.
3545         (win32_tdesc): Declare.
3546         * lynx-i386-low.c (tdesc_i386): Declare global.
3547         (lynx_i386_arch_setup): Set `lynx_tdesc'.
3548         * lynx-low.c (lynx_tdesc): New global.
3549         (lynx_add_process): Set the new process'es tdesc.
3550         * lynx-low.h (struct target_desc): Forward declare.
3551         (lynx_tdesc): Declare global.
3552         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
3553         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
3554         * nto-low.c (nto_tdesc): New global.
3555         (do_attach): Set the new process'es tdesc.
3556         * nto-low.h (struct target_desc): Forward declare.
3557         (nto_tdesc): Declare.
3558         * nto-x86-low.c (tdesc_i386): Declare.
3559         (nto_x86_arch_setup): Set `nto_tdesc'.
3560
3561 2013-06-04  Gary Benson  <gbenson@redhat.com>
3562
3563         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
3564         to qSupported response when appropriate.
3565         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
3566         with nonzero-length annex.
3567         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
3568         arguments supplied in annex.
3569
3570 2013-05-31  Doug Evans  <dje@google.com>
3571
3572         PR server/15594
3573         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
3574         64 bits in 64-cross-32 environment.
3575
3576 2013-05-28  Pedro Alves  <palves@redhat.com>
3577
3578         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
3579         (aarch64-without-fpu.c): Delete rule.
3580         * configure.srv (aarch64*-*-linux*): Remove references to
3581         aarch64-without-fpu.o and aarch64-without-fpu.xml.
3582         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
3583         declaration.
3584
3585 2013-05-24  Pedro Alves  <palves@redhat.com>
3586
3587         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
3588         instead of strchr/decode_address.  Error if the range isn't split
3589         with a ','.  Don't assume there's be a ':' in the action.
3590
3591 2013-05-23  Yao Qi  <yao@codesourcery.com>
3592             Pedro Alves  <palves@redhat.com>
3593
3594         * linux-low.c (lwp_in_step_range): New function.
3595         (linux_wait_1): If the thread was range stepping and stopped
3596         outside the stepping range, report the stop to GDB.  Otherwise,
3597         continue stepping.  Add range stepping debug output.
3598         (linux_set_resume_request): Copy the step range from the resume
3599         request to the lwp.
3600         (linux_supports_range_stepping): New.
3601         (linux_target_ops) <supports_range_stepping>: Set to
3602         linux_supports_range_stepping.
3603         * linux-low.h (struct linux_target_ops)
3604         <supports_range_stepping>: New field.
3605         (struct lwp_info) <step_range_start, step_range_end>: New fields.
3606         * linux-x86-low.c (x86_supports_range_stepping): New.
3607         (the_low_target) <supports_range_stepping>: Set to
3608         x86_supports_range_stepping.
3609         * server.c (handle_v_cont): Handle 'r' action.
3610         (handle_v_requests): Append ";r" if the target supports range
3611         stepping.
3612         * target.h (struct thread_resume) <step_range_start,
3613         step_range_end>: New fields.
3614         (struct target_ops) <supports_range_stepping>:
3615         New field.
3616         (target_supports_range_stepping): New macro.
3617
3618 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
3619
3620         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
3621         confusion in comment.
3622
3623 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
3624
3625         * lynx-low.c (struct process_info_private): New type.
3626         (lynx_add_process): New function.
3627         (lynx_create_inferior, lynx_attach): Replace calls to
3628         add_process by calls to lynx_add_process.
3629         (lynx_resume): If PTID is null, then try using
3630         current_process()->private->last_wait_event_ptid.
3631         Add comments.
3632         (lynx_clear_inferiors): Delete.  The contents of that function
3633         has been inlined in lynx_mourn;
3634         (lynx_wait_1): Save the ptid in the process's private data.
3635         (lynx_mourn): Free the process' private data.  Replace call
3636         to lynx_clear_inferiors by call to clear_inferiors.
3637
3638 2013-05-17  Yao Qi  <yao@codesourcery.com>
3639
3640         * i386-low.c (i386_length_and_rw_bits): Move the comment to
3641         the right place.
3642
3643 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
3644
3645         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
3646         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
3647         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
3648         PT_TEXT_END_ADDR guards.  Update comments.
3649         (linux_target_op) <read_offsets>: Conditionally define to
3650         linux_read_offsets if the target is UCLIBC and if it defines
3651         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
3652
3653 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
3654             Andrew Jenner  <andrew@codesourcery.com>
3655
3656         * Makefile.in (SFILES): Add linux-nios2-low.c.
3657         (clean): Add action to delete nios2-linux.c.
3658         (nios2-linux.c): New rule.
3659         * configure.srv: Add nios2*-*-linux*.
3660         * linux-nios2-low.c: New.
3661
3662 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
3663
3664         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
3665
3666 2013-04-25  Hui Zhu  <hui@codesourcery.com>
3667
3668         PR gdb/15186
3669         * ax.c (ax_printf): Add fflush.
3670
3671 2013-04-22  Tom Tromey  <tromey@redhat.com>
3672
3673         * Makefile.in (SFILES): Add filestuff.c.
3674         (OBS): Add filestuff.o.
3675         (filestuff.o): New target.
3676         * config.in, configure: Rebuild.
3677         * configure.ac: Check for fdwalk, pipe2.
3678
3679 2013-04-17  Pedro Alves  <palves@redhat.com>
3680
3681         * configure.ac (USE_THREAD_DB): Delete variable.
3682         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
3683         Don't AC_SUBST USE_THREAD_DB.
3684         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
3685         * config.in, configure: Regenerate.
3686
3687 2013-04-16  Pedro Alves  <palves@redhat.com>
3688
3689         * linux-low.h (struct lwp_info) <thread_known>: Move under
3690         the USE_THREAD_DB #ifdef.
3691
3692 2013-04-16  Pedro Alves  <palves@redhat.com>
3693
3694         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
3695         (linux-low.o): Delete rule.
3696         * linux-low.h: Always include "gdb_thread_db.h" instead of
3697         conditionally including thread_db.h.
3698         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
3699         HAVE_THREAD_DB_H.
3700
3701 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
3702
3703         * Makefile.in (install-only): Fix make install regression.
3704
3705 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
3706
3707         Convert man pages to texinfo, new gdbinit.5 texinfo page.
3708         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
3709         installation.
3710         * gdbserver.1: Remove.
3711
3712 2013-03-22  Pedro Alves  <palves@redhat.com>
3713
3714         * linux-low.c (handle_extended_wait): Don't call
3715         linux_enable_event_reporting.
3716
3717 2013-03-15  Tony Theodore  <tonyt@logyst.com>
3718
3719         PR build/9098:
3720         * Makefile.in (SHELL): Use @SHELL@.
3721
3722 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
3723
3724         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
3725         compiler warning.
3726
3727 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
3728
3729         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
3730         Remove extraneous NULL element.
3731
3732 2013-03-13  Yao Qi  <yao@codesourcery.com>
3733
3734         * tracepoint.c (traceframe_read_tsv): Look for the last matched
3735         'V' block in trace frame.
3736
3737 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
3738
3739         * target.h (struct target_ops): Add btrace ops.
3740         (target_supports_btrace): New macro.
3741         (target_enable_btrace): New macro.
3742         (target_disable_btrace): New macro.
3743         (target_read_btrace): New macro.
3744         * gdbthread.h (struct thread_info): Add btrace field.
3745         * server.c: Include btrace-common.h.
3746         (handle_btrace_general_set): New function.
3747         (handle_btrace_enable): New function.
3748         (handle_btrace_disable): New function.
3749         (handle_general_set): Call handle_btrace_general_set.
3750         (handle_qxfer_btrace): New function.
3751         (struct qxfer qxfer_packets[]): Add btrace entry.
3752         * inferiors.c (remove_thread): Disable btrace.
3753         * linux-low: Include linux-btrace.h.
3754         (linux_low_enable_btrace): New function.
3755         (linux_low_read_btrace): New function.
3756         (linux_target_ops): Add btrace ops.
3757         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
3758         Add srv_linux_btrace=yes.
3759         (x86_64-*-linux*): Add linux-btrace.o.
3760         Add srv_linux_btrace=yes.
3761         * configure.ac: Define HAVE_LINUX_BTRACE.
3762         * config.in: Regenerated.
3763         * configure: Regenerated.
3764
3765 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
3766
3767         * server.c (handle_qxfer): Preserve error message if -3 is
3768         returned.
3769         (qxfer): Document the -3 return value.
3770
3771 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
3772
3773         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
3774         (linux_btrace_h): New variable.
3775         (linux-btrace.o): New rule.
3776
3777 2013-03-08  Stan Shebs  <stan@codesourcery.com>
3778             Hafiz Abid Qadeer  <abidh@codesourcery.com>
3779
3780         * tracepoint.c (trace_buffer_size): New global.
3781         (DEFAULT_TRACE_BUFFER_SIZE): New define.
3782         (init_trace_buffer): Change to one-argument function. Allocate
3783         trace buffer memory.
3784         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
3785         handle QTBuffer:size packet.
3786         (cmd_bigqtbuffer_size): New function.
3787         (initialize_tracepoint): Call init_trace_buffer with
3788         DEFAULT_TRACE_BUFFER_SIZE.
3789         * server.c (handle_query): Add QTBuffer:size in the
3790         supported packets.
3791
3792 2013-03-07  Yao Qi  <yao@codesourcery.com>
3793
3794         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
3795         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
3796         of -1.
3797         (cmd_qtsp): Adjust condition.  Do post increment.
3798         Set cur_action and cur_step_action back to 0.
3799
3800 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
3801
3802         PR server/15236
3803         * linux-low.c (linux_write_memory): Return early success if LEN is
3804         zero.
3805
3806 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
3807
3808         * configure.srv: Add x86_64-*-cygwin* as target.
3809
3810 2013-02-28  Tom Tromey  <tromey@redhat.com>
3811
3812         * configure.ac: Invoke AC_SYS_LARGEFILE.
3813         * configure, config.in: Rebuild.
3814
3815 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
3816
3817         * win32-low.c: Throughout, fix format strings and casts of
3818         printf-like functions to avoid type related warnings on all
3819         platforms.
3820         (get_child_debug_event): Print dwDebugEventCode as hex since
3821         that's how it's usually documented.
3822
3823 2013-02-28  Yao Qi  <yao@codesourcery.com>
3824
3825         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
3826         pulongest.
3827
3828 2013-02-27  Jiong Wang  <jiwang@tilera.com>
3829
3830         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
3831         (reg-tilegx32.c): New rule.
3832         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
3833         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
3834         different register info initializer according to elf class.
3835         (init_registers_tilgx32): New function.  The tilegx32 register info
3836         initializer.
3837         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
3838         (tile_store_gregset): Likewise.
3839
3840 2013-02-27  Yao Qi  <yao@codesourcery.com>
3841
3842         * server.c (process_point_options): Print debug message when
3843         debug_threads is true.
3844
3845 2013-02-26  Yao Qi  <yao@codesourcery.com>
3846
3847         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
3848
3849 2013-02-19  Pedro Alves  <palves@redhat.com>
3850             Kai Tietz <ktietz@redhat.com>
3851
3852         PR gdb/15161
3853
3854         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
3855         instead of strtoul to extract address from packet.
3856         (process_serial_event) <'z'>: Likewise.
3857
3858 2013-02-18  Yao Qi  <yao@codesourcery.com>
3859
3860         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
3861
3862 2013-02-14  Pedro Alves  <palves@redhat.com>
3863
3864         Plug memory leak.
3865
3866         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
3867         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
3868
3869 2013-02-14  Pedro Alves  <palves@redhat.com>
3870
3871         * tracepoint.c (cmd_qtdpsrc): Use savestring.
3872
3873 2013-02-14  Pedro Alves  <palves@redhat.com>
3874
3875         * tracepoint.c (save_string): Delete.
3876         (add_tracepoint_action): Use savestring instead of save_string.
3877
3878 2013-02-12  Pedro Alves  <palves@redhat.com>
3879
3880         * linux-xtensa-low.c: Ditto.
3881         * xtensa-xtregs.c: Ditto.
3882
3883 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
3884
3885         * thread-db.c (thread_db_get_tls_address): NULL pointer check
3886         thread_db.
3887
3888 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3889
3890         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
3891         aarch64_num_wp_regs and aarch64_num_bp_regs to
3892         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
3893
3894 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3895
3896         * linux-aarch64-low.c (ps_get_thread_area): Replace
3897         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
3898
3899 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
3900             Marcus Shawcroft  <marcus.shawcroft@arm.com>
3901             Nigel Stephens  <nigel.stephens@arm.com>
3902             Yufeng Zhang  <yufeng.zhang@arm.com>
3903
3904         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
3905         (aarch64.c, aarch64-without-fpu.c): New targets.
3906         * configure.srv (aarch64*-*-linux*): New.
3907         * linux-aarch64-low.c: New file.
3908
3909 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3910
3911         * linux-low.c (handle_extended_wait, linux_create_inferior)
3912         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
3913         (dequeue_one_deferred_signal, linux_resume_one_thread)
3914         (fetch_register, linux_write_memory, linux_enable_event_reporting)
3915         (linux_tracefork_grandchild, linux_test_for_tracefork)
3916         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
3917         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
3918         where the argument is 0.
3919
3920 2013-01-25  Yao Qi  <yao@codesourcery.com>
3921
3922         * event-loop.c: Include "queue.h".
3923         (gdb_event_p): New typedef.
3924         (struct gdb_event) <next_event>: Remove.
3925         (event_queue): Change to QUEUE(gdb_event_p).
3926         (async_queue_event): Remove.
3927         (gdb_event_xfree): New.
3928         (initialize_event_loop): New.
3929         (process_event): Use API from QUEUE.
3930         (wait_for_event): Likewise.
3931         * server.c (main): Call initialize_event_loop.
3932         * server.h (initialize_event_loop): Declare.
3933
3934 2013-01-18  Yao Qi  <yao@codesourcery.com>
3935
3936         * ax.h (struct eval_agent_expr_context): New.
3937         (gdb_eval_agent_expr): Update declaration.
3938         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
3939         TFRAME.  Add new argument CTX.
3940         * server.h (struct eval_agent_expr_context): Declare.
3941         (agent_mem_read, agent_tsv_read): Update declaration.
3942         (agent_mem_read_string): Likewise.
3943         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
3944         (add_traceframe_block): Add new argument TPOINT.
3945         Increase TPOINT->traceframe_usage.
3946         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
3947         eval_tracepoint_agent_expr.
3948         (condition_true_at_tracepoint): Likewise.
3949         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
3950         (agent_mem_read_string, agent_tsv_read): Likewise.
3951
3952 2013-01-16  Yao Qi  <yao@codesourcery.com>
3953
3954         * linux-low.c (linux_resume_one_lwp): Don't check
3955         'lwp->bp_reinsert != 0'.
3956
3957 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3958             Pedro Alves  <palves@redhat.com>
3959
3960         * lynx-low.c (ptrace_request_to_str): Define a temporary
3961         macro and use it to simplify this function's implementation.
3962
3963 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3964
3965         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
3966         sets errno.
3967
3968 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3969
3970         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
3971
3972 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3973
3974         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
3975
3976 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3977
3978         * lynx-low.c (lynx_resume): Use the resume_info parameter
3979         to determine the ptid for the lynx_ptrace call, unless
3980         it is equal to minus_one_ptid, in which case we use the
3981         ptid of the current_inferior.
3982         (lynx_wait_1): After having received a thread create/exit
3983         event, resume the inferior's execution using the signaling
3984         thread's ptid, rather than the old ptid.
3985
3986 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3987
3988         * lynx-low.c (lynx_resume): Delete variable ret.
3989
3990 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
3991
3992         * gdbreplay.c (gdbreplay_version): Update copyright year.
3993         * server.c (gdbserver_version): Likewise.
3994
3995 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
3996
3997         * lynx-low.c (lynx_wait_1): Add debug trace before adding
3998         new thread.
3999
4000 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
4001
4002         * lynx-low.c (ptrace_request_to_str): Add handling for
4003         PTRACE_GETTRACESIG.
4004
4005 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
4006
4007         * lynx-low.c (lynx_attach): Delete variable new_process.
4008
4009 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
4010
4011         * lynx-low.c (lynx_create_inferior): Delete variable
4012         new_process.
4013
4014 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
4015
4016         * lynx-low.c (ptrace_request_to_str): Do not handle
4017         PTRACE_GETTHREADLIST if this macro does not exist.
4018
4019 2012-12-15  Yao Qi  <yao@codesourcery.com>
4020
4021         * Makefile.in (OBS): Add notif.o.
4022         * notif.c, notif.h: New.
4023         * server.c: Include "notif.h".
4024         (struct vstop_notif) <next>: Remove.
4025         <base>: New field.
4026         (queue_stop_reply): Update.
4027         (push_event, send_next_stop_reply): Remove.
4028         (discard_queued_stop_replies): Update.
4029         (notif_stop): New variable.
4030         (handle_v_stopped): Remove.
4031         (handle_v_requests): Don't call handle_v_stopped.  Call
4032         handle_ack_notif instead.
4033         (queue_stop_reply_callback): Call notif_event_enque instead
4034         of queue_stop_reply.
4035         (handle_status): Don't call send_next_stop_reply, call
4036         notif_write_event instead.
4037         (kill_inferior_callback): Likewise.
4038         (detach_or_kill_inferior_callback): Likewise.
4039         (main): Call initialize_notif.
4040         (process_serial_event): Call QUEUE_is_empty.
4041         (handle_target_event): Call notif_push instead of push event.
4042         * server.h (push_event): Remove declaration.
4043
4044 2012-12-10  Tom Tromey  <tromey@redhat.com>
4045
4046         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
4047         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
4048         macros.
4049         (.c.o): Rewrite.
4050         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
4051         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
4052         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
4053         (amd64-linux-ipa.o, ax.o): Rewrite.
4054         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
4055         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
4056         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
4057         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
4058         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
4059         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
4060         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
4061         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
4062         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
4063         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
4064         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
4065         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
4066         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
4067         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
4068         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
4069         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
4070         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
4071         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
4072         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
4073         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
4074         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
4075         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
4076         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
4077         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
4078         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
4079         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
4080         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
4081         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
4082         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
4083         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
4084         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
4085         (reg-tilegx.o): Remove.
4086         (all_object_files): New macro.
4087         Include .deps files.
4088         * aclocal.m4, configure: Rebuild.
4089         * acinclude.m4: Include depstand.m4, lead-dot.m4.
4090         * configure.ac: Invoke ZW_CREATE_DEPDIR,
4091         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
4092
4093 2012-12-05  Tom Tromey  <tromey@redhat.com>
4094
4095         PR gdb/14917:
4096         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
4097
4098 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
4099
4100         * configure.ac: Check for linux/perf_event.h.
4101         * config.in: Regenerated.
4102         * configure: Regenerated.
4103
4104 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
4105
4106         * hostio.c (handle_readlink): Decrease buffer size
4107         parameter passed to readlink by one byte.
4108
4109 2012-11-26  Yao Qi  <yao@codesourcery.com>
4110
4111         * configure.ac (build_warnings): Append '-Wempty-body'.
4112         * configure: Regenerated.
4113         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
4114         body.
4115
4116 2012-11-15  Pierre Muller  <muller@sourceware.org>
4117
4118         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
4119         * config.in: Regenerate.
4120         * configure: Regenerate.
4121         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
4122         Use "gdb_wait.h" header instead of <sys/wait.h> header.
4123         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
4124         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
4125         header.
4126         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
4127         instead of <sys/wait.h> header.
4128         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
4129
4130 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
4131
4132         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
4133         (various make rules): Remove -DGDBSERVER
4134
4135 2012-11-09  Yao Qi  <yao@codesourcery.com>
4136
4137         * spu-low.c (current_ptid): Move it to ..
4138         * gdbthread.h: ... here.  New.
4139         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
4140         * server.c (myresume, process_serial_event): Likewise.
4141         * thread-db.c (thread_db_find_new_threads): Likewise.
4142         * tracepoint.c (run_inferior_command): Likewise.
4143
4144 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
4145
4146         * server.c (handle_search_memory_1): Include access length in
4147         warning message.
4148
4149 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
4150
4151         * linux-crisv32-low.c: Fix compile errors.
4152
4153 2012-09-04  Yao Qi  <yao@codesourcery.com>
4154
4155         * tracepoint.c (cmd_qtsv): Adjust debug message.
4156         Don't check CUR_TPOINT.
4157
4158 2012-08-28  Yao Qi  <yao@codesourcery.com>
4159
4160         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
4161         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
4162         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
4163         Remove declarations of xmalloc, xreallloc, xstrdup and
4164         freeargv.
4165         * Makefile.in (libiberty_h): New.
4166         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
4167         (linux-bfin-low.o): Append dependency 'libiberty.h'.
4168
4169 2012-08-23  Yao Qi  <yao@codesourcery.com>
4170
4171         * server.h: Remove declaration of 'xsnprintf'.
4172
4173 2012-08-22  Keith Seitz  <keiths@redhat.com>
4174
4175         * server.h: Include build-gnulib-gbserver/config.h.
4176         * gdbreplay.c: Likewise.
4177
4178 2012-08-08  Doug Evans  <dje@google.com>
4179
4180         * Makefile.in (SFILES): Add gdb_vecs.c.
4181         (OBS): Add gdb_vecs.o.
4182         (gdb_vecs_h, host_defs_h): New variables.
4183         (thread-db.o): Add $(gdb_vecs_h) dependency.
4184         (gdb_vecs.o): New rule.
4185         * thread-db.c: #include "gdb_vecs.h".
4186         (thread_db_load_search): Use a vector to iterate over path elements.
4187         Handle text appearing after "$pdir".
4188
4189         * configure.ac: Add check for strstr.
4190         * config.in: Regenerate.
4191         * configure: Regenerate.
4192
4193 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
4194
4195         * hostio.c (handle_pread): If pread fails, fall back to attempting
4196         lseek/read.
4197         (handle_pwrite): Likewise for pwrite.
4198
4199 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
4200
4201         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
4202         between unsupported TYPE and unimplementable ADDR/LEN combination.
4203         (arm_insert_point): Act on new return value.
4204
4205 2012-07-31  Pedro Alves  <palves@redhat.com>
4206
4207         * server.c (process_point_options): Only skip tokens if we find
4208         one that is unrecognized.  Don't treat 'X' specially while
4209         skipping unrecognized tokens.
4210
4211 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
4212
4213         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
4214         to 4-byte-align HW breakpoint addresses for Thumb.
4215
4216 2012-07-27  Yao Qi  <yao@codesourcery.com>
4217
4218         PR remote/14161.
4219
4220         * server.h: Declare gdb_agent_about_to_close.
4221         * target.c (kill_inferior): Include "agent.h".
4222         New.  Send command 'kill'.
4223         * target.h (kill_inferior): Removed macro.
4224         * tracepoint.c (gdb_agent_about_to_close): New.
4225         (gdb_agent_helper_thread): Handle command 'close'.
4226         Wait endlessly until the inferior stops.
4227         Install gdb_agent_remove_socket to atexit hook.
4228         (agent_socket_name): New static variable.
4229         (gdb_agent_socket_init): Replace local variable 'name' with
4230         'agent_socket_name'.
4231         (gdb_agent_remove_socket): New.
4232
4233 2012-07-27  Yao Qi  <yao@codesourcery.com>
4234
4235         * server.c (process_point_options): Stop at 'X' when parsing.
4236
4237 2012-07-19  Michael Eager  <eager@eagercon.com>
4238
4239         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
4240         to hw_execute.
4241         * linux-x86-low.c (x86_insert_point, x86_remove_point):
4242         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
4243         hardware breakpoint.
4244
4245 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
4246
4247         * gdbserver/linux-low.c (initialize_low): Call
4248         linux_ptrace_init_warnings.
4249
4250 2012-07-02  Doug Evans  <dje@google.com>
4251
4252         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
4253         pointer to int.
4254
4255 2012-07-02  Stan Shebs  <stan@codesourcery.com>
4256
4257         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
4258         (ax.o): Add it to build rule.
4259         (ax-ipa.o): Ditto.
4260         (OBS): Add format.o.
4261         (IPA_OBS): Add format.o.
4262         * server.c (handle_query): Claim support for breakpoint commands.
4263         (process_point_options): Add command case.
4264         (process_serial_event): Leave running if there are printfs in
4265         effect.
4266         * mem-break.h (any_persistent_commands): Declare.
4267         (add_breakpoint_commands): Declare.
4268         (gdb_no_commands_at_breakpoint): Declare.
4269         (run_breakpoint_commands): Declare.
4270         * mem-break.c (struct point_command_list): New struct.
4271         (struct breakpoint): New field command_list.
4272         (any_persistent_commands): New function.
4273         (add_commands_to_breakpoint): New function.
4274         (add_breakpoint_commands): New function.
4275         (gdb_no_commands_at_breakpoint): New function.
4276         (run_breakpoint_commands): New function.
4277         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
4278         locally.
4279         * ax.c: Include format.h.
4280         (ax_printf): New function.
4281         (gdb_eval_agent_expr): Add printf opcode.
4282
4283 2012-06-13  Yao Qi  <yao@codesourcery.com>
4284
4285         * server.c (start_inferior): Remove duplicated writes to fields
4286         'last_resume_kind' and 'last_status' of 'current_inferior'.
4287
4288 2012-06-12  Yao Qi  <yao@codesourcery.com>
4289             Pedro Alves  <palves@redhat.com>
4290
4291         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
4292         comment.
4293         * server.c (handle_v_cont): Extend comment.
4294
4295 2012-06-11  Yao Qi  <yao@codesourcery.com>
4296
4297         * linux-low.c (linux_attach): Add 'static'.
4298
4299 2012-06-06  Yao Qi  <yao@codesourcery.com>
4300
4301         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
4302
4303 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
4304
4305         Fix gcc -flto compilation warning.
4306         * server.c (main): Make variable multi_mode and attach volatile.
4307
4308 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
4309
4310         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
4311         if the platform doesn't know about it.
4312
4313 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
4314
4315         * Makefile.in (SFILES): Add linux-tile-low.c.
4316         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
4317         * configure.srv: Handle tilegx-*-linux*.
4318         * linux-tile-low.c: New file.
4319
4320 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4321
4322         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
4323
4324 2012-05-24  Pedro Alves  <palves@redhat.com>
4325
4326         PR gdb/7205
4327
4328         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
4329
4330 2012-05-24  Pedro Alves  <palves@redhat.com>
4331
4332         PR gdb/7205
4333
4334         Replace target_signal with gdb_signal throughout.
4335
4336 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
4337
4338         * linux-low.c (linux_store_registers): Avoid the copying sequence
4339         when no data has been retrieved by ptrace.
4340
4341 2012-05-22  Will Deacon  <will.deacon@arm.com>
4342
4343         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
4344         Include asm/ptrace.h.
4345         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
4346         already defined.
4347
4348 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
4349
4350         * linux-low.c (linux_store_registers): Don't re-retrieve data
4351         with ptrace that has already been obtained from /proc.  Always
4352         copy any data retrieved with ptrace to the buffer supplied.
4353
4354 2012-05-11  Yao Qi  <yao@codesourcery.com>
4355             Pedro Alves  <palves@redhat.com>
4356
4357         * linux-low.c (enum stopping_threads_kind): New.
4358         (stopping_threads): Change type to `enum stopping_threads_kind'.
4359         (handle_extended_wait): If stopping and suspending threads, leave
4360         the new_lwp suspended too.
4361         (linux_wait_for_event): Adjust.
4362         (stop_all_lwps): Set `stopping_threads' to
4363         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
4364         whether we're suspending threads or just stopping them.  Assert no
4365         recursion happens.
4366
4367 2012-04-29  Yao Qi  <yao@codesourcery.com>
4368
4369         * server.h: Move some code to ...
4370         * gdbthread.h: ... here.  New.
4371         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
4372         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
4373         (nto-low.o, win32-low.o): Likewise.
4374         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
4375         * regcache.c, remote-utils.c, server.c: Likewise.
4376         * target.c, tracepoint.c, win32-low.c: Likewise.
4377
4378 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
4379
4380         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
4381         (PTRACE_ARG4_TYPE): Likewise.
4382         (PTRACE_XFER_TYPE): Likewise.
4383         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
4384         ptrace to PTRACE_ARG3_TYPE.
4385         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
4386         (PTRACE_ARG4_TYPE): Likewise.
4387         (PTRACE_XFER_TYPE): Likewise.
4388         (linux_detach_one_lwp): Cast fourth argument of
4389         ptrace to long then PTRACE_ARG4_TYPE.
4390         (regsets_fetch_inferior_registers): Cast third argument of
4391         ptrace to long then PTRACE_ARG3_TYPE.
4392         (regsets_store_inferior_registers): Likewise.
4393
4394 2012-04-20  Pedro Alves  <palves@redhat.com>
4395
4396         * configure: Regenerate.
4397
4398 2012-04-19  Pedro Alves  <palves@redhat.com>
4399
4400         * Makefile.in (GNULIB_BUILDDIR): New.
4401         (LIBGNU, INCGNU, GNULIB_H): Adjust.
4402         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
4403         (all, install-only, uninstall, clean-info, all-lib, clean): No
4404         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
4405         (maintainer-clean realclean distclean): Use subdir_do.
4406         (subdir_do): New.
4407         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
4408         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
4409         * acinclude.m4: Include acx_configure_dir.m4.
4410         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
4411         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
4412         ACX_CONFIGURE_DIR.
4413         (GNULIB): New.
4414         (GNULIB_STDINT_H): Adjust.
4415         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
4416         * gdbreplay.c: Include build-gnulib/config.h.
4417         * server.h: Likewise.
4418         * aclocal.m4: Regenerate.
4419         * config.in: Regenerate.
4420         * configure: Regenerate.
4421
4422 2012-04-19  Pedro Alves  <palves@redhat.com>
4423
4424         * Makefile.in (LIBGNU, INCGNU): Adjust.
4425         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
4426         (all, install-only, uninstall, clean-info, all-lib, clean)
4427         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
4428         * configure.ac: Adjust AC_OUTPUT output.
4429         * aclocal.m4: Regenerate.
4430         * configure: Regenerate.
4431
4432 2012-04-19  Pedro Alves  <palves@redhat.com>
4433
4434         * Makefile.in (generated_files): New.
4435         (server_h): Remove the explicit dependency on config.h, and depend
4436         on $generated_files.
4437
4438 2012-04-19  Pedro Alves  <palves@redhat.com>
4439
4440         * Makefile.in (INCGNU): Add -Ignulib.
4441
4442 2012-04-19  Pedro Alves  <palves@redhat.com>
4443
4444         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
4445         (INCGNU): ... this, and spell out -I here.
4446         (GNULIB_LIB): Rename to ...
4447         (LIBGNU): ... this.
4448         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
4449
4450 2012-04-19  Pedro Alves  <palves@redhat.com>
4451
4452         * config.in: Regenerate.
4453
4454 2012-04-19  Pedro Alves  <palves@redhat.com>
4455
4456         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
4457         * server.h (memmem): Remove declaration.
4458         * config.in: Regenerate.
4459         * configure: Regenerate.
4460
4461 2012-04-19  Yao Qi  <yao@codesourcery.com>
4462
4463         * Makefile.in (SFILES): Add common/vec.c.
4464         (OBS): Add vec.o.
4465         (vec.o): New rule.
4466
4467 2012-04-19  Yao Qi  <yao@codesourcery.com>
4468
4469         * remote-utils.c (prepare_resume_reply): Replace with macro
4470         target_core_of_thread.
4471         * server.c (handle_qxfer_threads_proper): Likewise.
4472         * target.h (traget_core_of_thread): New macro.
4473
4474 2012-04-18  Pedro Alves  <palves@redhat.com>
4475
4476         * aclocal.m4: Regenerate.
4477         * configure: Regenerate.
4478
4479 2012-04-16  Yao Qi  <yao@codesourcery.com>
4480
4481         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
4482         duplicated on address.
4483
4484 2012-04-16  Yao Qi  <yao@codesourcery.com>
4485
4486         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
4487         (struct tracepoint_action_ops) <send>: New field.
4488         (m_tracepoint_action_send, r_tracepoint_action_send): New.
4489         (agent_expr_send, x_tracepoint_action_send): New.
4490         (l_tracepoint_action_send): New.
4491         (cmd_qtdp): Download and install tracepoint
4492         according to `use_agent'.
4493         (run_inferior_command): Add one more parameter `len'.
4494         Update callers.
4495         (tracepoint_send_agent): New.
4496         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
4497
4498 2012-04-16  Yao Qi  <yao@codesourcery.com>
4499
4500         * tracepoint.c (download_tracepoints): Moved to ...
4501         (cmd_qtstart): ... here.
4502
4503 2012-04-14  Yao Qi  <yao@codesourcery.com>
4504
4505         * tracepoint.c: Include inttypes.h.
4506         (struct collect_memory_action): Use sized types.
4507         (struct tracepoint): Likewise.
4508         (cmd_qtdp, stop_tracing): Update print specifiers.
4509         (cmd_qtp, response_tracepoint): Likewise.
4510         (collect_data_at_tracepoint): Likewise.
4511         (collect_data_at_step): Likewise.
4512
4513 2012-04-14  Yao Qi  <yao@codesourcery.com>
4514
4515         Import gnulib module inttypes.
4516         * aclocal.m4, config.in, configure: Regenerated.
4517
4518 2012-04-14  Yao Qi  <yao@codesourcery.com>
4519
4520         * Makefile.in (maintainer-clean, realclean, distclean): Remove
4521         Makefile and config.status at last.
4522
4523 2012-04-13  Yao Qi  <yao@codesourcery.com>
4524
4525         * tracepoint.c: Include stdint.h unconditionally.
4526
4527 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
4528
4529         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
4530         on BFD_HAVE_SYS_PROCFS_TYPE.
4531         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
4532         * configure: Regenerate.
4533         * config.in: Likewise.
4534
4535 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
4536
4537         * Makefile.in (clean): Also remove x32.c x32-linux.c
4538         x32-avx.c x32-avx-linux.c.
4539         (x32.o): New target.
4540         (x32.c): Likewise.
4541         (x32-linux.o): Likewise.
4542         (x32-linux.c): Likewise.
4543         (x32-avx.o): Likewise.
4544         (x32-avx.c): Likewise.
4545         (x32-avx-linux.o): Likewise.
4546         (x32-avx-linux.c): Likewise.
4547
4548         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
4549         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
4550         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
4551         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
4552         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
4553         i386/x32-avx-linux.xml.
4554
4555         * linux-x86-low.c (init_registers_x32_linux): New prototype.
4556         (init_registers_x32_avx_linux): Likwise.
4557         (x86_linux_update_xmltarget): Call init_registers_x32_linux
4558         or init_registers_x32_avx_linux if linux_is_elf64 is false.
4559
4560 2012-04-13  Pedro Alves  <palves@redhat.com>
4561
4562         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
4563         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
4564         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
4565         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
4566         the sub-make.
4567
4568 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
4569
4570         * linux-x86-low.c (compat_x32_clock_t): New.
4571         (compat_x32_siginfo_t): Likewise.
4572         (compat_x32_siginfo_from_siginfo): Likewise.
4573         (siginfo_from_compat_x32_siginfo): Likewise.
4574         (linux_is_elf64): Likewise.
4575         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
4576         and siginfo_from_compat_x32_siginfo for x32.
4577         (x86_arch_setup): Set linux_is_elf64.
4578
4579 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
4580
4581         PR gdb/13969
4582         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
4583         e_machine field.
4584         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
4585         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
4586         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
4587         compatible with process.
4588
4589 2012-04-12  Yao Qi  <yao@codesourcery.com>
4590
4591         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
4592         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
4593         (install-only, install-info, clean): Handle sub dir gnulib.
4594         (all-lib, am--refresh): New targets.
4595         (memmem.o): Remove target.
4596         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
4597         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
4598         (AC_REPLACE_FUNCS): Remove memmem.
4599         Invoke gl_INIT and AM_INIT_AUTOMAKE.
4600         (AC_OUTPUT): Generate Makefile in gnulib/.
4601         * aclocal.m4, config.in, configure: Regenerated.
4602
4603 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
4604
4605         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
4606
4607 2012-04-05  Pedro Alves  <palves@redhat.com>
4608
4609         -Werror=strict-aliasing
4610
4611         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
4612         pointer.
4613
4614 2012-04-04  Pedro Alves  <palves@redhat.com>
4615
4616         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
4617         (sparc_store_gregset_from_stack, sparc_store_gregset)
4618         (sparc_breakpoint_at): Fix formatting.
4619
4620 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
4621
4622         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
4623         are available.
4624         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
4625         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
4626         * config.in: Regenerate.
4627         * configure: Likewise.
4628
4629 2012-03-29  Pedro Alves  <palves@redhat.com>
4630
4631         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
4632         Correct ptrace arguments.
4633
4634 2012-03-28  Pedro Alves  <palves@redhat.com>
4635
4636         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
4637         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
4638         (IA64_FR1_REGNUM): New defines.
4639         (ia64_fetch_register): New.
4640         (the_low_target): Install it.
4641         * linux-low.h (struct linux_target_ops) <fetch_register>: New
4642         field.
4643         * linux-low.c (linux_fetch_registers): Try the
4644         the_low_target.fetch_register hook first.
4645
4646         * linux-arm-low.c (the_low_target): Adjust.
4647         * linux-bfin-low.c (the_low_target): Adjust.
4648         * linux-cris-low.c (the_low_target): Adjust.
4649         * linux-crisv32-low.c (the_low_target): Adjust.
4650         * linux-m32r-low.c (the_low_target): Adjust.
4651         * linux-m68k-low.c (the_low_target): Adjust.
4652         * linux-mips-low.c (the_low_target): Adjust.
4653         * linux-ppc-low.c (the_low_target): Adjust.
4654         * linux-s390-low.c (the_low_target): Adjust.
4655         * linux-sh-low.c (the_low_target): Adjust.
4656         * linux-sparc-low.c (the_low_target): Adjust.
4657         * linux-tic6x-low.c (the_low_target): Adjust.
4658         * linux-x86-low.c (the_low_target): Adjust.
4659         * linux-xtensa-low.c (the_low_target): Adjust.
4660
4661 2012-03-26  Pedro Alves  <palves@redhat.com>
4662
4663         * server.c (handle_qxfer_libraries): Don't bail early if
4664         the_target->qxfer_libraries_svr4 is not NULL.
4665
4666 2012-03-26  Pedro Alves  <palves@redhat.com>
4667
4668         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
4669
4670 2012-03-23  Pedro Alves  <palves@redhat.com>
4671
4672         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
4673         "library-list-svr4" element's start tag when the the DSO list is
4674         empty.
4675
4676 2012-03-23  Pedro Alves  <palves@redhat.com>
4677
4678         * linux-low.c (read_one_ptr): Read the inferior's pointer through
4679         a variable whose type size is the same as the inferior's pointer
4680         size.
4681
4682 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
4683
4684         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
4685         struct siginfo.
4686         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
4687         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
4688         * linux-low.h: Include <signal.h>.
4689         (struct siginfo): Remove forward declaration.
4690         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
4691         struct siginfo.
4692
4693 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
4694
4695         * .gitignore: Ignore more files.
4696
4697 2012-03-19  Pedro Alves  <palves@redhat.com>
4698             Jan Kratochvil  <jan.kratochvil@redhat.com>
4699
4700         * server.c (cont_thread, general_thread): Add describing comments.
4701         (start_inferior): Clear `cont_thread'.
4702         (handle_v_cont): Don't set `cont_thread' if resuming all threads
4703         of a process.
4704
4705 2012-03-15  Yao Qi  <yao@codesourcery.com>
4706
4707         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
4708         handling to ...
4709         (cmd_qtdp): ... here.
4710
4711 2012-03-15  Yao Qi  <yao@codesourcery.com>
4712
4713         * tracepoint.c (struct tracepoint_action_ops): New.
4714         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
4715         (m_tracepoint_action_download): New.
4716         (r_tracepoint_action_download): New.
4717         (x_tracepoint_action_download): New.
4718         (l_tracepoint_action_download): New.
4719         (add_tracepoint_action): Install `action->ops' according type.
4720         (download_tracepoint_1): Move code `download' function pointer
4721         of various tracepoint_action_ops.
4722
4723 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
4724
4725         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
4726         linux_ptrace_attach_warnings.
4727
4728 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
4729
4730         * Makefile.in (linux-ptrace.o): New.
4731         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
4732         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
4733         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
4734         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
4735         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
4736         of these targets.
4737         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
4738
4739 2012-03-08  Yao Qi  <yao@codesourcery.com>
4740             Pedro Alves  <palves@redhat.com>
4741
4742         Fix PR server/13392.
4743         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
4744         offset of JMP insn.
4745         * tracepoint.c (remove_tracepoint): New.
4746         (cmd_qtdp): Call remove_tracepoint when failed to install.
4747
4748 2012-03-07  Pedro Alves  <palves@redhat.com>
4749
4750         * linux-low.c (get_detach_signal): New.
4751         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
4752         Pass on pending signals to PTRACE_DETACH.  Check the result of the
4753         ptrace call.
4754         * server.c (program_signals, program_signals_p): New.
4755         (handle_general_set): Handle QProgramSignals.
4756         * server.h (program_signals, program_signals_p): Declare.
4757
4758 2012-03-05  Pedro Alves  <palves@redhat.com>
4759             Jan Kratochvil  <jan.kratochvil@redhat.com>
4760
4761         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
4762         New comment why.
4763
4764 2012-03-03  Yao Qi  <yao@codesourcery.com>
4765
4766         * tracepoint.c (tracepoint_look_up_symbols): Update call to
4767         agent_look_up_symbols.
4768
4769 2012-03-03  Yao Qi  <yao@codesourcery.com>
4770
4771         * Makefile.in (linux-low.o): Keep dependence on agent.h.
4772         (linux-x86-low.o): Likewise.
4773         * server.h: Remove in_process_agent_loaded.
4774         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
4775         common/agent.c.
4776         Update callers.
4777
4778 2012-03-03  Yao Qi  <yao@codesourcery.com>
4779
4780         * tracepoint.c (gdb_agent_capability): New global.
4781         (in_process_agent_loaded_ust): Renamed to
4782         `in_process_agent_supports_ust'.
4783         Update callers.
4784         (in_process_agent_supports_ust): Call agent_capability_check.
4785         (clear_installed_tracepoints): Assert that agent supports
4786         agent.
4787
4788 2012-03-03  Yao Qi  <yao@codesourcery.com>
4789
4790         * linux-low.c (linux_supports_agent): New.
4791         (linux_target_ops): Initialize field `supports_agent' with
4792         linux_supports_agent.
4793         * target.h (struct target_ops) <supports_agent>: New.
4794         (target_supports_agent): New macro.
4795         * server.c (handle_general_set): Handle packet 'QAgent'.
4796         (handle_query): Send `QAgent+'.
4797         * Makefile.in (server.o): Depends on agent.h.
4798
4799 2012-03-03  Yao Qi  <yao@codesourcery.com>
4800
4801         * Makefile.in (OBS): Add agent.o.
4802         Add new rule for agent.o.
4803         Track dependence of tracepoint.c on agent.h.
4804         * tracepoint.c (run_inferior_command_1):
4805         (run_inferior_command): Call agent_run_command.
4806         (gdb_ust_connect_sync_socket): Deleted.  Move it to
4807         common/agent.c.
4808         (resume_thread, stop_thread): Likewise.
4809         (gdb_ust_socket_init): Renamed to ...
4810         (gdb_agent_socket_init): ... New.
4811         (gdb_ust_thread): Renamed to ...
4812         (gdb_agent_helper_thread): ... New.
4813         (gdb_ust_init): Move some code to ...
4814         (gdb_agent_init): ... here.  New.
4815         [HAVE_UST]: Call gdb_ust_init.
4816         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
4817         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
4818         * config.in, configure: Regenerated.
4819
4820 2012-03-02  Pedro Alves  <palves@redhat.com>
4821
4822         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
4823         * linux-low.c (struct simple_pid_list): New.
4824         (stopped_pids): New a struct simple_pid_list pointer.
4825         (add_to_pid_list, pull_pid_from_list): New.
4826         (handle_extended_wait): Don't assume the first signal new children
4827         report is SIGSTOP.  Adjust call to pull_pid_from_list.
4828         (linux_wait_for_lwp): Adjust.
4829
4830 2012-03-02  Yao Qi  <yao@codesourcery.com>
4831
4832         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
4833         debug log.
4834
4835 2012-03-02  Yao Qi  <yao@codesourcery.com>
4836
4837         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
4838         `stop_pc' and `tpoint'.  Update caller.
4839
4840 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
4841
4842         * linux-low.h (linux_target_ops): Add regset_bitmap member.
4843         * linux-low.c (use_linux_regsets): New macro.
4844         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
4845         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
4846         (linux_register_in_regsets): New function.
4847         (usr_fetch_inferior_registers): Skip registers covered by
4848         regsets.
4849         (usr_store_inferior_registers): Likewise.
4850         (usr_fetch_inferior_registers): New macro.
4851         (usr_store_inferior_registers): Likewise.
4852         (linux_fetch_registers): Handle mixed regset/non-regset targets.
4853         (linux_store_registers): Likewise.
4854         * linux-mips-low.c (init_registers_mips_dsp_linux): New
4855         prototype.
4856         (init_registers_mips64_dsp_linux): Likewise.
4857         (init_registers_mips_linux): New macro.
4858         (init_registers_mips_dsp_linux): Likewise.
4859         (mips_dsp_num_regs): Likewise.
4860         (DSP_BASE, DSP_CONTROL): New fallback macros.
4861         (mips_base_regs): New macro.
4862         (mips_regmap): Use it.  Fix the size.
4863         (mips_dsp_regmap): New variable.
4864         (mips_dsp_regset_bitmap): Likewise.
4865         (mips_arch_setup): New function.
4866         (mips_cannot_fetch_register): Use the_low_target.regmap rather
4867         than mips_regmap.
4868         (mips_cannot_store_register): Likewise.
4869         (the_low_target): Update .arch_setup, .num_regs and .regmap
4870         initializers.  Add .regset_bitmap initializer.
4871         * linux-arm-low.c (the_low_target): Add .regset_bitmap
4872         initializer.
4873         * linux-bfin-low.c (the_low_target): Likewise.
4874         * linux-cris-low.c (the_low_target): Likewise.
4875         * linux-crisv32-low.c (the_low_target): Likewise.
4876         * linux-ia64-low.c (the_low_target): Likewise.
4877         * linux-m32r-low.c (the_low_target): Likewise.
4878         * linux-m68k-low.c (the_low_target): Likewise.
4879         * linux-ppc-low.c (the_low_target): Likewise.
4880         * linux-s390-low.c (the_low_target): Likewise.
4881         * linux-sh-low.c (the_low_target): Likewise.
4882         * linux-sparc-low.c (the_low_target): Likewise.
4883         * linux-tic6x-low.c (the_low_target): Likewise.
4884         * linux-x86-low.c (the_low_target): Likewise.
4885         * linux-xtensa-low.c (the_low_target): Likewise.
4886         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
4887         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
4888         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
4889         srv_xmlfiles.
4890         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
4891         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
4892
4893 2012-02-29  Yao Qi  <yao@codesourcery.com>
4894             Pedro Alves  <palves@redhat.com>
4895
4896         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
4897         `step_over_finished' is true.
4898
4899 2012-02-27  Pedro Alves  <palves@redhat.com>
4900
4901         * linux-low.c (pid_is_stopped): Delete, moved to common/.
4902         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
4903
4904 2012-02-27  Pedro Alves  <palves@redhat.com>
4905
4906         PR server/9684
4907         * linux-low.c (pid_is_stopped): New.
4908         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
4909
4910 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
4911
4912         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
4913         of conditions.
4914
4915 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
4916
4917         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
4918
4919 2012-02-24  Luis Machado  <lgustavo@codesourcery>
4920
4921         * server.c (handle_query): Advertise support for target-side
4922         breakpoint condition evaluation.
4923         (process_point_options): New function.
4924         (process_serial_event): When inserting a breakpoint, check for
4925         a target-side condition that should be evaluated.
4926
4927         * mem-break.c: Include regcache.h and ax.h.
4928         (point_cond_list_t): New data structure.
4929         (breakpoint) <cond_list>: New field.
4930         (find_gdb_breakpoint_at): Make non-static.
4931         (delete_gdb_breakpoint_at): Clear any target-side
4932         conditions.
4933         (clear_gdb_breakpoint_conditions): New function.
4934         (add_condition_to_breakpoint): Likewise.
4935         (add_breakpoint_condition): Likewise.
4936         (gdb_condition_true_at_breakpoint): Likewise.
4937         (gdb_breakpoint_here): Return result directly instead
4938         of going through a local variable.
4939
4940         * mem-break.h (find_gdb_breakpoint_at): New prototype.
4941         (clear_gdb_breakpoint_conditions): Likewise.
4942         (add_breakpoint_condition): Likewise.
4943         (gdb_condition_true_at_breakpoint): Likewise.
4944
4945         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
4946         (need_step_over_p): Take target-side breakpoint condition into
4947         consideration.
4948
4949 2012-02-24  Luis Machado  <lgustavo@codesourcery>
4950
4951         * server.h: Include tracepoint.h.
4952         (agent_mem_read, agent_get_trace_state_variable_value,
4953         agent_set_trace_state_variable_value,
4954         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
4955         get_set_tsv_func_addr): New prototypes.
4956
4957         * ax.h: New include file.
4958         * ax.c: New source file.
4959
4960         * tracepoint.c: Include ax.h.
4961         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
4962         agent_expr, eval_result_type): Move to ax.h.
4963         (parse_agent_expr): Rename to ...
4964         (gdb_parse_agent_expr): ... this, make it non-static and move
4965         to ax.h.
4966         (unparse_agent_expr) Rename to ...
4967         (gdb_unparse_agent_expr): ... this, make it non-static and move
4968         to ax.h.
4969         (eval_agent_expr): Rename to ...
4970         (eval_tracepoint_agent_expr): ... this.
4971         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
4972         forward declarations.
4973         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
4974         (agent_get_trace_state_variable_value): New function.
4975         (agent_set_trace_state_variable_value): New function.
4976         (cmd_qtdp): Call gdb_parse_agent_expr (...).
4977         (response_tracepoint): Call gdb_unparse_agent_expr (...).
4978         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
4979         (condition_true_at_tracepoint): Likewise.
4980         (parse_agent_expr): Rename to ...
4981         (gdb_parse_agent_expr): ... this and move to ax.c.
4982         (unparse_agent_expr): Rename to ...
4983         (gdb_unparse_agent_expr): ... this and move to ax.c.
4984         (gdb_agent_op_name): Move to ax.c.
4985         (eval_agent_expr): Rename to ...
4986         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
4987         and move to ax.c.
4988         (eval_tracepoint_agent_expr): New function.
4989         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
4990         non-static.
4991         (current_insn_ptr, emit_error, struct bytecode_address): Move to
4992         ax.c.
4993         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
4994         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
4995         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
4996         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
4997         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
4998         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
4999         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
5000         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
5001         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
5002         (compile_bytecodes): Remove forward declaration.
5003         (is_goto_target): Move to ax.c.
5004         (compile_bytecodes): Move to ax.c and call
5005         agent_get_trace_state_variable_value (...) and
5006         agent_set_trace_state_variable_value (...).
5007
5008         * Makefile.in: Update ax.c and IPA dependencies.
5009
5010 2012-02-24  Pedro Alves  <palves@redhat.com>
5011
5012         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
5013         (cmd_bigqtbuffer_circular): ... this.  Only handle
5014         'QTBuffer:circular:'.
5015         (handle_tracepoint_general_set): Adjust.
5016
5017 2012-02-16  Yao Qi  <yao@codesourcery.com>
5018
5019         * inferiors.c: Move code to ...
5020         * dll.c: .... here.  New.
5021         * server.h: Declare clear_dlls.
5022         * Makefile.in (SFILES): Add dll.c.
5023         (OBS): Add dll.o
5024         (dll.o): New rule.
5025
5026 2012-02-11  Yao Qi  <yao@codesourcery.com>
5027
5028         * server.c: (handle_monitor_command): Add a new parameter
5029         `own_buf'.
5030         (handle_query): Update caller.
5031
5032 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
5033
5034         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
5035         * configure, config.in: Regenerate.
5036         * hostio.c: Provide an alternate implementation if HAVE_READLINK
5037         is not defined.
5038
5039 2012-02-02  Pedro Alves  <palves@redhat.com>
5040
5041         Try SIGKILL first, then PTRACE_KILL.
5042         * linux-low.c (linux_kill_one_lwp): New.
5043         (linux_kill_one_lwp): Rename to ...
5044         (kill_one_lwp_callback): ... this.  Use the new
5045         linux_kill_one_lwp.
5046
5047 2012-02-02  Pedro Alves  <palves@redhat.com>
5048
5049         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
5050         inferior.
5051
5052 2012-01-27  Pedro Alves  <palves@redhat.com>
5053
5054         * linux-low.c (linux_child_pid_to_exec_file): Delete.
5055         (elf_64_file_p): Make static.
5056         (linux_pid_exe_is_elf_64_file): New.
5057         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
5058         Delete declarations.
5059         (linux_pid_exe_is_elf_64_file): Declare.
5060         * linux-x86-low.c (x86_arch_setup): Use
5061         linux_pid_exe_is_elf_64_file.
5062
5063 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
5064
5065         * linux-low.c (linux_wait_for_event_1): Rename to ...
5066         (linux_wait_for_event): ... here and merge it with former
5067         linux_wait_for_event - new variable wait_ptid, use it.
5068         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
5069
5070 2012-01-23  Pedro Alves  <palves@redhat.com>
5071
5072         * server.c (main): Avoid yet another case of infinite loop while
5073         detaching/killing after a longjmp.
5074
5075 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
5076
5077         Code cleanup.
5078         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
5079
5080 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
5081
5082         * hostio.c (handle_readlink): New function.
5083         (handle_vFile): Call it to handle "vFile:readlink" packets.
5084
5085 2012-01-20  Pedro Alves  <palves@redhat.com>
5086             Ulrich Weigand  <ulrich.weigand@linaro.org>
5087
5088         * server.c (handle_v_requests): Only support vAttach and vRun to
5089         start multiple processes when in extended protocol mode.
5090
5091 2012-01-17  Pedro Alves  <palves@redhat.com>
5092
5093         * tracepoint.c (initialize_tracepoint): Use mmap instead of
5094         memalign plus mprotect to allocate the scratch buffer.
5095
5096 2012-01-13  Pedro Alves  <palves@redhat.com>
5097
5098         * server.c (attach_inferior): Clear `cont_thread'.
5099
5100 2012-01-13  Pedro Alves  <palves@redhat.com>
5101
5102         * server.c (main): Avoid infinite loop while detaching/killing
5103         after a longjmp.
5104
5105 2012-01-09  Doug Evans  <dje@google.com>
5106
5107         * server.c (start_inferior): Set last_ptid in --wrapper case.
5108
5109 2012-01-06  Yao Qi  <yao@codesourcery.com>
5110
5111         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
5112         defined.
5113         [IN_PROCESS_AGENT] (debug_agent): New global variable.
5114
5115 2012-01-04  Yao Qi  <yao@codesourcery.com>
5116
5117         * tracepoint.c (cmd_qtdp): Print debug message
5118         for static tracepoint.
5119
5120 2012-01-04  Yao Qi  <yao@codesourcery.com>
5121
5122         * tracepoint.c (trace_vdebug): Differentiate debug message
5123         between gdbserver and IPA.
5124
5125 2012-01-03  Yao Qi  <yao@codesourcery.com>
5126
5127         * tracepoint.c (tracepoint_was_hit): Don't collect for
5128         static tracepoint.
5129
5130 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
5131
5132         * terminal.h: Reformat copyright header.
5133
5134 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
5135
5136         * server.c (gdbserver_version): Update copyright year.
5137         * gdbreplay.c (gdbreplay_version): Likewise.
5138
5139 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
5140
5141         * linux-low.c (linux_create_inferior): Put empty if clause for write.
5142
5143         Revert:
5144         2011-12-18  Hui Zhu  <teawater@gmail.com>
5145         * linux-low.c (linux_create_inferior): Save return value to ret.
5146
5147 2011-12-18  Hui Zhu  <teawater@gmail.com>
5148
5149         * linux-low.c (linux_create_inferior): Save return value to ret.
5150
5151 2011-12-16  Doug Evans  <dje@google.com>
5152
5153         * linux-low.c (linux_create_inferior): If stdio connection,
5154         redirect stdin from /dev/null, stdout to stderr.
5155         * remote-utils.c (remote_is_stdio): New static global.
5156         (remote_connection_is_stdio): New function.
5157         (remote_prepare): Handle stdio connection.
5158         (remote_open): Ditto.
5159         (remote_close): Don't close stdin for stdio connections.
5160         (read_prim,write_prim): New functions.  Replace all calls to
5161         read/write to these.
5162         * server.c (main): Watch for "-" argument.  Move call to
5163         remote_prepare before start_inferior.
5164         * server.h (STDIO_CONNECTION_NAME): New macro.
5165         (remote_connection_is_stdio): Declare.
5166
5167         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
5168         in debugging output.
5169
5170 2011-12-15  Yao Qi  <yao@codesourcery.com>
5171
5172         * tracepoint.c: Include sys/syscall.h.
5173         (gdb_ust_thread): Remove preprocessor conditional.
5174
5175 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
5176
5177         * linux-low.c (linux_detach_one_lwp): Call
5178         the_low_target.prepare_to_resume before detaching.
5179
5180 2011-12-14  Yao Qi  <yao@codesourcery.com>
5181
5182         * tracepoint.c (gdb_ust_thread): Don't ignore return value
5183         of write.
5184
5185 2011-12-14  Yao Qi  <yao@codesourcery.com>
5186
5187         * i386-low.c (i386_low_stopped_data_address): Initialize local
5188         variable `control'.
5189
5190 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
5191
5192         PR remote/13492
5193
5194         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
5195         DR_CONTROL unless necessary.  Extend comments.
5196         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
5197         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
5198
5199 2011-12-13  Yao Qi  <yao@codesourcery.com>
5200
5201         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
5202         macros.
5203         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
5204
5205 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
5206
5207         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
5208         Print new debug message for such case.
5209
5210 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
5211
5212         Fix overlapping memcpy.
5213         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
5214         the read_inferior_memory transfer.
5215         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
5216         write_inferior_memory transfer.
5217         (set_fast_tracepoint_jump): New variable buf.  Use it for the
5218         read_inferior_memory and write_inferior_memory transfers.
5219         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
5220         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
5221         Use it for the write_inferior_memory transfer.
5222         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
5223         buffers.
5224
5225 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
5226
5227         * linux-low.c (fetch_register, store_register): Make code
5228         consistent, fix formatting.
5229
5230 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
5231
5232         * linux-low.c (usr_store_inferior_registers): Factor out code
5233         to handle individual registers into...
5234         (store_register): ... this new function.
5235
5236 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
5237
5238         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
5239         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
5240         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
5241         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
5242         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
5243         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
5244         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
5245         (srv_xmlfiles): Add new XML files.
5246
5247         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
5248         and <sys/uio.h>.
5249         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
5250         (init_registers_s390_linux32v1): Add prototype.
5251         (init_registers_s390_linux32v2): Likewise.
5252         (init_registers_s390_linux64v1): Likewise.
5253         (init_registers_s390_linux64v2): Likewise.
5254         (init_registers_s390x_linux64v1): Likewise.
5255         (init_registers_s390x_linux64v2): Likewise.
5256         (s390_num_regs): Increment to 52.
5257         (s390_regmap): Add orig_r2 register.
5258         (s390_num_regs_3264): Increment to 68.
5259         (s390_regmap_3264): Add orig_r2 register.
5260         (s390_collect_ptrace_register): Handle orig_r2 register.
5261         (s390_supply_ptrace_register): Likewise.
5262         (s390_fill_last_break): New function.
5263         (s390_store_last_break): Likewise.
5264         (s390_fill_system_call): New function.
5265         (s390_store_system_call): Likewise.
5266         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
5267         register sets.
5268         (s390_check_regset): New function.
5269         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
5270         NT_S390_SYSTEM_CALL regsets and use appropriate description.
5271         Update target_regsets for available register sets.
5272
5273 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
5274             Jan Kratochvil  <jan.kratochvil@redhat.com>
5275
5276         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
5277         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
5278         New.
5279         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
5280         * linux-low.h (struct process_info_private): New member r_debug.
5281         * server.c (handle_qxfer_libraries): Call
5282         the_target->qxfer_libraries_svr4.
5283         (handle_qxfer_libraries_svr4): New function.
5284         (qxfer_packets): New entry "libraries-svr4".
5285         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
5286         * target.h (struct target_ops): New member qxfer_libraries_svr4.
5287         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
5288         PACKET_qXfer_libraries_svr4.
5289
5290 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
5291
5292         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
5293         PSW address/mask between 8-byte and 16-byte formats.
5294         (s390_supply_ptrace_register): Likewise.
5295         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
5296         basic addressing mode bit.
5297
5298 2011-11-24  Stan Shebs  <stan@codesourcery.com>
5299
5300         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
5301
5302 2011-11-17  Stan Shebs  <stan@codesourcery.com>
5303
5304         * tracepoint.c (struct tracepoint): New field traceframe_usage.
5305         (tracing_start_time): New global.
5306         (tracing_stop_time): New global.
5307         (tracing_user_name): New global.
5308         (tracing_notes): New global.
5309         (tracing_stop_note): New global.
5310         (cmd_qtstart): Set traceframe_usage, start_time.
5311         (stop_tracing): Set stop_time.
5312         (cmd_qtstatus): Report additional status.
5313         (cmd_qtp): New function.
5314         (handle_tracepoint_query): Call it.
5315         (cmd_qtnotes): New function.
5316         (handle_tracepoint_general_set): Call it.
5317         (get_timestamp): Rename from tsv_get_timestamp.
5318
5319 2011-11-14  Stan Shebs  <stan@codesourcery.com>
5320             Kwok Cheung Yeung  <kcy@codesourcery.com>
5321
5322         * linux-x86-low.c (small_jump_insn): New.
5323         (i386_install_fast_tracepoint_jump_pad): Add arguments for
5324         trampoline and error message, build a trampoline and issue a small
5325         jump instruction to it.
5326         (x86_install_fast_tracepoint_jump_pad): Add arguments for
5327         trampoline and error message.
5328         (x86_get_min_fast_tracepoint_insn_len): New.
5329         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
5330         * linux-low.h (struct linux_target_ops): Add arguments to
5331         install_fast_tracepoint_jump_pad operation, add new operation.
5332         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
5333         arguments.
5334         (linux_get_min_fast_tracepoint_insn_len): New function.
5335         (linux_target_op): Add new operation.
5336         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
5337         (gdb_trampoline_buffer_end): Ditto.
5338         (gdb_trampoline_buffer_error): Ditto.
5339         (struct ipa_sym_addresses): Add fields for new IPA variables.
5340         (symbol_list): Add entries for new IPA variables.
5341         (struct tracepoint): Add fields to hold the address range of the
5342         trampoline used by the tracepoint.
5343         (trampoline_buffer_head): New static variable.
5344         (trampoline_buffer_tail): Ditto.
5345         (claim_trampoline_space): New function.
5346         (have_fast_tracepoint_trampoline_buffer): New function.
5347         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
5348         structure.
5349         (install_fast_tracepoint): Ditto, also add error buffer argument.
5350         (cmd_qtminftpilen): New function.
5351         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
5352         (fast_tracepoint_from_trampoline_address): New function.
5353         (fast_tracepoint_collecting): Handle trampoline as part of jump
5354         pad space.
5355         (set_trampoline_buffer_space): New function.
5356         (initialize_tracepoint): Initialize new IPA variables.
5357         * target.h (struct target_ops): Add arguments to
5358         install_fast_tracepoint_jump_pad operation, add new
5359         get_min_fast_tracepoint_insn_len operation.
5360         (target_get_min_fast_tracepoint_insn_len): New.
5361         (install_fast_tracepoint_jump_pad): Add arguments.
5362         * server.h (IPA_BUFSIZ): Define.
5363         * linux-i386-ipa.c: Include extra header files.
5364         (initialize_fast_tracepoint_trampoline_buffer): New function.
5365         (initialize_low_tracepoint): Call it.
5366         * server.h (set_trampoline_buffer_space): Declare.
5367         (claim_trampoline_space): Ditto.
5368         (have_fast_tracepoint_trampoline_buffer): Ditto.
5369
5370 2011-11-14  Yao Qi  <yao@codesourcery.com>
5371
5372         * server.c (handle_query): Handle InstallInTrace for qSupported.
5373         * tracepoint.c (add_tracepoint): Sort list.
5374         (install_tracepoint, download_tracepoint): New.
5375         (cmd_qtdp): Call them to install and download tracepoints.
5376         (sort_tracepoints): Removed.
5377         (cmd_qtstart): Update.
5378
5379 2011-11-14  Yao Qi  <yao@codesourcery.com>
5380
5381         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
5382         * mem-break.h: Declare.
5383         * tracepoint.c (cmd_qtstart): Move some code to ...
5384         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
5385         New.
5386         (download_tracepoints): Move some code to ...
5387         (download_tracepoint_1): ... here.  New.
5388
5389 2011-11-08  Yao Qi  <yao@codesourcery.com>
5390
5391         * remote-utils.c (relocate_instruction): A comment fix.
5392
5393 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
5394
5395         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
5396         (i386_dr_low_get_control, i386_dr_low_get_status): Use
5397         dr_status_mirror and dr_control_mirror from debug_reg_state.
5398         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
5399         (i386_initial_stuff): Remove use of deleted globals.
5400         (i386_get_thread_context, i386_set_thread_context,
5401         i386_thread_added): Use dr_status_mirror and dr_control_mirror
5402         from debug_reg_state.
5403
5404 2011-11-05  Yao Qi  <yao@codesourcery.com>
5405
5406         * tracepoint.c (gdb_collect): Loop over tracepoints of same
5407         address as TPOINT's.
5408
5409 2011-11-02  Stan Shebs  <stan@codesourcery.com>
5410
5411         * tracepoint.c (agent_mem_read_string): New function.
5412         (eval_agent_expr): Call it for tracenz.
5413         * server.c (handle_query): Report support for tracenz.
5414
5415 2011-11-02  Yao Qi  <yao@codesourcery.com>
5416
5417         * tracepoint.c (cmd_qtstart): Remove unused local variables.
5418
5419 2011-11-02  Yao Qi  <yao@codesourcery.com>
5420
5421         * target.h: Fix a typo in comment.
5422
5423 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
5424
5425         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
5426         clobber the breakpoints' shadows with fast tracepoint jumps.
5427         * mem-break.h (check_mem_write): Add `myaddr' parameter.
5428         * target.c (write_inferior_memory): Also pass MYADDR down to
5429         check_mem_write.
5430
5431 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
5432
5433         * configure.ac: Check support for personality routine.
5434         * configure: Regenerate.
5435         * config.in: Likewise.
5436         * linux-low.c: Include <sys/personality.h>.
5437         Define ADDR_NO_RANDOMIZE if necessary.
5438         (linux_create_inferior): Disable address space randomization when
5439         forking inferior, if requested.
5440         (linux_supports_disable_randomization): New function.
5441         (linux_target_ops): Install it.
5442         * server.h (disable_randomization): Declare.
5443         * server.c (disable_randomization): New global variable.
5444         (handle_general_set): Handle QDisableRandomization.
5445         (handle_query): Likewise for qSupported.
5446         (main): Support --disable-randomization and --no-disable-randomization
5447         command line arguments.
5448         * target.h (struct target_ops): Add supports_disable_randomization.
5449         (target_supports_disable_randomization): New macro.
5450
5451 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
5452
5453         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
5454         ifdef check.
5455         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
5456         [!PT_GETDSBT] (target_loadmap): New definition.
5457         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
5458         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
5459         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
5460         and PT_GETDSBT to LINUX_LOADMAP.
5461         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
5462         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
5463
5464 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
5465
5466         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
5467         (arm_linux_hwbp_cap): New static variable.
5468         (arm_linux_get_hwbp_cap): Replace by ...
5469         (arm_linux_init_hwbp_cap): ... this new function.
5470         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
5471         (arm_linux_get_hw_watchpoint_count): Likewise.
5472         (arm_linux_get_hw_watchpoint_max_length): Likewise.
5473         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
5474         (arm_prepare_to_resume): Use perror_with_name instead of error.
5475
5476 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
5477
5478         * linux-arm-low.c: Include <signal.h>.
5479         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
5480         (struct arm_linux_hwbp_cap): New data type.
5481         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
5482         (struct arm_linux_hw_breakpoint): New data type.
5483         (MAX_BPTS, MAX_WPTS): Define.
5484         (struct arch_process_info, struct arch_lwp_info): New data types.
5485         (arm_linux_get_hwbp_cap): New function.
5486         (arm_linux_get_hw_breakpoint_count): Likewise.
5487         (arm_linux_get_hw_watchpoint_count): Likewise.
5488         (arm_linux_get_hw_watchpoint_max_length): Likewise.
5489         (arm_hwbp_control_initialize): Likewise.
5490         (arm_hwbp_control_is_enabled): Likewise.
5491         (arm_hwbp_control_is_initialized): Likewise.
5492         (arm_hwbp_control_disable): Likewise.
5493         (arm_linux_hw_breakpoint_equal): Likewise.
5494         (arm_linux_hw_point_initialize): Likewise.
5495         (struct update_registers_data): New data structure.
5496         (update_registers_callback: New function.
5497         (arm_insert_point): Likewise.
5498         (arm_remove_point): Likewise.
5499         (arm_stopped_by_watchpoint): Likewise.
5500         (arm_stopped_data_address): Likewise.
5501         (arm_new_process): Likewise.
5502         (arm_new_thread): Likewise.
5503         (arm_prepare_to_resume): Likewise.
5504         (the_low_target): Register arm_insert_point, arm_remove_point,
5505         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
5506         arm_new_thread, and arm_prepare_to_resume.
5507
5508 2011-09-15  Stan Shebs  <stan@codesourcery.com>
5509
5510         * server.h (struct emit_ops): Add compare-goto fields.
5511         * tracepoint.c (gdb_agent_op_sizes): New table.
5512         (emit_eq_goto): New function.
5513         (emit_ne_goto): New function.
5514         (emit_lt_goto): New function.
5515         (emit_le_goto): New function.
5516         (emit_gt_goto): New function.
5517         (emit_ge_goto): New function.
5518         (is_goto_target): New function.
5519         (compile_bytecodes): Recognize special cases of compare-goto
5520         combinations and call specialized emitters for them.
5521         * linux-x86-low.c (amd64_emit_eq_goto): New function.
5522         (amd64_emit_ne_goto): New function.
5523         (amd64_emit_lt_goto): New function.
5524         (amd64_emit_le_goto): New function.
5525         (amd64_emit_gt_goto): New function.
5526         (amd64_emit_ge_goto): New function.
5527         (amd64_emit_ops): Add the new functions.
5528         (i386_emit_eq_goto): New function.
5529         (i386_emit_ne_goto): New function.
5530         (i386_emit_lt_goto): New function.
5531         (i386_emit_le_goto): New function.
5532         (i386_emit_gt_goto): New function.
5533         (i386_emit_ge_goto): New function.
5534         (i386_emit_ops): Add the new functions.
5535
5536 2011-09-08  Stan Shebs  <stan@codesourcery.com>
5537
5538         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
5539         (i386_emit_epilogue): Restore %ebx.
5540
5541 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
5542
5543         * server.c (step_thread): Remove definition.
5544         (process_serial_event): Don't handle Hs.
5545         * server.h (step_thread): Remove declaration.
5546         * target.c (set_desired_inferior): Remove use of step_thread.
5547
5548 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
5549
5550         * linux-low.c: Include linux-procfs.h.
5551         (linux_attach_lwp_1): Update comments.
5552         (linux_attach): Scan for existing threads when attaching to a
5553         process that is the tgid.
5554         * Makefile.in: Update dependencies.
5555
5556 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
5557
5558         * configure.srv: Add linux-procfs.o dependencies.
5559
5560 2011-08-14  Yao Qi  <yao@codesourcery.com>
5561
5562         * target.h (struct target_ops): Fix indent.
5563         * win32-low.c (win32_target_ops): Fix comment.
5564
5565 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
5566             Yao Qi  <yao@codesourcery.com>
5567
5568         * Makefile.in (clean): Remove tic6x-*.c files.
5569         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
5570         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
5571         (tic6x-c64xp-linux.c): Likewise.
5572         * configure.srv: Add support for tic6x-*-uclinux.
5573         * linux-tic6x-low.c: New.
5574         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
5575
5576 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
5577             Yao Qi  <yao@codesourcery.com>
5578
5579         * target.h (struct target_ops): Add read_loadmap.
5580         * linux-low.c (struct target_loadseg): New type.
5581         (struct target_loadmap): New type.
5582         (linux_read_loadmap): New function.
5583         (linux_target_ops): Add linux_read_loadmap.
5584         * server.c (handle_query): Support qXfer:fdpic:read packet.
5585         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
5586         to NULL.
5587
5588 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
5589
5590         * win32-low.c: Include <stdint.h>.
5591
5592 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
5593
5594         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
5595         to the inferior here.
5596         (i386_remove_aligned_watchpoint): Ditto.
5597         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
5598         fit part of the watchpoint in the debug registers.
5599         (i386_update_inferior_debug_regs): New.
5600         (i386_low_insert_watchpoint): Work on a local mirror of the debug
5601         registers, and only update the inferior on success.
5602         (i386_low_remove_watchpoint): Ditto.
5603
5604 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
5605
5606         * linux-low.c (compare_ints, unique, list_threads, show_process,
5607         linux_core_of_thread): Delete.
5608         (linux_target_ops): Change linux_core_of_thread to
5609         linux_common_core_of_thread.
5610         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
5611         * utils.c (malloc_failure): Change type of argument.
5612         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
5613         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
5614         common/linux-osdata.c, common/ptid.c and common/buffer.c.
5615         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
5616         (IPA_OBJS): Add common-utils-ipa.o.
5617         (ptid_h, linux_osdata_h): New macros.
5618         (server_h): Add common/common-utils.h, common/xml-utils.h,
5619         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
5620         common/ptid.h.
5621         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
5622         ptid.o, buffer.o): New rules.
5623         (linux-low.o): Add common/linux-osdata.h as a dependency.
5624         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
5625         * configure.ac: Add AC_HEADER_DIRENT check.
5626         * config.in: Regenerate.
5627         * configure: Regenerate.
5628         * remote-utils.c (xml_escape_text): Delete.
5629         (buffer_grow, buffer_free, buffer_init, buffer_finish,
5630         buffer_xml_printf): Move to common/buffer.c.
5631         * server.c (main): Remove call to initialize_inferiors.
5632         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
5633         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
5634         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
5635         internal_error, gdb_assert, gdb_assert_fail): Delete.
5636         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
5637         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
5638         common/buffer.h.
5639         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
5640         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
5641         initialize_inferiors): Delete.
5642
5643 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
5644
5645         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
5646         symbol error.
5647
5648 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
5649
5650         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
5651         assertion.
5652         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
5653
5654 2011-05-26  Yao Qi  <yao@codesourcery.com>
5655
5656         * Makefile.in (thread-db.o): Track dependence to
5657         common/gdb_thread_db.h.
5658         * thread-db.c: include gdb_thread_db.h from right place.
5659
5660 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
5661
5662         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
5663         __FILE__ and __LINE__ to internal_error.
5664
5665 2011-05-13  Doug Evans  <dje@google.com>
5666
5667         * thread-db.c (try_thread_db_load_from_sdir): New function.
5668         (try_thread_db_load_from_dir): New function.
5669         (thread_db_load_search): Handle $sdir, ignore $pdir.
5670         Remove trying of system directories if search of
5671         libthread-db-search-path fails, that is now done via $sdir.
5672
5673 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
5674
5675         * server.c (handle_query): Add EnableDisableTracepoints to the list
5676         of supported features.
5677         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
5678         tracepoints.
5679         (cmd_qtenable_disable): New.
5680         (cmd_qtstart): Install tracepoints even if disabled.
5681         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
5682         receiving a QTEnable or QTDisable packet.
5683         (gdb_collect): Skip data collection if fast tracepoint is disabled.
5684         (ust_marker_to_static_tracepoint): Do not ignore disabled static
5685         tracepoints.
5686         (gdb_probe): Skip data collection if static tracepoint is disabled.
5687
5688 2011-05-10  Doug Evans  <dje@google.com>
5689
5690         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
5691
5692 2011-05-04  Doug Evans  <dje@google.com>
5693
5694         * linux-low.c (linux_join): Skip process lookup.
5695         * spu-low.c (spu_join): Ditto.
5696         * server.c (join_inferiors_callback): Delete.
5697         (process_serial_event): For 'D' packet (detach) call join_inferior
5698         directly.
5699
5700 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
5701
5702         * README: Don't mention xscale*-*-linux*.
5703         * configure.srv (xscale*-*-linux*): Don't handle target.
5704
5705 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
5706
5707         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
5708         casting pointers.
5709         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
5710         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
5711         (i386_emit_void_call_2): Likewise.
5712
5713 2011-04-26  Yao Qi  <yao@codesourcery.com>
5714
5715         * linux-low.c: Move common macros to linux-ptrace.h.
5716         Include linux-ptrace.h.
5717         * Makefile.in (linux_ptrace_h): New.
5718         (linux-low.o): Depends on linux-ptrace.h.
5719
5720 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
5721
5722         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
5723         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
5724         (remote_prepare): New function with most of the TCP code from ...
5725         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
5726         setting transport_is_reliable.
5727         * server.c (run_once): New variable.
5728         (gdbserver_usage): Document it.
5729         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
5730         the first run if RUN_ONCE.
5731         * server.h (run_once, remote_prepare): New declarations.
5732
5733 2011-04-19  Tom Tromey  <tromey@redhat.com>
5734
5735         * win32-low.c (handle_load_dll): Remove duplicate "the".
5736
5737 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
5738
5739         Remove support for old Cygwin 1.5 versions.
5740         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
5741         function to avoid warning.
5742         (win32_add_one_solib): Use cygwin_conv_path function to avoid
5743         warning.
5744
5745 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
5746
5747         * gdbserver/server.h (Macro _): Define it if not available.
5748
5749 2011-03-14  Michael Snyder  <msnyder@vmware.com>
5750
5751         * hostio.c (handle_close): Remove unnecessary null test.
5752
5753 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
5754
5755         * Makefile.in (maintainer-clean realclean distclean): Remove
5756         "make ...  subdir_do" command.
5757
5758 2011-03-10  Michael Snyder  <msnyder@vmware.com>
5759
5760         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
5761
5762         * server.c (handle_v_run): Free alloced buffer on early return.
5763
5764 2011-03-09  Yao Qi  <yao@codesourcery.com>
5765
5766         Revert:
5767         2011-03-04  Yao Qi  <yao@codesourcery.com>
5768
5769         * Makefile.in: Remove GNU make feature --directory.
5770
5771         2011-03-05  Yao Qi  <yao@codesourcery.com>
5772
5773         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
5774         (subdir_do): New make target.  Copied from gdb/Makefile.
5775         (maintainer-clean, realclean, distclean, clean): Call corresponding
5776         make targets in common/Makefile.
5777
5778         2011-02-11  Yao Qi  <yao@codesourcery.com>
5779
5780         * configure.ac: Call AC_PROG_RANLIB.
5781         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
5782         * configure: Regenerate.
5783
5784 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5785
5786         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
5787
5788 2011-03-06  Yao Qi  <yao@codesourcery.com>
5789
5790         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
5791
5792 2011-03-05  Yao Qi  <yao@codesourcery.com>
5793
5794         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
5795         (subdir_do): New make target.  Copied from gdb/Makefile.
5796         (maintainer-clean, realclean, distclean, clean): Call corresponding
5797         make targets in common/Makefile.
5798
5799 2011-03-04  Yao Qi  <yao@codesourcery.com>
5800
5801         * Makefile.in: Remove GNU make feature --directory.
5802
5803 2011-03-04  Michael Snyder  <msnyder@vmware.com>
5804
5805         * server.c (queue_stop_reply): Call xmalloc not malloc.
5806
5807 2011-03-02  Michael Snyder  <msnyder@vmware.com>
5808
5809         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
5810
5811 2011-02-28  Michael Snyder  <msnyder@vmware.com>
5812
5813         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
5814         (cmd_qtframe): Ditto.
5815         (cmd_qtbuffer): Ditto.
5816         (cmd_bigqtbuffer): Ditto.
5817
5818         * utils.c (decimal2str): Initialize 'width' to nine, then
5819         don't mess with it.
5820
5821 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
5822
5823         * hostio.c (require_data): Free *data, not data.
5824
5825 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5826
5827         * hostio.c (require_data): Use free, not xfree.
5828
5829 2011-02-27  Michael Snyder  <msnyder@vmware.com>
5830
5831         * server.c (handle_query): Discard unused value.
5832
5833         * hostio.c (require_data): Free malloc memory before returning
5834         error.
5835
5836 2011-02-26  Michael Snyder  <msnyder@vmware.com>
5837
5838         * linux-low.c (list_threads): Call closedir for dirent.
5839
5840 2011-02-27  Michael Snyder  <msnyder@vmware.com>
5841
5842         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
5843         a case statement falls through.
5844
5845         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
5846
5847         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
5848         in comparison.
5849
5850 2011-02-26  Michael Snyder  <msnyder@vmware.com>
5851
5852         * utils.c (decimal2str): Eliminate dead code and dead param.
5853         (pulongest): Drop dead param from call to decimal2str.
5854         (plongest): Ditto.
5855
5856 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
5857
5858         Revert the following patch (not approved yet):
5859         2011-02-21  Hui Zhu  <teawater@gmail.com>
5860         * tracepoint.c (tp_printf): New function.
5861         (eval_agent_expr): Handle gdb_agent_op_printf.
5862
5863 2011-02-21  Hui Zhu  <teawater@gmail.com>
5864
5865         * tracepoint.c (tp_printf): New function.
5866         (eval_agent_expr): Handle gdb_agent_op_printf.
5867
5868 2011-02-18  Tom Tromey  <tromey@redhat.com>
5869
5870         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
5871         (tracepoint.o): Likewise.
5872         * tracepoint.c (enum gdb_agent_op): Use ax.def.
5873         (gdb_agent_op_names): Likewise.
5874
5875 2011-02-18  Tom Tromey  <tromey@redhat.com>
5876
5877         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
5878         gdb_agent_op_rot>: New constants.
5879         (gdb_agent_op_names): Add pick and roll.
5880         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
5881         cases.
5882
5883 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
5884
5885         * aclocal.m4: Regenerated with aclocal-1.11.1.
5886
5887 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
5888
5889         * server.c (handle_qxfer_traceframe_info): New.
5890         (qxfer_packets): Register "traceframe-info".
5891         (handle_query): Report support for qXfer:traceframe-info:read+.
5892         * tracepoint.c (match_blocktype): New.
5893         (traceframe_find_block_type): Rename to ...
5894         (traceframe_walk_blocks): ... this.  Add callback filter argument,
5895         and use it.
5896         (traceframe_find_block_type): New, reimplemented on top of
5897         traceframe_walk_blocks.
5898         (build_traceframe_info_xml): New.
5899         (traceframe_read_info): New.
5900         * server.h (traceframe_read_info): Declare.
5901
5902 2011-02-11  Yao Qi  <yao@codesourcery.com>
5903
5904         * configure.ac: Call AC_PROG_RANLIB.
5905         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
5906         * configure: Regenerate.
5907
5908 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
5909
5910         * server.c (gdb_read_memory): Change return semantics to allow
5911         partial transfers.
5912         (handle_search_memory_1): Adjust.
5913         (process_serial_event) <'m' packet>: Handle partial transfers.
5914         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
5915
5916 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
5917
5918         * regcache.c (init_register_cache): Initialize
5919         regcache->register_status.
5920         (free_register_cache): Release regcache->register_status.
5921         (regcache_cpy): Copy register_status.
5922         (registers_to_string): Print 'x's for unavailable registers.
5923         (supply_register): Mark the register's status valid or
5924         unavailable, depending on whether a buffer was passed in or not.
5925         (supply_register_zeroed): New.
5926         (supply_regblock): Mark the registers' status valid or
5927         unavailable, depending on whether a buffer was passed in or not.
5928         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
5929         (struct regcache): New `register_status' field.
5930         (supply_register_zeroed): Declare.
5931         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
5932         supply_register_zeroed, rather than passing a NULL buffer to
5933         supply_register.
5934         * tracepoint.c (fetch_traceframe_registers): Update comment.
5935
5936 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
5937
5938         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
5939         buffer explicit.
5940
5941 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
5942
5943         * server.h (decode_xfer_write): Change prototype.
5944         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
5945         and don't extract the annex here.
5946         * server.c (decode_xfer_read): Remove `annex' parameter,
5947         and don't extract the annex here.
5948         (decode_xfer): New.
5949         (struct qxfer): New.
5950         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
5951         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
5952         (handle_qxfer_statictrace): New functions, abstracted out from
5953         handle_query, and made to use the struct qxfer interface.
5954         (handle_threads_qxfer_proper): Rename to ...
5955         (handle_qxfer_threads_proper): ... this.
5956         (handle_threads_qxfer): Rename to ...
5957         (handle_qxfer_threads): ... this.  Adjust.
5958         (qxfer_packets): New array.
5959         (handle_qxfer): New function.
5960         (handle_query): Use handle_qxfer.
5961
5962 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
5963
5964         * gdbreplay.c: Shorten lines of >= 80 columns.
5965         * linux-low.c: Ditto.
5966         * linux-ppc-low.c: Ditto.
5967         * linux-s390-low.c: Ditto.
5968         * linux-sparc-low.c: Ditto.
5969         * linux-x86-low.c: Ditto.
5970         * linux-xtensa-low.c: Ditto.
5971         * mem-break.c: Ditto.
5972         * nto-low.c: Ditto.
5973         * regcache.h: Ditto.
5974         * remote-utils.c: Ditto.
5975         * server.c: Ditto.
5976         * server.h: Ditto.
5977         * thread-db.c: Ditto.
5978         * tracepoint.c: Ditto.
5979         * utils.c: Ditto.
5980         * win32-low.h: Ditto.
5981
5982 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
5983
5984         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
5985         update.
5986
5987 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
5988
5989         * server.c (gdbserver_version): Update copyright year in version
5990         output.
5991         * gdbreplay.c (gdbreplay_version): Ditto.
5992
5993 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
5994
5995         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
5996         * linux-bfin-low.c: New file.
5997         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
5998         PT_DATA_ADDR for BFIN targets.
5999         * Makefile.in (SFILES): Add linux-bfin-low.c.
6000         (clean): Remove reg-bfin.c.
6001         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
6002         * README: Mention supported Blackfin targets.
6003
6004 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
6005
6006         * .gitignore: New file.
6007
6008 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
6009
6010         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
6011
6012 2010-10-22  Jie Zhang  <jie@codesourcery.com>
6013
6014         * Makefile.in: Add FLAGS_TO_PASS variable.
6015         (install): Remove dependency of install-only and recursively
6016         invoke make for install-only.
6017
6018 2010-10-04  Doug Evans  <dje@google.com>
6019
6020         * Makefile.in (uninstall): Use $(DESTDIR).
6021
6022 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
6023
6024         PR gdb/11842
6025
6026         * linux-x86-low.c (compat_siginfo_from_siginfo)
6027         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
6028         si_code is < 0.  Check for si_code == SI_TIMER before checking for
6029         si_code < 0.
6030
6031 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
6032
6033         * lynx-i386-low.c: New file.
6034         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
6035
6036 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
6037
6038         * lynx-low.c (ptrace_request_to_str): Remove handling for
6039         request values that have been removed in LynxOS 5.x.
6040
6041 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
6042
6043         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
6044         <ptrace.h>
6045
6046 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
6047
6048         * configure.ac: Add --enable-inprocess-agent option.
6049         * configure: Rebuilt.
6050
6051 2010-09-06  Yao Qi  <yao@codesourcery.com>
6052
6053         * linux-low.c (linux_kill): Remove unused variable.
6054         (linux_stabilize_threads): Likewise.
6055         * server.c (start_inferior): Likewise.
6056         (queue_stop_reply_callback): Likewise.
6057         * tracepoint.c (do_action_at_tracepoint): Likewise.
6058
6059 2010-09-06  Yao Qi  <yao@codesourcery.com>
6060
6061         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
6062         on return.
6063
6064 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
6065
6066         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
6067
6068 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
6069
6070         * Makefile.in (install-only): Replace $IPA_DEPFILES with
6071         "$(IPA_DEPFILES)".
6072
6073 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
6074
6075         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
6076         gdbserver/lynx-ppc-low.c: New files.
6077         * Makefile.in (lynx_low_h): New variable.
6078         (lynx-low.o, lynx-ppc-low.o): New rules.
6079         * configure.ac: On LynxOS, link with -lnetinet.
6080         * configure.srv: Add handling of powerpc-*-lynxos* targets.
6081         * configure: regenerate.
6082
6083 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
6084
6085         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
6086         * configure.ac: Add check for vasprintf and vsnprintf.
6087         * configure, config.in: Regenerate.
6088         * server.h (vasprintf, vsnprintf): Add conditional declarations.
6089
6090 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
6091
6092         * gdbreplay.c: Move include of alloca.h up, next to include of
6093         malloc.h.
6094         * server.h: Add include of malloc.h.
6095         * mem-break.c: Remove include of malloc.h.
6096         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
6097
6098 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
6099
6100         * Makefile.in (memmem.o): Build with -Wno-error.
6101
6102 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
6103
6104         * utils.c (xsnprintf): Make non-static.
6105         * server.h: Add xsnprintf declaration.
6106         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
6107         replace calls to snprintf by calls to xsnprintf throughout.
6108
6109 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
6110
6111         * configure.ac: Add configure check for alloca.
6112         * configure, config.in: Regenerate.
6113         * server.h: Include alloca.h if it exists.
6114         * gdbreplay.c: Include alloca.h if it exists.
6115
6116 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
6117
6118         * linux-low.c (__SIGRTMIN): Define if not already defined.
6119         (linux_create_inferior): Check for __ANDROID__ rather than
6120         __SIGRTMIN.
6121         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
6122         are already deferred.
6123         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
6124         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
6125         stopped and already has a pending signal to report.
6126         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
6127         a pending signal to report or is moving out of a jump pad.
6128         (linux_init_signals): Check for __ANDROID__ rather than
6129         __SIGRTMIN.
6130
6131 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
6132
6133         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
6134         debug_threads check.  Avoid a linear search when not doing debug
6135         output.
6136
6137 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
6138
6139         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
6140         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
6141         (struct file_handler) <fd>: Change type to gdb_fildes_t.
6142         (process_event): Change local fd's type to gdb_fildes_t.
6143         (create_file_handler): Adjust prototype.
6144         (delete_file_handler): Adjust prototype.
6145         (handle_file_event): Adjust prototype.  Use pfildes.
6146         (create_file_event): Adjsut prototype.
6147         * remote-utils.c (remote_desc, listen_desc): Change type to
6148         gdb_fildes_t.
6149         * server.h: New gdb_fildes_t typedef.
6150         [USE_WIN32API]: Include winsock2.h.
6151         (delete_file_handler, add_file_handler): Adjust prototypes.
6152         (pfildes): Declare.
6153         * utils.c (pfildes): New.
6154
6155 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
6156
6157         * configure.ac (build_warnings): Add -Wno-char-subscripts.
6158         * configure: Regenerate.
6159
6160 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
6161
6162         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
6163         (linux_done_accessing_memory): ... this.
6164         (linux_target_ops): Adjust.
6165         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
6166         * nto-low.c (nto_target_ops): Adjust comment.
6167         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
6168         * spu-low.c (spu_target_ops): Adjust comment.
6169         * target.h (target_ops): Rename unprepare_to_access_memory field
6170         to done_accessing_memory.
6171         (unprepare_to_access_memory): Rename to ...
6172         (done_accessing_memory): ... this.
6173
6174 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
6175
6176         * linux-low.c (linux_prepare_to_access_memory): New.
6177         (linux_unprepare_to_access_memory): New.
6178         (linux_target_ops): Install them.
6179         * server.c (read_memory): Rename to ...
6180         (gdb_read_memory): ... this.  Use
6181         prepare_to_access_memory/prepare_to_access_memory.
6182         (write_memory): Rename to ...
6183         (gdb_write_memory): ... this.  Use
6184         prepare_to_access_memory/prepare_to_access_memory.
6185         (handle_search_memory_1): Adjust.
6186         (process_serial_event): Adjust.
6187         * target.h (struct target_ops): New fields
6188         prepare_to_access_memory and unprepare_to_access_memory.
6189         (prepare_to_access_memory, unprepare_to_access_memory): New.
6190         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
6191         prepare_to_access_memory/prepare_to_access_memory.
6192         * nto-low.c (nto_target_ops): Adjust.
6193         * spu-low.c (spu_target_ops): Adjust.
6194         * win32-low.c (win32_target_ops): Adjust.
6195
6196 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
6197
6198         * Makefile.in (WARN_CFLAGS): Get it from configure.
6199         (WERROR_CFLAGS): New.
6200         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
6201         * configure.ac: Introduce --enable-werror, which adds -Werror to
6202         the compiler command line.  Enabled by default.  Disable with
6203         --disable-werror.  Add -Wdeclaration-after-statement
6204         Wpointer-arith and -Wformat-nonliteral to warning flags.
6205         * configure: Regenerate.
6206
6207 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
6208
6209         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
6210
6211 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
6212
6213         * gdbreplay.c (remote_error): New.
6214         (gdbchar): New.
6215         (expect): Use gdbchar.  Check for error reading from GDB.
6216         Clarify sync error output.
6217         (play): Check for errors writing to GDB.
6218         * linux-low.c (sigchld_handler): Really ignore `write' errors.
6219         * remote-utils.c (getpkt): Check for errors writing to the remote
6220         descriptor.
6221
6222 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
6223
6224         * linux-low.c (linux_wait_1): Move non-debugging code out of
6225         `debug_threads' control.
6226
6227 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
6228
6229         * linux-low.c (linux_wait_1): Don't set last_status here.
6230         * server.c (push_event, queue_stop_reply_callback): Assert we're
6231         not pushing a TARGET_WAITKIND_IGNORE event.
6232         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
6233         (myresume, handle_target_event): Set the thread's last_resume_kind
6234         and last_status from the target returned status.
6235
6236 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
6237
6238         PR threads/10729
6239
6240         * linux-x86-low.c (update_debug_registers_callback): New.
6241         (i386_dr_low_set_addr): Use it.
6242         (i386_dr_low_get_addr): New.
6243         (i386_dr_low_set_control): Use update_debug_registers_callback.
6244         (i386_dr_low_get_control): New.
6245         (i386_dr_low_get_status): Adjust.
6246         * linux-low.c (linux_stop_lwp): New.
6247         * linux-low.h (linux_stop_lwp): Declare.
6248
6249         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
6250         argument instead of a i386_debug_reg_state.
6251         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
6252         a i386_debug_reg_state.
6253         (i386_insert_aligned_watchpoint): Adjust.
6254         (i386_remove_aligned_watchpoint): Adjust.
6255         (i386_low_stopped_data_address): Read the debug registers from the
6256         inferior instead of from the mirrors.
6257         * i386-low.h (struct i386_debug_reg_state): Extend comment.
6258         (i386_dr_low_get_addr): Declare.
6259         (i386_dr_low_get_control): Declare.
6260         (i386_dr_low_get_status): Change prototype.
6261
6262         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
6263         (i386_dr_low_get_addr): New.
6264         (i386_dr_low_get_control): New.
6265         (i386_dr_low_get_status): Adjust prototype.  Return
6266         dr_status_mirror.
6267         (i386_initial_stuff): Clear dr_status_mirror and
6268         dr_control_mirror.
6269         (i386_get_thread_context): Adjust.
6270         (i386_set_thread_context): Adjust.
6271         (i386_thread_added): Adjust.
6272
6273 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
6274
6275         * linux-low.h (linux_thread_area): Delete declaration.
6276
6277 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
6278
6279         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
6280         after its termination.
6281
6282 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
6283
6284         * linux-low.c (gdb_wants_lwp_stopped): Delete.
6285         (gdb_wants_all_stopped): Delete.
6286         (linux_wait_1): Don't call them.
6287         * server.c (handle_v_cont): Tag all threads as want-stopped.
6288         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
6289         stopped as "client-wants-stopped".
6290
6291 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
6292
6293         * Makefile.in (signals_h): New.
6294         (server_h): Depend on it.
6295         (server.o): Don't depend on $(signals_def).
6296         (signals.o): Depend on $(signals_def).
6297
6298 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
6299
6300         * Makefile.in (signals_def): New.
6301         (server_h): Append include/gdb/signals.h and signals_def.
6302         (server.o): Append signals_def.
6303
6304 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6305
6306         * server.c (handle_target_event): Use target_signal_to_host for
6307         resume_info.sig initialization.
6308         * target.h (struct thread_resume) <sig>: New comment.
6309
6310 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
6311
6312         * server.c (handle_query): strcpy() the returned string from paddress()
6313         instead of sprintf().
6314         * utils.c (paddress): Return phex_nz().
6315
6316 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
6317
6318         * server.c (handle_v_cont): Call mourn_inferior if process
6319         just exited.
6320         (myresume): Likewise.
6321
6322 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
6323
6324         Static tracepoints, and integration with UST.
6325
6326         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
6327         * mem-break.c (uninsert_all_breakpoints)
6328         (reinsert_all_breakpoints): New.
6329         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
6330         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
6331         (gdb_agent_ust_loaded, helper_thread_id)
6332         (gdb_agent_helper_thread_id): New macros.
6333         (struct ipa_sym_addresses): Add addr_ust_loaded,
6334         addr_helper_thread_id, addr_cmd_buf.
6335         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
6336         (in_process_agent_loaded_ust): New.
6337         (write_e_ust_not_loaded): New.
6338         (maybe_write_ipa_ust_not_loaded): New.
6339         (struct collect_static_trace_data_action): New.
6340         (enum tracepoint_type) <static_tracepoint>: New.
6341         (struct tracepoint) <handle>: Mention static tracepoints.
6342         (struct static_tracepoint_ctx): New.
6343         (CMD_BUF_SIZE): New.
6344         (add_tracepoint_action): Handle static tracepoint actions.
6345         (unprobe_marker_at): New.
6346         (clear_installed_tracepoints): Handle static tracepoints.
6347         (cmd_qtdp): Handle static tracepoints.
6348         (probe_marker_at): New.
6349         (cmd_qtstart): Handle static tracepoints.
6350         (response_tracepoint): Handle static tracepoints.
6351         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
6352         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
6353         (get_context_regcache): Handle static tracepoints.
6354         (do_action_at_tracepoint): Handle static tracepoint actions.
6355         (traceframe_find_block_type): Handle static trace data blocks.
6356         (traceframe_read_sdata): New.
6357         (download_tracepoints): Download static tracepoint actions.
6358         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
6359         (GDB_PROBE_NAME): New.
6360         (ust_ops): New.
6361         (GET_UST_SYM): New.
6362         (USTF): New.
6363         (dlsym_ust): New.
6364         (ust_marker_to_static_tracepoint): New.
6365         (gdb_probe): New.
6366         (collect_ust_data_at_tracepoint): New.
6367         (gdb_ust_probe): New.
6368         (UNIX_PATH_MAX, SOCK_DIR): New.
6369         (gdb_ust_connect_sync_socket): New.
6370         (resume_thread, stop_thread): New.
6371         (run_inferior_command): New.
6372         (init_named_socket): New.
6373         (gdb_ust_socket_init): New.
6374         (cstr_to_hexstr): New.
6375         (next_st): New.
6376         (first_marker, next_marker): New.
6377         (response_ust_marker): New.
6378         (cmd_qtfstm, cmd_qtsstm): New.
6379         (unprobe_marker_at, probe_marker_at): New.
6380         (cmd_qtstmat, gdb_ust_thread): New.
6381         (gdb_ust_init): New.
6382         (initialize_tracepoint_ftlib): Call gdb_ust_init.
6383         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
6384         (ST_REGENTRY): New.
6385         (x86_64_st_collect_regmap): New.
6386         (X86_64_NUM_ST_COLLECT_GREGS): New.
6387         (AMD64_RIP_REGNUM): New.
6388         (supply_static_tracepoint_registers): New.
6389         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
6390         (ST_REGENTRY): New.
6391         (i386_st_collect_regmap): New.
6392         (i386_NUM_ST_COLLECT_GREGS): New.
6393         (supply_static_tracepoint_registers): New.
6394         * server.c (handle_query): Handle qXfer:statictrace:read.
6395         <qSupported>: Report support for StaticTracepoints, and
6396         qXfer:statictrace:read features.
6397         * server.h (traceframe_read_sdata)
6398         (supply_static_tracepoint_registers): Declare.
6399         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
6400         (unpack_varlen_hex): Include in IPA build.
6401         * Makefile.in (ustlibs, ustinc): New.
6402         (IPA_OBJS): Add remote-utils-ipa.o.
6403         ($(IPA_LIB)): Link -ldl and -lpthread.
6404         (UST_CFLAGS): New.
6405         (IPAGENT_CFLAGS): Add UST_CFLAGS.
6406         * config.in, configure: Regenerate.
6407
6408 2010-06-20  Ian Lance Taylor  <iant@google.com>
6409             Pedro Alves  <pedro@codesourcery.com>
6410
6411         * linux-x86-low.c (always_true): Delete.
6412         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
6413         trying to fool the compiler with always_true.
6414
6415 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
6416
6417         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
6418         conditions in gdbserver.
6419
6420 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
6421
6422         * spu-low.c (spu_read_memory): Wrap around local store limit.
6423         (spu_write_memory): Likewise.
6424
6425 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
6426
6427         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
6428         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
6429         LONGEST uses.
6430         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
6431         uses.
6432         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
6433         uses with LONGEST uses.
6434
6435 2010-06-14  Stan Shebs  <stan@codesourcery.com>
6436             Pedro Alves  <pedro@codesourcery.com>
6437
6438         Bytecode compiler.
6439
6440         * linux-x86-low.c: Include limits.h.
6441         (add_insns): New.
6442         (always_true): New.
6443         (EMIT_ASM): New.
6444         (EMIT_ASM32): New.
6445         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
6446         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
6447         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
6448         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
6449         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
6450         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
6451         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
6452         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
6453         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
6454         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
6455         (amd64_emit_void_call_2): New.
6456         (amd64_emit_ops): New.
6457         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
6458         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
6459         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
6460         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
6461         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
6462         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
6463         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
6464         (i386_emit_call, i386_emit_reg, i386_emit_pop)
6465         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
6466         (i386_emit_stack_adjust, i386_emit_int_call_1)
6467         (i386_emit_void_call_2): New.
6468         (i386_emit_ops): New.
6469         (x86_emit_ops): New.
6470         (the_low_target): Install x86_emit_ops.
6471         * server.h (struct emit_ops): New.
6472         (get_raw_reg_func_addr): Declare.
6473         (current_insn_ptr, emit_error): Declare.
6474         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
6475         (set_trace_state_variable_value): New defines.
6476         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
6477         addr_get_trace_state_variable_value and
6478         addr_set_trace_state_variable_value.
6479         (symbol_list): New fields for get_raw_reg,
6480         get_trace_state_variable_value and set_trace_state_variable_value.
6481         (condfn): New typedef.
6482         (struct tracepoint): New field `compiled_cond'.
6483         (do_action_at_tracepoint): Clear compiled_cond.
6484         (get_trace_state_variable_value, set_trace_state_variable_value):
6485         Export in the IPA.
6486         (condition_true_at_tracepoint): If there's a compiled condition,
6487         run that.
6488         (current_insn_ptr, emit_error): New globals.
6489         (struct bytecode_address): New.
6490         (get_raw_reg_func_addr): New.
6491         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
6492         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
6493         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
6494         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
6495         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
6496         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
6497         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
6498         (compile_tracepoint_condition, compile_bytecodes): New.
6499         * target.h (emit_ops): Forward declare.
6500         (struct target_ops): New field emit_ops.
6501         (target_emit_ops): New.
6502         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
6503         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
6504         * linux-low.c (linux_emit_ops): New.
6505         (linux_target_ops): Install it.
6506         * linux-low.h (struct linux_target_ops): New field emit_ops.
6507
6508 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
6509
6510         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
6511         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
6512
6513 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
6514             Stan Shebs  <stan@codesourcery.com>
6515
6516         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
6517         (all): Depend on $(extra_libraries).
6518         (install-only): Install the IPA.
6519         (IPA_OBJS, IPA_LIB): New.
6520         (clean): Remove the IPA lib.
6521         (IPAGENT_CFLAGS): New.
6522         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
6523         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
6524         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
6525         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
6526         * configure.ac: Check for atomic builtins support in the compiler.
6527         (IPA_DEPFILES, extra_libraries): Define.
6528         * configure.srv (ipa_obj): Add description.
6529         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
6530         (i[34567]86-*-linux*): Set ipa_obj.
6531         (x86_64-*-linux*): Set ipa_obj.
6532         * linux-low.c (stabilizing_threads): New.
6533         (supports_fast_tracepoints): New.
6534         (linux_detach): Stabilize threads before detaching.
6535         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
6536         the lwp is either not stabilizing, or is moving out of a jump pad.
6537         (linux_fast_tracepoint_collecting): New.
6538         (maybe_move_out_of_jump_pad): New.
6539         (enqueue_one_deferred_signal): New.
6540         (dequeue_one_deferred_signal): New.
6541         (linux_wait_for_event_1): If moving out of a jump pad, defer
6542         pending signals to later.
6543         (linux_stabilize_threads): New.
6544         (linux_wait_1): Check if threads need moving out of jump pads, and
6545         do it if so.
6546         (stuck_in_jump_pad_callback): New.
6547         (move_out_of_jump_pad_callback): New.
6548         (lwp_running): New.
6549         (linux_resume_one_lwp): Handle moving out of jump pads.
6550         (linux_set_resume_request): Dequeue deferred signals.
6551         (need_step_over_p): Also step over fast tracepoint jumps.
6552         (start_step_over): Also uninsert fast tracepoint jumps.
6553         (finish_step_over): Also reinsert fast tracepoint jumps.
6554         (linux_install_fast_tracepoint_jump): New.
6555         (linux_target_ops): Install linux_stabilize_threads and
6556         linux_install_fast_tracepoint_jump_pad.
6557         * linux-low.h (linux_target_ops) <get_thread_area,
6558         install_fast_tracepoint_jump_pad>: New fields.
6559         (struct lwp_info) <collecting_fast_tracepoint,
6560         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
6561         (linux_get_thread_area): Declare.
6562         * linux-x86-low.c (jump_insn): New.
6563         (x86_get_thread_area): New.
6564         (append_insns): New.
6565         (push_opcode): New.
6566         (amd64_install_fast_tracepoint_jump_pad): New.
6567         (i386_install_fast_tracepoint_jump_pad): New.
6568         (x86_install_fast_tracepoint_jump_pad): New.
6569         (the_low_target): Install x86_get_thread_area and
6570         x86_install_fast_tracepoint_jump_pad.
6571         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
6572         (struct fast_tracepoint_jump): New.
6573         (fast_tracepoint_jump_insn): New.
6574         (fast_tracepoint_jump_shadow): New.
6575         (find_fast_tracepoint_jump_at): New.
6576         (fast_tracepoint_jump_here): New.
6577         (delete_fast_tracepoint_jump): New.
6578         (set_fast_tracepoint_jump): New.
6579         (uninsert_fast_tracepoint_jumps_at): New.
6580         (reinsert_fast_tracepoint_jumps_at): New.
6581         (set_breakpoint_at): Use write_inferior_memory.
6582         (uninsert_raw_breakpoint): Use write_inferior_memory.
6583         (check_mem_read): Mask out fast tracepoint jumps.
6584         (check_mem_write): Mask out fast tracepoint jumps.
6585         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
6586         (set_fast_tracepoint_jump): Declare.
6587         (delete_fast_tracepoint_jump)
6588         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
6589         (reinsert_fast_tracepoint_jumps_at): Declare.
6590         * regcache.c: Don't compile many functions when building the
6591         in-process agent library.
6592         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
6593         the register buffer in the heap.
6594         (free_register_cache): If the register buffer isn't owned by the
6595         regcache, don't free it.
6596         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
6597         pre-existing register caches.
6598         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
6599         type.
6600         (convert_ascii_to_int): : Constify `from' parameter type.
6601         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
6602         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
6603         the needed buffer in-place.
6604         (relocate_instruction): New.
6605         * server.c (handle_query) <qSymbols>: If the target supports
6606         tracepoints, give it a chance of looking up symbols.  Report
6607         support for fast tracepoints.
6608         (handle_status): Stabilize threads.
6609         (process_serial_event): Adjust.
6610         * server.h (struct fast_tracepoint_jump): Forward declare.
6611         (struct process_info) <fast_tracepoint_jumps>: New field.
6612         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
6613         (decode_X_packet, decode_M_packet): Adjust.
6614         (relocate_instruction): Declare.
6615         (in_process_agent_loaded): Declare.
6616         (tracepoint_look_up_symbols): Declare.
6617         (struct fast_tpoint_collect_status): Declare.
6618         (fast_tracepoint_collecting): Declare.
6619         (force_unlock_trace_buffer): Declare.
6620         (handle_tracepoint_bkpts): Declare.
6621         (initialize_low_tracepoint)
6622         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
6623         * target.h (struct target_ops) <stabilize_threads,
6624         install_fast_tracepoint_jump_pad>: New fields.
6625         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
6626         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
6627         [HAVE_STDINT_H]: Include stdint.h.
6628         (trace_debug_1): Rename to ...
6629         (trace_vdebug): ... this.
6630         (trace_debug): Rename to ...
6631         (trace_debug_1): ... this.  Add `level' parameter.
6632         (trace_debug): New.
6633         (ATTR_USED, ATTR_NOINLINE): New.
6634         (IP_AGENT_EXPORT): New.
6635         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
6636         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
6637         (about_to_request_buffer_space, trace_buffer_is_full)
6638         (stopping_tracepoint, expr_eval_result, error_tracepoint)
6639         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
6640         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
6641         (traceframe_write_count, traceframes_created)
6642         (trace_state_variables)
6643         New renaming defines.
6644         (struct ipa_sym_addresses): New.
6645         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
6646         (symbol_list): New.
6647         (ipa_sym_addrs): New.
6648         (all_tracepoint_symbols_looked_up): New.
6649         (in_process_agent_loaded): New.
6650         (write_e_ipa_not_loaded): New.
6651         (maybe_write_ipa_not_loaded): New.
6652         (tracepoint_look_up_symbols): New.
6653         (debug_threads) [IN_PROCESS_AGENT]: New.
6654         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
6655         (UNKNOWN_SIDE_EFFECTS): New.
6656         (stop_tracing): New.
6657         (flush_trace_buffer): New.
6658         (stop_tracing_bkpt): New.
6659         (flush_trace_buffer_bkpt): New.
6660         (read_inferior_integer): New.
6661         (read_inferior_uinteger): New.
6662         (read_inferior_data_pointer): New.
6663         (write_inferior_data_pointer): New.
6664         (write_inferior_integer): New.
6665         (write_inferior_uinteger): New.
6666         (struct collect_static_trace_data_action): Delete.
6667         (enum tracepoint_type): New.
6668         (struct tracepoint) <type>: New field `type'.
6669         <actions_str, step_actions, step_actions_str>: Only include in
6670         GDBserver.
6671         <orig_size, obj_addr_on_target, adjusted_insn_addr>
6672         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
6673         (tracepoints): Use IP_AGENT_EXPORT.
6674         (last_tracepoint): Don't include in the IPA.
6675         (stopping_tracepoint): Use IP_AGENT_EXPORT.
6676         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
6677         (alloced_trace_state_variables): New.
6678         (trace_state_variables): Use IP_AGENT_EXPORT.
6679         (traceframe_t): Delete unused variable.
6680         (circular_trace_buffer): Don't include in the IPA.
6681         (trace_buffer_start): Delete.
6682         (struct trace_buffer_control): New.
6683         (trace_buffer_free): Delete.
6684         (struct ipa_trace_buffer_control): New.
6685         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
6686         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
6687         New.
6688         (trace_buffer_ctrl): New.
6689         (TRACE_BUFFER_CTRL_CURR): New.
6690         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
6691         Reimplement as macros.
6692         (trace_buffer_wrap): Delete.
6693         (traceframe_write_count, traceframe_read_count)
6694         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
6695         (struct tracepoint_hit_ctx) <type>: New field.
6696         (struct fast_tracepoint_ctx): New.
6697         (memory_barrier): New.
6698         (cmpxchg): New.
6699         (record_tracepoint_error): Update atomically in the IPA.
6700         (clear_inferior_trace_buffer): New.
6701         (about_to_request_buffer_space): New.
6702         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
6703         updating the same buffer.
6704         (add_tracepoint): Default the tracepoint's type to trap
6705         tracepoint, and orig_size to -1.
6706         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
6707         internal variables.
6708         (create_trace_state_variable): New parameter `gdb'.  Handle it.
6709         (clear_installed_tracepoints): Clear fast tracepoint jumps.
6710         (cmd_qtdp): Handle fast tracepoints.
6711         (cmd_qtdv): Adjust.
6712         (max_jump_pad_size): New.
6713         (gdb_jump_pad_head): New.
6714         (get_jump_space_head): New.
6715         (claim_jump_space): New.
6716         (sort_tracepoints): New.
6717         (MAX_JUMP_SIZE): New.
6718         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
6719         IPA.
6720         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
6721         support.  Upload fast traceframes, and delete internal IPA
6722         breakpoints.
6723         (stop_tracing_handler): New.
6724         (flush_trace_buffer_handler): New.
6725         (cmd_qtstop): Upload fast tracepoints.
6726         (response_tracepoint): Handle fast tracepoints.
6727         (tracepoint_finished_step): Upload fast traceframes.  Set the
6728         tracepoint hit context's tracepoint type.
6729         (handle_tracepoint_bkpts): New.
6730         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
6731         type.  Add comment about fast tracepoints.
6732         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
6733         non-existing action_str field.
6734         (get_context_regcache): Handle fast tracepoints.
6735         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
6736         to the regcache.
6737         (fast_tracepoint_from_jump_pad_address): New.
6738         (fast_tracepoint_from_ipa_tpoint_address): New.
6739         (collecting_t): New.
6740         (force_unlock_trace_buffer): New.
6741         (fast_tracepoint_collecting): New.
6742         (collecting): New.
6743         (gdb_collect): New.
6744         (write_inferior_data_ptr): New.
6745         (target_tp_heap): New.
6746         (target_malloc): New.
6747         (download_agent_expr): New.
6748         (UALIGN): New.
6749         (download_tracepoints): New.
6750         (download_trace_state_variables): New.
6751         (upload_fast_traceframes): New.
6752         (IPA_FIRST_TRACEFRAME): New.
6753         (IPA_NEXT_TRACEFRAME_1): New.
6754         (IPA_NEXT_TRACEFRAME): New.
6755         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
6756         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
6757         (gdb_jump_pad_buffer_end): New.
6758         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
6759         (initialize_tracepoint): Adjust.
6760         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
6761         buffer.  Initialize the low module.
6762         * utils.c (PREFIX, TOOLNAME): New.
6763         (malloc_failure): Use PREFIX.
6764         (error): In the IPA, an error causes an exit.
6765         (fatal, warning): Use PREFIX.
6766         (internal_error): Use TOOLNAME.
6767         (NUMCELLS): Increase to 10.
6768         * configure, config.in: Regenerate.
6769
6770 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
6771
6772         * server.c (handle_query) <qSupported>: Do two passes over the
6773         qSupported string to avoid nesting strtok.
6774
6775 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
6776
6777         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
6778         (CDEPS): New.
6779         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
6780         -Wl,--dynamic-list.
6781         * configure: Regenerate.
6782         * proc-service.list: New.
6783
6784 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
6785
6786         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
6787         New comment.
6788
6789 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
6790
6791         * gdbreplay.c (remote_open): Check error return from socket() call by
6792         its equality to -1 not by it being negative.
6793         * remote-utils.c (remote_open): Likewise.
6794
6795 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
6796
6797         * config.h: Regenerate.
6798
6799 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
6800
6801         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
6802         doesn't provide PTRACE_GET_THREAD_AREA.
6803
6804 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
6805
6806         * linux-m68k-low.c: Include <asm/ptrace.h>
6807         (ps_get_thread_area): Implement.
6808
6809 2010-05-03  Doug Evans  <dje@google.com>
6810
6811         * event-loop.c (struct callback_event): New struct.
6812         (callback_list): New global.
6813         (append_callback_event, delete_callback_event): New functions.
6814         (process_callback): New function.
6815         (start_event_loop): Call it.
6816         * remote-utils.c (NOT_SCHEDULED): Define.
6817         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
6818         moved out of readchar.
6819         (readchar): Rewrite.  Call reschedule before returning.
6820         (reset_readchar): New function.
6821         (remote_close): Call it.
6822         (process_remaining, reschedule): New functions.
6823         * server.h (callback_handler_func): New typedef.
6824         (append_callback_event, delete_callback_event): Declare.
6825
6826 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
6827
6828         * proc-service.c (ps_pglobal_lookup): Use
6829         thread_db_look_up_one_symbol.
6830         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
6831         parameter.  Use it instead of all_symbols_looked_up.
6832         * server.h (struct process_info) <all_symbols_looked_up>: Delete
6833         field.
6834         (all_symbols_looked_up): Don't declare.
6835         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
6836         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
6837         field.
6838         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
6839         Set all_symbols_looked_up here.
6840         (thread_db_look_up_one_symbol): New.
6841         (thread_db_get_tls_address): Adjust.
6842         (thread_db_load_search, try_thread_db_load_1): Always allocate the
6843         thread_db object on the heap, and tentatively set it in the
6844         process structure.
6845         (thread_db_init): Don't set all_symbols_looked_up here.
6846         * linux-low.h (thread_db_look_up_one_symbol): Declare.
6847
6848 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
6849
6850         * linux-low.c (linux_kill, linux_detach): Adjust.
6851         (status_pending_p_callback): Remove redundant statement.  Check
6852         for !TARGET_WAITIKIND_IGNORE, instead of
6853         TARGET_WAITKIND_STOPPED.
6854         (handle_tracepoints): Make sure LWP is locked.  Adjust.
6855         (linux_wait_for_event_1): Adjust.
6856         (linux_cancel_breakpoints): New.
6857         (unsuspend_one_lwp): New.
6858         (unsuspend_all_lwps): New.
6859         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
6860         (send_sigstop_callback): Change return type to int, add new
6861         `except' parameter and handle it.
6862         (suspend_and_send_sigstop_callback): New.
6863         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
6864         pass them down.  If SUSPEND, also increment the lwp's suspend
6865         count.
6866         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
6867         (need_step_over_p): Don't consider suspended LWPs.
6868         (start_step_over): Adjust.
6869         (proceed_one_lwp): Change return type to int, add new `except'
6870         parameter and handle it.
6871         (unsuspend_and_proceed_one_lwp): New.
6872         (proceed_all_lwps): Use find_inferior instead of
6873         for_each_inferior.
6874         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
6875         also decrement the suspend count of LWPs.  Pass `except' down,
6876         instead of hacking its suspend count.
6877         (linux_pause_all): Add `freeze' parameter.  Adjust.
6878         (linux_unpause_all): New.
6879         (linux_target_ops): Install linux_unpause_all.
6880         * server.c (handle_status): Adjust.
6881         * target.h (struct target_ops): New fields `unpause_all' and
6882         `cancel_breakpoints'.  Add new parameter to `pause_all'.
6883         (pause_all): Add new `freeze' parameter.
6884         (unpause_all): New.
6885         (cancel_breakpoints): New.
6886         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
6887         cancel breakpoints.
6888         (cmd_qtstart): Pause threads.
6889         (stop_tracing): Pause threads, and cancel breakpoints.
6890         * win32-low.c (win32_target_ops): Adjust.
6891
6892 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
6893
6894         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
6895         the inferior right away from here...
6896         (linux_wait_1): ... to here, and adjust to check the thread's
6897         last_resume_kind instead of the lwp's step or stop_expected flags.
6898
6899 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
6900
6901         * README: Use consistent `GDB' and `GDBserver' spellings.
6902
6903 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
6904
6905         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
6906         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
6907         (linux_detach_one_lwp): Assume the lwp is stopped.
6908         (any_thread_of): Delete.
6909         (linux_detach): Stop all lwps here.  Don't blindly delete all
6910         breakpoints.
6911         (delete_lwp_callback): New.
6912         (linux_mourn): Delete all lwps of the process that is gone.
6913         (linux_wait_1): Don't delete the last lwp of the process here.
6914         * mem-break.h (mark_breakpoints_out): Declare.
6915         * mem-break.c (mark_breakpoints_out): New.
6916         (free_all_breakpoints): Use it.
6917         * server.c (handle_target_event): If the process is gone, mark
6918         breakpoints out.
6919         * thread-db.c (struct thread_db) <create_bp>: New field.
6920         (thread_db_enable_reporting): Fix prototype.  Store a thread event
6921         breakpoint reference in the thread_db struct.
6922         (thread_db_load_search): Clear the thread_db object.
6923         (try_thread_db_load_1): Ditto.
6924         (switch_to_process): New.
6925         (disable_thread_event_reporting): Use it.
6926         (remove_thread_event_breakpoints): New.
6927         (thread_db_detach, thread_db_mourn): Use it.
6928
6929 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
6930
6931         * linux-low.c (linux_enable_event_reporting): New.
6932         (linux_wait_for_event_1, handle_extended_wait): Use it.
6933
6934 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
6935
6936         * linux-low.c (linux_kill_one_lwp, linux_kill)
6937         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
6938         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
6939         SIGSTOP even if the LWP is stopped.
6940         (send_sigstop_callback): New.
6941         (stop_all_lwps): Use send_sigstop_callback instead.
6942         (linux_resume_one_thread): Adjust.
6943         (proceed_one_lwp): Still proceed an LWP that the client has
6944         requested to stop, if we haven't reported it as stopped yet.  Make
6945         sure that LWPs the client want stopped, have a pending SIGSTOP.
6946
6947 2010-04-26  Doug Evans  <dje@google.com>
6948
6949         * server.c (handle_general_set): Make static.
6950
6951         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
6952         Print received char after testing for error/eof instead of before.
6953         (input_interrupt): Tweak comment.
6954
6955 2010-04-23  Doug Evans  <dje@google.com>
6956
6957         * server.c (start_inferior): Print inferior argv if --debug.
6958
6959 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
6960
6961         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
6962         * nto-x86-low.c: Include server.h
6963
6964 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
6965
6966         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
6967         be consistent with other sources of this directory.
6968         (init_registers_amd64): Correct name of source file of this function
6969         in the comment.
6970
6971 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6972
6973         * configure.srv (x86_64-*-mingw*): New configuration for Windows
6974         64-bit executables.
6975
6976 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6977
6978         * win32-i386-low.c: Add 64-bit support.
6979         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
6980         (init_registers_amd64): Declare.
6981         (mappings): Add 64-bit version of array.
6982         (init_windows_x86): New function.
6983         (the_low_target): Change init_arch field to init_windows_x86.
6984
6985 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6986
6987         * win32-low.c: Adapt to support also 64-bit architecture.
6988         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
6989         (get_image_name): Use SIZE_T type for local variable `done'.
6990         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
6991         (toolhelp_get_dll_name): Idem.
6992         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
6993         Use uintptr_t typecast to avoid warning.
6994         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
6995         (handle_exception): Use phex_nz to avoid warning.
6996         (win32_wait): Remove unused local variable `process'.
6997
6998 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6999
7000         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
7001         `amd64-avx.o'.
7002
7003 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
7004
7005         * configure.ac: Use `ws2_32' library for srv_mingw.
7006         * configure: Regenerate.
7007         * gdbreplay.c: Include winsock2.h instead of winsock.h.
7008         * remote-utils.c: Likewise.
7009
7010 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
7011
7012         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
7013         if __x86_64__ is defined.
7014
7015 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
7016
7017         * configure: Regenerate.
7018
7019 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
7020
7021         * server.c (handle_query): Handle 'qGetTIBAddr' query.
7022         * target.h (target_ops): New get_tib_address field.
7023         * win32-low.h (win32_thread_info): Add thread_local_base field.
7024         * win32-low.c (child_add_thread): Add tlb argument.
7025         Set thread_local_base field to TLB.
7026         (get_child_debug_event): Adapt to child_add_thread change.
7027         (win32_get_tib_address): New function.
7028         (win32_target_ops): Set get_tib_address field to
7029         win32_get_tib_address.
7030         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
7031
7032 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
7033
7034         * linux-low.c (linux_mourn): Also remove the process.
7035         * server.c (handle_target_event): Don't remove the process here.
7036         * nto-low.c (nto_mourn): New.
7037         (nto_target_ops): Install it.
7038         * spu-low.c (spu_mourn): New.
7039         (spu_target_ops): Install it.
7040         * win32-low.c (win32_mourn): New.
7041         (win32_target_ops): Install it.
7042
7043 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
7044
7045         * server.h (buffer_xml_printf): Remove redundant `;'.
7046
7047 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
7048
7049         * regcache.c (set_register_cache): Invalidate regcaches before
7050         changing the register cache layout.
7051         (regcache_invalidate_one): Allow a NULL regcache.
7052         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
7053         regcaches before changing the register cache layout or the target
7054         regsets.
7055
7056 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
7057
7058         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
7059         variable warning on Linux/x86-64.
7060
7061 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
7062
7063         GDBserver disconnected tracing support.
7064
7065         * linux-low.c (linux_remove_process): Delete.
7066         (add_lwp): Don't set last_resume_kind here.
7067         (linux_kill): Use `mourn'.
7068         (linux_detach): Use `thread_db_detach', and `mourn'.
7069         (linux_mourn): New.
7070         (linux_attach_lwp_1): Adjust comment.
7071         (linux_attach): last_resume_kind moved the thread_info; adjust.
7072         (status_pending_p_callback): Adjust.
7073         (linux_wait_for_event_1): Adjust.
7074         (count_events_callback, select_singlestep_lwp_callback)
7075         (select_event_lwp_callback, cancel_breakpoints_callback)
7076         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
7077         (proceed_one_lwp): Adjust.
7078         (linux_async): Add debug output.
7079         (linux_thread_stopped): New.
7080         (linux_pause_all): New.
7081         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
7082         linux_pause_all.
7083         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
7084         (thread_db_free): Delete declaration.
7085         (thread_db_detach, thread_db_mourn): Declare.
7086         * thread-db.c (thread_db_init): Use thread_db_mourn.
7087         (thread_db_free): Delete, split in two.
7088         (disable_thread_event_reporting): New.
7089         (thread_db_detach): New.
7090         (thread_db_mourn): New.
7091
7092         * server.h (struct thread_info) <last_resume_kind>: New field.
7093         <attached>: Add comment.
7094         <gdb_detached>: New field.
7095         (handler_func): Change return type to int.
7096         (handle_serial_event, handle_target_event): Ditto.
7097         (gdb_connected): Declare.
7098         (tracing): Delete.
7099         (disconnected_tracing): Declare.
7100         (stop_tracing): Declare.
7101
7102         * server.c (handle_query) <qSupported>: Report support for
7103         disconnected tracing.
7104         (queue_stop_reply_callback): Account for running threads.
7105         (gdb_wants_thread_stopped): New.
7106         (gdb_wants_all_threads_stopped): New.
7107         (gdb_reattached_process): New.
7108         (handle_status): Clear the `gdb_detached' flag of all processes.
7109         In all-stop, stop all threads.
7110         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
7111         (process_serial_event): If the remote connection breaks, or if an
7112         exit was forced with "monitor exit", force an event loop exit.
7113         Handle disconnected tracing on detach.
7114         (handle_serial_event): Adjust.
7115         (handle_target_event): If GDB isn't connected, forward events back
7116         to the inferior, unless the last process exited, in which case,
7117         exit gdbserver.  Adjust interface.
7118
7119         * remote-utils.c (remote_open): Don't block in accept.  Instead
7120         register an event loop source on the listen socket file
7121         descriptor.  Refactor bits into ...
7122         (listen_desc): ... this new global.
7123         (gdb_connected): ... this new function.
7124         (enable_async_notification): ... this new function.
7125         (handle_accept_event): ... this new function.
7126         (remote_close): Clear remote_desc.
7127
7128         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
7129
7130         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
7131         New fields.
7132         (mourn_inferior): Define.
7133         (target_process_qsupported): Avoid the dangling else problem.
7134         (thread_stopped): Define.
7135         (pause_all): Define.
7136         (target_waitstatus_to_string): Declare.
7137         * target.c (target_waitstatus_to_string): New.
7138
7139         * tracepoint.c (tracing): Make extern.
7140         (disconnected_tracing): New.
7141         (stop_tracing): Make extern.  Handle tracing stops due to GDB
7142         disconnecting.
7143         (cmd_qtdisconnected): New.
7144         (cmd_qtstatus): Report disconnected tracing status in trace reply.
7145         (handle_tracepoint_general_set): Handle QTDisconnected.
7146
7147         * event-loop.c (event_handler_func): Change return type to int.
7148         (process_event): Bail out if the event handler wants the event
7149         loop to stop.
7150         (handle_file_event): Ditto.
7151         (start_event_loop): Bail out if the event handler wants the event
7152         loop to stop.
7153
7154         * nto-low.c (nto_target_ops): Adjust.
7155         * spu-low.c (spu_wait): Don't remove the process here.
7156         (spu_target_ops): Adjust.
7157         * win32-low.c (win32_wait): Don't remove the process here.
7158         (win32_target_ops): Adjust.
7159
7160 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
7161
7162         * regcache.c (realloc_register_cache): Invalidate inferior's
7163         regcache before recreating it.
7164
7165 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
7166
7167         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
7168
7169 2010-04-09  Stan Shebs  <stan@codesourcery.com>
7170             Pedro Alves  <pedro@codesourcery.com>
7171
7172         * server.h (LONGEST): New.
7173         (struct thread_info) <while_stepping>: New field.
7174         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
7175         Declare.
7176         (initialize_tracepoint, handle_tracepoint_general_set)
7177         (handle_tracepoint_query, tracepoint_finished_step)
7178         (tracepoint_was_hit, release_while_stepping_state_list):
7179         (current_traceframe): Declare.
7180         * server.c (handle_general_set): Handle tracepoint packets.
7181         (read_memory): New.
7182         (write_memory): New.
7183         (handle_search_memory_1): Use read_memory.
7184         (handle_query): Report support for conditional tracepoints, trace
7185         state variables, and tracepoint sources.  Handle tracepoint
7186         queries.
7187         (main): Initialize the tracepoints module.
7188         (process_serial_event): Handle traceframe reads/writes.
7189
7190         * linux-low.c (handle_tracepoints): New.
7191         (linux_wait_1): Call it.
7192         (linux_resume_one_lwp): Handle while-stepping.
7193         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
7194         (linux_target_ops): Install them.
7195         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
7196         New field.
7197         * linux-x86-low.c (x86_supports_tracepoints): New.
7198         (the_low_target). Install it.
7199
7200         * mem-break.h (delete_breakpoint): Declare.
7201         * mem-break.c (delete_breakpoint): Make external.
7202
7203         * target.h (struct target_ops): Add `supports_tracepoints',
7204         `read_pc', and `write_pc' fields.
7205         (target_supports_tracepoints): Define.
7206         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
7207         (phex_nz): New.
7208
7209         * regcache.h (struct regcache) <registers_owned>: New field.
7210         (init_register_cache, regcache_cpy): Declare.
7211         (regcache_read_pc, regcache_write_pc): Declare.
7212         (register_cache_size): Declare.
7213         (supply_regblock): Declare.
7214         * regcache.c (init_register_cache): New.
7215         (new_register_cache): Use it.
7216         (regcache_cpy): New.
7217         (register_cache_size): New.
7218         (supply_regblock): New.
7219         (regcache_read_pc, regcache_write_pc): New.
7220
7221         * tracepoint.c: New.
7222
7223         * Makefile.in (OBS): Add tracepoint.o.
7224         (tracepoint.o): New rule.
7225
7226 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
7227
7228         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
7229         (i386-mmx.o): New.
7230         (i386-mmx.c): Likewise.
7231         (i386-mmx-linux.o): Likewise.
7232         (i386-mmx-linux.c): Likewise.
7233
7234         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
7235         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
7236         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
7237         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
7238
7239         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
7240         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
7241         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
7242
7243 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
7244
7245         * Makefile.in (clean): Updated.
7246         (i386-avx.o): New.
7247         (i386-avx.c): Likewise.
7248         (i386-avx-linux.o): Likewise.
7249         (i386-avx-linux.c): Likewise.
7250         (amd64-avx.o): Likewise.
7251         (amd64-avx.c): Likewise.
7252         (amd64-avx-linux.o): Likewise.
7253         (amd64-avx-linux.c): Likewise.
7254
7255         * configure.srv (srv_i386_regobj): Add i386-avx.o.
7256         (srv_i386_linux_regobj): Add i386-avx-linux.o.
7257         (srv_amd64_regobj): Add amd64-avx.o.
7258         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
7259         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
7260         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
7261         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
7262         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
7263         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
7264         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
7265
7266         * i387-fp.c: Include "i386-xstate.h".
7267         (i387_xsave): New.
7268         (i387_cache_to_xsave): Likewise.
7269         (i387_xsave_to_cache): Likewise.
7270         (x86_xcr0): Likewise.
7271
7272         * i387-fp.h (i387_cache_to_xsave): Likewise.
7273         (i387_xsave_to_cache): Likewise.
7274         (x86_xcr0): Likewise.
7275
7276         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
7277         * linux-crisv32-low.c (target_regsets): Likewise.
7278         * linux-m68k-low.c (target_regsets): Likewise.
7279         * linux-mips-low.c (target_regsets): Likewise.
7280         * linux-ppc-low.c (target_regsets): Likewise.
7281         * linux-s390-low.c (target_regsets): Likewise.
7282         * linux-sh-low.c (target_regsets): Likewise.
7283         * linux-sparc-low.c (target_regsets): Likewise.
7284         * linux-xtensa-low.c (target_regsets): Likewise.
7285
7286         * linux-low.c: Include <sys/uio.h>.
7287         (regsets_fetch_inferior_registers): Support nt_type.
7288         (regsets_store_inferior_registers): Likewise.
7289         (linux_process_qsupported): New.
7290         (linux_target_ops): Add linux_process_qsupported.
7291
7292         * linux-low.h (regset_info): Add nt_type.
7293         (linux_target_ops): Add process_qsupported.
7294
7295         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
7296         and <sys/uio.h>.
7297         (init_registers_i386_avx_linux): New.
7298         (init_registers_amd64_avx_linux): Likewise.
7299         (xmltarget_i386_linux_no_xml): Likewise.
7300         (xmltarget_amd64_linux_no_xml): Likewise.
7301         (PTRACE_GETREGSET): Likewise.
7302         (PTRACE_SETREGSET): Likewise.
7303         (x86_fill_xstateregset): Likewise.
7304         (x86_store_xstateregset): Likewise.
7305         (use_xml): Likewise.
7306         (x86_linux_update_xmltarget): Likewise.
7307         (x86_linux_process_qsupported): Likewise.
7308         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
7309         (x86_arch_setup): Don't call init_registers_amd64_linux nor
7310         init_registers_i386_linux here.  Call
7311         x86_linux_update_xmltarget.
7312         (the_low_target): Add x86_linux_process_qsupported.
7313
7314         * server.c (handle_query): Call target_process_qsupported.
7315
7316         * target.h (target_ops): Add process_qsupported.
7317         (target_process_qsupported): New.
7318
7319 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
7320
7321         * inferiors.c (add_thread): Set last_status kind to
7322         TARGET_WAITKIND_IGNORE.
7323         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
7324         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
7325         (linux_wait_1): Move `thread' local definition to block that uses
7326         it.  Don't NULL initialize `event_child'.
7327         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
7328         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
7329         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
7330
7331 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
7332
7333         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
7334         an extended waitstatus, or by a watchpoint.
7335         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
7336         thread was stepping or has been stopped by a watchpoint.
7337
7338 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
7339
7340         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
7341         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
7342         of another, then delete the previous, and validate all
7343         breakpoints.
7344         (validate_inserted_breakpoint): New.
7345         (delete_disabled_breakpoints): New.
7346         (validate_breakpoints): New.
7347         (check_mem_read): Validate breakpoints before trusting their
7348         shadow.  Delete disabled breakpoints.
7349         (check_mem_write): Validate breakpoints before trusting they
7350         should be inserted.  Delete disabled breakpoints.
7351         * mem-break.h (validate_breakpoints):
7352         * server.c (handle_query): Validate breakpoints when we see a
7353         qSymbol query.
7354
7355 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
7356
7357         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
7358         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
7359         if we could tell there's a GDB breakpoint at stop_pc.
7360         (need_step_over_p): Don't do a step over if we find a GDB
7361         breakpoint at the resume PC.
7362
7363         * mem-break.c (struct raw_breakpoint): New.
7364         (enum bkpt_type): New type `gdb_breakpoint'.
7365         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
7366         fields.  New field `raw'.
7367         (find_raw_breakpoint_at): New.
7368         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
7369         breakpoint instead.
7370         (set_breakpoint_at): Adjust.
7371         (delete_raw_breakpoint): New.
7372         (release_breakpoint): New.
7373         (delete_breakpoint): Rename to...
7374         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
7375         release_breakpoint.  Return ENOENT.
7376         (delete_breakpoint): Reimplement.
7377         (find_breakpoint_at): Delete.
7378         (find_gdb_breakpoint_at): New.
7379         (delete_breakpoint_at): Delete.
7380         (set_gdb_breakpoint_at): New.
7381         (delete_gdb_breakpoint_at): New.
7382         (gdb_breakpoint_here): New.
7383         (set_reinsert_breakpoint): Use release_breakpoint.
7384         (uninsert_breakpoint): Rename to ...
7385         (uninsert_raw_breakpoint): ... this.
7386         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
7387         (reinsert_raw_breakpoint): Change parameter type to
7388         raw_breakpoint.
7389         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
7390         instead.
7391         (check_breakpoints): Adjust.  Use release_breakpoint.
7392         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
7393         (breakpoint_inserted_here): Ditto.
7394         (check_mem_read): Adjust to iterate over raw breakpoints instead.
7395         Don't trust the breakpoint's shadow if it is not inserted.
7396         (check_mem_write): Adjust to iterate over raw breakpoints instead.
7397         (delete_all_breakpoints): Adjust.
7398         (free_all_breakpoints): Mark all breakpoints as uninserted, and
7399         use delete_breakpoint_1.
7400
7401         * mem-break.h (breakpoints_supported): Delete declaration.
7402         (set_gdb_breakpoint_at): Declare.
7403         (gdb_breakpoint_here): Declare.
7404         (delete_breakpoint_at): Delete.
7405         (delete_gdb_breakpoint_at): Declare.
7406
7407         * server.h (struct raw_breakpoint): Forward declare.
7408         (struct process_info): New field `raw_breakpoints'.
7409
7410         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
7411         breakpoints.
7412
7413 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
7414
7415         * linux-low.c (status_pending_p_callback): Fix comment.
7416         (linux_wait_for_event_1): Move most of the internal breakpoint
7417         handling from here...
7418         (linux_wait_1): ... to here.
7419         (count_events_callback): New.
7420         (select_singlestep_lwp_callback): New.
7421         (select_event_lwp_callback): New.
7422         (cancel_breakpoints_callback): New.
7423         (select_event_lwp): New.
7424         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
7425         priority to all LWPs that have had events that should be reported
7426         to the client.  Cancel breakpoints when about to reporting the
7427         event to the client, not while stopping lwps.  No longer cancel
7428         finished single-steps here.
7429         (cancel_finished_single_step): Delete.
7430         (cancel_finished_single_steps): Delete.
7431
7432 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
7433
7434         * mem-break.c (enum bkpt_type): New.
7435         (struct breakpoint): New field `type'.
7436         (set_breakpoint_at): Change return type to struct breakpoint
7437         pointer.  Set type to `other_breakpoint' by default.
7438         (delete_breakpoint): Rewrite, supporting more than one breakpoint
7439         in the breakpoint list.
7440         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
7441         (reinsert_breakpoint): Rename to ...
7442         (reinsert_raw_breakpoint): ... this.
7443         (reinsert_breakpoints_at): Adjust.
7444         * mem-break.h (struct breakpoint): Declare.
7445         (set_breakpoint_at): Change return type to struct breakpoint
7446         pointer.
7447
7448 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
7449
7450         * server.c (handle_query): Assign, not compare.
7451
7452 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
7453
7454         Teach linux gdbserver to step-over-breakpoints.
7455
7456         * linux-low.c (can_hardware_single_step): New.
7457         (supports_breakpoints): New.
7458         (handle_extended_wait): If stopping threads, read the stop pc of
7459         the new cloned LWP.
7460         (get_pc): New.
7461         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
7462         low target doesn't support retrieving the PC.
7463         (add_lwp): Set last_resume_kind to resume_continue.
7464         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
7465         (linux_attach): Don't clear stop_expected.  Set the lwp's
7466         last_resume_kind to resume_stop.
7467         (linux_detach_one_lwp): Don't check for removed breakpoints.
7468         (check_removed_breakpoint): Delete.
7469         (status_pending_p): Rename to ...
7470         (status_pending_p_callback): ... this.  Don't check for removed
7471         breakpoints.  Don't consider threads that are stopped from GDB's
7472         perspective.
7473         (linux_wait_for_lwp): Always read the stop_pc here.
7474         (cancel_breakpoint): New.
7475         (step_over_bkpt): New global.
7476         (linux_wait_for_event_1): Implement stepping over breakpoints.
7477         (gdb_wants_lwp_stopped): New.
7478         (gdb_wants_all_stopped): New.
7479         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
7480         single-step traps here.  Store the thread's last reported target
7481         wait status.
7482         (send_sigstop): Don't clear stop_expected.  Always set it,
7483         instead.
7484         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
7485         (cancel_finished_single_step): New.
7486         (cancel_finished_single_steps): New.
7487         (wait_for_sigstop): Don't cancel finished single-step traps here.
7488         (linux_resume_one_lwp): Don't check for removed breakpoints.
7489         Don't set `step' on non-hardware step archs.
7490         (linux_set_resume_request): Ignore resume_stop requests if already
7491         stopping or stopped.  Set the lwp's last_resume_kind.
7492         (resume_status_pending_p): Don't check for removed breakpoints.
7493         (need_step_over_p): New.
7494         (start_step_over): New.
7495         (finish_step_over): New.
7496         (linux_resume_one_thread): Always queue a sigstop for resume_stop
7497         requests.  Clear the thread's last reported target waitstatus.
7498         Don't use the `suspended' flag.  Don't consider pending breakpoints.
7499         (linux_resume): Start a step-over if necessary.
7500         (proceed_one_lwp): New.
7501         (proceed_all_lwps): New.
7502         (unstop_all_lwps): New.
7503         * linux-low.h (struct lwp_info): Rewrite comment for the
7504         `suspended' flag.  Add the `stop_pc' field.  Delete the
7505         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
7506         Add `'last_resume_kind' and `need_step_over' fields.
7507         * inferiors.c (struct thread_info): Delete, moved elsewhere.
7508         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
7509         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
7510         (set_raw_breakpoint_at): New.
7511         (set_breakpoint_at): Rewrite to use it.
7512         (reinsert_breakpoint_handler): Delete.
7513         (set_reinsert_breakpoint): New.
7514         (reinsert_breakpoint_by_bp): Delete.
7515         (delete_reinsert_breakpoints): New.
7516         (uninsert_breakpoint): Rewrite.
7517         (uninsert_breakpoints_at): New.
7518         (reinsert_breakpoint): Rewrite.
7519         (reinsert_breakpoints_at): New.
7520         (check_breakpoints): Rewrite.
7521         (breakpoint_here): New.
7522         (breakpoint_inserted_here): New.
7523         (check_mem_read): Adjust.
7524         * mem-break.h (breakpoints_supported, breakpoint_here)
7525         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
7526         (reinsert_breakpoint_by_bp): Delete declaration.
7527         (delete_reinsert_breakpoints): Declare.
7528         (reinsert_breakpoint): Delete declaration.
7529         (reinsert_breakpoints_at): Declare.
7530         (uninsert_breakpoint): Delete declaration.
7531         (uninsert_breakpoints_at): Declare.
7532         (check_breakpoints): Adjust prototype.
7533         * server.h: Adjust include order.
7534         (struct thread_info): Declare here.  Add a `last_status' field.
7535
7536 2010-03-23  Michael Snyder  <msnyder@vmware.com>
7537
7538         * server.c (crc32): New function.
7539         (handle_query): Add handling for 'qCRC:' request.
7540
7541 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
7542
7543         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
7544         lwp had been stopped by a watchpoint.
7545
7546 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
7547
7548         * server.h (internal_error): Declare.
7549         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
7550         * utils.c (internal_error): New function.
7551
7552 2010-03-15  Andreas Schwab  <schwab@redhat.com>
7553
7554         * configure.srv: Fix typo setting srv_regobj.
7555
7556 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
7557
7558         * linux-low.c (fetch_register): Avoid passing a non string literal
7559         format to `error'.
7560         (usr_store_inferior_registers): Ditto.
7561
7562 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
7563
7564         * linux-low.c (linux_write_memory): Bail out early if peeking
7565         memory failed.
7566
7567 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
7568
7569         * linux-low.h (struct lwp_info): New fields
7570         `stopped_by_watchpoint' and `stopped_data_address'.
7571         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
7572         here, and cache them in the lwp object.
7573         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
7574         directly.
7575         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
7576         field.
7577         (linux_stopped_by_watchpoint): Rewrite.
7578         (linux_stopped_data_address): Rewrite.
7579
7580 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
7581
7582         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
7583         switching the current inferior, not before.
7584
7585 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
7586
7587         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
7588         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
7589         i386-linux.c and amd64-linux.c.
7590         (reg-i386.o): Removed.
7591         (reg-i386.c): Likewise.
7592         (reg-i386-linux.o): Likewise.
7593         (reg-i386-linux.c): Likewise.
7594         (reg-x86-64.o): Likewise.
7595         (reg-x86-64.c): Likewise.
7596         (reg-x86-64-linux.o): Likewise.
7597         (reg-x86-64-linux.c): Likewise.
7598         (i386.o): New.
7599         (i386.c): Likewise.
7600         (i386-linux.o): Likewise.
7601         (i386-linux.c): Likewise.
7602         (amd64.o): Likewise.
7603         (amd64.c): Likewise.
7604         (amd64-linux.o): Likewise.
7605         (amd64-linux.c): Likewise.
7606
7607         * configure.srv (srv_i386_regobj): New.
7608         (srv_i386_linux_regobj): Likewise.
7609         (srv_amd64_regobj): Likewise.
7610         (srv_amd64_linux_regobj): Likewise.
7611         (srv_i386_32bit_xmlfiles): Likewise.
7612         (srv_i386_64bit_xmlfiles): Likewise.
7613         (srv_i386_xmlfiles): Likewise.
7614         (srv_amd64_xmlfiles): Likewise.
7615         (srv_i386_linux_xmlfiles): Likewise.
7616         (srv_amd64_linux_xmlfiles): Likewise.
7617         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
7618         srv_xmlfiles to $srv_i386_xmlfiles.
7619         (i[34567]86-*-mingw32ce*): Likewise.
7620         (i[34567]86-*-mingw*): Likewise.
7621         (i[34567]86-*-nto*): Likewise.
7622         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
7623         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
7624         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
7625         (x86_64-*-linux*): Likewise.
7626
7627         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
7628         (init_registers_amd64_linux): New.
7629         (x86_arch_setup): Replace init_registers_x86_64_linux with
7630         init_registers_amd64_linux.
7631
7632 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
7633
7634         * configure.ac: Check for libdl.  If it is not available link against
7635         static libthread_db.
7636         * configure: Regenerate.
7637
7638 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
7639
7640         PR9605
7641
7642         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
7643         handing a read watchpoint.
7644         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
7645
7646 2010-02-12  Doug Evans  <dje@google.com>
7647
7648         * linux-low.c (linux_supports_tracefork_flag): Document.
7649         (linux_look_up_symbols): Add comment.
7650
7651 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
7652
7653         * regcache.c (supply_register): Clear regcache if buf is NULL.
7654
7655 2010-02-02  Nicolas Roche  <roche@sourceware.org>
7656             Joel Brobecker  <brobecker@adacore.com>
7657
7658         * inferiors.c (find_inferior): Add function documentation.
7659         (unloaded_dll): Handle the case where the unloaded dll has not
7660         been previously registered in the dll list.
7661
7662 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
7663
7664         * linux-arm-low.c (thumb_breakpoint_len): Delete.
7665         (thumb2_breakpoint): New.
7666         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
7667
7668 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
7669
7670         * linux-low.c (get_stop_pc): Check for SIGTRAP.
7671         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
7672         breakpoints.
7673
7674 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
7675
7676         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
7677
7678 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
7679
7680         * linux-s390-low.c (s390_collect_ptrace_register)
7681         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
7682
7683 2010-01-21  Doug Evans  <dje@google.com>
7684
7685         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
7686         (PTRACE_ARG4_TYPE): New macro.
7687         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
7688         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
7689         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
7690         (usr_store_inferior_registers): Ditto.
7691         (linux_read_memory, linux_write_memory): Ditto.
7692         (linux_test_for_tracefork): Ditto.
7693
7694         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
7695         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
7696
7697 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
7698
7699         * proc-service.c (ps_lgetregs): Don't refetch registers from the
7700         target.
7701
7702 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
7703
7704         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
7705         prototype to take a regcache.  Adjust.
7706
7707 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
7708
7709         * regcache.h (struct thread_info): Forward declare.
7710         (struct regcache): New.
7711         (new_register_cache): Adjust prototype.
7712         (get_thread_regcache): Declare.
7713         (free_register_cache): Adjust prototype.
7714         (registers_to_string, registers_from_string): Ditto.
7715         (supply_register, supply_register_by_name, collect_register)
7716         (collect_register_as_string, collect_register_by_name): Ditto.
7717         * regcache.c (struct inferior_regcache_data): Delete.
7718         (get_regcache): Rename to ...
7719         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
7720         fetching registers.
7721         (regcache_invalidate_one): Adjust.
7722         (regcache_invalidate): Fix prototype.
7723         (new_register_cache): Return the new register cache.
7724         (free_register_cache): Change prototype.
7725         (realloc_register_cache): Adjust.
7726         (registers_to_string): Change prototype to take a regcache.  Adjust.
7727         (registers_from_string): Ditto.
7728         (register_data): Ditto.
7729         (supply_register): Ditto.
7730         (supply_register_by_name): Ditto.
7731         (collect_register): Ditto.
7732         (collect_register_as_string): Ditto.
7733         (collect_register_by_name): Ditto.
7734         * server.c (process_serial_event): Adjust.
7735         * linux-low.h (regset_fill_func, regset_store_func): Change
7736         prototype.
7737         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
7738         Change prototype.
7739         * linux-low.c (get_stop_pc): Adjust.
7740         (check_removed_breakpoint): Adjust.
7741         (linux_wait_for_event): Adjust.
7742         (linux_resume_one_lwp): Adjust.
7743         (fetch_register): Add regcache parameter.  Adjust.
7744         (usr_store_inferior_registers): Ditto.
7745         (regsets_fetch_inferior_registers): Ditto.
7746         (regsets_store_inferior_registers): Ditto.
7747         (linux_fetch_registers, linux_store_registers): Ditto.
7748         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
7749         regcache.  Adjust.
7750         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
7751         Ditto.
7752         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
7753         prototype to take a regcache.
7754         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
7755         * remote-utils.c (convert_ascii_to_int, outreg)
7756         (prepare_resume_reply): Change prototype to take a regcache.
7757         Adjust.
7758         * target.h (struct target_ops) <fetch_registers, store_registers>:
7759         Change prototype to take a regcache.
7760         (fetch_inferior_registers, store_inferior_registers): Change
7761         prototype to take a regcache.  Adjust.
7762         * proc-service.c (ps_lgetregs): Adjust.
7763         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
7764         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
7765         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
7766         take a regcache.  Adjust.
7767         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
7768         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
7769         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
7770         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
7771         * linux-cris-low.c (cris_get_pc, cris_set_pc)
7772         (cris_cannot_fetch_register):
7773         (cris_breakpoint_at): Change prototype to take a regcache.
7774         Adjust.
7775         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
7776         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
7777         to take a regcache.  Adjust.
7778         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
7779         Adjust.
7780         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
7781         take a regcache.  Adjust.
7782         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
7783         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
7784         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
7785         * linux-mips-low.c (mips_get_pc):
7786         (mips_set_pc): Change prototype to take a regcache.  Adjust.
7787         (mips_reinsert_addr): Adjust.
7788         (mips_collect_register): Change prototype to take a regcache.
7789         Adjust.
7790         (mips_supply_register):
7791         (mips_collect_register_32bit, mips_supply_register_32bit)
7792         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
7793         (mips_store_fpregset): Ditto.
7794         * linux-ppc-low.c (ppc_supply_ptrace_register)
7795         (ppc_supply_ptrace_register): Ditto.
7796         (parse_spufs_run): Adjust.
7797         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
7798         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
7799         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
7800         take a regcache.  Adjust.
7801         * linux-s390-low.c (s390_collect_ptrace_register)
7802         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
7803         (s390_set_pc): Change prototype to take a regcache.  Adjust.
7804         (s390_arch_setup): Adjust.
7805         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
7806         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
7807         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
7808         (sparc_fill_gregset, sparc_store_gregset_from_stack)
7809         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
7810         regcache.  Adjust.
7811         (sparc_breakpoint_at): Adjust.
7812         * linux-xtensa-low.c (xtensa_fill_gregset):
7813         (xtensa_store_gregset):
7814         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
7815         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
7816         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
7817         prototype to take a regcache.  Adjust.
7818         * win32-arm-low.c (arm_fetch_inferior_register)
7819         (arm_store_inferior_register): Change prototype to take a
7820         regcache.  Adjust.
7821         * win32-i386-low.c (i386_fetch_inferior_register)
7822         (i386_store_inferior_register): Change prototype to take a
7823         regcache.  Adjust.
7824         * win32-low.c (child_fetch_inferior_registers)
7825         (child_store_inferior_registers): Change prototype to take a
7826         regcache.  Adjust.
7827         (win32_wait): Adjust.
7828         (win32_fetch_inferior_registers): Change prototype to take a
7829         regcache.  Adjust.
7830         (win32_store_inferior_registers): Adjust.
7831         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
7832         store_inferior_register>: Change prototype to take a regcache.
7833
7834 2010-01-20  Doug Evans  <dje@google.com>
7835
7836         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
7837         #ifdef.
7838         (linux_wait_for_event1, linux_init_signals): Ditto.
7839         (W_STOPCODE): Provide definition if missing.
7840
7841 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
7842
7843         * linux-low.c (linux_core_of_thread): New.
7844         (compare_ints, show_process, list_threads): New.
7845         (linux_qxfer_osdata): Report threads and cores.
7846         (linux_target_op): Register linux_core_of_thread.
7847         * remote-utils.c (prepare_resume_reply): Report the core.
7848         (buffer_xml_printf): Support %d specifier.
7849         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
7850         New.
7851         (handle_query): Handle qXfer:threads.  Announce availability
7852         thereof.
7853         * target.h (struct target_ops): New field core_of_thread.
7854
7855 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
7856
7857         * Makefile.in (clean): Remove new generated files.
7858         (reg-s390.o, reg-s390.c): Remove rules.
7859         (reg-s390x.o, reg-s390x.c): Likewise.
7860         (s390-linux32.o, s390-linux32.c): Add rules.
7861         (s390-linux64.o, s390-linux64.c): Likewise.
7862         (s390x-linux64.o, s390x-linux64.c): Likewise.
7863         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
7864         * linux-s390-low.c: Include <elf.h>.
7865         (HWCAP_S390_HIGH_GPRS): Define if undefined.
7866         (init_registers_s390): Remove prototype.
7867         (init_registers_s390x): Likewise.
7868         (init_registers_s390_linux32): Add prototype.
7869         (init_registers_s390_linux64): Likewise.
7870         (init_registers_s390x_linux64): Likewise.
7871         (s390_num_regs_3264): New define.
7872         (s390_regmap_3264): New global variable.
7873         (s390_cannot_fetch_register): Remove obsolete check.
7874         (s390_cannot_store_register): Likewise.
7875         (s390_collect_ptrace_register): Handle upper/lower register halves.
7876         (s390_supply_ptrace_register): Likewise.
7877         (s390_fill_gregset): Update to register number changes.
7878         (s390_get_hwcap): New routine.
7879         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
7880         Install appropriate regmap and register set.
7881
7882 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
7883
7884         * server.c (gdbserver_version): Update copyright year to 2010.
7885         * gdbreplay.c (gdbreplay_version): Likewise.
7886
7887 2009-12-28  Doug Evans  <dje@google.com>
7888
7889         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
7890         elf/external.h.  Include <elf.h> instead but only if necessary.
7891
7892 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
7893
7894         * linux-low.c (linux_remove_process): Remove `detaching'
7895         parameter.  Don't release/detach from thread_db here.
7896         (linux_kill): Release/detach from thread_db here, ...
7897         (linux_detach): ... and here, before actually detaching.
7898         (linux_wait_1): ... and here, when a process exits.
7899         * thread-db.c (any_thread_of): New.
7900         (thread_db_free): Switch the current inferior to a thread of the
7901         passed in process.
7902
7903 2009-12-21  Doug Evans  <dje@google.com>
7904
7905         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
7906
7907         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
7908         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
7909         warning ifndef __NR_tkill.  Move setting of errno there too.
7910         Delete unnecessary resetting of errno after syscall.
7911         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
7912
7913         * configure.ac: Check for dladdr.
7914         * config.in: Regenerate.
7915         * configure: Regenerate.
7916         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
7917         (try_thread_db_load): Update.
7918
7919         * linux-low.c (my_waitpid): Delete unnecessary prototype.
7920
7921 2009-12-18  Doug Evans  <dje@google.com>
7922
7923         * event-loop.c: Include unistd.h if it exists.
7924
7925         * linux-low.c (my_waitpid): Move definition away from being in
7926         between linux_tracefork_child/linux_test_for_tracefork.
7927
7928         * gdb_proc_service.h (psaddr_t): Fix type.
7929         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
7930         signature to match glibc.
7931
7932 2009-12-16  Doug Evans  <dje@google.com>
7933
7934         * linux-low.c (linux_read_memory): Fix argument to read.
7935
7936 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
7937
7938         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
7939         events, don't leave current_inferior pointing at null.
7940
7941 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
7942
7943         * win32-low.c (LOG): Delete.
7944         (OUTMSG): Output to stderr.
7945         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
7946         on compile time LOG macro.
7947         (win32_wait): Fix debug output.
7948
7949 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
7950
7951         * win32-low.c (win32_add_one_solib): If the dll name is
7952         "ntdll.dll", prepend the system directory to the dll path.
7953
7954 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
7955
7956         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
7957
7958 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
7959             Vladimir Prus  <vladimir@codesourcery.com>
7960
7961         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
7962         * configure.ac: Check for __mcoldfire__ and set
7963         gdb_cv_m68k_is_coldfire.
7964         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
7965         reg-cf.o and reg-m68k.o.
7966         * configure: Regenerated.
7967
7968 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
7969
7970         * linux-low.c (linux_remove_process): Add `detaching' parameter.
7971         Pass it to thread_db_free.
7972         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
7973         proper `detaching' argument to linux_remove_process.
7974         * linux-low.h (thread_db_free): Add `detaching' parameter.
7975         * thread-db.c (thread_db_init): Pass false as `detaching' argument
7976         to thread_db_free.
7977         (thread_db_free): Add `detaching' parameter.  Only
7978         call td_ta_clear_event if detaching from process.
7979
7980 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
7981
7982         * thread-db.c (thread_db_free): Fix typo.
7983
7984 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
7985
7986         PR gdb/10838
7987         * thread-db.c (thread_db_free): Call td_ta_clear_event.
7988
7989 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
7990
7991         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
7992         with an i686 compiler.
7993         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
7994         needed.
7995         * configure: Rebuilt.
7996
7997 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
7998
7999         PR gdb/10783
8000
8001         * server.c (handle_search_memory_1): Correct read_addr initialization
8002         in loop for searching subsequent chunks.
8003
8004 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
8005
8006         * configure.ac: New --with-libthread-db option.
8007         * thread-db.c: Allow direct dependence on libthread_db.
8008         (thread_db_free): Adjust.
8009         * config.in: Regenerate.
8010         * configure: Likewise.
8011
8012 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
8013
8014         PR gdb/10757
8015         * thread-db.c (attach_thread): New function.
8016         (maybe_attach_thread): Return success/failure.
8017         (find_new_threads_callback): Adjust.
8018         (thread_db_find_new_threads): Loop until no new threads.
8019
8020 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
8021
8022         * proc-service.c (ps_lgetregs): Formatting.
8023
8024 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
8025
8026         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
8027         * configure.ac: Adjust.
8028         * linux-low.h (struct process_info_private): Move members to struct
8029         thread_db.
8030         (thread_db_free, thread_db_handle_monitor_command): New prototype.
8031         * linux-low.c (linux_remove_process): Adjust.
8032         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
8033         * server.c (handle_query): Move code ...
8034         (handle_monitor_command): ... here. New function.
8035         * target.h (struct target_ops): New member.
8036         * thread-db.c (struct thread_db): New.
8037         (libthread_db_search_path): New variable.
8038         (thread_db_create_event, thread_db_enable_reporting)
8039         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
8040         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
8041         (try_thread_db_load_1, dladdr_to_soname): New functions.
8042         (try_thread_db_load, thread_db_load_search): New functions.
8043         (thread_db_init): Search for libthread_db.
8044         (thread_db_free): New function.
8045         (thread_db_handle_monitor_command): Likewise.
8046         * config.in: Regenerate.
8047         * configure: Regenerate.
8048
8049 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
8050
8051         * spu-low.c (spu_kill): Wait for inferior to terminate.
8052         Call clear_inferiors.
8053         (spu_detach): Call clear_inferiors.
8054
8055 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
8056
8057         * aclocal.m4: Regenerate.
8058         * config.in: Likewise.
8059         * configure: Likewise.
8060
8061 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
8062
8063         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
8064         (parse_spufs_run): New function.
8065         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
8066         (ppc_breakpoint_at): Handle SPU breakpoints.
8067
8068 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
8069
8070         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
8071         (SPUFS_MAGIC): Define.
8072         (spu_enumerate_spu_ids): New function.
8073         (linux_qxfer_spu): New function.
8074         (linux_target_ops): Install linux_qxfer_spu.
8075
8076 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
8077
8078         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
8079         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
8080         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
8081         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
8082         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
8083         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
8084         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
8085         (init_registers_powerpc_cell32l): Add prototype.
8086         (init_registers_powerpc_cell64l): Likewise.
8087         (ppc_arch_setup): Detect Cell/B.E. architecture.
8088
8089 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
8090
8091         * Makefile.in (datarootdir): New variable.
8092
8093 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
8094
8095         * linux-low.c (linux_write_memory): Update debugging output.
8096         * Makefile.in (clean): Add new descriptions.
8097         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
8098         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
8099         * configure.srv: Add new files for arm*-*-linux*.
8100         * linux-arm-low.c: Add new declarations.
8101         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
8102         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
8103         (HWCAP_VFPv3D16): New.
8104         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
8105         instead of __IWMMXT__.
8106         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
8107         (arm_arch_setup): New.
8108         (target_regsets): Remove #ifdef.  Add VFP regset.
8109         (the_low_target): Use arm_arch_setup.
8110
8111 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
8112
8113         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
8114         the main thread again.
8115
8116 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
8117
8118         Adding Neutrino gdbserver.
8119         * configure: Regenerated.
8120         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
8121         * configure.srv (i[34567]86-*-nto*): New target.
8122         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
8123         * remote-utils.c [__QNX__]: Include sys/iomgr.h
8124         (nto_comctrl) [__QNX__]: New function.
8125         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
8126
8127 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
8128
8129         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
8130         srv_tgtobj.
8131
8132 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
8133             Pedro Alves  <pedro@codesourcery.com>
8134
8135         * win32-i386-low.c (i386_get_thread_context): Handle systems that
8136         don't support CONTEXT_EXTENDED_REGISTERS.
8137         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
8138         (the_low_target): Install them.
8139         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
8140         failing with ERROR_PIPE_NOT_CONNECTED.
8141
8142 2009-06-30  Doug Evans  <dje@google.com>
8143             Pierre Muller  <muller@ics.u-strasbg.fr>
8144
8145         Add h/w watchpoint support to x86-linux, win32-i386.
8146         * Makefile.in (SFILES): Add i386-low.c
8147         (i386_low_h): Define.
8148         (i386-low.o): Add dependencies.
8149         (linux-x86-low.o): Add i386-low.h dependency.
8150         (win32-i386-low.o): Ditto.
8151         * i386-low.c: New file.
8152         * i386-low.h: New file.
8153         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
8154         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
8155         * linux-low.c (linux_add_process): Initialize arch_private.
8156         (linux_remove_process): Free arch_private.
8157         (add_lwp): Initialize arch_private.
8158         (delete_lwp): Free arch_private.
8159         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
8160         provided.
8161         * linux-low.h (process_info_private): New member arch_private.
8162         (lwp_info): New member arch_private.
8163         (linux_target_ops): New members new_process, new_thread,
8164         prepare_to_resume.
8165         (ptid_of): New macro.
8166         * linux-x86-low.c: Include stddef.h, i386-low.h.
8167         (arch_process_info): New struct.
8168         (arch_lwp_info): New struct.
8169         (x86_linux_dr_get, x86_linux_dr_set): New functions.
8170         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
8171         (i386_dr_low_get_status): New function.
8172         (x86_insert_point, x86_remove_point): New functions.
8173         (x86_stopped_by_watchpoint): New function.
8174         (x86_stopped_data_address): New function.
8175         (x86_linux_new_process, x86_linux_new_thread): New functions.
8176         (x86_linux_prepare_to_resume): New function.
8177         (the_low_target): Add entries for insert_point, remove_point,
8178         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
8179         prepare_to_resume.
8180         * server.c (debug_hw_points): New global.
8181         (monitor_show_help): Document set debug-hw-points.
8182         (handle_query): Process "set debug-hw-points".
8183         * server.h (debug_hw_points): Declare.
8184         (paddress): Declare.
8185         * utils.c (NUMCELLS, CELLSIZE): New macros.
8186         (get_sell, xsnprintf, paddress): New functions.
8187         * win32-arm-low.c (the_low_target): Add entries for insert_point,
8188         remove_point, stopped_by_watchpoint, stopped_data_address.
8189         * win32-i386-low.c: Include i386-low.h.
8190         (debug_reg_state): Replaces dr.
8191         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
8192         (i386_dr_low_get_status): New function.
8193         (i386_insert_point, i386_remove_point): New functions.
8194         (i386_stopped_by_watchpoint): New function.
8195         (i386_stopped_data_address): New function.
8196         (i386_initial_stuff): Update.
8197         (get_thread_context,set_thread_context,i386_thread_added): Update.
8198         (the_low_target): Add entries for insert_point,
8199         remove_point, stopped_by_watchpoint, stopped_data_address.
8200         * win32-low.c (win32_insert_watchpoint): New function.
8201         (win32_remove_watchpoint): New function.
8202         (win32_stopped_by_watchpoint): New function.
8203         (win32_stopped_data_address): New function.
8204         (win32_target_ops): Add entries for insert_watchpoint,
8205         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
8206         * win32-low.h (win32_target_ops): New members insert_point,
8207         remove_point, stopped_by_watchpoint, stopped_data_address.
8208
8209 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
8210
8211         * server.c (process_serial_event): Re-return unsupported, not
8212         error, if the type isn't recognized.  Re-allow supporting only
8213         insert or remove packets.  Also call require_running for
8214         breakpoints.  Add missing break statement to default case.  Tidy.
8215         * target.h (struct target_ops): Rename insert_watchpoint to
8216         insert_point, and remove_watchpoint to remove_point.
8217
8218         * linux-low.h (struct linux_target_ops): Likewise.
8219         * linux-low.c (linux_insert_watchpoint): Rename to ...
8220         (linux_insert_point): ... this.  Adjust.
8221         (linux_remove_watchpoint): Rename to ...
8222         (linux_remove_point): ... this.  Adjust.
8223         (linux_target_ops): Adjust.
8224         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
8225         (cris_insert_point): ... this.
8226         (cris_remove_watchpoint): Rename to ...
8227         (cris_remove_point): ... this.
8228         (the_low_target): Adjust.
8229
8230 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
8231
8232         * server.c (handle_v_kill): Pass signal_pid to
8233         kill_inferior if multi_process is zero.
8234
8235 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
8236
8237         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
8238         * target.h (target_ops): Comment for *_watchpoint to make it clear
8239         the functions can get types '0' and '1'.
8240
8241 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
8242
8243         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
8244         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
8245         * regcache.c (get_regcache): Likewise.
8246         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
8247         * win32-low.c (child_fetch_inferior_registers): Remove check for
8248         regno 0.
8249
8250 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
8251             Pedro Alves <pedro@codesourcery.com>
8252
8253         * target.h (struct target_ops) <supports_multi_process>: New
8254         callback.
8255         (target_supports_multi_process): New.
8256         * server.c (handle_query): Even if GDB reports support, only
8257         enable multi-process if the target also supports it.  Report
8258         multi-process support only if the target backend supports it.
8259         * linux-low.c (linux_supports_multi_process): New function.
8260         (linux_target_ops): Install it as target_supports_multi_process
8261         callback.
8262
8263 2009-05-24  Doug Evans  <dje@google.com>
8264
8265         Global renaming of find_thread_pid to find_thread_ptid.
8266         * server.h (find_thread_ptid): Renamed from find_thread_pid.
8267         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
8268         All callers updated.
8269
8270         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
8271         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
8272         directly.
8273
8274         * linux-low.c (get_stop_pc): Print pc if debug_threads.
8275         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
8276         (linux_resume_one_lwp): Ditto.
8277
8278 2009-05-23  Doug Evans  <dje@google.com>
8279
8280         * linux-low.c (linux_resume_one_lwp): Change type of first arg
8281         from struct inferior_list_entry * to struct lwp_info *.
8282         All callers updated.
8283
8284 2009-05-13  Doug Evans  <dje@google.com>
8285
8286         * linux-x86-low.c: Don't include assert.h.
8287         (x86_siginfo_fixup): Use fatal, not assert.
8288         (x86_arch_setup): Fix comment.
8289
8290 2009-05-12  Doug Evans  <dje@google.com>
8291
8292         Biarch support for i386/amd64 gdbserver.
8293         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
8294         Add linux-x86-low.c.
8295         (linux-i386-low.o, linux-x86-64-low.o): Delete.
8296         (linux-x86-low.o): Add.
8297         * linux-x86-64-low.c: Delete.
8298         * linux-i386-low.c: Delete.
8299         * linux-x86-low.c: New file.
8300         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
8301         linux-x86-low.o.
8302         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
8303         linux-x86-low.o.
8304         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
8305         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
8306         (linux_child_pid_to_exec_file): New function.
8307         (elf_64_header_p, elf_64_file_p): New functions.
8308         (siginfo_fixup): New function.
8309         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
8310         give target a chance to convert layout.
8311         * linux-low.h (linux_target_ops): New member siginfo_fixup.
8312         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
8313
8314 2009-05-07  Doug Evans  <dje@google.com>
8315
8316         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
8317         (regsets_store_inferior_registers): Ditto.
8318
8319 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
8320
8321         PR server/10048
8322
8323         * linux-low.c (must_set_ptrace_flags): Delete.
8324         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
8325         of the global.
8326         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
8327         `lwp->must_set_ptrace_flags' instead.
8328         (linux_wait_for_event_1): Set ptrace options here.
8329         (linux_wait_1): ... not here.
8330
8331 2009-04-30  Doug Evans  <dje@google.com>
8332
8333         * inferiors.c (started_inferior_callback): New function.
8334         (attached_inferior_callback): New function.
8335         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
8336         * server.c (print_started_pid, print_attached_pid): New functions.
8337         (detach_or_kill_for_exit): New function.
8338         (main): Call it instead of for_each_inferior (kill_inferior_callback).
8339         * server.h (have_started_inferiors_p): Declare.
8340         (have_attached_inferiors_p): Declare.
8341
8342         * inferiors.c (remove_process): Fix memory leak, free process.
8343         * linux-low.c (linux_remove_process): New function.
8344         (linux_kill): Call it instead of remove_process.
8345         (linux_detach, linux_wait_1): Ditto.
8346
8347 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
8348
8349         * configure.srv: Add x86 Windows CE target.
8350
8351 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
8352
8353         * inferiors.c (get_thread_process): Make global.
8354         * server.h (get_thread_process): Add prototype.
8355         * thread-db.c (find_one_thread): Use get_thread_process
8356         instead of current_process.
8357         (thread_db_get_tls_address): Do not crash if called when
8358         thread layer is not yet initialized.
8359
8360 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
8361
8362         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
8363         * spu-low.c (current_tid): Rename to ...
8364         (current_ptid): ... this.
8365         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
8366         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
8367         ptid_get_lwp (current_ptid) instead of current_tid.
8368         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
8369         instead of current_tid.  Use find_process_pid to verify pid
8370         argument is valid.  Pass proper argument to remove_process.
8371         (spu_thread_alive): Compare current_ptid instead of current_tid.
8372         (spu_resume): Likewise.
8373
8374 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
8375
8376         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
8377         variable.
8378
8379 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
8380
8381         Implement the multiprocess extensions, and add linux multiprocess
8382         support.
8383
8384         * server.h (ULONGEST): Declare.
8385         (struct ptid, ptid_t): New.
8386         (minus_one_ptid, null_ptid): Declare.
8387         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
8388         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
8389         (struct inferior_list_entry): Change `id' type from unsigned from
8390         to ptid_t.
8391         (struct sym_cache, struct breakpoint, struct
8392         process_info_private): Forward declare.
8393         (struct process_info): Declare.
8394         (current_process): Declare.
8395         (all_processes): Declare.
8396         (initialize_inferiors): Declare.
8397         (add_thread): Adjust to use ptid_t.
8398         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
8399         (add_process, remove_process, find_thread_pid): Declare.
8400         (find_inferior_id): Adjust to use ptid_t.
8401         (cont_thread, general_thread, step_thread): Change type to ptid_t.
8402         (multi_process): Declare.
8403         (push_event): Adjust to use ptid_t.
8404         (read_ptid, write_ptid): Declare.
8405         (prepare_resume_reply): Adjust to use ptid_t.
8406         (clear_symbol_cache): Declare.
8407         * inferiors.c (all_processes): New.
8408         (null_ptid, minus_one_ptid): New.
8409         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
8410         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
8411         (add_thread): Change unsigned long to ptid.  Remove gdb_id
8412         parameter.  Adjust.
8413         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
8414         (gdb_id_to_thread): Rename to ...
8415         (find_thread_pid): ... this.  Change unsigned long to ptid.
8416         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
8417         (loaded_dll, pull_pid_from_list): Adjust.
8418         (add_process, remove_process, find_process_pid)
8419         (get_thread_process, current_process, initialize_inferiors): New.
8420         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
8421         (struct target_waitstatus) <related_pid>: Ditto.
8422         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
8423         return type to int.
8424         (struct target_ops) <join>: Add `pid' argument.
8425         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
8426         (struct target_ops) <wait>: Add `ptid' field.  Change return type
8427         to ptid.
8428         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
8429         (mywait): Add `ptid' argument.  Change return type to ptid_t.
8430         (target_pid_to_str): Declare.
8431         * target.c (set_desired_inferior): Adjust to use ptids.
8432         (mywait): Add new `ptid' argument.  Adjust.
8433         (target_pid_to_str): New.
8434         * mem-break.h (free_all_breakpoints): Declare.
8435         * mem-break.c (breakpoints): Delelete.
8436         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
8437         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
8438         to use per-process breakpoint list.
8439         (free_all_breakpoints): New.
8440         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
8441         (symbol_cache, all_symbols_looked_up): Delete.
8442         (hexchars): New.
8443         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
8444         read_ptid): New.
8445         (prepare_resume_reply): Change ptid argument's type from unsigned
8446         long to ptid_t.  Adjust.  Implement W;process and X;process.
8447         (free_sym_cache, clear_symbol_cache): New.
8448         (look_up_one_symbol): Adjust to per-process symbol cache.  *
8449         * server.c (cont_thread, general_thread, step_thread): Change type
8450         to ptid_t.
8451         (attached): Delete.
8452         (multi_process): New.
8453         (last_ptid): Change type to ptid_t.
8454         (struct vstop_notif) <ptid>: Change type to ptid_t.
8455         (queue_stop_reply, push_event): Change `ptid' argument's type to
8456         ptid_t.
8457         (discard_queued_stop_replies): Add `pid' argument.
8458         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
8459         changes.  Don't reference the `attached' global.
8460         (attach_inferior): Adjust to mywait interface changes.
8461         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
8462         features.  Handle and report "multiprocess+".  Handle
8463         "qAttached:PID".
8464         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
8465         changes.
8466         (handle_v_kill): New.
8467         (handle_v_stopped): Adjust to use target_pid_to_str.
8468         (handle_v_requests): Allow multiple attaches and runs when
8469         multiprocess extensions are in effect.  Handle "vKill".
8470         (myresume): Adjust to use ptids.
8471         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
8472         (handle_status): Adjust to discard_queued_stop_replies interface
8473         change.
8474         (first_thread_of, kill_inferior_callback)
8475         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
8476         (main): Call initialize_inferiors.  Adjust to use ptids, killing
8477         and detaching from all inferiors.  Handle multiprocess packet
8478         variants.
8479         * linux-low.h: Include gdb_proc_service.h.
8480         (struct process_info_private): New.
8481         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
8482         <lwpid_of>: Use ptid_get_lwp.
8483         (get_lwp_thread): Adjust.
8484         (struct lwp_info): Add `dead' member.
8485         (find_lwp_pid): Declare.
8486         * linux-low.c (thread_db_active): Delete.
8487         (new_inferior): Adjust comment.
8488         (inferior_pid): Delete.
8489         (linux_add_process): New.
8490         (handle_extended_wait): Adjust.
8491         (add_lwp): Change unsigned long to ptid.
8492         (linux_create_inferior): Add process to processes table.  Adjust
8493         to use ptids.  Don't set new_inferior here.
8494         (linux_attach_lwp): Rename to ...
8495         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
8496         it.  Adjust to use ptids.
8497         (linux_attach_lwp): New.
8498         (linux_attach): Add process to processes table.  Don't set
8499         new_inferior here.
8500         (struct counter): New.
8501         (second_thread_of_pid_p, last_thread_of_process_p): New.
8502         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
8503         multiple processes.
8504         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
8505         processes.  Remove process from process table.
8506         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
8507         to multiple processes.
8508         (any_thread_of): New.
8509         (linux_detach): Add `pid' argument, and handle it.  Remove process
8510         from processes table.
8511         (linux_join): Add `pid' argument.  Handle it.
8512         (linux_thread_alive): Change unsighed long argument to ptid_t.
8513         Consider dead lwps as not being alive.
8514         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
8515         threads we're not interested in.
8516         (same_lwp, find_lwp_pid): New.
8517         (linux_wait_for_lwp): Change `pid' argument's type from int to
8518         ptid_t.  Adjust.
8519         (linux_wait_for_event): Rename to ...
8520         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
8521         from int to ptid_t.  Adjust.
8522         (linux_wait_for_event): New.
8523         (linux_wait_1): Add `ptid' argument.  Change return type to
8524         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
8525         that exit from the process table.
8526         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
8527         Adjust.
8528         (mark_lwp_dead): New.
8529         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
8530         stopping all threads, mark its main lwp as dead.
8531         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
8532         ptids.
8533         (fetch_register, usr_store_inferior_registers)
8534         (regsets_fetch_inferior_registers)
8535         (regsets_store_inferior_registers, linux_read_memory)
8536         (linux_write_memory): Inline `inferior_pid'.
8537         (linux_look_up_symbols): Adjust to use per-process
8538         `thread_db_active'.
8539         (linux_request_interrupt): Adjust to use ptids.
8540         (linux_read_auxv): Inline `inferior_pid'.
8541         (initialize_low): Don't reference thread_db_active.
8542         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
8543         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
8544         (ps_getpid): Return the pid of the current inferior.
8545         * thread-db.c (proc_handle, thread_agent): Delete.
8546         (thread_db_create_event, thread_db_enable_reporting): Adjust to
8547         per-process data.
8548         (find_one_thread): Change argument type to ptid_t.  Adjust to
8549         per-process data.
8550         (maybe_attach_thread): Adjust to per-process data and ptids.
8551         (thread_db_find_new_threads): Ditto.
8552         (thread_db_init): Ditto.
8553         * spu-low.c (spu_create_inferior, spu_attach): Add process to
8554         processes table.  Adjust to use ptids.
8555         (spu_kill, spu_detach): Adjust interface.  Remove process from
8556         processes table.
8557         (spu_join, spu_thread_alive): Adjust interface.
8558         (spu_wait): Adjust interface.  Remove process from processes
8559         table.  Adjust to use ptids.
8560         * win32-low.c (current_inferior_tid): Delete.
8561         (current_inferior_ptid): New.
8562         (debug_event_ptid): New.
8563         (thread_rec): Take a ptid.  Adjust.
8564         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
8565         (child_delete_thread): Ditto.
8566         (do_initial_child_stuff): Add `attached' argument.  Add process to
8567         processes table.
8568         (child_fetch_inferior_registers, child_store_inferior_registers):
8569         Adjust.
8570         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
8571         (win32_attach): Pass 1 to do_initial_child_stuff.
8572         (win32_kill): Adjust interface.  Remove process from processes
8573         table.
8574         (win32_detach): Ditto.
8575         (win32_join): Adjust interface.
8576         (win32_thread_alive): Take a ptid.
8577         (win32_resume): Adjust to use ptids.
8578         (get_child_debug_event): Ditto.
8579         (win32_wait): Adjust interface.  Remove exiting process from
8580         processes table.
8581
8582 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
8583
8584         Non-stop mode support.
8585
8586         * server.h (non_stop): Declare.
8587         (gdb_client_data, handler_func): Declare.
8588         (delete_file_handler, add_file_handler, start_event_loop):
8589         Declare.
8590         (handle_serial_event, handle_target_event, push_event)
8591         (putpkt_notif): Declare.
8592         * target.h (enum resume_kind): New.
8593         (struct thread_resume): Replace `step' field by `kind' field.
8594         (TARGET_WNOHANG): Define.
8595         (struct target_ops) <wait>: Add `options' argument.
8596         <supports_non_stop, async, start_non_stop>: New fields.
8597         (target_supports_non_stop, target_async): New.
8598         (start_non_stop): Declare.
8599         (mywait): Add `options' argument.
8600         * target.c (mywait): Add `options' argument.  Print child exit
8601         notifications here.
8602         (start_non_stop): New.
8603         * server.c (non_stop, own_buf, mem_buf): New globals.
8604         (struct vstop_notif): New.
8605         (notif_queue): New global.
8606         (queue_stop_reply, push_event, discard_queued_stop_replies)
8607         (send_next_stop_reply): New.
8608         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
8609         interface changes.
8610         (attach_inferior): In non-stop mode, don't wait for the target
8611         here.
8612         (handle_general_set): Handle QNonStop.
8613         (handle_query): When handling qC, return the current general
8614         thread, instead of the first thread of the list.
8615         (handle_query): If the backend supports non-stop mode, include
8616         QNonStop+ in the qSupported query response.
8617         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
8618         and non-stop mode.
8619         (handle_v_attach, handle_v_run): Handle non-stop mode.
8620         (handle_v_stopped): New.
8621         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
8622         (myresume): Adjust to use resume_kind.  Handle non-stop.
8623         (queue_stop_reply_callback): New.
8624         (handle_status): Handle non-stop mode.
8625         (main): Clear non_stop flag on reconnection.  Use the event-loop.
8626         Refactor serial protocol handling from here ...
8627         (process_serial_event): ... to this new function.  When GDB
8628         selects any thread, select one here.  In non-stop mode, wait until
8629         GDB acks all pending events before exiting.
8630         (handle_serial_event, handle_target_event): New.
8631         * remote-utils.c (remote_open): Install remote_desc in the event
8632         loop.
8633         (remote_close): Remove remote_desc from the event loop.
8634         (putpkt_binary): Rename to...
8635         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
8636         (putpkt_binary): New as wrapper around putpkt_binary_1.
8637         (putpkt_notif): New.
8638         (prepare_resume_reply): In non-stop mode, don't change the
8639         general_thread.
8640         * event-loop.c: New.
8641         * Makefile.in (OBJ): Add event-loop.o.
8642         (event-loop.o): New rule.
8643
8644         * linux-low.h (pid_of): Moved here.
8645         (lwpid_of): New.
8646         (get_lwp_thread): Use lwpid_of.
8647         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
8648         * linux-low.c (pid_of): Delete.
8649         (inferior_pid): Use lwpid_of.
8650         (linux_event_pipe): New.
8651         (target_is_async_p): New.
8652         (delete_lwp): New.
8653         (handle_extended_wait): Use lwpid_of.
8654         (add_lwp): Don't set lwpid field.
8655         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
8656         (linux_kill_one_lwp): If killing a running lwp, stop it first.
8657         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
8658         (linux_detach_one_lwp): If detaching from a running lwp, stop it
8659         first.  Adjust to linux_wait_for_event interface changes.  Use
8660         lwpid_of.
8661         (linux_detach): Don't delete the main lwp here.
8662         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
8663         (status_pending_p): Don't consider explicitly suspended lwps.
8664         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
8665         pointer.  Add OPTIONS argument.  Change return type to int.  Use
8666         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
8667         (linux_wait_for_event): Take an integer pid instead of a lwp_info
8668         pointer.  Add status pointer argument.  Return a pid instead of a
8669         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
8670         changes.  In non-stop mode, don't switch to a random thread.
8671         (linux_wait): Rename to...
8672         (linux_wait_1): ... this.  Add target_options argument, and handle
8673         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
8674         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
8675         clean exit and signal exit code.  Don't stop all threads in
8676         non-stop mode.  In all-stop mode, only stop all threads when
8677         reporting a stop to GDB.  Handle explicit thread stop requests.
8678         (async_file_flush, async_file_mark): New.
8679         (linux_wait): New.
8680         (send_sigstop): Use lwpid_of.
8681         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
8682         interface changes.  In non-stop mode, don't switch to a random
8683         thread.
8684         (linux_resume_one_lwp): Use lwpid_of.
8685         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
8686         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
8687         non-stop mode, don't look for pending flag in all threads.
8688         (resume_status_pending_p): Don't consider explicitly suspended
8689         threads.
8690         (my_waitpid): Reimplement.  Emulate __WALL.
8691         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
8692         Use lwpid_of.
8693         (sigchld_handler, linux_supports_non_stop, linux_async)
8694         (linux_start_non_stop): New.
8695         (linux_target_ops): Register linux_supports_non_stop, linux_async
8696         and linux_start_non_stop.
8697         (initialize_low): Install SIGCHLD handler.
8698         * thread-db.c (thread_db_create_event, find_one_thread)
8699         (thread_db_get_tls_address): Use lwpid_of.
8700         * win32-low.c (win32_detach): Adjust to use resume_kind.
8701         (win32_wait): Add `options' argument.
8702         * spu-low.c (spu_resume): Adjust to use resume_kind.
8703         (spu_wait): Add `options' argument.
8704
8705 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
8706
8707         Decouple target code from remote protocol.
8708
8709         * target.h (enum target_waitkind): New.
8710         (struct target_waitstatus): New.
8711         (struct target_ops) <wait>: Return an unsigned long.  Take a
8712         target_waitstatus pointer instead of a char pointer.
8713         (mywait): Likewise.
8714         * target.c (mywait): Change prototype to return an unsigned long.
8715         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
8716         * server.h (thread_from_wait, old_thread_from_wait): Delete
8717         declarations.
8718         (prepare_resume_reply): Change prototype to take a
8719         target_waitstatus.
8720         * server.c (thread_from_wait, old_thread_from_wait): Delete.
8721         (last_status, last_ptid): New.
8722         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
8723         pid instead of a signal.
8724         (attach_inferior): Remove "status" and "signal" parameters.
8725         Adjust.
8726         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
8727         not as an address.
8728         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
8729         (handle_v_requests, myresume): Remove "status" and "signal"
8730         parameters.  Adjust.
8731         (handle_status): New.
8732         (main): Delete local `status'.  Adjust.
8733         * remote-utils.c: Include target.h.
8734         (prepare_resume_reply): Change prototype to take a
8735         target_waitstatus.  Adjust.
8736
8737         * linux-low.c (linux_wait): Adjust to new target_ops->wait
8738         interface.
8739         * spu-low.c (spu_wait): Adjust.
8740         * win32-low.c (enum target_waitkind, struct target_waitstatus):
8741         Delete.
8742         (win32_wait): Adjust.
8743
8744 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
8745
8746         * target.h (struct thread_resume): Delete leave_stopped member.
8747         (struct target_ops): Add a `n' argument to the `resume' callback.
8748         * server.c (start_inferior): Adjust.
8749         (handle_v_cont, myresume): Adjust.
8750         * linux-low.c (check_removed_breakpoint): Adjust to resume
8751         interface change, and to removed leave_stopped field.
8752         (resume_ptr): Delete.
8753         (struct thread_resume_array): New.
8754         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
8755         resume interface change.
8756         (linux_continue_one_thread, linux_queue_one_thread)
8757         (resume_status_pending_p): Check if the resume field is NULL
8758         instead of checking the leave_stopped member.
8759         (linux_resume): Adjust to the target resume interface change.
8760         * spu-low.c (spu_resume): Adjust to the target resume interface
8761         change.
8762         * win32-low.c (win32_detach, win32_resume): Ditto.
8763
8764 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
8765
8766         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
8767         flag.
8768         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
8769         pending.
8770         (linux_continue_one_thread): Only preserve the stepping flag if
8771         there's a pending breakpoint.
8772
8773 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
8774
8775         * server.c (main): After the inferior having exited, call
8776         remote_close before exiting gdbserver.
8777
8778 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
8779
8780         Fix size of FPSCR in Power 7 processors.
8781         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
8782         (PPC_FEATURE_HAS_DFP): New #define.
8783         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
8784         size of the FPSCR.
8785
8786 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
8787
8788         * server.c (handle_query) Whitespace and formatting.
8789
8790 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
8791
8792         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
8793         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
8794         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
8795         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
8796         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
8797         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
8798         Makefile.in, configure.ac: Fix whitespace throughout.
8799         * configure: Regenerate.
8800
8801 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
8802
8803         * inferiors.c (find_inferior): Make it safe for the callback
8804         function to delete the currently iterated inferior.
8805
8806 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
8807
8808         * Makefile.in (linuw_low_h): Move higher.
8809         (thread-db.o): Depend on $(linux_low_h).
8810
8811 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
8812
8813         Rename "process" to "lwp" throughout.
8814
8815         * linux-low.c (all_processes): Rename to...
8816         (all_lwps): ... this.
8817         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
8818         (add_process): Rename to ...
8819         (add_lwp): ... this.  Adjust.
8820         (linux_create_inferior): Adjust.
8821         (linux_attach_lwp): Adjust.
8822         (linux_attach): Adjust.
8823         (linux_kill_one_process): Rename to ...
8824         (linux_kill_one_lwp): ... this.  Adjust.
8825         (linux_kill): Adjust.
8826         (linux_detach_one_process): Rename to ...
8827         (linux_detach_one_lwp): ... this.  Adjust.
8828         (linux_detach): Adjust.
8829         (check_removed_breakpoint): Adjust.
8830         (status_pending_p): Adjust.
8831         (linux_wait_for_process): Rename to ...
8832         (linux_wait_for_lwp): ... this.  Adjust.
8833         (linux_wait_for_event): Adjust.
8834         (send_sigstop): Adjust.
8835         (wait_for_sigstop): Adjust.
8836         (stop_all_processes): Rename to ...
8837         (stop_all_lwps): ... this.
8838         (linux_resume_one_process): Rename to ...
8839         (linux_resume_one_lwp): ... this.  Adjust.
8840         (linux_set_resume_request, linux_continue_one_thread)
8841         (linux_queue_one_thread, resume_status_pending_p)
8842         (usr_store_inferior_registers, regsets_store_inferior_registers)
8843         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
8844         Adjust.
8845         * linux-low.h (get_process): Rename to ...
8846         (get_lwp): ... this.  Adjust.
8847         (get_thread_process): Rename to ...
8848         (get_thread_lwp): ... this.  Adjust.
8849         (get_process_thread): Rename to ...
8850         (get_lwp_thread): ... this.  Adjust.
8851         (struct process_info): Rename to ...
8852         (struct lwp_info): ... this.
8853         (all_processes): Rename to ...
8854         (all_lwps): ... this.
8855         * proc-service.c (ps_lgetregs): Adjust.
8856         * thread-db.c (thread_db_create_event, find_one_thread)
8857         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
8858
8859 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
8860
8861         * server.c (handle_query): Handle "qAttached".
8862
8863 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
8864
8865         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
8866         GPLv3, update license URL.
8867
8868 2009-03-01  Doug Evans  <dje@google.com>
8869
8870         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
8871         (server_h): Add gdb_signals.h.
8872         (signals.o): Update.
8873         * server.h (target_signal_from_host,target_signal_to_host_p)
8874         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
8875
8876 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
8877
8878         * remote-utils.c (getpkt): Also generate remote-debug
8879         information if noack_mode is set.
8880
8881 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
8882
8883         * server.c (handle_query): Report qXfer:siginfo:read and
8884         qXfer:siginfo:write as supported and handle them.
8885         * target.h (struct target_ops) <qxfer_siginfo>: New field.
8886         * linux-low.c (linux_xfer_siginfo): New.
8887         (linux_target_ops): Set it.
8888
8889 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
8890
8891         * server.c (gdbserver_usage): Mention --remote-debug.
8892         (main): Accept '--remote-debug' switch.
8893
8894 2009-01-18  Doug Evans  <dje@google.com>
8895
8896         * regcache.c (new_register_cache): No need to check result of xcalloc.
8897         * server.c (handle_search_memory): Back out calls to xmalloc,
8898         result is checked and error is returned to user upon failure.
8899         (handle_query): Ditto.  Add more checks for result of malloc.
8900         (handle_v_cont): Check result of malloc, report error back to
8901         user upon failure.
8902         (handle_v_run): Ditto.  Call freeargv.
8903         * server.h (freeargv): Declare.
8904         * utils.c (freeargv): New fn.
8905
8906 2009-01-15  Doug Evans  <dje@google.com>
8907
8908         * gdbreplay.c (perror_with_name): Make arg const char *.
8909         * server.h (target_signal_to_name): Make return type const char *.
8910         * thread-db.c (thread_db_err_str): Make return type const char *.
8911         * utils.c (perror_with_name): Make arg const char *.
8912
8913 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
8914
8915         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
8916         when handling a EXIT_PROCESS_DEBUG_EVENT.
8917
8918 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
8919
8920         * gdbreplay.c (gdbreplay_version): Update copyright year.
8921         * server.c (gdbserver_version): Likewise.
8922
8923 2009-01-05  Doug Evans  <dje@google.com>
8924
8925         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
8926         (handle_extended_wait): Improve comment.
8927
8928 2008-12-13  Doug Evans  <dje@google.com>
8929
8930         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
8931         * server.h (ATTR_MALLOC): New macro.
8932         (xmalloc,xcalloc,xstrdup): Declare.
8933         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
8934         * inferiors.c: Ditto.
8935         * linux-low.c: Ditto.
8936         * mem-break.c: Ditto.
8937         * regcache.c: Ditto.
8938         * remote-utils.c: Ditto.
8939         * server.c: Ditto.
8940         * target.c: Ditto.
8941         * win32-low.c: Ditto.
8942
8943 2008-12-12  Doug Evans  <dje@google.com>
8944
8945         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
8946         in debugging printf.
8947
8948         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
8949
8950 2008-12-09  Doug Evans  <dje@google.com>
8951
8952         * linux-low.h (struct process_info): Delete member tid, unused.
8953         * thread-db.c (find_one_thread): Update.
8954         (maybe_attach_thread): Update.
8955
8956 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
8957
8958         * target.h (struct target_ops): Add qxfer_osdata member.
8959         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
8960         and dirent.h.
8961         (linux_qxfer_osdata): New functions.
8962         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
8963         callback.
8964         * server.c (handle_query): Handle "qXfer:osdata:read:".
8965         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
8966         (buffer_xml_printf): New functions.
8967         * server.h (struct buffer): New.
8968         (buffer_grow_str, buffer_grow_str0): New macros.
8969         (buffer_grow, buffer_free, buffer_init, buffer_finish)
8970         (buffer_xml_printf): Declare.
8971
8972 2008-11-24  Doug Evans  <dje@google.com>
8973
8974         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
8975
8976 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
8977
8978         * server.c (handle_v_run): Always use the supplied argument list.
8979
8980 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
8981
8982         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
8983         (xtensa_regmap_table): Add entry for scompare1.
8984
8985 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
8986
8987         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
8988         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
8989         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
8990         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
8991         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
8992         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
8993         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
8994         XML target descriptions.
8995         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
8996         when inferior is running on an ISA 2.05 or later processor.  Add
8997         special case to return offset for full 64-bit slot of FPSCR when
8998         in 32-bits.
8999
9000 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
9001
9002         * Makefile.in (SFILES, clean): Added sparc64 files.
9003         (reg-sparc64.o, reg-sparc64.c): New.
9004         * configure.srv (sparc*-*-linux*): New configuration.
9005         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
9006         syscall arguments for SPARC.
9007         (regsets_store_inferior_registers): Likewise.
9008         * linux-sparc-low.c: New file.
9009
9010 2008-10-21  Doug Evans  <dje@google.com>
9011
9012         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
9013         (READLINE_DIR,READLINE_DEP): Delete.
9014         (INTERNAL_CFLAGS): Update.
9015         (LINTFLAGS): Update.
9016
9017 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
9018
9019         * server.c (handle_v_run): If GDB didn't specify an argv, use the
9020         whole argv from the last run, not just argv[0].
9021
9022 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
9023
9024         * regcache.c (new_register_cache): Return NULL if the register
9025         cache size isn't known yet.
9026         (free_register_cache): Avoid dereferencing a NULL regcache.
9027
9028 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
9029
9030         * configure.srv: Merge MIPS and MIPS64.
9031
9032 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
9033
9034         * Makefile.in (uninstall): Apply $(EXEEXT) too.
9035
9036 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
9037
9038         * Makefile.in: Add required vsx dependencies.
9039
9040         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
9041         Declare init_registers_powerpc_vsx32l.
9042         Declare init_registers_powerpc_vsx64l.
9043         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
9044         (ppc_arch_setup): Check for VSX in hwcap.
9045         (ppc_fill_vsxregset): New function.
9046         (ppc_store_vsxregset): New function.
9047         Add new VSX entry in regset_info target_regsets.
9048
9049         * configure.srv: Add new VSX dependencies.
9050
9051 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
9052
9053         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
9054         (remote_open): Set or clear transport_is_reliable.
9055         (putpkt_binary): Don't expect acks in noack mode.
9056         (getpkt): Don't send ack/nac in noack mode.
9057         * server.c (handle_general_set): Handle QStartNoAckMode.
9058         (handle_query): If connected by tcp pass QStartNoAckMode+ in
9059         qSupported.
9060         (main): Reset noack_mode on every connection.
9061         * server.h (noack_mode): Declare.
9062
9063 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9064
9065         * Makefile.in (GDBREPLAY_OBS): New variable.
9066         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
9067
9068 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
9069             Daniel Jacobowitz  <dan@codesourcery.com>
9070
9071         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
9072         (usr_store_inferior_registers): Likewise.
9073         (regsets_store_inferior_registers): Likewise.
9074
9075 2008-07-31  Rolf Jansen  <rj@surtec.com>
9076             Pedro Alves  <pedro@codesourcery.com>
9077
9078         * configure.ac: Check for memmem declaration.
9079         * server.c [HAVE_MALLOC_H]: Include malloc.h.
9080         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
9081         (disable_packet_qfThreadInfo): Unconditionally compile.
9082         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
9083         * configure, config.in: Regenerate.
9084
9085 2008-07-28  Doug Kwan  <dougkwan@google.com>
9086
9087         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
9088         (linux_write_memory): Remove declaration of errno.
9089
9090 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
9091
9092         * linux-low.c (handle_extended_wait): Do not use "status"
9093         variable uninitialized.
9094
9095 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
9096
9097         * server.c (handle_v_attach): Inhibit reporting dll changes.
9098
9099 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
9100
9101         * remote-utils.c (prepare_resume_reply): If requested, don't
9102         output "thread:TID" in the T stop reply.
9103
9104         * server.c (disable_packet_vCont, disable_packet_Tthread)
9105         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
9106         (handle_query): If requested, disable support for qC, qfThreadInfo
9107         and qsThreadInfo.
9108         (handle_v_requests): If requested, disable support for vCont.
9109         (gdbserver_show_disableable): New.
9110         (main): Handle --disable-packet and --disable-packet=LIST.
9111
9112         * server.h (disable_packet_vCont, disable_packet_Tthread)
9113         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
9114
9115 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
9116
9117         * server.c (gdbserver_usage): Mention --version.
9118
9119 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
9120
9121         * Makefile.in (gdbreplay.o): New rule.
9122
9123 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
9124
9125         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
9126         message, not gdbserver.
9127
9128 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
9129             Nathan Sidwell  <nathan@codesourcery.com>
9130             Joseph Myers  <joseph@codesourcery.com>
9131
9132         * acinclude.m4: Include ../../config/acx.m4.
9133         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
9134         * configure, config.in: Regenerate.
9135         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
9136         * server.c (gdbserver_version): Print PKGVERSION.
9137         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
9138         (main): Adjust gdbserver_usage calls.
9139         * gdbreplay.c (version, host_name): Add declarations.
9140         (gdbreplay_version, gdbreplay_usage): New.
9141         (main): Accept --version and --help options.
9142
9143 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
9144
9145         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
9146         (arm_breakpoint_at): Handle Thumb.
9147         (the_low_target): Add comment.
9148
9149 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
9150
9151         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
9152
9153 2008-05-09  Doug Evans  <dje@google.com>
9154
9155         * server.h (decode_search_memory_packet): Declare.
9156         * remote-utils.c (decode_search_memory_packet): New fn.
9157         * server.c (handle_search_memory_1): New fn.
9158         (handle_search_memory): New fn.
9159         (handle_query): Process qSearch:memory packets.
9160
9161 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
9162
9163         * regcache.c (registers_length): Remove.
9164         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
9165         full register packet.
9166         * regcache.h (registers_length): Remove prototype.
9167         * server.h (PBUFSIZ): Define to 16384.
9168
9169 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
9170
9171         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
9172         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
9173         powerpc-64l.o, and powerpc-altivec64l.o.
9174         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
9175         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
9176         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
9177         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
9178         rs6000/power-linux.xml, and rs6000/power64-linux.xml
9179         to srv_xmlfiles.
9180
9181         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
9182         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
9183         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
9184         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
9185         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
9186         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
9187         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
9188         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
9189         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
9190         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
9191         (clean): Update.
9192
9193         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
9194         (init_registers_powerpc_32l): ... this new prototype.
9195         (init_registers_powerpc_32): Remove, replace by ...
9196         (init_registers_powerpc_altivec32l): ... this new prototype.
9197         (init_registers_powerpc_e500): Remove, replace by ...
9198         (init_registers_powerpc_e500l): ... this new prototype.
9199         (init_registers_ppc64): Remove, replace by ...
9200         (init_registers_powerpc_64l): ... this new prototype.
9201         (init_registers_powerpc_64): Remove, replace by ...
9202         (init_registers_powerpc_altivec64l): ... this new prototype.
9203         (ppc_num_regs): Set to 73.
9204         (PT_ORIG_R3, PT_TRAP): Define if necessary.
9205         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
9206         (ppc_cannot_store_register): Handle orig_r3 and trap.
9207         (ppc_arch_setup): Update init_registers_... calls.
9208         (ppc_fill_gregset): Handle orig_r3 and trap.
9209
9210         * inferiors.c (clear_inferiors): Reset current_inferior.
9211
9212 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
9213
9214         * acinclude.m4: Add override.m4.
9215         * configure: Regenerate.
9216
9217 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
9218
9219         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
9220         initial call to init_register_ppc64.
9221
9222 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
9223
9224         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
9225         single powerpc*-*-linux* case.
9226         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
9227
9228 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
9229
9230         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
9231         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
9232         from reg_xmlfiles.
9233         * linux-ppc-low.c: Include <elf.h>.
9234         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
9235         (ppc_hwcap): New global variable.
9236         (ppc_regmap): Remove __SPE__ #ifdef sections.
9237         (ppc_regmap_e500): New global variable.
9238         (ppc_cannot_store_register): Update __SPE__ special case.
9239         (ppc_get_hwcap): New function.
9240         (ppc_arch_setup): Use it to determine whether inferior supports
9241         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
9242         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
9243         Do not access registers if target does not support AltiVec.
9244         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
9245         Do not access registers if target does not support SPE.
9246         (target_regsets): Unconditionally include AltiVec and SPE regsets.
9247
9248 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
9249
9250         * linux-low.c (disabled_regsets, num_regsets): New.
9251         (use_regsets_p): Delete.
9252         (linux_wait_for_process): Clear disabled_regsets.
9253         (regsets_fetch_inferior_registers): Check and set it.
9254         (regsets_store_inferior_registers): Likewise.
9255         (linux_fetch_registers, linux_store_registers): Do not use
9256         use_regsets_p.
9257         (initialize_low): Allocate disabled_regsets.
9258
9259 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
9260
9261         * Makefile.in (LIBOBJS): New.
9262         (OBS): Use LIBOBJS.
9263         (memmem.o): New rule.
9264         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
9265         * configure: Regenerated.
9266
9267 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
9268
9269         * server.c (handle_query): Never return "unsupported" for
9270         qXfer:features:read queries.
9271
9272 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
9273
9274         * server.c (get_features_xml): Fix inverted condition.
9275         (handle_query): Always support qXfer:feature:read.
9276
9277 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
9278
9279         * server.c (wrapper_argv): New.
9280         (start_inferior): Handle wrapper_argv.  If set, expect an extra
9281         trap.
9282         (gdbserver_usage): Document --wrapper.
9283         (main): Parse --wrapper.
9284
9285 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
9286
9287         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
9288         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
9289         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
9290         (ppc_set_pc): Likewise.
9291         (ppc_arch_setup): New function.
9292         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
9293         of collect_register.
9294         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
9295
9296 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
9297
9298         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
9299         instead of linux-ppc64-low.o.
9300         * linux-ppc64-low.c: Remove file.
9301         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
9302         (linux-ppc64-low.o): Remove rule.
9303
9304         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
9305         (init_registers_powerpc_64): Likewise.
9306         (ppc_regmap): Conditionally define depending on __powerpc64__.
9307         (ppc_cannot_store_register): Do not special-case "fpscr" when
9308         compiled on __powerpc64__.
9309         (ppc_collect_ptrace_register): New function.
9310         (ppc_supply_ptrace_register): New function.
9311         (ppc_breakpoint): Change type to "unsigned int".
9312         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
9313         (the_low_target): Conditionally provide initializers for the
9314         arch_setup member depending on __powerpc64__.  Install
9315         collect_ptrace_register and supply_ptrace_register members.
9316
9317 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
9318
9319         * regcache.h (gdbserver_xmltarget): Add extern declaration.
9320         * server.c (gdbserver_xmltarget): Define.
9321         (get_features_xml): Use it to replace "target.xml" and arch_string.
9322
9323         * configure.srv: Remove srv_xmltarget.  Add XML files that were
9324         mentioned there to srv_xmlfiles instead.  Remove conditional tests
9325         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
9326         srv_xmlfiles and srv_regobj to include all possible choices.
9327         * configure.ac (srv_xmltarget): Remove.
9328         (srv_xmlfiles): Do not add "target.xml".
9329         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
9330         checks for supplementary target information.
9331         * configure: Regenerate.
9332         * Makefile.in (XML_TARGET): Remove.
9333         (target.xml): Remove rule.
9334         (clean): Do not clean up target.xml.
9335         (.PRECIOUS): Do not mention target.xml.
9336
9337         * target.h (struct target_ops): Remove arch_string member.
9338         * linux-low.c (linux_arch_string): Remove.
9339         (linux_target_ops): Remove arch_string initializer.
9340         * linux-low.h (struct linux_target_ops): Remove arch_string member.
9341         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
9342         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
9343         * spu-low.c (spu_arch_string): Remove.
9344         (spu_target_ops): Remove arch_string initializer.
9345         * win32-low.c (win32_arch_string): Remove.
9346         (win32_target_ops): Remove arch_string initializer.
9347         * win32-low.h (struct win32_target_ops): Remove arch_string member.
9348         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
9349         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
9350
9351 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
9352
9353         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
9354         by collect_ptrace_register and supply_ptrace_register hooks.
9355         * linux-low.c (fetch_register): Use supply_ptrace_register callback
9356         instead of checking for the_low_target.left_pad_xfer.
9357         (usr_store_inferior_registers): Use collect_ptrace_register callback
9358         instead of checking for the_low_target.left_pad_xfer.
9359
9360         * linux-s390-low.c (s390_collect_ptrace_register): New function.
9361         (s390_supply_ptrace_register): Likewise.
9362         (s390_fill_gregset): Call s390_collect_ptrace_register.
9363         (the_low_target): Update.
9364
9365         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
9366         (ppc_supply_ptrace_register): Likewise.
9367         (the_low_target): Update.
9368
9369         * linux-i386-low.c (the_low_target): Update.
9370         * linux-x86-64-low.c (the_low_target): Update.
9371
9372 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
9373
9374         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
9375         reg-s390.o and reg-s390x.o.
9376
9377         * linux-low.c (new_inferior): New global variable.
9378         (linux_create_inferior, linux_attach): Set it.
9379         (linux_wait_for_process): Call the_low_target.arch_setup after the
9380         target has stopped for the first time.
9381         (initialize_low): Do not call the_low_target.arch_setup.
9382
9383         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
9384         (s390_set_pc): Likewise.
9385         (s390_arch_setup): New function.
9386         (the_low_target): Use s390_arch_setup as arch_setup routine.
9387
9388         * regcache.c (realloc_register_cache): New function.
9389         (set_register_cache): Call it for each existing regcache.
9390
9391 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
9392
9393         * server.h (init_registers): Remove prototype.
9394
9395         * linux-low.h (struct linux_target_ops): Add arch_setup field.
9396         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
9397         instead of init_registers ().
9398         * linux-arm-low.c (init_registers_arm): Add prototype.
9399         (init_registers_arm_with_iwmmxt): Likewise.
9400         (the_low_target): Add initializer for arch_setup field.
9401         * linux-cris-low.c (init_registers_cris): Add prototype.
9402         (the_low_target): Add initializer for arch_setup field.
9403         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
9404         (the_low_target): Add initializer for arch_setup field.
9405         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
9406         (the_low_target): Add initializer for arch_setup field.
9407         * linux-ia64-low.c (init_registers_ia64): Add prototype.
9408         (the_low_target): Add initializer for arch_setup field.
9409         * linux-m32r-low.c (init_registers_m32r): Add prototype.
9410         (the_low_target): Add initializer for arch_setup field.
9411         * linux-m68k-low.c (init_registers_m68k): Add prototype.
9412         (the_low_target): Add initializer for arch_setup field.
9413         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
9414         (init_registers_mips64_linux): Likewise.
9415         (the_low_target): Add initializer for arch_setup field.
9416         * linux-ppc-low.c (init_registers_ppc): Add prototype.
9417         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
9418         (the_low_target): Add initializer for arch_setup field.
9419         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
9420         (init_registers_powerpc_64): Likewise.
9421         (the_low_target): Add initializer for arch_setup field.
9422         * linux-s390-low.c (init_registers_s390): Add prototype.
9423         (init_registers_s390x): Likewise.
9424         (the_low_target): Add initializer for arch_setup field.
9425         * linux-sh-low.c (init_registers_sh): Add prototype.
9426         (the_low_target): Add initializer for arch_setup field.
9427         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
9428         (the_low_target): Add initializer for arch_setup field.
9429         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
9430         (the_low_target): Add initializer for arch_setup field.
9431
9432         * win32-low.h (struct win32_target_ops): Add arch_setup field.
9433         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
9434         instead of init_registers ().
9435         * win32-arm-low.c (init_registers_arm): Add prototype.
9436         (the_low_target): Add initializer for arch_setup field.
9437         * win32-i386-low.c (init_registers_i386): Add prototype.
9438         (the_low_target): Add initializer for arch_setup field.
9439
9440         * spu-low.c (init_registers_spu): Add prototype.
9441         (initialize_low): Call initialie_registers_spu () instead of
9442         initialize_registers ().
9443
9444 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
9445
9446         * server.c (handle_v_requests): When handling the vRun and vAttach
9447         packets, if already debugging a process, don't kill it.  Return an
9448         error instead.
9449
9450 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
9451
9452         * server.c (handle_query): Correct length check.
9453
9454 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
9455
9456         * win32-low.c (do_initial_child_stuff): Add process handle
9457         parameter.  Set current_process_handle and current_process_id from the
9458         parameters. Clear globals.
9459         (win32_create_inferior): Don't set current_process_handle and
9460         current_process_id here.  Instead pass them on the call to
9461         do_initial_child_stuff.
9462         (win32_attach): Likewise.
9463         (win32_clear_inferiors): New.
9464         (win32_kill): Don't close the current process handle or the
9465         current thread handle here.  Instead call win32_clear_inferiors.
9466         (win32_detach): Don't open a new handle to the process.  Call
9467         win32_clear_inferiors.
9468         (win32_join): Don't rely on current_process_handle; open a new
9469         handle using the process id.
9470         (win32_wait): Call win32_clear_inferiors when the inferior process
9471         has exited.
9472
9473 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
9474
9475         * server.c (monitor_show_help): Add "exit".
9476
9477 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
9478
9479         * Makefile.in (SFILES): Add linux-xtensa-low.c.
9480         (clean): Add reg-xtensa.c.
9481         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
9482         * configure.srv (xtensa*-*-linux*) New target.
9483         * linux-xtensa-low.c: New.
9484         * xtensa-xtregs.c: New.
9485
9486 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
9487
9488         * hostio.c: Don't include errno.h.
9489         (errno_to_fileio_errno): Move to hostio-errno.
9490         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
9491         error number outputting to the target->hostio_last_error callback.
9492         (hostio_packet_error): Use FILEIO_EINVAL directly.
9493         (handle_open, handle_pread, hostio_error, handle_unlink): Update
9494         calls to hostio_error.
9495         * hostio-errno.c: New.
9496         * server.h (hostio_last_error_from_errno): Declare.
9497         * target.h (target_ops): Add hostio_last_error member.
9498         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
9499         as hostio_last_error handler.
9500         * spu-low.c (spu_target_ops): Likewise.
9501         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
9502         (wince_hostio_last_error): New functions.
9503         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
9504         as hostio_last_error handler.
9505         (win32_target_ops) [!_WIN32_WCE]: Register
9506         hostio_last_error_from_errno as hostio_last_error handler.
9507         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
9508         (hostio-errno.o): New rule.
9509         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
9510         * configure.srv (srv_hostio_err_objs): New variable.  Default to
9511         hostio-errno.o.
9512         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
9513         * configure: Regenerate.
9514
9515 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9516
9517         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
9518         (linux_kill, linux_detach): Clean up the process list.
9519         * remote-utils.c (remote_open): Improve port number parsing.
9520         (putpkt_binary, input_interrupt): Only send interrupts if the target
9521         is running.
9522         * server.c (extended_protocol): Make static.
9523         (attached): Define earlier.
9524         (exit_requested, response_needed, program_argv): New variables.
9525         (target_running): New.
9526         (start_inferior): Clear attached here.
9527         (attach_inferior): Set attached here.
9528         (require_running): Define.
9529         (handle_query): Use require_running and target_running.  Implement
9530         "monitor exit".
9531         (handle_v_attach, handle_v_run): New.
9532         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
9533         (gdbserver_usage): Update.
9534         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
9535         --attach along with other options or after the port.  Save
9536         program_argv.  Support no initial program.  Resynchronize
9537         communication with GDB after an error.  Handle "monitor exit".
9538         Use require_running and target_running.  Always allow the extended
9539         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
9540         restart in extended mode.
9541         * README: Refer to the GDB manual.  Update --attach usage.
9542
9543 2007-12-20  Andreas Schwab  <schwab@suse.de>
9544
9545         * linux-low.c (STACK_SIZE): Define.
9546         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
9547         (linux_test_for_tracefork): Likewise.
9548
9549 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
9550
9551         * linux-low.c (linux_wait_for_event): Update messages.  Do not
9552         reinsert auto-delete breakpoints.
9553         * mem-break.c (struct breakpoint): Change return type of handler to
9554         int.
9555         (set_breakpoint_at): Update handler type.
9556         (reinsert_breakpoint_handler): Return 1 instead of calling
9557         delete_breakpoint.
9558         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
9559         setting a new one.
9560         (check_breakpoints): Delete auto-delete breakpoints and return 2.
9561         * mem-break.h (set_breakpoint_at): Update handler type.
9562         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
9563         * win32-low.c (auto_delete_breakpoint): New.
9564         (get_child_debug_event): Use it.
9565
9566 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
9567
9568         * configure.ac: Check for pread and pwrite.
9569         * hostio.c (handle_pread): Fall back to lseek and read.
9570         (handle_pwrite): Fall back to lseek and write.
9571         * config.in, configure: Regenerated.
9572
9573 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
9574
9575         * server.c (myresume): Add own_buf argument.
9576         (main): Update calls.
9577
9578 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
9579
9580         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
9581         * remote-utils.c (remote_open): Do not call disable_async_io.
9582         (block_async_io): Delete.
9583         (unblock_async_io): Make static.
9584         (initialize_async_io): New.
9585         * server.c (handle_v_cont): Handle async I/O here.
9586         (myresume): Likewise.  Move other common resume tasks here...
9587         (main): ... from here.  Call initialize_async_io.  Disable async
9588         I/O before the main loop.
9589         * server.h (initialize_async_io): Declare.
9590         (block_async_io, unblock_async_io): Delete prototypes.
9591         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
9592
9593 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
9594
9595         * remote-utils.c (readchar): Allow binary data in received messages.
9596
9597 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
9598
9599         * win32-low.c (attaching): New global.
9600         (win32_create_inferior): Clear the `attaching' global.
9601         (win32_attach): Set the `attaching' global.
9602         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
9603         attaching.  Only set a breakpoint at the entry point if not
9604         attaching.
9605
9606 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
9607
9608         * server.c (main): Don't report dll events on the initial
9609         connection on attaches.
9610
9611 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
9612
9613         * server.c (main): Relax numerical bases supported for the pid of
9614         the --attach command line argument.
9615
9616 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
9617
9618         * win32-low.c (win32_attach): Call OpenProcess before
9619         DebugActiveProcess, not after.  Add last error output to error
9620         call.
9621
9622 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
9623
9624         * win32-low.c (win32_get_thread_context)
9625         (win32_set_thread_context): New functions.
9626         (thread_rec): Use win32_get_thread_context.
9627         (continue_one_thread, win32_resume): Use win32_set_thread_context.
9628         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
9629         field.
9630
9631 2007-12-03  Leo Zayas
9632             Pedro Alves  <pedro_alves@portugalmail.pt>
9633
9634         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
9635         global variables.
9636         (child_add_thread): Minor cleanup.
9637         (child_continue): Resume artificially suspended threads before
9638         calling ContinueDebugEvent.
9639         (suspend_one_thread): New.
9640         (fake_breakpoint_event): New.
9641         (get_child_debug_event): Change return type to int.  Check here if
9642         gdb sent an interrupt request.  If a soft interrupt was requested,
9643         fake a breakpoint event.  Return 0 if there is no event to handle,
9644         and 1 otherwise.
9645         (win32_wait): Don't check here if gdb sent an interrupt request.
9646         Ensure there is a valid event to handle.
9647         (win32_request_interrupt): Add soft interruption method as last
9648         resort.
9649
9650 2007-12-03  Leo Zayas
9651             Pedro Alves  <pedro_alves@portugalmail.pt>
9652
9653         * win32-low.h (win32_thread_info): Add descriptions to the
9654         structure members.  Replace `suspend_count' counter by a
9655         `suspended' flag.
9656         * win32-low.c (thread_rec): Update condition of when to get the
9657         context from the inferior.  Rely on ContextFlags being set if it
9658         has already been retrieved.  Only suspend the inferior thread if
9659         we haven't already.  Warn if that fails.
9660         (continue_one_thread): s/suspend_count/suspended/.  Only call
9661         ResumeThread once.  Warn if that fails.
9662
9663 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
9664
9665         * win32-low.c (win32_wait): Don't read from the inferior when it
9666         has already exited.
9667
9668 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
9669
9670         * Makefile.in (win32_low_h): New variable.
9671         (win32-low.o): Add dependency on $(win32_low_h).
9672         (win32-arm-low.o, win32-i386-low.o): New rules.
9673
9674 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
9675
9676         * hostio.c: Correct copyright year.
9677
9678 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
9679
9680         * Makefile.in (OBS): Add hostio.o.
9681         (hostio.o): New rule.
9682         * server.h (handle_vFile): Declare.
9683         * hostio.c: New file.
9684         * server.c (handle_v_requests): Take packet_len and new_packet_len
9685         for binary packets.  Call handle_vFile.
9686         (main): Update call to handle_v_requests.
9687
9688 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
9689
9690         * linux-low.c: Include <sched.h>.
9691
9692 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
9693
9694         * linux-low.c (linux_tracefork_grandchild): New.
9695         (linux_tracefork_child): Use clone.
9696         (linux_test_for_tracefork): Use clone; allocate and free a stack.
9697
9698 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
9699
9700         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
9701
9702 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
9703
9704         * linux-low.c (handle_extended_wait): Handle unexpected signals.
9705
9706 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
9707
9708         * inferiors.c (change_inferior_id): Delete.
9709         (add_pid_to_list, pull_pid_from_list): New.
9710         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
9711         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
9712         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
9713         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
9714         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
9715         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
9716         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
9717         (using_threads): Always set to 1.
9718         (handle_extended_wait): New.
9719         (add_process): Do not set TID.
9720         (linux_create_inferior): Set must_set_ptrace_flags.
9721         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
9722         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
9723         (linux_thread_alive): Rename TID argument to LWPID.
9724         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
9725         (linux_wait_for_event): Do not use TID or check using_threads.  Update
9726         call to dead_thread_notify.  Call handle_extended_wait.
9727         (linux_create_inferior): Use PTRACE_SETOPTIONS.
9728         (send_sigstop): Delete sigstop_sent.
9729         (wait_for_sigstop): Avoid TID.
9730         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
9731         (linux_test_for_tracefork): New.
9732         (linux_lookup_signals): Use thread_db_active and
9733         linux_supports_tracefork_flag.
9734         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
9735         * linux-low.h (get_process_thread): Avoid TID.
9736         (struct process_ifo): Move thread_known and tid to the end.  Remove
9737         sigstop_sent.
9738         (linux_attach_lwp, thread_db_init): Update prototypes.
9739         * server.h (change_inferior_id): Delete prototype.
9740         (add_pid_to_list, pull_pid_from_list): New prototypes.
9741         * thread-db.c (thread_db_use_events): New.
9742         (find_first_thread): Rename to...
9743         (find_one_thread): ...this.  Update callers and messages.  Do not
9744         call fatal.  Check thread_db_use_events.  Do not call
9745         change_inferior_id or new_thread_notify.
9746         (maybe_attach_thread): Update.  Do not call new_thread_notify.
9747         (thread_db_init): Set thread_db_use_events.  Check use_events.
9748         * utils.c (fatal, warning): Correct message prefix.
9749
9750 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
9751
9752         * Makefile.in (clean): Remove new files.
9753         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
9754         (powerpc-64.o, powerpc-64.c): New rules.
9755         * configure.srv: Use alternate register sets for powerpc64-*-linux*
9756         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
9757         with SPE.
9758         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
9759         SPE targets.
9760         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
9761         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
9762         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
9763         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
9764         (target_regsets): Add AltiVec and SPE register sets.
9765         * configure.ac: Check for AltiVec and SPE.
9766         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
9767         (ppc_fill_vrregset, ppc_store_vrregset): New.
9768         (target_regsets): Add AltiVec register set.
9769         * configure: Regenerated.
9770
9771 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
9772
9773         * linux-low.c (O_LARGEFILE): Define.
9774         (linux_read_memory): Use /proc/PID/mem.
9775         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
9776         * configure, config.in: Regenerated.
9777
9778 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
9779
9780         * linux-low.c (linux_wait_for_event): Do not pass signals while
9781         single-stepping.
9782
9783 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
9784
9785         * win32-low.c (create_process): New.
9786         (win32_create_inferior): Use create_process instead of
9787         CreateProcess.  If create_process failed retry appending an ".exe"
9788         suffix.  Store the GetLastError result immediatelly after
9789         create_process calls and use it on the call to error.
9790
9791 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
9792
9793         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
9794
9795 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
9796
9797         * configure.ac: Switch license to GPLv3.
9798
9799 2007-08-01  Michael Snyder  <msnyder@access-company.com>
9800
9801         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
9802
9803 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
9804
9805         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
9806         typedef.
9807         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
9808         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
9809         CloseToolhelp32Snapshot.
9810         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
9811         CloseToolhelp32Snapshot.
9812
9813 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
9814
9815         * server.c (main): Check for inferior exit before main loop.
9816
9817 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
9818
9819         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
9820         instead of on tmp_desc.
9821
9822 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
9823             Daniel Jacobowitz  <dan@codesourcery.com>
9824
9825         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
9826         (add_thread): Minor cleanups.
9827         (clear_inferiors): Move lower in the file.  Clear the DLL
9828         list.
9829         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
9830         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
9831         (xml_escape_text): New.
9832         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
9833         for qSupported.
9834         (handle_v_cont): Report errors.
9835         (gdbserver_version): Update.
9836         (main): Correct size of own_buf.  Do not report initial DLL events.
9837         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
9838         (unloaded_dll, xml_escape_text): New.
9839         * win32-low.c (enum target_waitkind): Update comments.
9840         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
9841         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
9842         (win32_EnumProcessModules, win32_GetModuleInformation)
9843         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
9844         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
9845         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
9846         (win32_Module32First, win32_Module32Next, load_toolhelp)
9847         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
9848         (get_child_debug_event): Handle DLL events.
9849         (win32_wait): Likewise.
9850
9851 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
9852
9853         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
9854         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
9855
9856 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
9857
9858         * win32-low.c (handle_output_debug_string): Ignore event if not
9859         waiting.
9860
9861 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
9862
9863         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
9864
9865 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
9866
9867         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
9868
9869 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
9870
9871         * inferiors.c (change_inferior_id): Add comment.
9872         * linux-low.c (check_removed_breakpoint): Add an early
9873         prototype.  Improve debug output.
9874         (linux_attach): Doc update.
9875         (linux_detach_one_process, linux_detach): Clean up before releasing
9876         each process.
9877         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
9878         * linux-low.h (struct process_info): Doc improvement.
9879         * mem-break.c (delete_all_breakpoints): New.
9880         * mem-break.h (delete_all_breakpoints): New prototype.
9881         * thread-db.c (find_first_thread): New.
9882         (thread_db_create_event): Call it instead of
9883         thread_db_find_new_threads.  Clean up unused variables.
9884         (maybe_attach_thread): Remove first thread handling.
9885         (thread_db_find_new_threads): Use find_first_thread.
9886         (thread_db_get_tls_address): Likewise.
9887
9888 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
9889
9890         * thread-db.c (thread_db_find_new_threads): Add prototype.
9891         (thread_db_create_event): Check for the main thread before adding
9892         a new thread.
9893         (maybe_attach_thread): Only enable event reporting if TID == 0.
9894         (thread_db_get_tls_address): Check for new threads.
9895
9896 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
9897
9898         * linux-low.c (linux_create_inferior): Try execv before execvp.
9899         * spu-low.c (spu_create_inferior): Likewise.
9900
9901 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
9902
9903         * linux-low.c (linux_create_inferior): Change execv to execvp.
9904         * spu-low.c (spu_create_inferior): Likewies.
9905
9906 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
9907
9908         * Makefile.in (clean): Clean new files instead of deleted ones.
9909         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
9910         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
9911         rules.
9912         * configure.srv: Specify XML files and new regformats for MIPS and
9913         MIPS64 GNU/Linux.
9914         * linux-mips-low.c (mips_num_regs): Set to only used registers.
9915         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
9916         an entry for the restart register.
9917         (mips_cannot_fetch_register, mips_cannot_store_register)
9918         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
9919         register names to match the XML descriptions.
9920         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
9921         restart register instead of $0.
9922
9923 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
9924             Markus Deuling  <deuling@de.ibm.com>
9925
9926         * remote-utils.c (decode_xfer_write): New function.
9927         * server.h (decode_xfer_write): Add prototype.
9928         * server.c (handle_query): Add PACKET_LEN argument.  Support
9929         qXfer:spu:read and qXfer:spu:write packets.
9930         (main): Pass packet_len to handle_query.
9931         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
9932         * target.h (target_ops): Add qxfer_spu.
9933
9934 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
9935
9936         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
9937         accessing non-seekable spufs files.
9938
9939 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
9940
9941         * server.c (handle_query): Add reply for qC packet.
9942
9943 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
9944             Leo Zayas  <lerele@champenstudios@com>
9945
9946         * server.h (check_remote_input_interrupt_request): New function.
9947         * remote_utils.c (INVALID_DESCRIPTOR): New define.
9948         (remote_desc): Initialize with INVALID_DESCRIPTOR.
9949         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
9950         (check_remote_input_interrupt_request): New function.
9951         * server.h (check_remote_input_interrupt_request): Declare.
9952         * win32-low.c (winapi_DebugBreakProcess,
9953         winapi_GenerateConsoleCtrlEvent): New typedefs.
9954         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
9955         to 250 ms.
9956         (win32_wait): Check for remote interrupt request
9957         with check_remote_input_interrupt_request.
9958         (win32_request_interrupt): New function.
9959         (win32_target_op): Set request_interrupt to win32_request_interrupt.
9960
9961 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
9962
9963         * win32-low.c (debug_registers_changed,
9964         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
9965         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
9966         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
9967         (thread_rec): Get context using the low target.
9968         (child_add_thread): Call thread_added on the low target,
9969         which does the same thing.
9970         (regptr): Delete.
9971         (do_initial_child_stuff): Remove debug registers references.
9972         Set context using the low target.  Resume threads after
9973         setting the contexts.
9974         (child_continue): Remove dead variable.  Remove debug
9975         registers references.
9976         (child_fetch_inferior_registers): Go through the low target.
9977         (do_child_store_inferior_registers): Remove.
9978         (child_store_inferior_registers): Go through the low target.
9979         (win32_resume): Remove debug registers references.
9980         Set context using the low target.
9981         (handle_exception): Change return type to void.  Don't record
9982         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
9983         first chance exception.
9984         (get_child_debug_event): Change return type to void.  Remove
9985         goto loop.  Always return after waiting for debug event.
9986         (win32_wait): Convert to switch statement.  Handle spurious
9987         events.
9988
9989         * win32-i386-low.c (debug_registers_changed,
9990         debug_registers_used): New.
9991         (initial_stuff): Rename to ...
9992         (i386_initial_stuff): ... this.  Clear debug registers
9993         state variables.
9994         (store_debug_registers): Delete.
9995         (i386_get_thread_context): New.
9996         (load_debug_registers): Delete.
9997         (i386_set_thread_context): New.
9998         (i386_thread_added): New.
9999         (single_step): Rename to ...
10000         (i386_single_step): ... this.
10001         (do_fetch_inferior_registers): Rename to ...
10002         (i386_fetch_inferior_register): ... this.
10003         (i386_store_inferior_register): New.
10004         (the_low_target): Adapt to new interface.
10005
10006         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
10007         (arm_get_thread_context): New.
10008         (arm_set_thread_context): New.
10009         (regptr): New.
10010         (do_fetch_inferior_registers): Rename to ...
10011         (arm_fetch_inferior_register): ... this.
10012         (arm_store_inferior_register): New.
10013         (arm_wince_breakpoint): Reimplement as unsigned long.
10014         (arm_wince_breakpoint_len): Define.
10015         (the_low_target): Adapt to new interface.
10016
10017         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
10018         load_debug_registers.  Add get_thread_context, set_thread_context,
10019         thread_added and store_inferior_register.  Rename
10020         fetch_inferior_registers to fetch_inferior_register.
10021         (regptr): Remove declaration.
10022
10023 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
10024
10025         * linux-low.c (linux_detach): Change return type to int.  Return 0.
10026         * spu-low.c (spu_detach): Likewise.
10027
10028 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
10029
10030         * target.h (target_ops): Change return type of detach to int.
10031         Add join.
10032         (join_inferior): New.
10033         * server.c (main): Don't skip detach support on mingw32.
10034         If the inferior doesn't support detaching return error.
10035         Call join_inferior instead of using waitpid.
10036         * linux-low.c (linux_join): New.
10037         (linux_target_op): Add linux_join.
10038         * spu-low.c (spu_join): New.
10039         (spu_target_ops): Add spu_join.
10040         * win32-low.c (win32_detach): Adapt to new interface.
10041         Reopen current_process_handle before detaching.  Issue a child
10042         resume before detaching.
10043         (win32_join): New.
10044         (win32_target_op): Add win32_join.
10045
10046 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
10047
10048         * win32-low.c (win32-attach): Fix return value.
10049         * target.h (target_ops): Describe ATTACH return values.
10050
10051 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
10052
10053         * win32-low.c (GETPROCADDRESS): Define.
10054         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
10055         (winapi_DebugSetProcessKillOnExit): Likewise.
10056         (win32_create_inferior): Force usage of ansi CreateProcessA.
10057         (win32_attach): Use GETPROCADDRESS.
10058         (win32_detach): Likewise.
10059
10060 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
10061
10062         * win32-low.c (win32_wait): Don't use WSTOPSIG.
10063
10064 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
10065
10066         * win32-low.c: Commit leftover changes from 2007-03-29.
10067
10068 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
10069
10070         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
10071         fields short instead of int.  Add explicit padding.
10072         (i387_cache_to_fsave): Remove unnecessary casts.
10073         (i387_fsave_to_cache): Doc fix.
10074         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
10075
10076 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
10077
10078         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
10079         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
10080
10081 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
10082
10083         * configure.srv (arm*-*-mingw32ce*): Move near the other
10084         arm targets.
10085
10086 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
10087
10088         * configure.ac: Add errno checking.
10089         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
10090         sys/file.h and malloc.h.
10091         (AC_CHECK_DECLS): Add perror.
10092         (srv_mingwce): Handle.
10093         * configure.srv (i[34567]86-*-cygwin*): Add
10094         win32-i386-low.o to srv_tgtobj.
10095         (i[34567]86-*-mingw*): Likewise.
10096         (arm*-*-mingw32ce*): Add case.
10097         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
10098         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
10099         [__MINGW32CE__] (strerror): New function.
10100         [__MINGW32CE__] (errno): Define to GetLastError.
10101         [__MINGW32CE__] (COUNTOF): New macro.
10102         (remote_open): Remove extra close call.
10103         * mem-break.c (delete_breakpoint_at): New function.
10104         * mem-break.h (delete_breakpoint_at): Declare.
10105         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
10106         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
10107         [USE_WIN32API] (read, write): Add char* casts.
10108         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
10109         * server.h: Include wincecompat.h on Windows CE.
10110         [HAVE_ERRNO_H]: Check.
10111         (perror): Declare if not declared.
10112         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
10113         (perror_with_name): Remove errno declaration.
10114         * wincecompat.h: New.
10115         * wincecompat.c: New.
10116         * win32-low.h: New.
10117         * win32-arm-low.c: New.
10118         * win32-i386-low.c: New.
10119         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
10120         (OUTMSG2): Make it safe.
10121         (_T): New macro.
10122         (COUNTOF): New macro.
10123         (NUM_REGS): Get it from the low target.
10124         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
10125         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
10126         (thread_rec): Let low target handle debug registers.
10127         (child_add_thread): Likewise.
10128         (child_init_thread_list): Likewise.
10129         (continue_one_thread): Likewise.
10130         (regptr): New.
10131         (do_child_fetch_inferior_registers): Move to ...
10132         * win32-i386-low.c: ... here, and rename to ...
10133         (do_fetch_inferior_registers): ... this.
10134         * win32-low.c (child_fetch_inferior_registers):
10135         Go through the low target.
10136         (do_child_store_inferior_registers): Use regptr.
10137         (strwinerror): New function.
10138         (win32_create_inferior): Handle Windows CE.
10139         Use strwinerror instead of strerror on Windows error
10140         codes.  Add program to the error output.
10141         Don't close the main thread handle on Windows CE.
10142         (win32_attach): Use coredll.dll on Windows CE.
10143         (win32_kill): Close current process and current
10144         thread handles.
10145         (win32_detach): Use coredll.dll on Windows CE.
10146         (win32_resume): Let low target handle debug registers, and
10147         step request.
10148         (handle_exception): Add/Remove initial breakpoint.  Avoid
10149         non-existant WSTOPSIG on Windows CE.
10150         (win32_read_inferior_memory): Cast to remove warning.
10151         (win32_arch_string): Go through the low target.
10152         (initialize_low): Call set_breakpoint_data with the low
10153         target's breakpoint.
10154         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
10155         FOP_REGNUM, mappings): Move to ...
10156         * win32-i386-low.c: ... here.
10157         * win32-low.c (win32_thread_info): Move to ...
10158         * win32-low.h: ... here.
10159         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
10160         win32-arm-low.c and wincecompat.c.
10161         (all:): Add $EXEEXT.
10162         (install-only:): Likewise.
10163         (gdbserver:): Likewise.
10164         (gdbreplay:): Likewise.
10165         * config.in: Regenerate.
10166         * configure: Regenerate.
10167
10168 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
10169
10170         * win32-low.c: Rename typedef thread_info to
10171         win32_thread_info throughout.
10172
10173 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
10174
10175         * win32-i386-low.c: Rename to ...
10176         * win32-low.c: ... this.
10177         * configure.srv: Replace win32-i386-low.o with win32-low.o.
10178         * Makefile.in: Likewise.
10179
10180 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
10181
10182         * remote-utils.c (monitor_output): Constify msg parameter.
10183         * server.h (monitor_output): Likewise.
10184         * win32-i386-low.c (handle_output_debug_string): New.
10185         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
10186         handle_output_debug_string.
10187         (get_child_debug_event): Likewise.
10188
10189 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
10190
10191         * server.c (main): Correct strtoul check.
10192
10193 2007-03-27  Jon Ringle  <jon@ringle.org>
10194
10195         * linux-low.c: Check __ARCH_HAS_MMU__ also.
10196
10197 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
10198
10199         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
10200
10201 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
10202
10203         * terminal.h: Check HAVE_SGTTY_H.
10204
10205 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
10206
10207         * remote-utils.c (remote_open): Print out the assigned port number.
10208
10209 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
10210
10211         * remote-utils.c (monitor_output): New function.
10212         * server.c (debug_threads): Define here.
10213         (monitor_show_help): New function.
10214         (handle_query): Handle qRcmd.
10215         (main): Do not handle 'd' packet.
10216         * server.h (debug_threads, remote_debug, monitor_output): Declare.
10217         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
10218         of debug_threads.
10219
10220 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
10221
10222         * Makefile.in (EXEEXT): New.
10223         (clean): Use $(EXEEXT).
10224
10225 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
10226
10227         * target.h (target_ops): Rename send_signal to request_interrupt,
10228         and remove enum target_signal parameter.
10229         * linux-low.c (linux_request_interrupt): Rename from
10230         linux_send_signal, and always send SIGINT.
10231         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
10232         and always send SIGINT.
10233         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
10234         of send_signal.
10235         (input_interrupt): Likewise.
10236
10237 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
10238
10239         * server.c (get_features_xml): Check if target implemented
10240         arch_string.
10241         * win32-i386-low.c (win32_arch_string): New.
10242         (win32_target_ops): Add win32_arch_string as arch_string member.
10243
10244 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
10245
10246         * spu-low.c (spu_arch_string): New.
10247         (spu_target_ops): Add spu_arch_string.
10248
10249 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
10250
10251         * remote-utils.c: Remove HAVE_TERMINAL_H check.
10252         * configure.ac: Do not check for terminal.h.
10253         * configure, config.in: Regenerated.
10254
10255 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
10256
10257         * Makefile.in (OBS): Add $(XML_BUILTIN).
10258         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
10259         (clean): Update.
10260         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
10261         (arm-with-iwmmxt.c): New.
10262         * config.in, configure: Regenerate.
10263         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
10264         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
10265         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
10266         (arm*-*-linux*): Add iWMMXt and regset support.
10267         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
10268         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
10269         (arm_store_wmmxregset, target_regsets): New.
10270         * server.c (get_features_xml): Take annex argument.  Check builtin
10271         XML documents.
10272         (handle_query): Handle multiple annexes.
10273
10274 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
10275
10276         * remote-utils.c [USE_WIN32API] (read, write): Define.
10277         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
10278         write.
10279
10280 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
10281
10282         * linux-i386-low.c (the_low_target): Set arch_string.
10283         * linux-x86-64-low.c (the_low_target): Likewise.
10284         * linux-low.c (linux_arch_string): New.
10285         (linux_target_ops): Add it.
10286         * linux-low.h (struct linux_target_ops): Add arch_string.
10287         * server.c (write_qxfer_response): Use const void * for DATA.
10288         (get_features_xml): New.
10289         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
10290         * target.h (struct target_ops): Add arch_string method.
10291
10292 2007-01-03  Denis Pilat  <denis.pilat@st.com>
10293             Daniel Jacobowitz  <dan@codesourcery.com>
10294
10295         * linux-low.c (linux_kill): Handle being called with no threads.
10296         * win32-i386-low.c (win32_kill): Likewise.
10297         (get_child_debug_event): Clear current_process_handle.
10298
10299 2006-12-30  Denis PILAT  <denis.pilat@st.com>
10300             Daniel Jacobowitz  <dan@codesourcery.com>
10301
10302         * remote-utils.c (remote_open): Check the type of specified
10303         serial port devices before opening them.
10304         * server.c (main): Kill the inferior if an error occurs during
10305         the first remote_open.
10306
10307 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
10308
10309         * README: Update supported targets.
10310
10311 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
10312
10313         * Makefile.in (clean): Remove reg-mips64.c.
10314         (reg-mips64.c, reg-mips64.o): New rules.
10315         * configure.srv: Handle mips64.  Include regset support for mips.
10316         * linux-mips-low.c (union mips_register): New.
10317         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
10318         (mips_breakpoint, mips_breakpoint_at): Use int.
10319         (mips_collect_register, mips_supply_register)
10320         (mips_collect_register_32bit, mips_supply_register_32bit)
10321         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
10322         (mips_store_fpregset, target_regsets): New.
10323         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
10324
10325 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
10326
10327         * configure.srv: Add target "spu*-*-*".
10328         * Makefile.in (clean): Remove reg-spu.c.
10329         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
10330         * spu-low.c: New file.
10331
10332 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
10333
10334         * configure.ac: Correct td_thr_tls_get_addr test.
10335         * configure: Regenerated.
10336
10337 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
10338
10339         * linux-low.c (linux_wait_for_event): Reformat.  Use the
10340         pass_signals array.
10341         * remote-utils.c (decode_address_to_semicolon): New.
10342         * server.c (pass_signals, handle_general_set): New.
10343         (handle_query): Mention QPassSignals for qSupported.
10344         (main): Call handle_general_set.
10345         * server.h (pass_signals, decode_address_to_semicolon): New.
10346
10347 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
10348
10349         * server.c (handle_query): Correct error handling for read_auxv.
10350
10351 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
10352
10353         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
10354         and srv_linux_thread_db to yes.
10355         * linux-s390-low.c (s390_fill_gregset): New function.
10356         (target_regsets): Define data structure.
10357
10358 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
10359
10360         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
10361         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
10362         * config.in, configure: Regenerated.
10363         * inferiors.c (gdb_id_to_thread): New function.
10364         (gdb_id_to_thread_id): Use it.
10365         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
10366         * linux-low.h (struct process_info): Add th member.
10367         (thread_db_get_tls_address): New prototype.
10368         * remote-utils.c (decode_address): Make non-static.
10369         * server.c (handle_query): Handle qGetTLSAddr.
10370         * server.h (gdb_id_to_thread, decode_address): New prototypes.
10371         * target.h (struct target_ops): Add get_tls_address.
10372         * thread-db.c (maybe_attach_thread): Save the thread handle.
10373         (thread_db_get_tls_address): New.
10374
10375 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
10376
10377         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
10378         (linux_resume_one_process): Take a siginfo_t *.  Update all
10379         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
10380         (struct pending_signals): Add a siginfo_t.
10381         (linux_wait_for_process): Always set last_status.
10382         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
10383         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
10384         * linux-low.h (struct process_info): Add last_status.
10385
10386 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
10387
10388         * remote-utils.c (try_rle): New function.
10389         (putpkt_binary): Use it.
10390
10391 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
10392
10393         * Makefile.in (clean): Clean reg-x86-64-linux.c.
10394         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
10395         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
10396         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
10397         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
10398         point registers.
10399
10400 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
10401
10402         * server.c (terminal_fd): New variable.
10403         (old_foreground_pgrp): Likewise.
10404         (restore_old_foreground_pgrp): New function.
10405         (start_inferior): Record the terminal file descriptor in terminal_fd
10406         and its original foreground group in old_foreground_pgrp.  Register
10407         restore_old_foreground_pgrp with atexit().
10408
10409 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
10410
10411         * server.c (handle_query): Correct qPart to qXfer.
10412
10413 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
10414
10415         * configure.ac: Check for more headers which are missing on
10416         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
10417         * configure.srv: Add Cygwin and mingw32.
10418         * remote-utils.c: Don't include headers unconditionally which
10419         are missing on mingw32.  Include <winsock.h> for mingw32.
10420         (remote_open): Adjust for mingw32 support.  Flush
10421         standard error after writing to it.
10422         (remote_close, putpkt_binary, input_interrupt, block_async_io)
10423         (unblock_async_io, enable_async_io, disable_async_io)
10424         (readchar, getpkt): Update for Winsock support.
10425         (prepare_resume_reply): Expect a protocol signal number.
10426         * server.c: Disable <sys/wait.h> on mingw32.
10427         (start_inferior): Adjust for mingw32 support.  Flush
10428         standard error after writing to it.
10429         (attach_inferior): Likewise.  Use protocol signal
10430         numbers.
10431         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
10432         and names.
10433         * win32-i386-low.c: New file.
10434         * Makefile.in (XM_CLIBS): Set.
10435         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
10436         (win32-i386-low.o): New dependency rule.
10437         * linux-low.c (linux_wait): Use target signal numbers.
10438         * target.h (struct target_ops): Doc fix.
10439         * server.h (target_signal_to_name): New prototype.
10440         * gdbreplay.c: Don't include headers unconditionally which
10441         are missing on mingw32.  Include <winsock.h> for mingw32.
10442         (remote_close, remote_open): Adjust for Winsock support.
10443         * configure, config.in: Regenerated.
10444
10445 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
10446
10447         * server.c (decode_xfer_read, write_qxfer_response): New.
10448         (handle_query): Take a packet length argument.  Handle
10449         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
10450         the qSupported response.
10451         (main): Update call to handle_query.
10452
10453 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
10454
10455         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
10456         (putpkt_binary): Renamed from putpkt and adjusted for binary
10457         data.
10458         (putpkt): New wrapper for putpkt_binary.
10459         (readchar): Don't mask off the high bit.
10460         (decode_X_packet): New function.
10461         * server.c (main): Call putpkt_binary if a handler sets the packet
10462         length.  Save the length of the incoming packet.  Handle 'X'.
10463         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
10464
10465 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
10466
10467         * server.c (handle_query): Handle qSupported.
10468
10469 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
10470
10471         * remote-utils.c (all_symbols_looked_up): New variable.
10472         (look_up_one_symbol): Check it.
10473         * server.h (look_up_one_symbol): New declaration.
10474         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
10475
10476 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
10477
10478         * Makefile.in (linux-arm-low.o): Update dependencies.
10479         * linux-arm-low.c: Include "gdb_proc_service.h".
10480         (PTRACE_GET_THREAD_AREA): Define.
10481         (ps_get_thread_area): New function.
10482
10483 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
10484
10485         * configure.srv (m68k*-*-uclinux*): New target.
10486         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
10487         (linux_resume_one_process): Remove extraneous cast.
10488         (linux_read_offsets): New.
10489         (linux_target_op): Add linux_read_offsets on mmuless systems.
10490         * server.c (handle_query): Add qOffsets logic.
10491         * target.h (struct target_ops): Add read_offsets.
10492
10493 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
10494
10495         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
10496         (PTRACE_GET_THREAD_AREA): Define.
10497         (ps_get_thread_area): New function.
10498         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
10499         (linux-x86-64-low.o): Update.
10500
10501 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
10502
10503         * configure.ac: Remove checks for prfpregset_t.
10504         * gdb_proc_service.h: New file.
10505         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
10506         new "gdb_proc_service.h".
10507         * proc-service.c: Likewise.
10508         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
10509         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
10510         * Makefile.in (gdb_proc_service_h): Updated.
10511         * configure, config.in: Regenerated.
10512
10513 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
10514
10515         * remote-utils.c (prepare_resume_reply): Move declaration
10516         of gdb_id_from_wait to the top of the block.
10517
10518 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
10519
10520         * linux-low.c (regsets_store_inferior_registers): Read the regset
10521         from the target before filling it.
10522
10523 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
10524
10525         * server.c (attach_inferior): Return SIGTRAP for a successful
10526         attach.
10527
10528 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
10529
10530         * Makefile.in (OBS): Add version.o.
10531         (STAGESTUFF): Delete.
10532         (version.o): Add dependencies.
10533         (version.c): Replace rule.
10534         (clean): Remove version.c.
10535         * server.c (gdbserver_version): New.
10536         (gdbserver_usage): Use printf.
10537         (main): Handle --version and --help.
10538         * server.h (version, host_name): Add declarations.
10539
10540 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
10541
10542         * linux-arm-low.c:
10543         * linux-arm-low.c:
10544         * inferiors.c:
10545         * i387-fp.h:
10546         * i387-fp.c:
10547         * gdbreplay.c:
10548         * regcache.c:
10549         * proc-service.c:
10550         * mem-break.h:
10551         * mem-break.c:
10552         * linux-x86-64-low.c:
10553         * linux-sh-low.c:
10554         * linux-s390-low.c:
10555         * linux-ppc64-low.c:
10556         * linux-ppc-low.c:
10557         * linux-mips-low.c:
10558         * linux-m68k-low.c:
10559         * linux-m32r-low.c:
10560         * linux-low.h:
10561         * linux-low.c:
10562         * linux-ia64-low.c:
10563         * linux-i386-low.c:
10564         * linux-crisv32-low.c:
10565         * thread-db.c:
10566         * terminal.h:
10567         * target.h:
10568         * target.c:
10569         * server.h:
10570         * server.c:
10571         * remote-utils.c:
10572         * regcache.h:
10573         * utils.c:
10574         * Makefile.in:
10575         * configure.ac:
10576         * gdbserver.1: Add (C) after Copyright.  Update the FSF
10577         address.
10578
10579 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
10580
10581         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
10582         (arm_breakpoint_at): Recognize both breakpoints.
10583         (the_low_target): Use the correct breakpoint instruction.
10584
10585 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
10586
10587         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
10588         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
10589         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
10590         (the_low_target): Update.
10591
10592 2005-10-25  Andreas Schwab  <schwab@suse.de>
10593
10594         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
10595
10596         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
10597         (ia64_num_regs): Reduce to 462.
10598
10599 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
10600
10601         * acinclude.m4: Correct quoting.
10602         * aclocal.m4: Regenerated.
10603
10604         Suggested by SZOKOVACS Robert <szo@ies.hu>:
10605         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
10606         (thread_db_init): Call thread_db_err_str.
10607         * configure.ac: Check for TD_VERSION.
10608         * config.in, configure: Regenerated.
10609
10610 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
10611
10612         * server.h (error, fatal, warning): Add ATTR_FORMAT.
10613
10614 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
10615
10616         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
10617         is not available.  Define HAVE_PTRACE_GETREGS if it is.
10618         * config.in, configure: Regenerated.
10619         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
10620         * linux-i386-low.c, linux-m68k-low.c: Update to use
10621         HAVE_PTRACE_GETREGS.
10622         * linux-low.c (regsets_fetch_inferior_registers)
10623         (regsets_store_inferior_registers): Only return 0 if we processed
10624         GENERAL_REGS.
10625         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
10626         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
10627
10628 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
10629
10630         * inferiors.c (struct thread_info): Add gdb_id.
10631         (add_thread): Add gdb_id argument.
10632         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
10633         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
10634         calls to add_thread.
10635         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
10636         * server.c (handle_query): Use thread_to_gdb_id.
10637         (handle_v_cont, main): Use gdb_id_to_thread_id.
10638         * server.h (add_thread): Update prototype.
10639         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
10640         prototypes.
10641
10642 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
10643
10644         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
10645         left-padded registers.
10646         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
10647         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
10648
10649 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
10650
10651         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
10652         * configure: Regenerate.
10653         * config.in: Regenerate.
10654         * server.h (NEED_DECLARATION_STRERROR):
10655         Replace with !HAVE_DECL_STRERROR.
10656
10657 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
10658
10659         * linux-low.c (linux_wait, linux_send_signal): Don't test
10660         an unsigned long variable for > 0 if it could be MAX_ULONG.
10661         * server.c (myresume): Likewise.
10662         * target.c (set_desired_inferior): Likewise.
10663
10664 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
10665
10666         * configure.ac: Simplify and improve check for socklen_t.
10667         * configure, config.in: Regenerate.
10668
10669 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
10670
10671         * acconfig.h: Remove.
10672         * configure.ac: Add a test for socklen_t.  Use three-argument
10673         AC_DEFINE throughout.
10674         * config.in: Regenerated using autoheader 2.59.
10675         * configure: Regenerated.
10676
10677         * gdbreplay.c (socklen_t): Provide a default.
10678         (remote_open): Use socklen_t.
10679         * remote-utils.c (socklen_t): Provide a default.
10680         (remote_open): Use socklen_t.
10681         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
10682         unsigned char.
10683
10684         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
10685         char for buffers.
10686         * linux-low.c (linux_read_memory, linux_write_memory)
10687         (linux_read_auxv): Likewise.
10688         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
10689         (check_mem_write): Likewise.
10690         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
10691         Likewise.
10692         * regcache.c (struct inferior_rgcache_data, registers_to_string)
10693         (registers_from_string, register_data): Likewise.
10694         * server.c (handle_query, main): Likewise.
10695         * server.h (convert_ascii_to_int, convert_int_to_ascii)
10696         (decode_M_packet): Likewise.
10697         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
10698         * target.h (struct target_ops): Update read_memory, write_memory,
10699         and read_auxv.
10700         (read_inferior_memory, write_inferior_memory): Update.
10701         * linux-low.h (struct linux_target_ops): Change type of breakpoint
10702         to unsigned char *.
10703         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
10704         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
10705         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
10706         linux-s390-low.c, linux-sh-low.c: Update for changes in
10707         read_inferior_memory and the_low_target->breakpoint.
10708
10709 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
10710
10711         * Makefile.in (SFILES): Add linux-ppc64-low.c.
10712         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
10713         * configure.srv: Add powerpc64-*-linux*.
10714         * linux-ppc64-low.c: New file.
10715
10716 2005-05-23  Orjan Friberg  <orjanf@axis.com>
10717
10718         * linux-cris-low.c: New file with support for CRIS.
10719         * linux-crisv32-low.c: Ditto for CRISv32.
10720         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
10721         (clean): Add reg-cris.c and reg-crisv32.c.
10722         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
10723         reg-crisv32.o, and reg-crisv32.c to make rules.
10724         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
10725         recognized targets.
10726
10727 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
10728
10729         * linux-low.c (fetch_register): Ensure buffer size is a multiple
10730         of sizeof (PTRACE_XFER_TYPE).
10731         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
10732
10733 2005-05-12  Orjan Friberg  <orjanf@axis.com>
10734
10735         * target.h (struct target_ops): Add insert_watchpoint,
10736         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
10737         pointers for hardware watchpoint support.
10738         * linux-low.h (struct linux_target_ops): Ditto.
10739         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
10740         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
10741         to linux_target_ops.
10742         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
10743         reply packet.
10744         * server.c (main): Recognize 'Z' and 'z' packets.
10745
10746 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
10747
10748         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
10749         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
10750         (the_low_target): Add new members.
10751
10752 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
10753
10754         * proc-service.c (ps_lgetregs): Search all_processes instead of
10755         all_threads.
10756
10757 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
10758
10759         * server.c (start_inferior): Change return type to int.
10760         (attach_inferior): Change sigptr to int *.
10761         (handle_v_cont, handle_v_requests): Change signal to int *.
10762         (main): Change signal to int.
10763
10764 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
10765
10766         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
10767         * configure.srv: Add m32r*-*-linux*.
10768         * linux-m32r-low.c: New file.
10769
10770 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
10771
10772         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
10773
10774 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
10775
10776         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
10777         Take unsigned long arguments for PIDs.
10778         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
10779         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
10780         (wait_for_sigstop, linux_resume_one_process)
10781         (regsets_fetch_inferior_registers, linux_send_signal)
10782         (linux_read_auxv): Likewise.  Update the types of variables holding
10783         PIDs.  Update format string specifiers.
10784         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
10785         * remote-utils.c (prepare_resume_reply): Likewise.
10786         * server.c (cont_thread, general_thread, step_thread)
10787         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
10788         unsigned long.
10789         (handle_query): Update format specifiers.
10790         (handle_v_cont, main): Use strtoul for thread IDs.
10791         * server.h (struct inferior_list_entry): Use unsigned long for ID.
10792         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
10793         (general_thread, step_thread, thread_from_wait)
10794         (old_thread_from_wait): Update.
10795         * target.h (struct thread_resume): Use unsigned long for THREAD.
10796         (struct target_ops): Use unsigned long for arguments to attach and
10797         thread_alive.
10798
10799 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
10800
10801         * acinclude.m4: Include bfd/bfd.m4 directly.
10802         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
10803         <agriffis@toolchain.org>.
10804         * aclocal.m4, configure: Regenerated.
10805
10806 2005-01-07  Andrew Cagney  <cagney@gnu.org>
10807
10808         * configure.ac: Rename configure.in, require autoconf 2.59.
10809         * configure: Re-generate.
10810
10811 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
10812
10813         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
10814         LIBS when finished.
10815         * aclocal.m4: Regenerated.
10816         * configure: Regenerated.
10817
10818 2004-11-21  Andreas Schwab  <schwab@suse.de>
10819
10820         * linux-m68k-low.c (m68k_num_gregs): Define.
10821         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
10822         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
10823         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
10824         (m68k_breakpoint_at): New.  Add to the_low_target.
10825
10826         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
10827         srv_linux_thread_db to yes.
10828
10829 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
10830
10831         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
10832         (ARCH_SET_FS): Likewise.
10833         (ARCH_GET_FS): Likewise.
10834         (ARCH_GET_GS): Likewise.
10835
10836 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
10837
10838         * linux-i386-low.c (ps_get_thread_area): New.
10839         * linux-x86-64-low.c (ps_get_thread_area): New.
10840         * linux-low.c: Include <sys/syscall.h>.
10841         (linux_kill_one_process): Don't kill the first thread here.
10842         (linux_kill): Kill the first thread here.
10843         (kill_lwp): New function.
10844         (send_sigstop, linux_send_signal): Use it.
10845         * proc-service.c: Clean up #ifdefs.
10846         (fpregset_info): Delete.
10847         (ps_lgetregs): Update and enable implementation.
10848         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
10849         implementations.
10850         * remote-utils.c (struct sym_cache, symbol_cache): New.
10851         (input_interrupt): Print a clearer message.
10852         (async_io_enabled): New variable.
10853         (enable_async_io, disable_async_io): Use it.  Update comments.
10854         (look_up_one_symbol): Use the symbol cache.
10855         * thread-db.c (thread_db_look_up_symbols): New function.
10856         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
10857
10858 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
10859
10860         * configure.in: Test for -rdynamic.
10861         * configure: Regenerated.
10862         * Makefile (INTERNAL_LDFLAGS): New.
10863         (gdbserver, gdbreplay): Use it.
10864
10865 2004-09-02  Andrew Cagney  <cagney@gnu.org>
10866
10867         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
10868
10869 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
10870
10871         * linux-low.c (linux_wait): Clear all_processes list also.
10872
10873 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
10874
10875         * linux-low.c: Include <errno.h>.  Remove extern declaration of
10876         errno.
10877
10878 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
10879
10880         * gdbreplay.c, server.h, utils.c: Update copyright years.
10881
10882 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
10883
10884         * server.c (main): Print child status or termination signal from
10885         variable 'signal', not 'sig'.
10886
10887 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
10888
10889         * linux-low.c (linux_read_memory): Change return type to
10890         int.  Check for and return error from ptrace().
10891         * target.c (read_inferior_memory): Change return type to int.  Pass
10892         back return status from the_target->read_memory().
10893         * target.h (struct target_ops): Adapt *read_memory() prototype.
10894         Update comment.
10895         (read_inferior_memory): Adapt prototype.
10896         * server.c (main): Return an error packet if
10897         read_inferior_memory() returns an error.
10898
10899 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
10900
10901         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
10902         Unify with other clean targets.
10903
10904 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
10905
10906         * server.c (handle_v_cont): Call set_desired_inferior.
10907
10908 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
10909
10910         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
10911
10912 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
10913
10914         * linux-low.c (linux_wait): Unblock async I/O.
10915         (linux_resume): Block and enable async I/O.
10916         * remote-utils.c (block_async_io, unblock_async_io): New functions.
10917         * server.h (block_async_io, unblock_async_io): Add prototypes.
10918
10919 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
10920
10921         * remote-utils.c (remote_open): Print a status notice after
10922         opening a TCP port.
10923         * server.c (attach_inferior): Print a status notice after
10924         attaching.
10925
10926 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
10927
10928         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
10929
10930 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
10931
10932         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
10933         error packet.
10934         * server.c, target.h: Update copyright years.
10935
10936 2004-02-25  Roland McGrath  <roland@redhat.com>
10937
10938         * target.h (struct target_ops): New member `read_auxv'.
10939         * server.c (handle_query): Handle qPart:auxv:read: query using that.
10940         * linux-low.c (linux_read_auxv): New function.
10941         (linux_target_ops): Initialize `read_auxv' member to that.
10942
10943 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
10944
10945         Committed by Jim Blandy  <jimb@redhat.com>.
10946
10947         * linux-s390-low.c (s390_num_regs): Update.
10948         (s390_regmap): Remove control registers.  Use __s390x__ predefine
10949         instead of GPR_SIZE to distiguish s390 and s390x targets.
10950
10951 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
10952
10953         * linux-low.c: Update copyright year.
10954         (check_removed_breakpoint): Clear pending_is_breakpoint.
10955         (linux_set_resume_request, linux_queue_one_thread)
10956         (resume_status_pending_p): New functions.
10957         (linux_continue_one_thread): Use process->resume.
10958         (linux_resume): Only resume threads if there are no pending events.
10959         * linux-low.h (struct process_info): Add resume request
10960         pointer.
10961
10962 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
10963
10964         * regcache.c (new_register_cache): Clear the allocated register
10965         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
10966
10967 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
10968
10969         * linux-low.c (linux_resume): Take a struct thread_resume *
10970         argument.
10971         (linux_wait): Update call.
10972         (resume_ptr): New static variable.
10973         (linux_continue_one_thread): Renamed from
10974         linux_continue_one_process.  Use resume_ptr.
10975         (linux_resume): Use linux_continue_one_thread.
10976         * server.c (handle_v_cont, handle_v_requests): New functions.
10977         (myresume): New function.
10978         (main): Handle 'v' case.
10979         * target.h (struct thread_resume): New type.
10980         (struct target_ops): Change argument of "resume" to struct
10981         thread_resume *.
10982         (myresume): Delete macro.
10983
10984 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
10985
10986         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
10987         (uninstall): Support DESTDIR.
10988
10989 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
10990
10991         * configure.srv: Add xscale*linux copy of arm*linux entry.
10992
10993 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
10994
10995         * linux-arm-low.c (arm_reinsert_addr): New function.
10996         (the_low_target): Add arm_reinsert_addr.
10997
10998 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
10999
11000         * mem-break.c: Remove whitespace at end of file.
11001
11002 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
11003
11004         * configure.in: Check whether we need to prototype strerror.
11005         * server.h: Optionally prototype strerror.
11006         * gdbreplay.c (perror_with_name): Use strerror.
11007         * linux-low.c (linux_attach_lwp): Use strerror.
11008         * utils.c (perror_with_name): Use strerror.
11009         * config.in, configure: Regenerated.
11010
11011 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
11012
11013         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
11014         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
11015
11016 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
11017
11018         * Makefile.in (SFILES): Update.
11019         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
11020         low-sun3.c: Remove files.
11021
11022 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
11023
11024         * linux-low.c: Move comment to linux_thread_alive where it belonged.
11025         (linux_detach_one_process, linux_detach): New functions.
11026         (linux_target_ops): Add linux_detach.
11027         * server.c (main): Handle 'D' packet.
11028         * target.h (struct target_ops): Add "detach" member.
11029         (detach_inferior): Define.
11030
11031 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
11032
11033         From Kelley Cook  <kelleycook@wideopenwest.com>:
11034         * configure.srv: Accept i[34567]86 variants.
11035
11036 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
11037
11038         * linux-low.c (linux_wait_for_event): Correct comment typos.
11039         (linux_resume_one_process): Call check_removed_breakpoint.
11040         (linux_send_signal): New function.
11041         (linux_target_ops): Add linux_send_signal.
11042         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
11043         of kill.
11044         * target.h (struct target_ops): Add send_signal.
11045
11046 2003-05-29  Jim Blandy  <jimb@redhat.com>
11047
11048         * linux-low.c (usr_store_inferior_registers): Transfer buf in
11049         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
11050         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
11051         away part of the register's value.
11052
11053 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
11054
11055         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
11056         (linux_wait_for_event, linux_init_signals): Likewise.
11057
11058 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
11059
11060         * configure.in: Check for stdlib.h.
11061         * configure: Regenerated.
11062         * config.in: Regenerated.
11063
11064 2003-01-04  Andreas Schwab  <schwab@suse.de>
11065
11066         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
11067
11068 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
11069
11070         * Makefile.in: Remove obsolete code.
11071
11072 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
11073
11074         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
11075         defined(PT_FPR0_HI).
11076
11077 2002-11-17  Stuart Hughes  <seh@zee2.com>
11078
11079         * linux-arm-low.c (arm_num_regs): Increase.
11080         (arm_regmap): Include status register.
11081
11082 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
11083
11084         * linux-low.c (register_addr): Remove incorrect -1 check.
11085
11086 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
11087
11088         * linux-low.c (linux_create_inferior): Call setpgid.  Return
11089         the new PID.
11090         (unstopped_p, linux_signal_pid): Remove.
11091         (linux_target_ops): Remove linux_signal_pid.
11092         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
11093         global instead of target method.
11094         * target.h (struct target_ops): Remove signal_pid.  Update comment
11095         for create_inferior.
11096         * server.c (signal_pid): New variable.
11097         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
11098         gdbserver.  Set the child to be the foreground process group.
11099         (attach_inferior): Set signal_pid.
11100
11101 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
11102
11103         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
11104
11105 2002-08-20  Jim Blandy  <jimb@redhat.com>
11106
11107         * Makefile.in (LDFLAGS): Allow the configure script to establish a
11108         default for this.
11109
11110 2002-08-01  Andrew Cagney  <cagney@redhat.com>
11111
11112         * Makefile.in: Make chill references obsolete.
11113
11114 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
11115
11116         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
11117         * configure: Regenerate.
11118         * config.in: Regenerate.
11119
11120 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
11121
11122         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
11123         (perror_with_name, remote_close, remote_open, expect, play): Static.
11124
11125 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
11126
11127         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
11128         byte offsets instead of an array of indexes.
11129         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
11130
11131 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
11132
11133         * regcache.c: Add comment.
11134
11135 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
11136
11137         * thread-db.c: New file.
11138         * proc-service.c: New file.
11139         * acinclude.m4: New file.
11140         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
11141         proc-service.o, and thread-db.o.
11142         (linux-low.o): Add USE_THREAD_DB.
11143         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
11144         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
11145         * aclocal.m4: Regenerated.
11146         * config.in: Regenerated.
11147         * configure: Regenerated.
11148         * configure.in: Check for proc_service.h, sys/procfs.h,
11149         thread_db.h, and linux/elf.h headrs.
11150         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
11151         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
11152         Check for -lthread_db and thread support.
11153         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
11154         PowerPC, and SuperH.
11155         * i387-fp.c: Constify arguments.
11156         * i387-fp.h: Likewise.
11157         * inferiors.c: (struct thread_info): Renamed from
11158         `struct inferior_info'.  Remove PID member.  Use generic inferior
11159         list header.  All uses updated.
11160         (inferiors, signal_pid): Removed.
11161         (all_threads): New variable.
11162         (get_thread): Define.
11163         (add_inferior_to_list): New function.
11164         (for_each_inferior): New function.
11165         (change_inferior_id): New function.
11166         (add_inferior): Removed.
11167         (remove_inferior): New function.
11168         (add_thread): New function.
11169         (free_one_thread): New function.
11170         (remove_thread): New function.
11171         (clear_inferiors): Use for_each_inferior and free_one_thread.
11172         (find_inferior): New function.
11173         (find_inferior_id): New function.
11174         (inferior_target_data): Update argument type.
11175         (set_inferior_target_data): Likewise.
11176         (inferior_regcache_data): Likewise.
11177         (set_inferior_regcache_data): Likewise.
11178         * linux-low.c (linux_bp_reinsert): Remove.
11179         (all_processes, stopping_threads, using_thrads)
11180         (struct pending_signals, debug_threads, pid_of): New.
11181         (inferior_pid): Replace with macro.
11182         (struct inferior_linux_data): Remove.
11183         (get_stop_pc, add_process): New functions.
11184         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
11185         Use add_process and add_thread.
11186         (linux_attach_lwp): New function, based on old linux_attach.  Use
11187         add_process and add_thread.  Set stop_expected for new threads.
11188         (linux_attach): New function.
11189         (linux_kill_one_process): New function.
11190         (linux_kill): Kill all LWPs.
11191         (linux_thread_alive): Use find_inferior_id.
11192         (check_removed_breakpoints, status_pending_p): New functions.
11193         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
11194         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
11195         struct for the found process.
11196         (linux_wait_for_event): New function.
11197         (linux_wait): Use it.  Support LWPs.
11198         (send_sigstop, wait_for_sigstop, stop_all_processes)
11199         (linux_resume_one_process, linux_continue_one_process): New functions.
11200         (linux_resume): Support LWPs.
11201         (REGISTER_RAW_SIZE): Remove.
11202         (fetch_register): Use register_size instead.  Call supply_register.
11203         (usr_store_inferior_registers): Likewise.  Call collect_register.
11204         Fix recursive case.
11205         (regsets_fetch_inferior_registers): Improve error message.
11206         (regsets_store_inferior_registers): Add debugging.
11207         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
11208         (unstopped_p, linux_signal_pid): New functions.
11209         (linux_target_ops): Add linux_signal_pid.
11210         (linux_init_signals): New function.
11211         (initialize_low): Call it.  Initialize using_threads.
11212         * regcache.c (inferior_regcache_data): Add valid
11213         flag.
11214         (get_regcache): Fetch registers lazily.  Add fetch argument
11215         and update all callers.
11216         (regcache_invalidate_one, regcache_invalidate): New
11217         functions.
11218         (new_register_cache): Renamed from create_register_cache.
11219         Return the new regcache.
11220         (free_register_cache): Change argument to a void *.
11221         (registers_to_string, registers_from_string): Call get_regcache
11222         with fetch flag set.
11223         (register_data): Make static.  Pass fetch flag to get_regcache.
11224         (supply_register): Call get_regcache with fetch flag clear.
11225         (collect_register): Call get_regcache with fetch flag set.
11226         (collect_register_as_string): New function.
11227         * regcache.h: Update.
11228         * remote-utils.c (putpkt): Flush after debug output and use
11229         stderr.
11230         Handle input interrupts while waiting for an ACK.
11231         (input_interrupt): Use signal_pid method.
11232         (getpkt): Flush after debug output and use stderr.
11233         (outreg): Use collect_register_as_string.
11234         (new_thread_notify, dead_thread_notify): New functions.
11235         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
11236         and general_thread.
11237         (look_up_one_symbol): Flush after debug output.
11238         * server.c (step_thread, server_waiting): New variables.
11239         (start_inferior): Don't use signal_pid.  Update call to mywait.
11240         (attach_inferior): Update call to mywait.
11241         (handle_query): Handle qfThreadInfo and qsThreadInfo.
11242         (main): Don't fetch/store registers explicitly.  Use
11243         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
11244         calls to mywait.
11245         * server.h: Update.
11246         (struct inferior_list, struct_inferior_list_entry): New.
11247         * target.c (set_desired_inferior): New.
11248         (write_inferior_memory): Constify.
11249         (mywait): New function.
11250         * target.h: Update.
11251         (struct target_ops): New signal_pid method.
11252         (mywait): Removed macro, added prototype.
11253
11254         * linux-low.h (regset_func): Removed.
11255         (regset_fill_func, regset_store_func): New.
11256         (enum regset_type): New.
11257         (struct regset_info): Add type field.  Use new operation types.
11258         (struct linux_target_ops): stop_pc renamed to get_pc.
11259         Add decr_pc_after_break and breakpoint_at.
11260         (get_process, get_thread_proess, get_process_thread)
11261         (strut process_info, all_processes, linux_attach_lwp)
11262         (thread_db_init): New.
11263
11264         * linux-arm-low.c (arm_get_pc, arm_set_pc,
11265         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
11266         (the_low_target): Add new members.
11267         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
11268         (i386_store_fpxregset): Constify.
11269         (target_regsets): Add new kind identifier.
11270         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
11271         (i386_set_pc): Add debugging.
11272         (i386_breakpoint_at): New function.
11273         (the_low_target): Add new members.
11274         * linux-mips-low.c (mips_get_pc, mips_set_pc)
11275         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
11276         (mips_breakpoint_at): New.
11277         (the_low_target): Add new members.
11278         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
11279         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
11280         (the_low_target): Add new members.
11281         * linux-sh-low.c (sh_get_pc, sh_set_pc)
11282         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
11283         (the_low_target): Add new members.
11284         * linux-x86-64-low.c (target_regsets): Add new kind
11285         identifier.
11286
11287 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
11288
11289         From Martin Pool <mbp@samba.org>:
11290         * server.c (gdbserver_usage): New function.
11291         (main): Call it.
11292
11293 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
11294
11295         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
11296         stop_at -> stop_pc.
11297
11298 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
11299
11300         * Makefile.in: Remove obsolete code.
11301
11302 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
11303
11304         * linux-low.c (regsets_fetch_inferior_registers),
11305         (regsets_store_inferior_registers): Removed cast to int from
11306         ptrace() calls.
11307         * regcache.h: Added declaration of struct inferior_info.
11308
11309 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
11310
11311         * inferiors.c (struct inferior_info): Add regcache_data.
11312         (add_inferior): Call create_register_cache.
11313         (clear_inferiors): Call free_register_cache.
11314         (inferior_regcache_data, set_inferior_regcache_data): New functions.
11315         * regcache.c (struct inferior_regcache_data): New.
11316         (registers): Remove.
11317         (get_regcache): New function.
11318         (create_register_cache, free_register_cache): New functions.
11319         (set_register_cache): Don't initialize the register cache here.
11320         (registers_to_string, registers_from_string, register_data): Call
11321         get_regcache.
11322         * regcache.h: Add prototypes.
11323         * server.h: Likewise.
11324
11325 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
11326
11327         * mem-break.c: New file.
11328         * mem-break.h: New file.
11329         * Makefile.in: Add mem-break.o rule; update server.h
11330         dependencies.
11331         * inferiors.c (struct inferior_info): Add target_data
11332         member.
11333         (clear_inferiors): Free target_data member if set.
11334         (inferior_target_data, set_inferior_target_data): New functions.
11335         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
11336         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
11337         * linux-low.c (linux_bp_reinsert): New variable.
11338         (struct inferior_linux_data): New.
11339         (linux_create_inferior): Use set_inferior_target_data.
11340         (linux_attach): Likewise.  Call add_inferior.
11341         (linux_wait_for_one_inferior): New function.
11342         (linux_wait): Call it.
11343         (linux_write_memory): Add const.
11344         (initialize_low): Call set_breakpoint_data.
11345         * linux-low.h (struct linux_target_ops): Add breakpoint
11346         handling members.
11347         * server.c (attach_inferior): Remove extra add_inferior
11348         call.
11349         * server.h: Include mem-break.h.  Update inferior.c
11350         prototypes.
11351         * target.c (read_inferior_memory)
11352         (write_inferior_memory): New functions.
11353         * target.h (read_inferior_memory)
11354         (write_inferior_memory): Change macros to prototypes.
11355         (struct target_ops): Update comments.  Add const to write_memory
11356         definition.
11357
11358 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
11359
11360         * linux-low.c (usr_store_inferior_registers): Support
11361         registers which are allowed to fail to store.
11362         * linux-low.h (linux_target_ops): Likewise.
11363         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
11364         (ppc_cannot_store_register): FPSCR may not be storable.
11365
11366 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
11367
11368         * server.h: Include <string.h> if HAVE_STRING_H.
11369         * ChangeLog: Correct paths in last ChangeLog entry.
11370
11371 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
11372
11373         * linux-low.h: Remove obsolete prototypes.
11374         (struct linux_target_ops): New.
11375         (extern the_low_target): New.
11376         * linux-low.c (num_regs, regmap): Remove declarations.
11377         (register_addr): Use the_low_target explicitly.
11378         (fetch_register): Likewise.
11379         (usr_fetch_inferior_registers): Likewise.
11380         (usr_store_inferior_registers): Likewise.
11381         * linux-arm-low.c (num_regs): Remove.
11382         (arm_num_regs): Define.
11383         (arm_regmap): Renamed from regmap, made static.
11384         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
11385         made static.
11386         (arm_cannot_store_register): Renamed from cannot_store_register,
11387         made static.
11388         (the_low_target): New.
11389         * linux-i386-low.c (num_regs): Remove.
11390         (i386_num_regs): Define.
11391         (i386_regmap): Renamed from regmap, made static.
11392         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
11393         made static.
11394         (i386_cannot_store_register): Renamed from cannot_store_register,
11395         made static.
11396         (the_low_target): New.
11397         * linux-ia64-low.c (num_regs): Remove.
11398         (ia64_num_regs): Define.
11399         (ia64_regmap): Renamed from regmap, made static.
11400         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
11401         made static.
11402         (ia64_cannot_store_register): Renamed from cannot_store_register,
11403         made static.
11404         (the_low_target): New.
11405         * linux-m68k-low.c (num_regs): Remove.
11406         (m68k_num_regs): Define.
11407         (m68k_regmap): Renamed from regmap, made static.
11408         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
11409         made static.
11410         (m68k_cannot_store_register): Renamed from cannot_store_register,
11411         made static.
11412         (the_low_target): New.
11413         * linux-mips-low.c (num_regs): Remove.
11414         (mips_num_regs): Define.
11415         (mips_regmap): Renamed from regmap, made static.
11416         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
11417         made static.
11418         (mips_cannot_store_register): Renamed from cannot_store_register,
11419         made static.
11420         (the_low_target): New.
11421         * linux-ppc-low.c (num_regs): Remove.
11422         (ppc_num_regs): Define.
11423         (ppc_regmap): Renamed from regmap, made static.
11424         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
11425         made static.
11426         (ppc_cannot_store_register): Renamed from cannot_store_register,
11427         made static.
11428         (the_low_target): New.
11429         * linux-s390-low.c (num_regs): Remove.
11430         (s390_num_regs): Define.
11431         (s390_regmap): Renamed from regmap, made static.
11432         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
11433         made static.
11434         (s390_cannot_store_register): Renamed from cannot_store_register,
11435         made static.
11436         (the_low_target): New.
11437         * linux-sh-low.c (num_regs): Remove.
11438         (sh_num_regs): Define.
11439         (sh_regmap): Renamed from regmap, made static.
11440         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
11441         made static.
11442         (sh_cannot_store_register): Renamed from cannot_store_register,
11443         made static.
11444         (the_low_target): New.
11445         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
11446         (the_low_target): New.
11447
11448 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
11449
11450         * Makefile.in: Add stamp-h target.
11451         * configure.in: Create stamp-h.
11452         * configure: Regenerated.
11453
11454 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
11455
11456         * inferiors.c: New file.
11457         * target.c: New file.
11458         * target.h: New file.
11459         * Makefile.in:  Add target.o and inferiors.o.  Update
11460         dependencies.
11461         * linux-low.c (inferior_pid): New static variable,
11462         moved from server.c.
11463         (linux_create_inferior): Renamed from create_inferior.
11464         Call add_inferior.  Return 0 on success instead of a PID.
11465         (linux_attach): Renamed from myattach.
11466         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
11467         (linux_thread_alive): Renamed from mythread_alive.
11468         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
11469         child dies.
11470         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
11471         (regsets_store_inferior_registers): Correct error message.
11472         Add missing ``return 0''.
11473         (linux_fetch_registers): Renamed from fetch_inferior_registers.
11474         (linux_store_registers): Renamed from store_inferior_registers.
11475         (linux_read_memory): Renamed from read_inferior_memory.
11476         (linux_write_memory): Renamed from write_inferior_memory.
11477         (linux_target_ops): New structure.
11478         (initialize_low): Call set_target_ops ().
11479         * remote-utils.c (unhexify): New function.
11480         (hexify): New function.
11481         (input_interrupt): Send signals to ``signal_pid''.
11482         * server.c (inferior_pid): Remove.
11483         (start_inferior): Update create_inferior call.
11484         (attach_inferior): Call add_inferior.
11485         (handle_query): New function.
11486         (main): Call handle_query for `q' packets.
11487         * server.h: Include "target.h".  Remove obsolete prototypes.
11488         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
11489
11490 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
11491
11492         * Makefile.in: Add WARN_CFLAGS.  Update configury
11493         dependencies.
11494         * configure.in: Check for <string.h>
11495         * configure: Regenerate.
11496         * config.in: Regenerate.
11497         * gdbreplay.c: Include needed system headers.
11498         (remote_open): Remove strchr prototype.
11499         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
11500         * regcache.c (supply_register): Change buf argument to const void *.
11501         (supply_register_by_name): Likewise.
11502         (collect_register): Change buf argument to void *.
11503         (collect_register_by_name): Likewise.
11504         * regcache.h: Add missing prototypes.
11505         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
11506         * server.c (handle_query): New function.
11507         (attached): New static variable, moved out of main.
11508         (main): Quiet longjmp clobber warnings.
11509         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
11510         * utils.c (error): Remove NORETURN.
11511         (fatal): Likewise.