Imported Upstream version 7.9
[platform/upstream/gdb.git] / gdb / gdbserver / ChangeLog
1 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
2
3         * i387-fp.c (i387_cache_to_xsave): In look over
4         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
5         zmmh_low_space field by use of zmmh_high_space.
6
7 2015-01-09  Pedro Alves  <palves@redhat.com>
8
9         * linux-low.c (step_over_bkpt): Move higher up in the file.
10         (handle_extended_wait): Don't store the stop_pc here.
11         (get_stop_pc): Adjust comments and rename to ...
12         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
13         stopped for a software breakpoint or hardware breakpoint.
14         (thread_still_has_status_pending_p): New function.
15         (status_pending_p_callback): Use
16         thread_still_has_status_pending_p.  If the event is no longer
17         interesting, resume the LWP.
18         (handle_tracepoints): Add assert.
19         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
20         (wstatus_maybe_breakpoint): New function.
21         (cancel_breakpoint): Delete function.
22         (check_stopped_by_watchpoint): New function, factored out from
23         linux_low_filter_event.
24         (lp_status_maybe_breakpoint): Delete function.
25         (linux_low_filter_event): Remove filter_ptid argument.
26         Leave thread group exits pending here.  Store the LWP's stop PC.
27         Always leave events pending.
28         (linux_wait_for_event_filtered): Pull all events out of the
29         kernel, and leave them all pending.
30         (count_events_callback, select_event_lwp_callback): Consider all
31         events.
32         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
33         (select_event_lwp): Only give preference to the stepping LWP in
34         all-stop mode.  Adjust comments.
35         (ignore_event): New function.
36         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
37         references to cancel_breakpoints.  Adjust to renames.  Also give
38         equal priority to all LWPs that have had events in non-stop mode.
39         If reporting a software breakpoint event, unadjust the LWP's PC.
40         (linux_wait): If linux_wait_1 returned an ignored event, retry.
41         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
42         Adjust.
43         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
44         (resume_status_pending_p): Use thread_still_has_status_pending_p.
45         (linux_stopped_by_watchpoint): Adjust.
46         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
47         * linux-low.h (enum lwp_stop_reason): New.
48         (struct lwp_info) <stop_pc>: Adjust comment.
49         <stopped_by_watchpoint>: Delete field.
50         <stop_reason>: New field.
51         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
52         * mem-break.c (software_breakpoint_inserted_here)
53         (hardware_breakpoint_inserted_here): New function.
54         * mem-break.h (software_breakpoint_inserted_here)
55         (hardware_breakpoint_inserted_here): Declare.
56         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
57         (cancel_breakpoints): Delete.
58         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
59         (upload_fast_traceframes): Remove references to
60         cancel_breakpoints.
61
62 2015-01-09  Pedro Alves  <palves@redhat.com>
63
64         * thread-db.c (find_new_threads_callback): Ignore thread if the
65         kernel thread ID is -1.
66
67 2015-01-09  Pedro Alves  <palves@redhat.com>
68
69         * linux-low.c (linux_attach_fail_reason_string): Move to
70         nat/linux-ptrace.c, and rename.
71         (linux_attach_lwp): Update comment.
72         (attach_proc_task_lwp_callback): New function.
73         (linux_attach): Adjust to rename and use
74         linux_proc_attach_tgid_threads.
75         (linux_attach_fail_reason_string): Delete declaration.
76
77 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
78
79         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
80         * server.c (gdbserver_version): Likewise.
81
82 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
83
84         * remote-utils.c: Include ctype.h.
85         (input_interrupt): Explicitly handle the case when the char
86         received is the NUL byte.  Improve the printing of non-ASCII
87         characters.
88
89 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
90
91         * linux-low.c (linux_low_filter_event): Update call to
92         linux_enable_event_reporting following the addition of
93         a new parameter to that function.
94
95 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
96
97         PR server/17457
98         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
99         (AARCH64_FPCR_REGNO): Likewise.
100         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
101         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
102         (aarch64_store_fpregset): Likewise.
103
104 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
105
106         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
107         Remove FIXME comment about assumption about N.
108
109 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
110
111         * configure.ac: If large-file support is disabled in GDBserver,
112         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
113         * configure: Regenerate.
114
115 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
116
117         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
118         warning upon ENODATA from ptrace.
119         * linux-s390-low.c (s390_store_tdb): New.
120         (s390_regsets): Add regset for NT_S390_TDB.
121
122 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
123
124         * linux-low.c (regsets_store_inferior_registers): Skip regsets
125         without a fill_function.
126         * linux-s390-low.c (s390_fill_last_break): Remove.
127         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
128         (s390_arch_setup): Use regset's size instead of fill_function for
129         loop end condition.
130
131 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
132
133         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
134         the regset's store function when ptrace returned an error.
135         * regcache.c (get_thread_regcache): Invalidate register cache
136         before fetching inferior's registers.
137
138 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
139
140         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
141         while-loop as for-loop.
142         (regsets_store_inferior_registers): Likewise.
143
144 2014-11-28  Yao Qi  <yao@codesourcery.com>
145
146         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
147         * config.in, configure: Re-generate.
148         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
149         is defined.
150
151 2014-11-21  Yao Qi  <yao@codesourcery.com>
152
153         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
154         (AC_CHECK_HEADERS): Remove malloc.h.
155         * configure: Re-generated.
156         * config.in: Re-generated.
157         * server.h: Don't include alloca.h and malloc.h.
158         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
159         Don't include malloc.h.
160
161 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
162
163         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
164         corresponding ERRNO check in same block.
165
166 2014-11-12  Pedro Alves  <palves@redhat.com>
167
168         * server.c (cont_thread): Update comment.
169         (start_inferior, attach_inferior): No longer clear cont_thread.
170         (handle_v_cont): No longer set cont_thread.
171         (captured_main): Clear cont_thread each time a GDB connects.
172
173 2014-11-12  Pedro Alves  <palves@redhat.com>
174
175         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
176         thread, and don't resume all threads if the Hc thread has exited.
177
178 2014-11-12  Pedro Alves  <palves@redhat.com>
179
180         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
181         the process group instead of to a specific LWP.
182
183 2014-10-15  Pedro Alves  <palves@redhat.com>
184
185         PR server/17487
186         * win32-arm-low.c (arm_set_thread_context): Remove current_event
187         parameter.
188         (arm_set_thread_context): Delete.
189         (the_low_target): Adjust.
190         * win32-i386-low.c (debug_registers_changed)
191         (debug_registers_used): Delete.
192         (update_debug_registers_callback): New function.
193         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
194         needing to update their debug registers.
195         (win32_get_current_dr): New function.
196         (x86_dr_low_get_addr, x86_dr_low_get_control)
197         (x86_dr_low_get_status): Fetch the debug register from the thread
198         record's context.
199         (i386_initial_stuff): Adjust.
200         (i386_get_thread_context): Remove current_event parameter.  Don't
201         clear debug_registers_changed nor copy DR values to
202         debug_reg_state.
203         (i386_set_thread_context): Delete.
204         (i386_prepare_to_resume): New function.
205         (i386_thread_added): Mark the thread as needing to update irs
206         debug registers.
207         (the_low_target): Remove i386_set_thread_context and install
208         i386_prepare_to_resume.
209         * win32-low.c (win32_get_thread_context): Adjust.
210         (win32_set_thread_context): Use SetThreadContext
211         directly.
212         (win32_prepare_to_resume): New function.
213         (win32_require_context): New function, factored out from ...
214         (thread_rec): ... this.
215         (continue_one_thread): Call win32_prepare_to_resume on each thread
216         we're about to continue.
217         (win32_resume): Call win32_prepare_to_resume on the event thread.
218         * win32-low.h (struct win32_thread_info)
219         <debug_registers_changed>: New field.
220         (struct win32_target_ops): Change prototype of set_thread_context,
221         delete set_thread_context and add prepare_to_resume.
222         (win32_require_context): New declaration.
223
224 2014-10-08  Gary Benson  <gbenson@redhat.com>
225
226         * server.h: Do not include common-exceptions.h.
227
228 2014-10-08  Gary Benson  <gbenson@redhat.com>
229
230         * server.h: Do not include cleanups.h.
231
232 2014-09-30  James Hogan  <james.hogan@imgtec.com>
233
234         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
235         mips64-dsp-linux.c.
236
237 2014-09-23  Yao Qi  <yao@codesourcery.com>
238
239         * linux-low.c (lp_status_maybe_breakpoint): New function.
240         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
241         (count_events_callback): Likewise.
242         (select_event_lwp_callback): Likewise.
243         (cancel_breakpoints_callback): Likewise.
244
245 2014-09-19  Don Breazeal  <donb@codesourcery.com>
246
247         * linux-low.c (handle_extended_wait): Call
248         linux_ptrace_get_extended_event.
249         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
250         linux_is_extended_waitstatus.
251
252 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
253
254         * Makefile.in (CPPFLAGS): Define.
255         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
256         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
257
258 2014-09-16  Gary Benson  <gbenson@redhat.com>
259
260         * inferiors.h (current_inferior): Renamed as...
261         (current_thread): New variable.  All uses updated.
262         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
263         (maybe_move_out_of_jump_pad): Likewise.
264         (cancel_breakpoint): Likewise.
265         (linux_low_filter_event): Likewise.
266         (wait_for_sigstop): Likewise.
267         (linux_resume_one_lwp): Likewise.
268         (need_step_over_p): Likewise.
269         (start_step_over): Likewise.
270         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
271         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
272         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
273         and save_inferior as saved_thread.
274         * regcache.c (get_thread_regcache): Renamed saved_inferior as
275         saved_thread.
276         (regcache_invalidate_thread): Likewise.
277         * remote-utils.c (prepare_resume_reply): Likewise.
278         * thread-db.c (thread_db_get_tls_address): Likewise.
279         (disable_thread_event_reporting): Likewise.
280         (remove_thread_event_breakpoints): Likewise.
281         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
282         as saved_thread.
283         * target.h (set_desired_inferior): Renamed as...
284         (set_desired_thread): New declaration.  All uses updated.
285         * server.c (myresume): Updated comment to reference thread instead
286         of inferior.
287         (handle_serial_event): Likewise.
288         (handle_target_event): Likewise.
289
290 2014-09-12  Tom Tromey  <tromey@redhat.com>
291             Gary Benson  <gbenson@redhat.com>
292
293         * regcache.h: Include common-regcache.h.
294         (regcache_read_pc): Don't declare.
295         * regcache.c (get_thread_regcache_for_ptid): New function.
296
297 2014-09-11  Tom Tromey  <tromey@redhat.com>
298             Gary Benson  <gbenson@redhat.com>
299
300         * symbol.c: New file.
301         * Makefile.in (SFILES): Add symbol.c.
302         (OBS): Add symbol.o.
303
304 2014-09-11  Gary Benson  <gbenson@redhat.com>
305
306         * target.c (target_stop_ptid, target_continue_ptid): New
307         functions.
308
309 2014-09-11  Tom Tromey  <tromey@redhat.com>
310             Gary Benson  <gbenson@redhat.com>
311
312         * target.h: Include target/target.h.
313         * target.c (target_read_memory, target_read_uint32)
314         (target_write_memory): New functions.
315
316 2014-09-11  Gary Benson  <gbenson@redhat.com>
317
318         * server.h (debug_hw_points): Don't declare.
319         * server.c (debug_hw_points): Don't define.  Replace all uses
320         with show_debug_regs.
321         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
322         all uses with show_debug_regs.
323
324 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
325
326         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
327         endianness into account.
328         (ppc_supply_ptrace_register): Likewise.
329
330 2014-09-03  James Hogan  <james.hogan@imgtec.com>
331
332         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
333         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
334
335 2014-09-03  Gary Benson  <gbenson@redhat.com>
336
337         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
338         ALL_DEBUG_ADDRESS_REGISTERS.
339
340 2014-09-02  Gary Benson  <gbenson@redhat.com>
341
342         * i386-low.h: Renamed as...
343         * x86-low.h: New file.  All type, function and variable name
344         prefixes changed from "i386_" to "x86_".  All references updated.
345         * i386-low.c: Renamed as...
346         * x86-low.c: New file.  All type, function and variable name
347         prefixes changed from "i386_" to "x86_".  All references updated.
348
349 2014-09-02  Gary Benson  <gbenson@redhat.com>
350
351         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
352         (x86_linux_new_thread): Likewise.
353
354 2014-08-29  Gary Benson  <gbenson@redhat.com>
355
356         * server.h (setjmp.h): Do not include.
357         (toplevel): Do not declare.
358         (common-exceptions.h): Include.
359         (cleanups.h): Likewise.
360         * server.c (toplevel): Do not define.
361         (exit_code): New static global.
362         (detach_or_kill_for_exit_cleanup): New function.
363         (main): New function.  Original main renamed to...
364         (captured_main): New function.
365         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
366
367 2014-08-29  Gary Benson  <gbenson@redhat.com>
368
369         * Makefile.in (SFILES): Add common/common-exceptions.c.
370         (OBS): Add common-exceptions.o.
371         (common-exceptions.o): New rule.
372         * utils.c (prepare_to_throw_exception): New function.
373
374 2014-08-29  Gary Benson  <gbenson@redhat.com>
375
376         * config.in: Regenerate.
377         * configure: Likewise.
378
379 2014-08-29  Gary Benson  <gbenson@redhat.com>
380
381         * Makefile.in (SFILES): Add common/cleanups.c.
382         (OBS): cleanups.o.
383         (cleanups.o): New rule.
384
385 2014-08-29  Gary Benson  <gbenson@redhat.com>
386
387         * utils.c (internal_vwarning): New function.
388
389 2014-08-28  Gary Benson  <gbenson@redhat.com>
390
391         * utils.h (fatal): Remove declaration.
392         * utils.c (fatal): Remove function.
393
394 2014-08-28  Gary Benson  <gbenson@redhat.com>
395
396         * tracepoint.c (gdb_agent_init): Replace fatal with
397         perror_with_name.
398         (initialize_tracepoint): Likewise.
399
400 2014-08-28  Gary Benson  <gbenson@redhat.com>
401
402         * remote-utils.c (remote_prepare): Replace fatal with error.
403
404 2014-08-28  Gary Benson  <gbenson@redhat.com>
405
406         * linux-low.c (linux_async): Replace fatal with warning.
407         Tidy up and return.
408         (linux_start_non_stop): Return -1 if linux_async failed.
409
410 2014-08-28  Gary Benson  <gbenson@redhat.com>
411
412         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
413         gdb_assert.
414         (i386_dr_low_get_addr): Remove vague comment.
415         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
416         gdb_assert.
417
418 2014-08-28  Gary Benson  <gbenson@redhat.com>
419
420         * inferiors.c (get_thread_process): Replace check with gdb_assert.
421         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
422         internal_error.
423         (linux_resume_one_lwp): Likewise.
424         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
425         gdb_assert.
426         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
427         with internal_error.
428         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
429         (init_register_cache): Replace fatal with gdb_assert_not_reached.
430         (find_register_by_name): Replace fatal with internal_error.
431         (find_regno): Likewise.
432         * tdesc.c (init_target_desc): Replace check with gdb_assert.
433         * thread-db.c (thread_db_create_event): Likewise.
434         (thread_db_load_search): Likewise.
435         (try_thread_db_load_1): Likewise.
436         * tracepoint.c (get_jump_space_head): Replace fatal with
437         internal_error.
438         (claim_trampoline_space): Likewise.
439         (have_fast_tracepoint_trampoline_buffer): Likewise.
440         (cmd_qtstart): Likewise.
441         (stop_tracing): Likewise.
442         (fast_tracepoint_collecting): Likewise.
443         (target_malloc): Likewise.
444         (download_tracepoint): Likewise.
445         (download_trace_state_variables): Replace check with gdb_assert.
446         (upload_fast_traceframes): Replace fatal with internal_error.
447
448 2014-08-19  Tom Tromey  <tromey@redhat.com>
449             Gary Benson  <gbenson@redhat.com>
450
451         * Makefile.in (SFILES): Add common/common-debug.c.
452         (OBS): Add common-debug.o.
453         (common-debug.o): New rule.
454         * debug.h (debug_printf): Don't declare.
455         * debug.c (debug_printf): Renamed and rewritten as...
456         (debug_vprintf): New function.
457
458 2014-08-19  Gary Benson  <gbenson@redhat.com>
459
460         * utils.h: Do not include print-utils.h.
461
462 2014-08-19  Tom Tromey  <tromey@redhat.com>
463             Gary Benson  <gbenson@redhat.com>
464
465         * server.h: Add static assertion.
466         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
467
468 2014-08-19  Tom Tromey  <tromey@redhat.com>
469             Gary Benson  <gbenson@redhat.com>
470
471         * Makefile.in (SFILES): Add common/errors.c.
472         (OBS): Add errors.o.
473         (IPA_OBS): Add errors-ipa.o.
474         (errors.o): New rule.
475         (errors-ipa.o): Likewise.
476         * utils.h (perror_with_name, error, warning): Don't declare.
477         * utils.c (warning): Renamed and rewritten as...
478         (vwarning): New function.
479         (error): Renamed and rewritten as...
480         (verror): New function.
481         (internal_error): Renamed and rewritten as...
482         (internal_verror): New function.
483
484 2014-08-07  Gary Benson  <gbenson@redhat.com>
485
486         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
487         * configure: Regenerate.
488         * config.in: Likewise.
489         * server.h: Do not include errno.h.
490         * event-loop.c: Likewise.
491         * hostio-errno.c: Likewise.
492         * linux-low.c: Likewise.
493         * remote-utils.c: Likewise.
494         * spu-low.c: Likewise.
495         * utils.c: Likewise.
496         * gdbreplay.c: Unconditionally include errno.h.
497
498 2014-08-07  Gary Benson  <gbenson@redhat.com>
499
500         * server.h: Do not include string.h.
501         * event-loop.c: Likewise.
502         * linux-low.c: Likewise.
503         * regcache.c: Likewise.
504         * remote-utils.c: Likewise.
505         * spu-low.c: Likewise.
506         * utils.c: Likewise.
507
508 2014-08-07  Gary Benson  <gbenson@redhat.com>
509
510         * server.h: Do not include gdb_assert.h.
511
512 2014-08-07  Gary Benson  <gbenson@redhat.com>
513
514         * server.h: Do not include common-utils.h.
515
516 2014-08-07  Gary Benson  <gbenson@redhat.com>
517
518         * server.h: Do not include ptid.h.
519         * notif.h: Likewise.
520
521 2014-08-07  Gary Benson  <gbenson@redhat.com>
522
523         * server.h: Do not include gdb_locale.h.
524
525 2014-08-07  Gary Benson  <gbenson@redhat.com>
526
527         * server.h: Do not include gdb/signals.h.
528         * win32-low.c: Likewise.
529
530 2014-08-07  Gary Benson  <gbenson@redhat.com>
531
532         * server.h: Do not include pathmax.h.
533
534 2014-08-07  Gary Benson  <gbenson@redhat.com>
535
536         * server.h: Do not include libiberty.h.
537         * linux-bfin-low.c: Likewise.
538
539 2014-08-07  Gary Benson  <gbenson@redhat.com>
540
541         * server.h: Do not include ansidecl.h.
542
543 2014-08-07  Gary Benson  <gbenson@redhat.com>
544
545         * linux-x86-low.c: Do not include stddef.h.
546         * lynx-ppc-low.c: Likewise.
547         * tracepoint.c: Likewise.
548
549 2014-08-07  Gary Benson  <gbenson@redhat.com>
550
551         * server.h: Do not include stdarg.h.
552         * nto-low.c: Likewise.
553
554 2014-08-07  Gary Benson  <gbenson@redhat.com>
555
556         * server.h: Do not include stdlib.h.
557         * inferiors.c: Likewise.
558         * linux-low.c: Likewise.
559         * regcache.c: Likewise.
560         * spu-low.c: Likewise.
561         * tracepoint.c: Likewise.
562         * utils.c: Likewise.
563
564 2014-08-07  Gary Benson  <gbenson@redhat.com>
565
566         * server.h: Do not include stdio.h.
567         * linux-low.c: Likewise.
568         * remote-utils.c: Likewise.
569         * spu-low.c: Likewise.
570         * utils.c: Likewise.
571         * wincecompat.c: Likewise.
572
573 2014-08-06  Gary Benson  <gbenson@redhat.com>
574
575         * regcache.c (init_register_cache): Move conditionals inside if.
576
577 2014-08-06  Gary Benson  <gbenson@redhat.com>
578
579         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
580
581 2014-07-31  Gary Benson  <gbenson@redhat.com>
582
583         * ax.h: Do not include server.h.
584         * gdbthread.h: Likewise.
585         * lynx-low.h: Likewise.
586         * notif.h: Likewise.
587
588 2014-07-30  Gary Benson  <gbenson@redhat.com>
589
590         * server.h: Include common-defs.h.
591         Do not include config.h or build-gnulib-gdbserver/config.h.
592
593 2014-07-30  Gary Benson  <gbenson@redhat.com>
594
595         * hostio-errno.c: Move server.h to top of includes list.
596         * inferiors.c: Likewise.
597         * linux-x86-low.c: Likewise.
598         * notif.c: Include server.h.
599
600 2014-07-24  Tom Tromey  <tromey@redhat.com>
601             Gary Benson  <gbenson@redhat.com>
602
603         * server.h (CORE_ADDR): Now unsigned.
604
605 2014-07-16  Pedro Alves  <palves@redhat.com>
606
607         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
608
609 2014-07-15  Pedro Alves  <palves@redhat.com>
610
611         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
612         copy.
613
614 2014-07-11  Pedro Alves  <palves@redhat.com>
615
616         * linux-low.c (kill_wait_lwp): New function, based on
617         kill_one_lwp_callback, but use my_waitpid directly.
618         (kill_one_lwp_callback, linux_kill): Use it.
619
620 2014-06-23  Pedro Alves  <palves@redhat.com>
621
622         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
623         before setting DR0..DR3.
624
625 2014-06-20  Gary Benson  <gbenson@redhat.com>
626
627         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
628         * configure: Regenerated.
629         * config.in: Likewise.
630
631 2014-06-20  Gary Benson  <gbenson@redhat.com>
632
633         * Makefile.in (SFILES): Update locations for files moved
634         from common to nat.
635         (object file files): Reordered.
636
637 2014-06-20  Gary Benson  <gbenson@redhat.com>
638
639         * i386-low.h (i386_dr_low_can_set_addr): Removed.
640         (i386_dr_low_set_addr): Likewise.
641         (i386_dr_low_get_addr): Likewise.
642         (i386_dr_low_can_set_control): Likewise.
643         (i386_dr_low_set_control): Likewise.
644         (i386_dr_low_get_control): Likewise.
645         (i386_dr_low_get_status): Likewise.
646         (i386_get_debug_register_length): Likewise.
647         * linux-x86-low.c (i386_dr_low_set_addr):
648         Changed signature.  Made static.
649         (i386_dr_low_get_addr): Likewise.
650         (i386_dr_low_set_control): Likewise.
651         (i386_dr_low_get_control): Likewise.
652         (i386_dr_low_get_status): Likewise.
653         (i386_dr_low): New global variable.
654         * win32-i386-low.c (i386_dr_low_set_addr):
655         Changed signature.  Made static.
656         (i386_dr_low_get_addr): Likewise.
657         (i386_dr_low_set_control): Likewise.
658         (i386_dr_low_get_control): Likewise.
659         (i386_dr_low_get_status): Likewise.
660         (i386_dr_low): New global variable.
661
662 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
663
664         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
665         * Makefile.in (AR, AR_FLAGS): Define.
666         * configure: Regenerate.
667
668 2014-06-19  Gary Benson  <gbenson@redhat.com>
669
670         * Makefile.in (i386-dregs.o): New rule.
671         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
672         * i386-low.c (target.h): Remove include.
673         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
674         (DR_CONTROL_SHIFT): Likewise.
675         (DR_CONTROL_SIZE): Likewise.
676         (DR_RW_EXECUTE): Likewise.
677         (DR_RW_WRITE): Likewise.
678         (DR_RW_READ): Likewise.
679         (DR_RW_IORW): Likewise.
680         (DR_LEN_1): Likewise.
681         (DR_LEN_2): Likewise.
682         (DR_LEN_4): Likewise.
683         (DR_LEN_8): Likewise.
684         (DR_LOCAL_ENABLE_SHIFT): Likewise.
685         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
686         (DR_ENABLE_SIZE): Likewise.
687         (DR_LOCAL_SLOWDOWN): Likewise.
688         (DR_GLOBAL_SLOWDOWN): Likewise.
689         (DR_CONTROL_RESERVED): Likewise.
690         (I386_DR_CONTROL_MASK): Likewise.
691         (I386_DR_VACANT): Likewise.
692         (I386_DR_LOCAL_ENABLE): Likewise.
693         (I386_DR_GLOBAL_ENABLE): Likewise.
694         (I386_DR_DISABLE): Likewise.
695         (I386_DR_SET_RW_LEN): Likewise.
696         (I386_DR_GET_RW_LEN): Likewise.
697         (I386_DR_WATCH_HIT): Likewise.
698         (i386_wp_op_t): Likewise.
699         (i386_show_dr): Likewise.
700         (i386_length_and_rw_bits): Likewise.
701         (i386_insert_aligned_watchpoint): Likewise.
702         (i386_remove_aligned_watchpoint): Likewise.
703         (i386_handle_nonaligned_watchpoint): Likewise.
704         i386_update_inferior_debug_regs(): Likewise.
705         (i386_dr_insert_watchpoint): Likewise.
706         (i386_dr_remove_watchpoint): Likewise.
707         (i386_dr_region_ok_for_watchpoint): Likewise.
708         (i386_dr_stopped_data_address): Likewise.
709         (i386_dr_stopped_by_watchpoint): Likewise.
710
711 2014-06-19  Gary Benson  <gbenson@redhat.com>
712
713         * i386-low.c (i386_dr_show): Renamed to
714         i386_show_dr and made static.  All uses updated.
715         (i386_dr_length_and_rw_bits): Renamed to
716         i386_length_and_rw_bits and made static.
717         All uses updated.
718         (i386_dr_insert_aligned_watchpoint): Renamed to
719         i386_insert_aligned_watchpoint and made static.
720         All uses updated.
721         (i386_dr_remove_aligned_watchpoint): Renamed to
722         i386_remove_aligned_watchpoint and made static.
723         All uses updated.
724         (i386_dr_update_inferior_debug_regs): Renamed to
725         i386_update_inferior_debug_regs and made static.
726         All uses updated.
727
728 2014-06-18  Gary Benson  <gbenson@redhat.com>
729
730         * i386-low.h (i386_dr_low_can_set_addr): New macro.
731         (i386_dr_low_can_set_control): Likewise.
732         (i386_get_debug_register_length): Likewise.
733         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
734         (i386_dr_low_can_set_control): Likewise.
735         (i386_get_debug_register_length): Likewise.
736
737 2014-06-17  Gary Benson  <gbenson@redhat.com>
738
739         * i386-low.h (i386-dregs.h): New include.
740         (DR_FIRSTADDR): Now in i386-dregs.h.
741         (DR_LASTADDR): Likewise.
742         (DR_NADDR): Likewise.
743         (DR_STATUS): Likewise.
744         (DR_CONTROL): Likewise.
745         (i386_debug_reg_state): Likewise.
746         (i386_dr_insert_watchpoint): Likewise.
747         (i386_dr_remove_watchpoint): Likewise.
748         (i386_dr_region_ok_for_watchpoint): Likewise.
749         (i386_dr_stopped_data_address): Likewise.
750         (i386_dr_stopped_by_watchpoint): Likewise.
751         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
752
753 2014-06-18  Gary Benson  <gbenson@redhat.com>
754
755         * i386-low.h (i386_low_insert_watchpoint): Renamed to
756         i386_dr_insert_watchpoint.
757         (i386_low_remove_watchpoint): Renamed to
758         i386_dr_remove_watchpoint.
759         (i386_low_region_ok_for_watchpoint): Renamed to
760         i386_dr_region_ok_for_watchpoint.
761         (i386_low_stopped_data_address): Renamed to
762         i386_dr_stopped_data_address.
763         (i386_low_stopped_by_watchpoint): Renamed to
764         i386_dr_stopped_by_watchpoint.
765         * i386-low.c (i386_show_dr): Renamed to
766         i386_dr_show and made nonstatic.  All uses updated.
767         (i386_length_and_rw_bits): Renamed to
768         i386_dr_length_and_rw_bits and made nonstatic.
769         All uses updated.
770         (i386_insert_aligned_watchpoint): Renamed to
771         i386_dr_insert_aligned_watchpoint and made nonstatic.
772         All uses updated.
773         (i386_remove_aligned_watchpoint): Renamed to
774         i386_dr_remove_aligned_watchpoint and made nonstatic.
775         All uses updated.
776         (i386_update_inferior_debug_regs): Renamed to
777         i386_dr_update_inferior_debug_regs and made nonstatic.
778         All uses updated.
779         (i386_low_insert_watchpoint): Renamed to
780         i386_dr_insert_watchpoint.  All uses updated.
781         (i386_low_remove_watchpoint): Renamed to
782         i386_dr_remove_watchpoint.  All uses updated.
783         (i386_low_region_ok_for_watchpoint): Renamed to
784         i386_dr_region_ok_for_watchpoint.  All uses updated.
785         (i386_low_stopped_data_address): Renamed to
786         i386_dr_stopped_data_address.  All uses updated.
787         (i386_low_stopped_by_watchpoint): Renamed to
788         i386_dr_stopped_by_watchpoint.  All uses updated.
789
790 2014-06-18  Gary Benson  <gbenson@redhat.com>
791
792         * i386-low.c (i386_dr_low_can_set_addr): New macro.
793         (i386_dr_low_can_set_control): Likewise.
794         (i386_insert_aligned_watchpoint): New check.
795
796 2014-06-18  Gary Benson  <gbenson@redhat.com>
797
798         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
799         Renamed to state.
800
801 2014-06-18  Gary Benson  <gbenson@redhat.com>
802
803         * i386-low.c (i386_length_and_rw_bits): Use internal_error
804         instead of fatal and error.
805         (i386_handle_nonaligned_watchpoint): Likewise.
806
807 2014-06-18  Gary Benson  <gbenson@redhat.com>
808
809         * i386-low.c (i386_get_debug_register_length): New macro.
810         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
811         (i386_show_dr): Use debug_printf instead of fprintf.  Use
812         phex to format values.
813
814 2014-06-18  Gary Benson  <gbenson@redhat.com>
815
816         * i386-low.h: Comment changes.
817         * i386-low.c: Likewise.
818
819 2014-06-18  Gary Benson  <gbenson@redhat.com>
820
821         * i386-low.c: Whitespace changes.
822
823 2014-06-12  Tom Tromey  <tromey@redhat.com>
824
825         * utils.c (freeargv): Remove.
826
827 2014-06-12  Tom Tromey  <tromey@redhat.com>
828
829         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
830         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
831         (parse_debug_format_options): Likewise.
832         (gdbserver_usage): Likewise.
833         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
834         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
835         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
836         against libiberty.
837         ($(LIBGNU)): Depend on libiberty.
838         (all-lib): Recurse into all subdirs.
839         (install-only): Invoke "install" target in subdirs.
840         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
841         targets.
842         * configure: Rebuild.
843         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
844         for vasprintf, vsnprintf, or gettimeofday.
845         * configure.srv: Don't add safe-ctype.o or lbasename.o to
846         srv_tgtobj.
847
848 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
849
850         * development.sh: Delete.
851         * Makefile.in (config.status): Adjust dependency on development.sh.
852         * configure.ac: Adjust development.sh source call.
853         * configure: Regenerate.
854
855 2014-06-02  Pedro Alves  <palves@redhat.com>
856
857         * ax.c (gdb_free_agent_expr): New function.
858         * ax.h (gdb_free_agent_expr): New declaration.
859         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
860         list.
861         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
862         static.
863         (clear_breakpoint_conditions_and_commands): New function.
864         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
865         (clear_breakpoint_conditions_and_commands): New declaration.
866
867 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
868
869         * linux-aarch64-low.c (asm/ptrace.h): Include.
870
871 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
872
873         Fix TLS access for -static -pthread.
874         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
875         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
876         (thread_db_load_search, try_thread_db_load_1): Initialize it.
877
878 2014-05-20  Pedro Alves  <palves@redhat.com>
879
880         * linux-aarch64-low.c (aarch64_insert_point)
881         (aarch64_remove_point): No longer check whether the type is
882         supported here.  Adjust to new interface.
883         (the_low_target): Install aarch64_supports_z_point_type as
884         supports_z_point_type method.
885         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
886         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
887         instead of a Z packet char.  Adjust.
888         (arm_supports_z_point_type): New function.
889         (arm_insert_point, arm_remove_point): Adjust to new interface.
890         (the_low_target): Install arm_supports_z_point_type.
891         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
892         (cris_insert_point, cris_remove_point): Adjust to new interface.
893         Don't check whether the type is supported here.
894         (the_low_target): Install cris_supports_z_point_type.
895         * linux-low.c (linux_supports_z_point_type): New function.
896         (linux_insert_point, linux_remove_point): Adjust to new interface.
897         * linux-low.h (struct linux_target_ops) <insert_point,
898         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
899         raw_breakpoint pointer parameter.
900         <supports_z_point_type>: New method.
901         * linux-mips-low.c (mips_supports_z_point_type): New function.
902         (mips_insert_point, mips_remove_point): Adjust to new interface.
903         Use mips_supports_z_point_type.
904         (the_low_target): Install mips_supports_z_point_type.
905         * linux-ppc-low.c (the_low_target): Install NULL as
906         supports_z_point_type method.
907         * linux-s390-low.c (the_low_target): Install NULL as
908         supports_z_point_type method.
909         * linux-sparc-low.c (the_low_target): Install NULL as
910         supports_z_point_type method.
911         * linux-x86-low.c (x86_supports_z_point_type): New function.
912         (x86_insert_point): Adjust to new insert_point interface.  Use
913         insert_memory_breakpoint.  Adjust to new
914         i386_low_insert_watchpoint interface.
915         (x86_remove_point): Adjust to remove_point interface.  Use
916         remove_memory_breakpoint.  Adjust to new
917         i386_low_remove_watchpoint interface.
918         (the_low_target): Install x86_supports_z_point_type.
919         * lynx-low.c (lynx_target_ops): Install NULL as
920         supports_z_point_type callback.
921         * nto-low.c (nto_supports_z_point_type): New.
922         (nto_insert_point, nto_remove_point): Adjust to new interface.
923         (nto_target_ops): Install nto_supports_z_point_type.
924         * mem-break.c: Adjust intro comment.
925         (struct raw_breakpoint) <raw_type, size>: New fields.
926         <inserted>: Update comment.
927         <shlib_disabled>: Delete field.
928         (enum bkpt_type) <gdb_breakpoint>: Delete value.
929         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
930         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
931         (raw_bkpt_type_to_target_hw_bp_type): New function.
932         (find_enabled_raw_code_breakpoint_at): New function.
933         (find_raw_breakpoint_at): New type and size parameters.  Use them.
934         (insert_memory_breakpoint): New function, based off
935         set_raw_breakpoint_at.
936         (remove_memory_breakpoint): New function.
937         (set_raw_breakpoint_at): Reimplement.
938         (set_breakpoint): New, based on set_breakpoint_at.
939         (set_breakpoint_at): Reimplement.
940         (delete_raw_breakpoint): Go through the_target->remove_point
941         instead of assuming memory breakpoints.
942         (find_gdb_breakpoint_at): Delete.
943         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
944         (find_gdb_breakpoint): New function.
945         (set_gdb_breakpoint_at): Delete.
946         (z_type_supported): New function.
947         (set_gdb_breakpoint_1): New function, loosely based off
948         set_gdb_breakpoint_at.
949         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
950         (delete_gdb_breakpoint_at): Delete.
951         (delete_gdb_breakpoint_1): New function, loosely based off
952         delete_gdb_breakpoint_at.
953         (delete_gdb_breakpoint): New function.
954         (clear_gdb_breakpoint_conditions): Rename to ...
955         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
956         breakpoint.
957         (add_condition_to_breakpoint): Make static.
958         (add_breakpoint_condition): Take a struct breakpoint pointer
959         instead of an address.  Adjust.
960         (gdb_condition_true_at_breakpoint): Rename to ...
961         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
962         z_type parameter.
963         (gdb_condition_true_at_breakpoint): Reimplement.
964         (add_breakpoint_commands): Take a struct breakpoint pointer
965         instead of an address.  Adjust.
966         (gdb_no_commands_at_breakpoint): Rename to ...
967         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
968         parameter.  Return true if no breakpoint was found.  Change debug
969         output.
970         (gdb_no_commands_at_breakpoint): Reimplement.
971         (run_breakpoint_commands): Rename to ...
972         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
973         and change return type to boolean.
974         (run_breakpoint_commands): New function.
975         (gdb_breakpoint_here): Also check for Z1 breakpoints.
976         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
977         breakpoint.  Go through the_target->remove_point instead of
978         assuming memory breakpoint.
979         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
980         software and hardware breakpoints.
981         (reinsert_raw_breakpoint): Go through the_target->insert_point
982         instead of assuming memory breakpoint.
983         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
984         software and hardware breakpoints.
985         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
986         Check both software and hardware breakpoints.
987         (validate_inserted_breakpoint): Assert the breakpoint is a
988         software breakpoint.  Set the inserted flag to -1 instead of
989         setting shlib_disabled.
990         (delete_disabled_breakpoints): Adjust.
991         (validate_breakpoints): Only validate software breakpoints.
992         Adjust to inserted flag change.
993         (check_mem_read, check_mem_write): Skip breakpoint types other
994         than software breakpoints.  Adjust to inserted flag change.
995         * mem-break.h (enum raw_bkpt_type): New enum.
996         (raw_breakpoint, struct process_info): Forward declare.
997         (Z_packet_to_target_hw_bp_type): Delete declaration.
998         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
999         (set_gdb_breakpoint, delete_gdb_breakpoint)
1000         (clear_breakpoint_conditions): New declarations.
1001         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
1002         (breakpoint_inserted_here): Update comment.
1003         (add_breakpoint_condition, add_breakpoint_commands): Replace
1004         address parameter with a breakpoint pointer parameter.
1005         (gdb_breakpoint_here): Update comment.
1006         (delete_gdb_breakpoint_at): Delete.
1007         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
1008         * server.c (process_point_options): Take a struct breakpoint
1009         pointer instead of an address.  Adjust.
1010         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
1011         delete_gdb_breakpoint.
1012         * spu-low.c (spu_target_ops): Install NULL as
1013         supports_z_point_type method.
1014         * target.h: Include mem-break.h.
1015         (struct target_ops) <prepare_to_access_memory>: Update comment.
1016         <supports_z_point_type>: New field.
1017         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
1018         instead of a char.  Also take a raw breakpoint pointer.
1019         * win32-arm-low.c (the_low_target): Install NULL as
1020         supports_z_point_type.
1021         * win32-i386-low.c (i386_supports_z_point_type): New function.
1022         (i386_insert_point, i386_remove_point): Adjust to new interface.
1023         (the_low_target): Install i386_supports_z_point_type.
1024         * win32-low.c (win32_supports_z_point_type): New function.
1025         (win32_insert_point, win32_remove_point): Adjust to new interface.
1026         (win32_target_ops): Install win32_supports_z_point_type.
1027         * win32-low.h (struct win32_target_ops):
1028         <supports_z_point_type>: New method.
1029         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
1030         instead of a char.  Also take a raw breakpoint pointer.
1031
1032 2014-05-20  Pedro Alves  <palves@redhat.com>
1033
1034         * mem-break.h: Include break-common.h.
1035         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
1036         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
1037         (Z_packet_to_target_hw_bp_type): New declaration.
1038         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
1039         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
1040         (Z_PACKET_ACCESS_WP): Delete macros.
1041         (Z_packet_to_hw_type): Delete function.
1042         * i386-low.h: Don't include break-common.h here.
1043         (Z_packet_to_hw_type): Delete declaration.
1044         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
1045         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
1046         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
1047         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
1048         * linux-aarch64-low.c: Don't include break-common.h here.
1049         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
1050         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
1051         (Z_packet_to_target_hw_bp_type): Delete function.
1052         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
1053         function.
1054         (mips_insert_point, mips_remove_point): Use
1055         Z_packet_to_target_hw_bp_type.
1056
1057 2014-05-20  Pedro Alves  <palves@redhat.com>
1058
1059         * linux-aarch64-low.c: Include break-common.h.
1060         (enum target_point_type): Delete.
1061         (Z_packet_to_point_type): Rename to ...
1062         (Z_packet_to_target_hw_bp_type): ... this, and return a
1063         target_hw_bp_type instead.
1064         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
1065         instead of an enum target_point_type.
1066         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
1067         breakpoint type.
1068         (aarch64_dr_state_insert_one_point)
1069         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
1070         (aarch64_handle_aligned_watchpoint)
1071         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
1072         Take an enum target_hw_bp_type instead of an enum
1073         target_point_type.
1074         (aarch64_supports_z_point_type): New function.
1075         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
1076         use Z_packet_to_target_hw_bp_type.
1077
1078 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
1079
1080         * configure.ac: Only use -Werror by default when DEVELOPMENT
1081         is true.
1082         * configure: Regenerate.
1083
1084 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
1085
1086         Fix gdbserver qGetTLSAddr for x86_64 -m32.
1087         * linux-x86-low.c (X86_64_USER_REGS): New.
1088         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
1089
1090 2014-04-28  Yao Qi  <yao@codesourcery.com>
1091
1092         * Makefile.in (i386-avx512.c): Fix the typo of generated file
1093         name.
1094
1095 2014-04-25  Pedro Alves  <palves@redhat.com>
1096
1097         PR server/16255
1098         * linux-low.c (linux_attach_fail_reason_string): New function.
1099         (linux_attach_lwp): Delete.
1100         (linux_attach_lwp_1): Rename to ...
1101         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
1102         argument.  Remove "initial" parameter.  Return int instead of
1103         void.  Don't error or warn here.
1104         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
1105         failure to attach to the tgid.  Call warning when failing to
1106         attach to an lwp.
1107         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
1108         argument.  Remove "initial" parameter.  Return int instead of
1109         void.  Don't error or warn here.
1110         (linux_attach_fail_reason_string): New declaration.
1111         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
1112         interface change.  Use linux_attach_fail_reason_string.
1113
1114 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
1115             Walfred Tedeschi  <walfred.tedeschi@intel.com>
1116
1117         * Makefile.in: Added rules to handle new files
1118         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
1119         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
1120         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
1121         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
1122         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
1123         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
1124         x32-avx512-linux.o.
1125         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
1126         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
1127         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
1128         i386/x32-avx512.xml.
1129         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
1130         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
1131         i386/x32-avx512-linux.xml.
1132         * i387-fp.c (num_avx512_k_registers): New constant for number
1133         of K registers.
1134         (num_avx512_zmmh_low_registers): New constant for number of
1135         lower ZMM registers (0-15).
1136         (num_avx512_zmmh_high_registers): New constant for number of
1137         higher ZMM registers (16-31).
1138         (num_avx512_ymmh_registers): New contant for number of higher
1139         YMM registers (ymm16-31 added by avx521 on x86_64).
1140         (num_avx512_xmm_registers): New constant for number of higher
1141         XMM registers (xmm16-31 added by AVX512 on x86_64).
1142         (struct i387_xsave): Add space for AVX512 registers.
1143         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
1144         Add code to handle AVX512 registers.
1145         (i387_xsave_to_cache): Add code to handle AVX512 registers.
1146         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
1147         prototypei from generated file.
1148         (tdesc_amd64_avx512_linux): Likewise.
1149         (init_registers_x32_avx512_linux): Likewise.
1150         (tdesc_x32_avx512_linux): Likewise.
1151         (init_registers_i386_avx512_linux): Likewise.
1152         (tdesc_i386_avx512_linux): Likewise.
1153         (x86_64_regmap): Add AVX512 registers.
1154         (x86_linux_read_description): Add code to handle AVX512 XSTATE
1155         mask.
1156         (initialize_low_arch): Add code to initialize AVX512 registers.
1157
1158 2014-04-23  Pedro Alves  <palves@redhat.com>
1159
1160         * mem-break.c (find_gdb_breakpoint_at): Make static.
1161         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
1162
1163 2014-04-23  Pedro Alves  <palves@redhat.com>
1164
1165         * i386-low.c: Don't include break-common.h here.
1166         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
1167         prototype to take target_hw_bp_type as argument instead of a Z
1168         packet char.
1169         * i386-low.h: Include break-common.h here.
1170         (Z_packet_to_hw_type): Declare.
1171         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
1172         prototypes.
1173         * linux-x86-low.c (x86_insert_point): Convert the packet number to
1174         a target_hw_bp_type before calling i386_low_insert_watchpoint.
1175         (x86_remove_point): Convert the packet number to a
1176         target_hw_bp_type before calling i386_low_remove_watchpoint.
1177         * win32-i386-low.c (i386_insert_point): Convert the packet number
1178         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
1179         (i386_remove_point): Convert the packet number to a
1180         target_hw_bp_type before calling i386_low_remove_watchpoint.
1181
1182 2014-04-23  Pedro Alves  <palves@redhat.com>
1183
1184         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
1185
1186 2014-04-10  Pedro Alves  <palves@redhat.com>
1187
1188         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
1189         Check if the condition or command is NULL before checking if the
1190         breakpoint is known.  On success, return true.
1191         * mem-break.h (add_breakpoint_condition): Document return.
1192         (add_breakpoint_commands): Add describing comment.
1193         * server.c (skip_to_semicolon): New function.
1194         (process_point_options): Use it.
1195
1196 2014-04-09  Pedro Alves  <palves@redhat.com>
1197
1198         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
1199         to lwpid_of.
1200
1201 2014-02-27  Pedro Alves  <palves@redhat.com>
1202
1203         PR 12702
1204         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
1205         macros.
1206         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
1207         output.
1208         (last_thread_of_process_p): Take a PID argument instead of a
1209         thread pointer.
1210         (linux_wait_for_lwp): Delete.
1211         (num_lwps, check_zombie_leaders, not_stopped_callback): New
1212         functions.
1213         (linux_low_filter_event): New function, party factored out from
1214         linux_wait_for_event.
1215         (linux_wait_for_event): Rename to ...
1216         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
1217         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
1218         sigsuspend.  Check for zombie leaders.
1219         (linux_wait_for_event): Reimplement as wrapper around
1220         linux_wait_for_event_filtered.
1221         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
1222         a normal or signal exit is seen, it's the whole process exiting.
1223         (wait_for_sigstop): No longer a for_each_inferior callback.
1224         Rewrite on top of linux_wait_for_event_filtered.
1225         (stop_all_lwps): Call wait_for_sigstop directly.
1226         * server.c (resume, handle_target_event): Handle
1227         TARGET_WAITKIND_NO_RESUMED.
1228
1229 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
1230
1231         * win32-low.c (psapi_get_dll_name,
1232         * win32_CreateToolhelp32Snapshot): Delete.
1233         (win32_CreateToolhelp32Snapshot, win32_Module32First)
1234         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
1235         Delete.
1236         (handle_load_dll): Add function description.
1237         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
1238
1239 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
1240
1241         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
1242         Add comment.
1243         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
1244         base address when calling win32_add_one_solib.
1245         (handle_load_dll): Delete local variable load_addr.
1246         Remove 0x1000 offset applied to DLL base address when calling
1247         win32_add_one_solib.
1248         (handle_unload_dll): Add comment.
1249
1250 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
1251
1252         * win32-low.c (win32_add_all_dlls): Renames
1253         win32_ensure_ntdll_loaded.  Rewrite function documentation.
1254         Adjust implementation to always load all DLLs.
1255         Add 0x1000 offset to DLL base address when calling
1256         win32_add_one_solib.
1257         (child_initialization_done): New static global.
1258         (do_initial_child_stuff): Set child_initialization_done to
1259         zero during child initialization, and 1 after.  Replace call
1260         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
1261         Add comment.
1262         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
1263         (handle_unload_dll): Add function documentation.
1264         (get_child_debug_event): Ignore load and unload DLL events
1265         during child initialization.
1266
1267 2014-02-20  Doug Evans  <dje@google.com>
1268
1269         Remove global all_lwps.
1270         * inferiors.h (ptid_of): Move here from linux-low.h.
1271         (pid_of, lwpid_of): Ditto.
1272         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
1273         parameter is a struct thread_info * now.
1274         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
1275         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
1276         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
1277         directly.
1278         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
1279         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
1280         * linux-arm-low.c (update_registers_callback): Update, "entry"
1281         parameter is a struct thread_info * now.
1282         Fetch lwpid from current_inferior directly.
1283         (arm_insert_point): Pass &all_threads to find_inferior instead of
1284         &all_lwps.
1285         (arm_remove_point): Ditto.
1286         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
1287         (arm_prepare_to_resume): Fetch pid from thread.
1288         (arm_read_description): Fetch lwpid from current_inferior directly.
1289         * linux-low.c (all_lwps): Delete.
1290         (delete_lwp): Delete call to remove_inferior.
1291         (handle_extended_wait): Fetch lwpid from thread.
1292         (add_lwp): Don't set lwp->entry.id.  Remove call to
1293         add_inferior_to_list.
1294         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
1295         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
1296         (kill_one_lwp_callback): Ditto.
1297         (linux_kill): Don't dereference NULL pointer.
1298         Fetch ptid,lwpid from thread.
1299         (get_detach_signal): Fetch ptid from thread.
1300         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
1301         Simplify call to regcache_invalidate_thread.
1302         (delete_lwp_callback): Update, "entry" parameter is a
1303         struct thread_info * now.  Fetch pid from thread.
1304         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
1305         (status_pending_p_callback): Update, "entry" parameter is a
1306         struct thread_info * now.  Fetch ptid from thread.
1307         (find_lwp_pid): Update, "entry" parameter is a
1308         struct thread_info * now.
1309         (linux_wait_for_lwp): Fetch pid from thread.
1310         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
1311         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
1312         (enqueue_one_deferred_signal): Fetch lwpid from thread.
1313         (dequeue_one_deferred_signal): Ditto.
1314         (cancel_breakpoint): Fetch ptid from current_inferior.
1315         (linux_wait_for_event): Pass &all_threads to find_inferior,
1316         not &all_lwps.  Fetch ptid, lwpid from thread.
1317         (count_events_callback): Update, "entry" parameter is a
1318         struct thread_info * now.
1319         (select_singlestep_lwp_callback): Ditto.
1320         (select_event_lwp_callback): Ditto.
1321         (cancel_breakpoints_callback): Ditto.
1322         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
1323         not &all_lwps.
1324         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
1325         (unsuspend_one_lwp): Update, "entry" parameter is a
1326         struct thread_info * now.
1327         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
1328         not &all_lwps.
1329         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
1330         Fetch lwpid from thread, not lwp.
1331         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
1332         Pass &all_threads to find_inferior, not &all_lwps.
1333         (send_sigstop): Fetch lwpid from thread, not lwp.
1334         (send_sigstop_callback): Update, "entry" parameter is a
1335         struct thread_info * now.
1336         (suspend_and_send_sigstop_callback): Ditto.
1337         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
1338         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
1339         struct thread_info * now.
1340         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
1341         from thread, lwp.
1342         (lwp_running): Update, "entry" parameter is a
1343         struct thread_info * now.
1344         (stop_all_lwps): Fetch ptid from thread.
1345         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
1346         (linux_resume_one_lwp): Fetch lwpid from thread.
1347         (linux_set_resume_request): Update, "entry" parameter is a
1348         struct thread_info * now.  Fetch pid, lwpid from thread.
1349         (resume_status_pending_p): Update, "entry" parameter is a
1350         struct thread_info * now.
1351         (need_step_over_p): Ditto.  Fetch lwpid from thread.
1352         (start_step_over): Fetch lwpid from thread.
1353         (linux_resume_one_thread): Update, "entry" parameter is a
1354         struct thread_info * now.  Fetch lwpid from thread.
1355         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
1356         (proceed_one_lwp): Update, "entry" parameter is a
1357         struct thread_info * now.  Fetch lwpid from thread.
1358         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
1359         struct thread_info * now.
1360         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
1361         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
1362         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
1363         directly.
1364         (regsets_store_inferior_registers): Ditto.
1365         (fetch_register, store_register): Ditto.
1366         (linux_read_memory, linux_write_memory): Ditto.
1367         (linux_request_interrupt): Ditto.
1368         (linux_read_auxv): Ditto.
1369         (linux_xfer_siginfo): Ditto.
1370         (linux_qxfer_spu): Ditto.
1371         (linux_qxfer_libraries_svr4): Ditto.
1372         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
1373         moved to inferiors.h.
1374         (get_lwp): Delete.
1375         (get_thread_lwp): Update.
1376         (struct lwp_info): Delete member "entry".  Simplify comment for
1377         member "thread".
1378         (all_lwps): Delete.
1379         * linux-mips-low.c (mips_read_description): Fetch lwpid from
1380         current_inferior directly.
1381         (update_watch_registers_callback): Update, "entry" parameter is a
1382         struct thread_info * now.  Fetch pid from thread.
1383         (mips_linux_prepare_to_resume): Fetch ptid from thread.
1384         (mips_insert_point): Fetch lwpid from current_inferior.
1385         Pass &all_threads to find_inferior, not &all_lwps.
1386         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
1387         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
1388         directly.
1389         (mips_stopped_data_address): Ditto.
1390         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
1391         directly.
1392         * linux-tile-low.c (tile_arch_setup): Ditto.
1393         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
1394         (update_debug_registers_callback): Update, "entry" parameter is a
1395         struct thread_info * now.  Fetch pid from thread.
1396         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
1397         Pass &all_threads to find_inferior, not &all_lwps.
1398         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
1399         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
1400         Pass &all_threads to find_inferior, not &all_lwps.
1401         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
1402         (i386_dr_low_get_status): Ditto.
1403         (x86_linux_prepare_to_resume): Fetch ptid from thread.
1404         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
1405         (x86_linux_read_description): Ditto.
1406         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
1407
1408 2014-02-20  Doug Evans  <dje@google.com>
1409
1410         * inferiors.c (get_first_inferior): Fix buglet.
1411
1412 2014-02-19  Doug Evans  <dje@google.com>
1413
1414         * gdbthread.h (add_thread): Change result type to struct thread_info *.
1415         * inferiors.c (add_thread): Change result type to struct thread_info *.
1416         All callers updated.
1417         (add_lwp): Call add_thread here instead of in callers.
1418         All callers updated.
1419         * linux-low.h (get_lwp_thread): Rewrite.
1420         (struct lwp_info): New member "thread".
1421
1422 2014-02-19  Doug Evans  <dje@google.com>
1423
1424         * linux-low.c (add_lwp): Change result to struct lwp_info *.
1425         All callers updated.
1426
1427 2014-02-19  Doug Evans  <dje@google.com>
1428
1429         * inferiors.c (add_thread): Fix whitespace.
1430
1431 2014-02-19  Doug Evans  <dje@google.com>
1432
1433         * dll.c (clear_dlls): Replace accessing list implemention details
1434         with API function.
1435         * gdbthread.h (get_first_thread): Declare.
1436         * inferiors.c (for_each_inferior_with_data): New function.
1437         (get_first_thread): New function.
1438         (find_thread_ptid): Simplify.
1439         (get_first_inferior): New function.
1440         (clear_list): Delete.
1441         (one_inferior_p): New function.
1442         (clear_inferior_list): New function.
1443         (clear_inferiors): Update.
1444         * inferiors.h (for_each_inferior_with_data): Declare.
1445         (clear_inferior_list): Declare.
1446         (one_inferior_p): Declare.
1447         (get_first_inferior): Declare.
1448         * linux-low.c (linux_wait_for_event): Replace accessing list
1449         implemention details with API function.
1450         * server.c (target_running): Ditto.
1451         (accumulate_file_name_length): New function.
1452         (emit_dll_description): New function.
1453         (handle_qxfer_libraries): Replace accessing list implemention
1454         details with API function.
1455         (handle_qxfer_threads_worker): New function.
1456         (handle_qxfer_threads_proper): Replace accessing list implemention
1457         details with API function.
1458         (handle_query): Ditto.
1459         (visit_actioned_threads_callback_ftype): New typedef.
1460         (visit_actioned_threads_data): New struct.
1461         (visit_actioned_threads): Rewrite to be find_inferior callback.
1462         (resume): Call find_inferior.
1463         (handle_status): Replace accessing list implemention
1464         details with API function.
1465         (process_serial_event): Replace accessing list implemention details
1466         with API function.
1467         * target.c (set_desired_inferior): Replace accessing list implemention
1468         details with API function.
1469         * tracepoint.c (same_process_p): New function.
1470         (gdb_agent_about_to_close): Replace accessing list implemention
1471         details with API function.
1472         * win32-low.c (child_delete_thread): Replace accessing list
1473         implemention details with API function.
1474         (match_dll_by_basename): New function.
1475         (dll_is_loaded_by_basename): New function.
1476         (win32_ensure_ntdll_loaded): Replace accessing list implemention
1477         details call to dll_is_loaded_by_basename.
1478
1479 2014-02-19  Doug Evans  <dje@google.com>
1480
1481         * dll.h (struct dll_info): Add comment.
1482         * gdbthread.h (struct thread_info): Add comment.
1483         (current_ptid): Simplify.
1484         * inferiors.c (add_process): Update.
1485         (remove_process): Update.
1486         * inferiors.h (struct process_info): Rename member "head" to "entry".
1487         * linux-low.c (delete_lwp): Update.
1488         (add_lwp): Update.
1489         (last_thread_of_process_p): Update.
1490         (kill_one_lwp_callback, linux_kill): Update.
1491         (status_pending_p_callback): Update.
1492         (wait_for_sigstop): Update.  Simplify read of ptid.
1493         (start_step_over): Update.
1494         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
1495         (get_lwp_thread): Update.
1496         (struct lwp_info): Rename member "head" to "entry".
1497         * regcache.h (inferior_list_entry): Delete.
1498         * server.c (kill_inferior_callback): Update.
1499         (detach_or_kill_inferior_callback): Update.
1500         (print_started_pid): Update.
1501         (print_attached_pid): Update.
1502         (process_serial_event): Simplify read of ptid.
1503         * thread-db.c (thread_db_create_event): Update.
1504         (thread_db_get_tls_address): Update.
1505         * win32-low.c (current_inferior_ptid): Simplify.
1506
1507 2014-02-19  Tom Tromey  <tromey@redhat.com>
1508
1509         * target.h (struct target_ops) <supports_btrace>: Add target_ops
1510         argument.
1511         (target_supports_btrace): Update.
1512
1513 2014-02-14  Yao Qi  <yao@codesourcery.com>
1514
1515         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
1516         (rsp-low-ipa.o): New target.
1517
1518 2014-02-12  Tom Tromey  <tromey@redhat.com>
1519
1520         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
1521         convert_ascii_to_int.
1522         * regcache.c (registers_to_string): Likewise.
1523         * remote-utils.c (decode_M_packet): Likewise.
1524         * server.c (process_serial_event): Likewise.
1525
1526 2014-02-12  Tom Tromey  <tromey@redhat.com>
1527
1528         * server.c (handle_query, handle_v_run): Use hex2bin, not
1529         unhexify.
1530         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
1531
1532 2014-02-12  Tom Tromey  <tromey@redhat.com>
1533
1534         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
1535         convert_int_to_ascii.
1536         * regcache.c (registers_to_string, collect_register_as_string):
1537         Likewise.
1538         * remote-utils.c (look_up_one_symbol, relocate_instruction):
1539         Likewise.
1540         * server.c (process_serial_event): Likewise.
1541         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
1542         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
1543
1544 2014-02-12  Tom Tromey  <tromey@redhat.com>
1545
1546         * remote-utils.c (look_up_one_symbol, monitor_output): Use
1547         bin2hex, not hexify.
1548         * tracepoint.c (cmd_qtstatus): Likewise.
1549
1550 2014-02-12  Tom Tromey  <tromey@redhat.com>
1551
1552         * remote-utils.c (monitor_output): Pass explicit length to
1553         hexify.
1554
1555 2014-02-12  Tom Tromey  <tromey@redhat.com>
1556
1557         * tracepoint.c: Include rsp-low.h.
1558         * server.c: Include rsp-low.h.
1559         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
1560         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
1561         declare.
1562         * remote-utils.c: Include rsp-low.h.
1563         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
1564         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
1565         (convert_int_to_ascii, convert_ascii_to_int): Move to
1566         common/rsp-low.c.
1567         * regcache.c: Include rsp-low.h.
1568         * ax.c: Include rsp-low.h.
1569         * Makefile.in (SFILES): Add common/rsp-low.c.
1570         (OBS): Add rsp-low.o.
1571         (rsp-low.o): New target.
1572
1573 2014-02-12  Tom Tromey  <tromey@redhat.com>
1574
1575         * utils.h (pulongest, plongest, phex_nz): Don't declare.
1576         Include print-utils.h.
1577         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
1578         (plongest, thirty_two, phex_nz): Remove.
1579         * Makefile.in (SFILES): Add common/print-utils.c.
1580         (OBS): Add print-utils.o.
1581         (print-utils-ipa.o): New target.
1582         (print-utils.o): New target.
1583         (IPA_OBJS): Add print-utils-ipa.o.
1584
1585 2014-02-06  Tom Tromey  <tromey@redhat.com>
1586
1587         * Makefile.in (SFILES): Fix indentation.
1588
1589 2014-02-05  Doug Evans  <dje@google.com>
1590
1591         * linux-low.c (linux_wait_for_event): Improve comment.
1592         (linux_wait_1): Keep current_inferior in sync with event_child.
1593
1594 2014-01-22  Doug Evans  <dje@google.com>
1595
1596         * gdbthread.h (gdb_id_to_thread): Delete, unused.
1597
1598 2014-01-22  Doug Evans  <dje@google.com>
1599
1600         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
1601         * configure: Regenerate.
1602         * config.in: Regenerate.
1603         * Makefile.in (SFILES): Add debug.c.
1604         (OBS): Add debug.o.
1605         * debug.c: New file.
1606         * debug.h: New file.
1607         * linux-aarch64-low.c (*): Update all debugging printfs to use
1608         debug_printf instead of fprintf.
1609         * linux-arm-low.c (*): Ditto.
1610         * linux-cris-low.c (*): Ditto.
1611         * linux-crisv32-low.c (*): Ditto.
1612         * linux-m32r-low.c (*): Ditto.
1613         * linux-sparc-low.c (*): Ditto.
1614         * linux-x86.c (*): Ditto.
1615         * linux-low.c (*): Ditto.
1616         (linux_wait_1): Add calls to debug_enter, debug_exit.
1617         (linux_wait): Remove redundant debugging printf.
1618         (stop_all_lwps): Add calls to debug_enter, debug_exit.
1619         (linux_resume, unstop_all_lwps): Ditto.
1620         * mem-break.c (*): Update all debugging printfs to use
1621         debug_printf instead of fprintf.
1622         * remote-utils.c (*): Ditto.
1623         * thread-db.c (*): Ditto.
1624         * server.c #include <ctype.h>, "gdb_vecs.h".
1625         (debug_threads): Moved to debug.c.
1626         (*): Update all debugging printfs to use debug_printf instead of
1627         fprintf.
1628         (start_inferior): Replace call to fflush with call to debug_flush.
1629         (monitor_show_help): Mention set debug-format.
1630         (parse_debug_format_options): New function.
1631         (handle_monitor_command): Handle "monitor set debug-format".
1632         (gdbserver_usage): Mention --debug-format.
1633         (main): Parse --debug-format.
1634         * server.h (debug_threads): Declaration moved to debug.h.
1635         #include "debug.h".
1636         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
1637         trace_debug_1 that uses debug_printf.
1638         (tracepoint_look_up_symbols): Update all debugging printfs to use
1639         debug_printf instead of fprintf.
1640
1641 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
1642
1643         * linux-xtensa-low.c: Include asm/ptrace.h instead of
1644         sys/ptrace.h.
1645
1646 2014-01-17  Pedro Alves  <palves@redhat.com>
1647
1648         PR build/16445
1649         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
1650         defined after including gdb_proc_service.h.
1651
1652 2014-01-16  Doug Evans  <dje@google.com>
1653
1654         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
1655         (match_dll): Use it.
1656
1657 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
1658
1659         * target.h (target_ops) <read_btrace>: Change parameters and
1660         return type to allow error reporting.
1661         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
1662         trace reading errors on.
1663         * linux-low.c (linux_low_read_btrace): Pass trace reading
1664         errors on.
1665         (linux_low_disable_btrace): New.
1666
1667 2014-01-15  Doug Evans  <dje@google.com>
1668
1669         * inferiors.c (thread_id_to_gdb_id): Delete.
1670         * inferiors.h (thread_id_to_gdb_id): Delete.
1671
1672 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
1673
1674         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
1675         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
1676         versions.
1677
1678 2014-01-08  Pedro Alves  <palves@redhat.com>
1679
1680         * server.c (handle_status): Don't discard previous queued stop
1681         replies or thread's pending status here.
1682         (main) <disconnection>: Do it here instead.
1683
1684 2014-01-08  Pedro Alves  <palves@redhat.com>
1685
1686         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
1687         * server.c (visit_actioned_threads, handle_pending_status): New
1688         function.
1689         (handle_v_cont): Factor out parts to ...
1690         (resume): ... this new function.  If in all-stop, and a thread
1691         being resumed has a pending status, report it without actually
1692         resuming.
1693         (myresume): Adjust to use the new 'resume' function.
1694         (clear_pending_status_callback, set_pending_status_callback)
1695         (find_status_pending_thread_callback): New functions.
1696         (handle_status): Handle the case of multiple threads having
1697         interesting statuses to report.  Report threads' real last signal
1698         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
1699         with an interesting thread to report the status for, instead of
1700         always reporting the status of the first thread.
1701
1702 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
1703
1704         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
1705         * gdbreplay.c (gdbreplay_version): Likewise.
1706
1707 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
1708
1709         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
1710         iov.iov_len with the real length in use.
1711
1712 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
1713
1714         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
1715         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
1716         for all targets that use win32-low.c.
1717         * win32-low.c (win32_ensure_ntdll_loaded): New function.
1718         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
1719
1720 2013-12-13  Pedro Alves  <palves@redhat.com>
1721
1722         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
1723         if equal to TARGET_WAITKIND_LOADED.
1724         * win32-low.c (cached_status): New static global.
1725         (win32_wait): Add declaration.
1726         (do_initial_child_stuff): Flush all initial pending debug events
1727         up to the initial breakpoint.
1728         (win32_wait): If CACHED_STATUS was set, return that instead
1729         of doing a real wait.  Remove the code resuming the execution
1730         of the inferior after receiving a TARGET_WAITKIND_LOADED event
1731         during the initial phase.  Also remove the code changing
1732         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
1733         TARGET_WAITKIND_STOPPED.
1734
1735 2013-12-11  Yao Qi  <yao@codesourcery.com>
1736
1737         * notif.c (handle_notif_ack): Return 0 if no notification
1738         matches.
1739
1740 2013-11-20  Doug Evans  <dje@google.com>
1741
1742         * linux-low.c (linux_set_resume_request): Fix comment.
1743
1744 2013-11-20  Doug Evans  <dje@google.com>
1745
1746         * linux-low.c (resume_status_pending_p): Tweak comment.
1747
1748 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
1749
1750         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
1751         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
1752         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
1753         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
1754         (srv_amd64_regobj): Add amd64-mpx.o.
1755         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
1756         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
1757         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
1758         * i387-fp.c (num_pl_bnd_register) Added constant.
1759         (num_pl_bnd_cfg_registers) Added constant.
1760         (struct i387_xsave) Added reserved area and MPX fields.
1761         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
1762         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
1763         function.
1764         (tdesc_i386_mpx_linux): Add MPX amd64 target.
1765         (init_registers_amd64_mpx_linux): Declare new function.
1766         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
1767         (x86_64_regmap): Add MPX registers.
1768         (x86_linux_read_description): Add MPX case.
1769         (initialize_low_arch): Initialize MPX targets.
1770
1771 2013-11-18  Tom Tromey  <tromey@redhat.com>
1772
1773         * configure: Rebuild.
1774         * configure.ac: Don't check for stdlib.h.
1775         * gdbreplay.c: Unconditionally include stdlib.h.
1776
1777 2013-11-18  Tom Tromey  <tromey@redhat.com>
1778
1779         * config.in: Rebuild.
1780         * configure: Rebuild.
1781         * configure.ac: Don't use AC_HEADER_DIRENT.
1782
1783 2013-11-18  Tom Tromey  <tromey@redhat.com>
1784
1785         * server.h: Don't check HAVE_STRING_H.
1786         * gdbreplay.c: Don't check HAVE_STRING_H.
1787         * configure: Rebuild.
1788
1789 2013-11-18  Tom Tromey  <tromey@redhat.com>
1790
1791         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
1792         LIBGNU.
1793
1794 2013-11-08  Tom Tromey  <tromey@redhat.com>
1795
1796         * configure, config.in: Rebuild.
1797         * configure.ac: Remove unused configury.
1798
1799 2013-11-08  Tom Tromey  <tromey@redhat.com>
1800
1801         * acinclude.m4: Include common.m4, codeset.m4.
1802         * configure, config.in: Rebuild.
1803         * configure.ac: Use GDB_AC_COMMON.
1804
1805 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
1806
1807         * linux-s390-low.c (HWCAP_S390_TE): New define.
1808         (s390_arch_setup): Consider the TE field in the HWCAP for
1809         determining 'have_regset_tdb'.
1810
1811 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
1812
1813         PR gdb/16014
1814         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
1815         call to sizeof.
1816
1817 2013-10-02  Pedro Alves  <palves@redhat.com>
1818
1819         * server.c (process_serial_event): Don't output "GDBserver
1820         exiting" if GDB is connected through stdio.
1821         * target.c (mywait): Likewise, be silent if GDB is connected
1822         through stdio.
1823
1824 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
1825
1826         * lynx-low.c (lynx_add_threads_after_attach): New function.
1827         (lynx_attach): Remove call to add_thread.  Add call to
1828         lynx_add_threads_after_attach instead.
1829
1830 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
1831
1832         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
1833         * config.in, configure: Regenerated.
1834
1835 2013-09-18  Yao Qi  <yao@codesourcery.com>
1836
1837         PR server/15959
1838         * server.c (start_inferior): Clear 'resume_info'.
1839
1840 2013-09-16  Jiong Wang  <jiwang@tilera.com>
1841
1842         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
1843         for each register.
1844
1845 2013-09-16  Jiong Wang  <jiwang@tilera.com>
1846
1847         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
1848         linux-tile-low.o to srv_tgtobj.
1849
1850 2013-09-16  Will Newton  <will.newton@linaro.org>
1851
1852         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
1853         out regs.
1854
1855 2013-09-06  Pedro Alves  <palves@redhat.com>
1856
1857         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
1858         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
1859         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
1860         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
1861         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
1862         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
1863
1864 2013-09-06  Pedro Alves  <palves@redhat.com>
1865
1866         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
1867         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
1868
1869 2013-09-06  Pedro Alves  <palves@redhat.com>
1870
1871         * linux-amd64-ipa.c: Include tracepoint.h.
1872         * linux-i386-ipa.c: Include tracepoint.h.
1873
1874 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
1875
1876         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
1877         (ps_get_thread_area): New function.
1878
1879 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
1880
1881         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
1882         (initialize_low_arch): Call init_registers_crisv32 rather than
1883         init_register_crisv32.
1884
1885 2013-09-05  Pedro Alves  <palves@redhat.com>
1886
1887         * server.h (handle_vFile, hostio_last_error_from_errno): Move
1888         to ...
1889         * hostio.h: ... this new file.
1890         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
1891         win32-low.c: Include hostio.h.
1892
1893 2013-09-05  Pedro Alves  <palves@redhat.com>
1894
1895         * server.h (gdb_client_data, handler_func, callback_handler_func)
1896         (delete_file_handler, add_file_handler, append_callback_event)
1897         (delete_callback_event, start_event_loop, initialize_event_loop):
1898         Move to event-loop.h and include it.
1899         * event-loop.h: New file.
1900
1901 2013-09-05  Pedro Alves  <palves@redhat.com>
1902
1903         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
1904         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
1905         (loaded_dll, unloaded_dll): Move to ...
1906         * dll.h: ... this new file.
1907         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
1908
1909 2013-09-05  Pedro Alves  <palves@redhat.com>
1910
1911         * server.h (current_process, get_thread_process, all_processes)
1912         (add_inferior_to_list, for_each_inferior, current_inferior)
1913         (remove_inferior, add_process, remove_process, find_process_pid)
1914         (have_started_inferiors_p, have_attached_inferiors_p)
1915         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
1916         (clear_inferiors, find_inferior, find_inferior_id)
1917         (inferior_target_data, set_inferior_target_data)
1918         (inferior_regcache_data, set_inferior_regcache_data): Move to
1919         inferiors.h, and include it.
1920         * inferiors.h: New file.
1921
1922 2013-09-05  Pedro Alves  <palves@redhat.com>
1923
1924         * server.h (struct emit_ops, current_insn_ptr, emit_error):
1925         Move ...
1926         * ax.h: ... here.
1927
1928 2013-09-05  Pedro Alves  <palves@redhat.com>
1929
1930         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
1931         tracepoint.h.
1932         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
1933         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
1934         (handle_tracepoint_general_set, handle_tracepoint_query)
1935         (tracepoint_finished_step, tracepoint_was_hit)
1936         (release_while_stepping_state_list, current_traceframe)
1937         (in_readonly_region, traceframe_read_mem)
1938         (fetch_traceframe_registers, traceframe_read_sdata)
1939         (traceframe_read_info, struct fast_tpoint_collect_status)
1940         (fast_tracepoint_collecting, force_unlock_trace_buffer)
1941         (handle_tracepoit_bkpts, initialize_low_tracepoint)
1942         (supply_fast_tracepoint_registers)
1943         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
1944         (ipa_tdesc, claim_trampoline_space)
1945         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
1946         (agent_mem_read, agent_get_trace_state_variable_value)
1947         (agent_set_trace_state_variable_value, agent_tsv_read)
1948         (agent_mem_read_string, get_raw_reg_func_addr)
1949         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
1950         * tracepoint.h: ... this new file.
1951
1952 2013-09-05  Pedro Alves  <palves@redhat.com>
1953
1954         * server.h (perror_with_name, error, fatal, warning, paddress)
1955         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
1956         include it.
1957         * utils.h: New file.
1958
1959 2013-09-05  Pedro Alves  <palves@redhat.com>
1960
1961         * server.h (remote_debug, noack_mode, transport_is_reliable)
1962         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
1963         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
1964         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
1965         (write_enn, initialize_async_io, enable_async_io)
1966         (disable_async_io, check_remote_input_interrupt_request)
1967         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
1968         (dead_thread_notify, prepare_resume_reply)
1969         (decode_address_to_semicolon, decode_address, decode_m_packet)
1970         (decode_M_packet, decode_X_packet, decode_xfer_write)
1971         (decode_search_memory_packet, unhexify, hexify)
1972         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
1973         (look_up_one_symbol, relocate_instruction)
1974         (monitor_output): Move to remote-utils.h, and include it.
1975         * remote-utils.h: New file.
1976
1977 2013-09-05  Pedro Alves  <palves@redhat.com>
1978
1979         * server.h (_): Delete.
1980
1981 2013-09-02  Pedro Alves  <palves@redhat.com>
1982
1983         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
1984         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
1985         allocated.
1986         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
1987
1988 2013-09-02  Pierre Muller  <muller@sourceware.org>
1989
1990         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
1991         or WriteProcessMemory complete successfully and handle
1992         ERROR_PARTIAL_COPY error.
1993
1994 2013-09-02  Pedro Alves  <palves@redhat.com>
1995
1996         * server.c (gdb_read_memory): Return -1 on traceframe memory read
1997         error instead of EIO.
1998
1999 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
2000
2001         PR server/15604
2002         * linux-low.c: Include filestuff.h.
2003         (linux_create_inferior) <pid == 0>: Call close_most_fds.
2004         * lynx-low.c: Include filestuff.h.
2005         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
2006         * server.c: Include filestuff.h.
2007         (main): Call notice_open_fds.
2008         * spu-low.c: Include filestuff.h.
2009         (spu_create_inferior) <pid == 0>: Call close_most_fds.
2010
2011 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
2012
2013         * Makefile.in: Explain why ../target and ../nat are not
2014         listed as include file search paths.
2015         (linux-waitpid.o): New object file rule.
2016         * configure.srv (srv_native_linux_obj): New variable.
2017         Replace all occurrences of linux native object files with
2018         $srv_native_linux_obj.
2019         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
2020         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
2021         (linux_enable_event_reporting): Remove declaration.
2022         (my_waitpid): Moved to common/linux-waitpid.c.
2023         (linux_wait_for_event): Pass ptid when calling
2024         linux_enable_event_reporting.
2025         (linux_supports_tracefork_flag): Remove.
2026         (linux_enable_event_reporting): Likewise.
2027         (linux_tracefork_grandchild): Remove.
2028         (STACK_SIZE): Moved to common/linux-ptrace.c.
2029         (linux_tracefork_child): Remove.
2030         (linux_test_for_tracefork): Remove.
2031         (linux_look_up_symbols): Call linux_supports_traceclone.
2032         (initialize_low): Remove call to linux_test_for_tracefork.
2033         * linux-low.h (PTRACE_TYPE_ARG3): Move to
2034         common/linux-ptrace.h.
2035         (PTRACE_TYPE_ARG4): Likewise.
2036         Include linux-ptrace.h.
2037
2038 2013-08-21  Pedro Alves  <palves@redhat.com>
2039
2040         * config.in: Renegerate.
2041
2042 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
2043
2044         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
2045         (SFILES): Remove $(srcdir)/common/target-common.c and
2046         add $(srcdir)/target/waitstatus.c.
2047         (OBS): Remove target-common.o and add waitstatus.o.
2048         (server_h): Remove $(srcdir)/../common/target-common.h and
2049         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
2050         and $(srcdir)/../target/waitstatus.h.
2051         (target-common.o): Remove.
2052         (waitstatus.o): New target object file.
2053         * target.h: Do not include target-common.h and
2054         include target/resume.h, target/wait.h and
2055         target/waitstatus.h.
2056
2057 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
2058
2059         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
2060         to PTRACE_TYPE_ARG3.
2061         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
2062         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
2063         PTRACE_TYPE_ARG4.
2064         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
2065         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
2066
2067 2013-07-27  Jie Zhang  <jie@codesourcery.com>
2068             Daniel Jacobowitz  <dan@codesourcery.com>
2069             Yao Qi  <yao@codesourcery.com>
2070
2071         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
2072         (mips-linux-watch.o): New rule.
2073         (mips_linux_watch_h): New variable.
2074         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
2075         srv_tgtobj.
2076         * linux-mips-low.c: Include mips-linux-watch.h.
2077         (struct arch_process_info, struct arch_lwp_info): New.
2078         (update_watch_registers_callback): New function.
2079         (mips_linux_new_process, mips_linux_new_thread) New functions.
2080         (mips_linux_prepare_to_resume, mips_insert_point): New
2081         functions.
2082         (mips_remove_point, mips_stopped_by_watchpoint): New
2083         functions.
2084         (rsp_bp_type_to_target_hw_bp_type): New function.
2085         (mips_stopped_data_address): New function.
2086         (the_low_target): Add watchpoint support functions.
2087
2088 2013-07-27  Yao Qi  <yao@codesourcery.com>
2089
2090         * i386-low.c: Include break-common.h.
2091         (enum target_hw_bp_type): Remove.
2092
2093 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
2094
2095         * Makefile.in (SFILES): /common/target-common.c.
2096         (OBS): Add target-common.o.
2097         (server_h): Add $(srcdir)/../common/target-common.h.
2098         (target-common.o): New target.
2099         * server.c (queue_stop_reply_callback): Free
2100         status string after use.
2101         * target.c (target_waitstatus_to_string): Remove.
2102         * target.h: Include target-common.h.
2103         (resume_kind): Likewise.
2104         (target_waitkind): Likewise.
2105         (target_waitstatus): Likewise.
2106         (TARGET_WNOHANG): Likewise.
2107
2108 2013-07-04  Yao Qi  <yao@codesourcery.com>
2109
2110         * Makefile.in (host_alias): Use @host_noncanonical@.
2111         (target_alias): Use @target_noncanonical@.
2112         * configure.ac: Use ACX_NONCANONICAL_TARGET and
2113         ACX_NONCANONICAL_HOST.
2114         * configure: Regenerated.
2115
2116         Revert:
2117         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
2118
2119         * configure.ac (version_host, version_target): Set and AC_SUBST them.
2120         * configure: Rebuild.
2121         * Makefile.in (version_host, version_target): Get from configure.
2122         (version.c): Use $(version_host) and $(version_target).
2123
2124 2013-07-03  Pedro Alves  <palves@redhat.com>
2125
2126         * Makefile.in (config.status): Depend on development.sh.
2127         * acinclude.m4: Include libmcheck.m4.
2128         * configure: Regenerate.
2129
2130 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
2131
2132         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
2133         attribute inside the parentheses.
2134         (winapi_DebugSetProcessKillOnExit): Ditto.
2135         (winapi_DebugBreakProcess): Ditto.
2136         (winapi_GenerateConsoleCtrlEvent): Ditto.
2137
2138 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
2139
2140         * notif.h (notif_event): Add a dummy member to avoid compiler
2141         errors.
2142
2143 2013-07-01  Pedro Alves  <palves@redhat.com>
2144
2145         * hostio.c (HOSTIO_PATH_MAX): Define.
2146         (require_filename, handle_open, handle_unlink, handle_readlink):
2147         Use it.
2148
2149 2013-07-01  Pedro Alves  <palves@redhat.com>
2150
2151         * server.h: Include "pathmax.h".
2152         * linux-low.c: Don't include sys/param.h.
2153         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
2154         MAXPATHLEN.
2155         * win32-low.c: Don't include sys/param.h.
2156         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
2157
2158 2013-07-01  Pedro Alves  <palves@redhat.com>
2159
2160         * event-loop.c: Don't check HAVE_UNISTD_H before including
2161         <unistd.h>.
2162         * gdbreplay.c: Likewise.
2163         * remote-utils.c: Likewise.
2164         * server.c: Likewise.
2165         * configure.ac: Don't check for unistd.h.
2166         * configure: Regenerate.
2167
2168 2013-06-28  Tom Tromey  <tromey@redhat.com>
2169
2170         * Makefile.in (version.c): Use version.in, not
2171         common/version.in.
2172
2173 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
2174
2175         * configure.ac (version_host, version_target): Set and AC_SUBST them.
2176         * configure: Rebuild.
2177         * Makefile.in (version_host, version_target): Get from configure.
2178         (version.c): Use $(version_host) and $(version_target).
2179
2180 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
2181
2182         Fix trace-status to output user name without trailing colon.
2183         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
2184
2185 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
2186
2187         Fix trace-status to output proper start-time and stop-time.
2188         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
2189         output start time and stop time in hex as gdb expects.
2190
2191 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
2192
2193         * tracepoint.c (build_traceframe_info_xml): Output trace state
2194         variables present in the trace buffer.
2195
2196 2013-06-24  Tom Tromey  <tromey@redhat.com>
2197
2198         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
2199         create-version.sh.
2200         (version.o): Remove.
2201         * gdbreplay.c: Include version.h.
2202         (version, host_name): Don't declare.
2203         * server.h: Include version.h.
2204         (version, host_name): Don't declare.
2205
2206 2013-06-12  Pedro Alves  <palves@redhat.com>
2207
2208         * linux-x86-low.c (linux_is_elf64): Delete global.
2209         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
2210         with local linux_pid_exe_is_elf_64_file use.
2211
2212 2013-06-11  Pedro Alves  <palves@redhat.com>
2213
2214         * linux-low.c (regset_disabled, disable_regset): New functions.
2215         (regsets_fetch_inferior_registers)
2216         (regsets_store_inferior_registers): Use them.
2217         (initialize_regsets_info); Don't allocate the disabled_regsets
2218         array here.
2219         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
2220         comment.
2221
2222 2013-06-11  Pedro Alves  <palves@redhat.com>
2223
2224         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
2225         xmalloc.
2226
2227 2013-06-11  Pedro Alves  <palves@redhat.com>
2228
2229         * linux-x86-low.c (initialize_low_arch): Call
2230         init_registers_x32_avx_linux.
2231
2232 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
2233
2234         Fix compatibility with Android Bionic.
2235         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
2236         it is not empty.
2237
2238 2013-06-07  Pedro Alves  <palves@redhat.com>
2239
2240         PR server/14823
2241         * Makefile.in (OBS): Add tdesc.o.
2242         (IPA_OBJS): Add tdesc-ipa.o.
2243         (tdesc-ipa.o): New rule.
2244         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
2245         interface.
2246         * linux-low.c (new_inferior): Delete.
2247         (disabled_regsets, num_regsets): Delete.
2248         (linux_add_process): Adjust to set the new per-process
2249         new_inferior flag.
2250         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
2251         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
2252         was a stop.  When calling arch_setup, switch the current inferior
2253         to the thread that got an event.
2254         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
2255         (regsets_fetch_inferior_registers)
2256         (regsets_store_inferior_registers): New regsets_info parameter.
2257         Adjust to use it.
2258         (linux_register_in_regsets): New regs_info parameter.  Adjust to
2259         use it.
2260         (register_addr, fetch_register, store_register): New usrregs_info
2261         parameter.  Adjust to use it.
2262         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
2263         parameter regs_info.  Adjust to use it.
2264         (linux_fetch_registers): Get the current inferior's regs_info, and
2265         adjust to use it.
2266         (linux_store_registers): Ditto.
2267         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
2268         (initialize_low): Don't initialize the target_regsets here.  Call
2269         initialize_low_arch.
2270         * linux-low.h (target_regsets): Delete declaration.
2271         (struct regsets_info): New.
2272         (struct usrregs_info): New.
2273         (struct regs_info): New.
2274         (struct process_info_private) <new_inferior>: New field.
2275         (struct linux_target_ops): Delete the num_regs, regmap, and
2276         regset_bitmap fields.  New field regs_info.
2277         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
2278         * i387-fp.c (num_xmm_registers): Delete.
2279         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
2280         calls to new interface.
2281         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
2282         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
2283         Infer the number of xmm registers from the regcache's target
2284         description.
2285         * i387-fp.h (num_xmm_registers): Delete.
2286         * inferiors.c (add_thread): Don't install the thread's regcache
2287         here.
2288         * proc-service.c (gregset_info): Fetch the current inferior's
2289         regs_info.  Adjust to use it.
2290         * regcache.c: Include tdesc.h.
2291         (register_bytes, reg_defs, num_registers)
2292         (gdbserver_expedite_regs): Delete.
2293         (get_thread_regcache): If the thread doesn't have a regcache yet,
2294         create one, instead of aborting gdbserver.
2295         (regcache_invalidate_one): Rename to ...
2296         (regcache_invalidate_thread): ... this.
2297         (regcache_invalidate_one): New.
2298         (regcache_invalidate): Only invalidate registers of the current
2299         process.
2300         (init_register_cache): Add target_desc parameter, and use it.
2301         (new_register_cache): Ditto.  Assert the target description has a
2302         non zero registers_size.
2303         (regcache_cpy): Add assertions.  Adjust.
2304         (realloc_register_cache, set_register_cache): Delete.
2305         (registers_to_string, registers_from_string): Adjust.
2306         (find_register_by_name, find_regno, find_register_by_number)
2307         (register_cache_size): Add target_desc parameter, and use it.
2308         (free_register_cache_thread, free_register_cache_thread_one)
2309         (regcache_release, register_cache_size): New.
2310         (register_size): Add target_desc parameter, and use it.
2311         (register_data, supply_register, supply_register_zeroed)
2312         (supply_regblock, supply_register_by_name, collect_register)
2313         (collect_register_as_string, collect_register_by_name): Adjust.
2314         * regcache.h (struct target_desc): Forward declare.
2315         (struct regcache) <tdesc>: New field.
2316         (init_register_cache, new_register_cache): Add target_desc
2317         parameter.
2318         (regcache_invalidate_thread): Declare.
2319         (regcache_invalidate_one): Delete declaration.
2320         (regcache_release): Declare.
2321         (find_register_by_number, register_cache_size, register_size)
2322         (find_regno): Add target_desc parameter.
2323         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
2324         declarations.
2325         * remote-utils.c: Include tdesc.h.
2326         (outreg, prepare_resume_reply): Adjust.
2327         * server.c: Include tdesc.h.
2328         (gdbserver_xmltarget): Delete declaration.
2329         (get_features_xml, process_serial_event): Adjust.
2330         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
2331         declare.
2332         (struct process_info) <tdesc>: New field.
2333         (ipa_tdesc): Declare.
2334         * tdesc.c: New file.
2335         * tdesc.h: New file.
2336         * tracepoint.c: Include tdesc.h.
2337         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
2338         (get_context_regcache): Adjust to pass ipa_tdesc down.
2339         (do_action_at_tracepoint): Adjust to get the register cache size
2340         from the context regcache's description.
2341         (traceframe_walk_blocks): Adjust to get the register cache size
2342         from the current trace frame's description.
2343         (traceframe_get_pc): Adjust to get current trace frame's
2344         description and pass it down.
2345         (gdb_collect): Adjust to get the register cache size from the
2346         IPA's description.
2347         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
2348         (gdbserver_xmltarget): Delete.
2349         (initialize_low_tracepoint): Set the ipa's target description.
2350         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
2351         (initialize_low_tracepoint): Set the ipa's target description.
2352         * linux-x86-low.c: Include tdesc.h.
2353         [__x86_64__] (is_64bit_tdesc): New.
2354         (ps_get_thread_area, x86_get_thread_area): Use it.
2355         (i386_cannot_store_register): Rename to ...
2356         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
2357         (i386_cannot_fetch_register): Rename to ...
2358         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
2359         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
2360         to new interface.
2361         (target_regsets): Rename to ...
2362         (x86_regsets): ... this.
2363         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
2364         interface.
2365         (x86_siginfo_fixup): Use is_64bit_tdesc.
2366         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
2367         (tdesc_x32_avx_linux, tdesc_x32_linux)
2368         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
2369         Declare.
2370         (x86_linux_update_xmltarget): Delete.
2371         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
2372         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
2373         (AMD64_LINUX_USER64_CS): New.
2374         (x86_linux_read_description): New, based on
2375         x86_linux_update_xmltarget.
2376         (same_process_callback): New.
2377         (x86_arch_setup_process_callback): New.
2378         (x86_linux_update_xmltarget): New.
2379         (x86_regsets_info): New.
2380         (amd64_linux_regs_info): New.
2381         (i386_linux_usrregs_info): New.
2382         (i386_linux_regs_info): New.
2383         (x86_linux_regs_info): New.
2384         (x86_arch_setup): Reimplement.
2385         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
2386         (x86_emit_ops): Ditto.
2387         (the_low_target): Adjust.  Install x86_linux_regs_info,
2388         x86_cannot_fetch_register, and x86_cannot_store_register.
2389         (initialize_low_arch): New.
2390         * linux-ia64-low.c (tdesc_ia64): Declare.
2391         (ia64_fetch_register): Adjust.
2392         (ia64_usrregs_info, regs_info): New globals.
2393         (ia64_regs_info): New function.
2394         (the_low_target): Adjust.
2395         (initialize_low_arch): New function.
2396         * linux-sparc-low.c (tdesc_sparc64): Declare.
2397         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
2398         Adjust.
2399         (sparc_arch_setup): New function.
2400         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
2401         (the_low_target): Adjust.
2402         (initialize_low_arch): New function.
2403         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
2404         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
2405         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
2406         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
2407         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
2408         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
2409         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
2410         (tdesc_powerpc_isa205_vsx64l): Declare.
2411         (ppc_cannot_store_register, ppc_collect_ptrace_register)
2412         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
2413         (ppc_set_pc, ppc_get_hwcap): Adjust.
2414         (ppc_usrregs_info): Forward declare.
2415         (!__powerpc64__) ppc_regmap_adjusted: New global.
2416         (ppc_arch_setup): Adjust to the current process'es target
2417         description.
2418         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
2419         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
2420         (ppc_store_evrregset): Adjust.
2421         (target_regsets): Rename to ...
2422         (ppc_regsets): ... this, and make static.
2423         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
2424         (ppc_regs_info): New function.
2425         (the_low_target): Adjust.
2426         (initialize_low_arch): New function.
2427         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
2428         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
2429         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
2430         (tdesc_s390x_linux64v2): Declare.
2431         (s390_collect_ptrace_register, s390_supply_ptrace_register)
2432         (s390_fill_gregset, s390_store_last_break): Adjust.
2433         (target_regsets): Rename to ...
2434         (s390_regsets): ... this, and make static.
2435         (s390_get_pc, s390_set_pc): Adjust.
2436         (s390_get_hwcap): New target_desc parameter, and use it.
2437         [__s390x__] (have_hwcap_s390_high_gprs): New global.
2438         (s390_arch_setup): Adjust to set the current process'es target
2439         description.  Don't adjust the regmap.
2440         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
2441         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
2442         (regs_info_3264): New globals.
2443         (s390_regs_info): New function.
2444         (the_low_target): Adjust.
2445         (initialize_low_arch): New function.
2446         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
2447         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
2448         [__mips64] (init_registers_mips_linux)
2449         (init_registers_mips_dsp_linux): Delete defines.
2450         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
2451         (have_dsp): New global.
2452         (mips_read_description): New, based on mips_arch_setup.
2453         (mips_arch_setup): Reimplement.
2454         (get_usrregs_info): New function.
2455         (mips_cannot_fetch_register, mips_cannot_store_register)
2456         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
2457         (mips_fill_fpregset, mips_store_fpregset): Adjust.
2458         (target_regsets): Rename to ...
2459         (mips_regsets): ... this, and make static.
2460         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
2461         (dsp_regs_info, regs_info): New globals.
2462         (mips_regs_info): New function.
2463         (the_low_target): Adjust.
2464         (initialize_low_arch): New function.
2465         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
2466         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
2467         Declare.
2468         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
2469         (arm_read_description): New, with bits factored from
2470         arm_arch_setup.
2471         (arm_arch_setup): Reimplement.
2472         (target_regsets): Rename to ...
2473         (arm_regsets): ... this, and make static.
2474         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
2475         (arm_regs_info): New function.
2476         (the_low_target): Adjust.
2477         (initialize_low_arch): New function.
2478         * linux-m68k-low.c (tdesc_m68k): Declare.
2479         (target_regsets): Rename to ...
2480         (m68k_regsets): ... this, and make static.
2481         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
2482         (m68k_regs_info): New function.
2483         (m68k_arch_setup): New function.
2484         (the_low_target): Adjust.
2485         (initialize_low_arch): New function.
2486         * linux-sh-low.c (tdesc_sharch): Declare.
2487         (target_regsets): Rename to ...
2488         (sh_regsets): ... this, and make static.
2489         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
2490         (sh_regs_info, sh_arch_setup): New functions.
2491         (the_low_target): Adjust.
2492         (initialize_low_arch): New function.
2493         * linux-bfin-low.c (tdesc_bfin): Declare.
2494         (bfin_arch_setup): New function.
2495         (bfin_usrregs_info, regs_info): New globals.
2496         (bfin_regs_info): New function.
2497         (the_low_target): Adjust.
2498         (initialize_low_arch): New function.
2499         * linux-cris-low.c (tdesc_cris): Declare.
2500         (cris_arch_setup): New function.
2501         (cris_usrregs_info, regs_info): New globals.
2502         (cris_regs_info): New function.
2503         (the_low_target): Adjust.
2504         (initialize_low_arch): New function.
2505         * linux-cris-low.c (tdesc_crisv32): Declare.
2506         (cris_arch_setup): New function.
2507         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
2508         (cris_regs_info): New function.
2509         (the_low_target): Adjust.
2510         (initialize_low_arch): New function.
2511         * linux-m32r-low.c (tdesc_m32r): Declare.
2512         (m32r_arch_setup): New function.
2513         (m32r_usrregs_info, regs_info): New globals.
2514         (m32r_regs_info): Adjust.
2515         (initialize_low_arch): New function.
2516         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
2517         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
2518         (tic6x_usrregs_info): Forward declare.
2519         (tic6x_read_description): New function, based on ...
2520         (tic6x_arch_setup): ... this.  Reimplement.
2521         (target_regsets): Rename to ...
2522         (tic6x_regsets): ... this, and make static.
2523         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
2524         (tic6x_regs_info): New function.
2525         (the_low_target): Adjust.
2526         (initialize_low_arch): New function.
2527         * linux-xtensa-low.c (tdesc_xtensa): Declare.
2528         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
2529         (target_regsets): Rename to ...
2530         (xtensa_regsets): ... this, and make static.
2531         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
2532         globals.
2533         (xtensa_arch_setup, xtensa_regs_info): New functions.
2534         (the_low_target): Adjust.
2535         (initialize_low_arch): New function.
2536         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
2537         (nios2_arch_setup): Set the current process'es tdesc.
2538         (target_regsets): Rename to ...
2539         (nios2_regsets): ... this.
2540         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
2541         (nios2_regs_info): New function.
2542         (the_low_target): Adjust.
2543         (initialize_low_arch): New function.
2544         * linux-aarch64-low.c (tdesc_aarch64): Declare.
2545         (aarch64_arch_setup): Set the current process'es tdesc.
2546         (target_regsets): Rename to ...
2547         (aarch64_regsets): ... this.
2548         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
2549         (aarch64_regs_info): New function.
2550         (the_low_target): Adjust.
2551         (initialize_low_arch): New function.
2552         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
2553         globals.
2554         (target_regsets): Rename to ...
2555         (tile_regsets): ... this.
2556         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
2557         (tile_regs_info): New function.
2558         (tile_arch_setup): Set the current process'es tdesc.
2559         (the_low_target): Adjust.
2560         (initialize_low_arch): New function.
2561         * spu-low.c (tdesc_spu): Declare.
2562         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
2563         * win32-arm-low.c (tdesc_arm): Declare.
2564         (arm_arch_setup): New function.
2565         (the_low_target): Install arm_arch_setup instead of
2566         init_registers_arm.
2567         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
2568         (init_windows_x86): Rename to ...
2569         (i386_arch_setup): ... this.  Set `win32_tdesc'.
2570         (the_low_target): Adjust.
2571         * win32-low.c (win32_tdesc): New global.
2572         (child_add_thread): Don't create the thread cache here.
2573         (do_initial_child_stuff): Set the new process'es tdesc.
2574         * win32-low.h (struct target_desc): Forward declare.
2575         (win32_tdesc): Declare.
2576         * lynx-i386-low.c (tdesc_i386): Declare global.
2577         (lynx_i386_arch_setup): Set `lynx_tdesc'.
2578         * lynx-low.c (lynx_tdesc): New global.
2579         (lynx_add_process): Set the new process'es tdesc.
2580         * lynx-low.h (struct target_desc): Forward declare.
2581         (lynx_tdesc): Declare global.
2582         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
2583         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
2584         * nto-low.c (nto_tdesc): New global.
2585         (do_attach): Set the new process'es tdesc.
2586         * nto-low.h (struct target_desc): Forward declare.
2587         (nto_tdesc): Declare.
2588         * nto-x86-low.c (tdesc_i386): Declare.
2589         (nto_x86_arch_setup): Set `nto_tdesc'.
2590
2591 2013-06-04  Gary Benson  <gbenson@redhat.com>
2592
2593         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
2594         to qSupported response when appropriate.
2595         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
2596         with nonzero-length annex.
2597         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
2598         arguments supplied in annex.
2599
2600 2013-05-31  Doug Evans  <dje@google.com>
2601
2602         PR server/15594
2603         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
2604         64 bits in 64-cross-32 environment.
2605
2606 2013-05-28  Pedro Alves  <palves@redhat.com>
2607
2608         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
2609         (aarch64-without-fpu.c): Delete rule.
2610         * configure.srv (aarch64*-*-linux*): Remove references to
2611         aarch64-without-fpu.o and aarch64-without-fpu.xml.
2612         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
2613         declaration.
2614
2615 2013-05-24  Pedro Alves  <palves@redhat.com>
2616
2617         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
2618         instead of strchr/decode_address.  Error if the range isn't split
2619         with a ','.  Don't assume there's be a ':' in the action.
2620
2621 2013-05-23  Yao Qi  <yao@codesourcery.com>
2622             Pedro Alves  <palves@redhat.com>
2623
2624         * linux-low.c (lwp_in_step_range): New function.
2625         (linux_wait_1): If the thread was range stepping and stopped
2626         outside the stepping range, report the stop to GDB.  Otherwise,
2627         continue stepping.  Add range stepping debug output.
2628         (linux_set_resume_request): Copy the step range from the resume
2629         request to the lwp.
2630         (linux_supports_range_stepping): New.
2631         (linux_target_ops) <supports_range_stepping>: Set to
2632         linux_supports_range_stepping.
2633         * linux-low.h (struct linux_target_ops)
2634         <supports_range_stepping>: New field.
2635         (struct lwp_info) <step_range_start, step_range_end>: New fields.
2636         * linux-x86-low.c (x86_supports_range_stepping): New.
2637         (the_low_target) <supports_range_stepping>: Set to
2638         x86_supports_range_stepping.
2639         * server.c (handle_v_cont): Handle 'r' action.
2640         (handle_v_requests): Append ";r" if the target supports range
2641         stepping.
2642         * target.h (struct thread_resume) <step_range_start,
2643         step_range_end>: New fields.
2644         (struct target_ops) <supports_range_stepping>:
2645         New field.
2646         (target_supports_range_stepping): New macro.
2647
2648 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
2649
2650         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
2651         confusion in comment.
2652
2653 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
2654
2655         * lynx-low.c (struct process_info_private): New type.
2656         (lynx_add_process): New function.
2657         (lynx_create_inferior, lynx_attach): Replace calls to
2658         add_process by calls to lynx_add_process.
2659         (lynx_resume): If PTID is null, then try using
2660         current_process()->private->last_wait_event_ptid.
2661         Add comments.
2662         (lynx_clear_inferiors): Delete.  The contents of that function
2663         has been inlined in lynx_mourn;
2664         (lynx_wait_1): Save the ptid in the process's private data.
2665         (lynx_mourn): Free the process' private data.  Replace call
2666         to lynx_clear_inferiors by call to clear_inferiors.
2667
2668 2013-05-17  Yao Qi  <yao@codesourcery.com>
2669
2670         * i386-low.c (i386_length_and_rw_bits): Move the comment to
2671         the right place.
2672
2673 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
2674
2675         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
2676         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
2677         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
2678         PT_TEXT_END_ADDR guards.  Update comments.
2679         (linux_target_op) <read_offsets>: Conditionally define to
2680         linux_read_offsets if the target is UCLIBC and if it defines
2681         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
2682
2683 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
2684             Andrew Jenner  <andrew@codesourcery.com>
2685
2686         * Makefile.in (SFILES): Add linux-nios2-low.c.
2687         (clean): Add action to delete nios2-linux.c.
2688         (nios2-linux.c): New rule.
2689         * configure.srv: Add nios2*-*-linux*.
2690         * linux-nios2-low.c: New.
2691
2692 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
2693
2694         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
2695
2696 2013-04-25  Hui Zhu  <hui@codesourcery.com>
2697
2698         PR gdb/15186
2699         * ax.c (ax_printf): Add fflush.
2700
2701 2013-04-22  Tom Tromey  <tromey@redhat.com>
2702
2703         * Makefile.in (SFILES): Add filestuff.c.
2704         (OBS): Add filestuff.o.
2705         (filestuff.o): New target.
2706         * config.in, configure: Rebuild.
2707         * configure.ac: Check for fdwalk, pipe2.
2708
2709 2013-04-17  Pedro Alves  <palves@redhat.com>
2710
2711         * configure.ac (USE_THREAD_DB): Delete variable.
2712         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
2713         Don't AC_SUBST USE_THREAD_DB.
2714         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
2715         * config.in, configure: Regenerate.
2716
2717 2013-04-16  Pedro Alves  <palves@redhat.com>
2718
2719         * linux-low.h (struct lwp_info) <thread_known>: Move under
2720         the USE_THREAD_DB #ifdef.
2721
2722 2013-04-16  Pedro Alves  <palves@redhat.com>
2723
2724         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
2725         (linux-low.o): Delete rule.
2726         * linux-low.h: Always include "gdb_thread_db.h" instead of
2727         conditionally including thread_db.h.
2728         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
2729         HAVE_THREAD_DB_H.
2730
2731 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
2732
2733         * Makefile.in (install-only): Fix make install regression.
2734
2735 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
2736
2737         Convert man pages to texinfo, new gdbinit.5 texinfo page.
2738         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
2739         installation.
2740         * gdbserver.1: Remove.
2741
2742 2013-03-22  Pedro Alves  <palves@redhat.com>
2743
2744         * linux-low.c (handle_extended_wait): Don't call
2745         linux_enable_event_reporting.
2746
2747 2013-03-15  Tony Theodore  <tonyt@logyst.com>
2748
2749         PR build/9098:
2750         * Makefile.in (SHELL): Use @SHELL@.
2751
2752 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
2753
2754         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
2755         compiler warning.
2756
2757 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
2758
2759         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
2760         Remove extraneous NULL element.
2761
2762 2013-03-13  Yao Qi  <yao@codesourcery.com>
2763
2764         * tracepoint.c (traceframe_read_tsv): Look for the last matched
2765         'V' block in trace frame.
2766
2767 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
2768
2769         * target.h (struct target_ops): Add btrace ops.
2770         (target_supports_btrace): New macro.
2771         (target_enable_btrace): New macro.
2772         (target_disable_btrace): New macro.
2773         (target_read_btrace): New macro.
2774         * gdbthread.h (struct thread_info): Add btrace field.
2775         * server.c: Include btrace-common.h.
2776         (handle_btrace_general_set): New function.
2777         (handle_btrace_enable): New function.
2778         (handle_btrace_disable): New function.
2779         (handle_general_set): Call handle_btrace_general_set.
2780         (handle_qxfer_btrace): New function.
2781         (struct qxfer qxfer_packets[]): Add btrace entry.
2782         * inferiors.c (remove_thread): Disable btrace.
2783         * linux-low: Include linux-btrace.h.
2784         (linux_low_enable_btrace): New function.
2785         (linux_low_read_btrace): New function.
2786         (linux_target_ops): Add btrace ops.
2787         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
2788         Add srv_linux_btrace=yes.
2789         (x86_64-*-linux*): Add linux-btrace.o.
2790         Add srv_linux_btrace=yes.
2791         * configure.ac: Define HAVE_LINUX_BTRACE.
2792         * config.in: Regenerated.
2793         * configure: Regenerated.
2794
2795 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
2796
2797         * server.c (handle_qxfer): Preserve error message if -3 is
2798         returned.
2799         (qxfer): Document the -3 return value.
2800
2801 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
2802
2803         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
2804         (linux_btrace_h): New variable.
2805         (linux-btrace.o): New rule.
2806
2807 2013-03-08  Stan Shebs  <stan@codesourcery.com>
2808             Hafiz Abid Qadeer  <abidh@codesourcery.com>
2809
2810         * tracepoint.c (trace_buffer_size): New global.
2811         (DEFAULT_TRACE_BUFFER_SIZE): New define.
2812         (init_trace_buffer): Change to one-argument function. Allocate
2813         trace buffer memory.
2814         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
2815         handle QTBuffer:size packet.
2816         (cmd_bigqtbuffer_size): New function.
2817         (initialize_tracepoint): Call init_trace_buffer with
2818         DEFAULT_TRACE_BUFFER_SIZE.
2819         * server.c (handle_query): Add QTBuffer:size in the
2820         supported packets.
2821
2822 2013-03-07  Yao Qi  <yao@codesourcery.com>
2823
2824         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
2825         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
2826         of -1.
2827         (cmd_qtsp): Adjust condition.  Do post increment.
2828         Set cur_action and cur_step_action back to 0.
2829
2830 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
2831
2832         PR server/15236
2833         * linux-low.c (linux_write_memory): Return early success if LEN is
2834         zero.
2835
2836 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
2837
2838         * configure.srv: Add x86_64-*-cygwin* as target.
2839
2840 2013-02-28  Tom Tromey  <tromey@redhat.com>
2841
2842         * configure.ac: Invoke AC_SYS_LARGEFILE.
2843         * configure, config.in: Rebuild.
2844
2845 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
2846
2847         * win32-low.c: Throughout, fix format strings and casts of
2848         printf-like functions to avoid type related warnings on all
2849         platforms.
2850         (get_child_debug_event): Print dwDebugEventCode as hex since
2851         that's how it's usually documented.
2852
2853 2013-02-28  Yao Qi  <yao@codesourcery.com>
2854
2855         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
2856         pulongest.
2857
2858 2013-02-27  Jiong Wang  <jiwang@tilera.com>
2859
2860         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
2861         (reg-tilegx32.c): New rule.
2862         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
2863         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
2864         different register info initializer according to elf class.
2865         (init_registers_tilgx32): New function.  The tilegx32 register info
2866         initializer.
2867         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
2868         (tile_store_gregset): Likewise.
2869
2870 2013-02-27  Yao Qi  <yao@codesourcery.com>
2871
2872         * server.c (process_point_options): Print debug message when
2873         debug_threads is true.
2874
2875 2013-02-26  Yao Qi  <yao@codesourcery.com>
2876
2877         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
2878
2879 2013-02-19  Pedro Alves  <palves@redhat.com>
2880             Kai Tietz <ktietz@redhat.com>
2881
2882         PR gdb/15161
2883
2884         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
2885         instead of strtoul to extract address from packet.
2886         (process_serial_event) <'z'>: Likewise.
2887
2888 2013-02-18  Yao Qi  <yao@codesourcery.com>
2889
2890         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
2891
2892 2013-02-14  Pedro Alves  <palves@redhat.com>
2893
2894         Plug memory leak.
2895
2896         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
2897         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
2898
2899 2013-02-14  Pedro Alves  <palves@redhat.com>
2900
2901         * tracepoint.c (cmd_qtdpsrc): Use savestring.
2902
2903 2013-02-14  Pedro Alves  <palves@redhat.com>
2904
2905         * tracepoint.c (save_string): Delete.
2906         (add_tracepoint_action): Use savestring instead of save_string.
2907
2908 2013-02-12  Pedro Alves  <palves@redhat.com>
2909
2910         * linux-xtensa-low.c: Ditto.
2911         * xtensa-xtregs.c: Ditto.
2912
2913 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
2914
2915         * thread-db.c (thread_db_get_tls_address): NULL pointer check
2916         thread_db.
2917
2918 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2919
2920         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
2921         aarch64_num_wp_regs and aarch64_num_bp_regs to
2922         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
2923
2924 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2925
2926         * linux-aarch64-low.c (ps_get_thread_area): Replace
2927         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
2928
2929 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
2930             Marcus Shawcroft  <marcus.shawcroft@arm.com>
2931             Nigel Stephens  <nigel.stephens@arm.com>
2932             Yufeng Zhang  <yufeng.zhang@arm.com>
2933
2934         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
2935         (aarch64.c, aarch64-without-fpu.c): New targets.
2936         * configure.srv (aarch64*-*-linux*): New.
2937         * linux-aarch64-low.c: New file.
2938
2939 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
2940
2941         * linux-low.c (handle_extended_wait, linux_create_inferior)
2942         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
2943         (dequeue_one_deferred_signal, linux_resume_one_thread)
2944         (fetch_register, linux_write_memory, linux_enable_event_reporting)
2945         (linux_tracefork_grandchild, linux_test_for_tracefork)
2946         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
2947         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
2948         where the argument is 0.
2949
2950 2013-01-25  Yao Qi  <yao@codesourcery.com>
2951
2952         * event-loop.c: Include "queue.h".
2953         (gdb_event_p): New typedef.
2954         (struct gdb_event) <next_event>: Remove.
2955         (event_queue): Change to QUEUE(gdb_event_p).
2956         (async_queue_event): Remove.
2957         (gdb_event_xfree): New.
2958         (initialize_event_loop): New.
2959         (process_event): Use API from QUEUE.
2960         (wait_for_event): Likewise.
2961         * server.c (main): Call initialize_event_loop.
2962         * server.h (initialize_event_loop): Declare.
2963
2964 2013-01-18  Yao Qi  <yao@codesourcery.com>
2965
2966         * ax.h (struct eval_agent_expr_context): New.
2967         (gdb_eval_agent_expr): Update declaration.
2968         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
2969         TFRAME.  Add new argument CTX.
2970         * server.h (struct eval_agent_expr_context): Declare.
2971         (agent_mem_read, agent_tsv_read): Update declaration.
2972         (agent_mem_read_string): Likewise.
2973         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
2974         (add_traceframe_block): Add new argument TPOINT.
2975         Increase TPOINT->traceframe_usage.
2976         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
2977         eval_tracepoint_agent_expr.
2978         (condition_true_at_tracepoint): Likewise.
2979         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
2980         (agent_mem_read_string, agent_tsv_read): Likewise.
2981
2982 2013-01-16  Yao Qi  <yao@codesourcery.com>
2983
2984         * linux-low.c (linux_resume_one_lwp): Don't check
2985         'lwp->bp_reinsert != 0'.
2986
2987 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
2988             Pedro Alves  <palves@redhat.com>
2989
2990         * lynx-low.c (ptrace_request_to_str): Define a temporary
2991         macro and use it to simplify this function's implementation.
2992
2993 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
2994
2995         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
2996         sets errno.
2997
2998 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
2999
3000         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
3001
3002 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3003
3004         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
3005
3006 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3007
3008         * lynx-low.c (lynx_resume): Use the resume_info parameter
3009         to determine the ptid for the lynx_ptrace call, unless
3010         it is equal to minus_one_ptid, in which case we use the
3011         ptid of the current_inferior.
3012         (lynx_wait_1): After having received a thread create/exit
3013         event, resume the inferior's execution using the signaling
3014         thread's ptid, rather than the old ptid.
3015
3016 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
3017
3018         * lynx-low.c (lynx_resume): Delete variable ret.
3019
3020 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
3021
3022         * gdbreplay.c (gdbreplay_version): Update copyright year.
3023         * server.c (gdbserver_version): Likewise.
3024
3025 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
3026
3027         * lynx-low.c (lynx_wait_1): Add debug trace before adding
3028         new thread.
3029
3030 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
3031
3032         * lynx-low.c (ptrace_request_to_str): Add handling for
3033         PTRACE_GETTRACESIG.
3034
3035 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
3036
3037         * lynx-low.c (lynx_attach): Delete variable new_process.
3038
3039 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
3040
3041         * lynx-low.c (lynx_create_inferior): Delete variable
3042         new_process.
3043
3044 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
3045
3046         * lynx-low.c (ptrace_request_to_str): Do not handle
3047         PTRACE_GETTHREADLIST if this macro does not exist.
3048
3049 2012-12-15  Yao Qi  <yao@codesourcery.com>
3050
3051         * Makefile.in (OBS): Add notif.o.
3052         * notif.c, notif.h: New.
3053         * server.c: Include "notif.h".
3054         (struct vstop_notif) <next>: Remove.
3055         <base>: New field.
3056         (queue_stop_reply): Update.
3057         (push_event, send_next_stop_reply): Remove.
3058         (discard_queued_stop_replies): Update.
3059         (notif_stop): New variable.
3060         (handle_v_stopped): Remove.
3061         (handle_v_requests): Don't call handle_v_stopped.  Call
3062         handle_ack_notif instead.
3063         (queue_stop_reply_callback): Call notif_event_enque instead
3064         of queue_stop_reply.
3065         (handle_status): Don't call send_next_stop_reply, call
3066         notif_write_event instead.
3067         (kill_inferior_callback): Likewise.
3068         (detach_or_kill_inferior_callback): Likewise.
3069         (main): Call initialize_notif.
3070         (process_serial_event): Call QUEUE_is_empty.
3071         (handle_target_event): Call notif_push instead of push event.
3072         * server.h (push_event): Remove declaration.
3073
3074 2012-12-10  Tom Tromey  <tromey@redhat.com>
3075
3076         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
3077         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
3078         macros.
3079         (.c.o): Rewrite.
3080         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
3081         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
3082         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
3083         (amd64-linux-ipa.o, ax.o): Rewrite.
3084         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
3085         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
3086         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
3087         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
3088         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
3089         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
3090         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
3091         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
3092         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
3093         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
3094         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
3095         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
3096         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
3097         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
3098         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
3099         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
3100         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
3101         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
3102         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
3103         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
3104         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
3105         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
3106         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
3107         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
3108         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
3109         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
3110         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
3111         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
3112         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
3113         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
3114         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
3115         (reg-tilegx.o): Remove.
3116         (all_object_files): New macro.
3117         Include .deps files.
3118         * aclocal.m4, configure: Rebuild.
3119         * acinclude.m4: Include depstand.m4, lead-dot.m4.
3120         * configure.ac: Invoke ZW_CREATE_DEPDIR,
3121         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
3122
3123 2012-12-05  Tom Tromey  <tromey@redhat.com>
3124
3125         PR gdb/14917:
3126         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
3127
3128 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
3129
3130         * configure.ac: Check for linux/perf_event.h.
3131         * config.in: Regenerated.
3132         * configure: Regenerated.
3133
3134 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
3135
3136         * hostio.c (handle_readlink): Decrease buffer size
3137         parameter passed to readlink by one byte.
3138
3139 2012-11-26  Yao Qi  <yao@codesourcery.com>
3140
3141         * configure.ac (build_warnings): Append '-Wempty-body'.
3142         * configure: Regenerated.
3143         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
3144         body.
3145
3146 2012-11-15  Pierre Muller  <muller@sourceware.org>
3147
3148         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
3149         * config.in: Regenerate.
3150         * configure: Regenerate.
3151         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
3152         Use "gdb_wait.h" header instead of <sys/wait.h> header.
3153         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
3154         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
3155         header.
3156         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
3157         instead of <sys/wait.h> header.
3158         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
3159
3160 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
3161
3162         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
3163         (various make rules): Remove -DGDBSERVER
3164
3165 2012-11-09  Yao Qi  <yao@codesourcery.com>
3166
3167         * spu-low.c (current_ptid): Move it to ..
3168         * gdbthread.h: ... here.  New.
3169         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
3170         * server.c (myresume, process_serial_event): Likewise.
3171         * thread-db.c (thread_db_find_new_threads): Likewise.
3172         * tracepoint.c (run_inferior_command): Likewise.
3173
3174 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
3175
3176         * server.c (handle_search_memory_1): Include access length in
3177         warning message.
3178
3179 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
3180
3181         * linux-crisv32-low.c: Fix compile errors.
3182
3183 2012-09-04  Yao Qi  <yao@codesourcery.com>
3184
3185         * tracepoint.c (cmd_qtsv): Adjust debug message.
3186         Don't check CUR_TPOINT.
3187
3188 2012-08-28  Yao Qi  <yao@codesourcery.com>
3189
3190         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
3191         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
3192         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
3193         Remove declarations of xmalloc, xreallloc, xstrdup and
3194         freeargv.
3195         * Makefile.in (libiberty_h): New.
3196         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
3197         (linux-bfin-low.o): Append dependency 'libiberty.h'.
3198
3199 2012-08-23  Yao Qi  <yao@codesourcery.com>
3200
3201         * server.h: Remove declaration of 'xsnprintf'.
3202
3203 2012-08-22  Keith Seitz  <keiths@redhat.com>
3204
3205         * server.h: Include build-gnulib-gbserver/config.h.
3206         * gdbreplay.c: Likewise.
3207
3208 2012-08-08  Doug Evans  <dje@google.com>
3209
3210         * Makefile.in (SFILES): Add gdb_vecs.c.
3211         (OBS): Add gdb_vecs.o.
3212         (gdb_vecs_h, host_defs_h): New variables.
3213         (thread-db.o): Add $(gdb_vecs_h) dependency.
3214         (gdb_vecs.o): New rule.
3215         * thread-db.c: #include "gdb_vecs.h".
3216         (thread_db_load_search): Use a vector to iterate over path elements.
3217         Handle text appearing after "$pdir".
3218
3219         * configure.ac: Add check for strstr.
3220         * config.in: Regenerate.
3221         * configure: Regenerate.
3222
3223 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
3224
3225         * hostio.c (handle_pread): If pread fails, fall back to attempting
3226         lseek/read.
3227         (handle_pwrite): Likewise for pwrite.
3228
3229 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
3230
3231         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
3232         between unsupported TYPE and unimplementable ADDR/LEN combination.
3233         (arm_insert_point): Act on new return value.
3234
3235 2012-07-31  Pedro Alves  <palves@redhat.com>
3236
3237         * server.c (process_point_options): Only skip tokens if we find
3238         one that is unrecognized.  Don't treat 'X' specially while
3239         skipping unrecognized tokens.
3240
3241 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
3242
3243         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
3244         to 4-byte-align HW breakpoint addresses for Thumb.
3245
3246 2012-07-27  Yao Qi  <yao@codesourcery.com>
3247
3248         PR remote/14161.
3249
3250         * server.h: Declare gdb_agent_about_to_close.
3251         * target.c (kill_inferior): Include "agent.h".
3252         New.  Send command 'kill'.
3253         * target.h (kill_inferior): Removed macro.
3254         * tracepoint.c (gdb_agent_about_to_close): New.
3255         (gdb_agent_helper_thread): Handle command 'close'.
3256         Wait endlessly until the inferior stops.
3257         Install gdb_agent_remove_socket to atexit hook.
3258         (agent_socket_name): New static variable.
3259         (gdb_agent_socket_init): Replace local variable 'name' with
3260         'agent_socket_name'.
3261         (gdb_agent_remove_socket): New.
3262
3263 2012-07-27  Yao Qi  <yao@codesourcery.com>
3264
3265         * server.c (process_point_options): Stop at 'X' when parsing.
3266
3267 2012-07-19  Michael Eager  <eager@eagercon.com>
3268
3269         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
3270         to hw_execute.
3271         * linux-x86-low.c (x86_insert_point, x86_remove_point):
3272         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
3273         hardware breakpoint.
3274
3275 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
3276
3277         * gdbserver/linux-low.c (initialize_low): Call
3278         linux_ptrace_init_warnings.
3279
3280 2012-07-02  Doug Evans  <dje@google.com>
3281
3282         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
3283         pointer to int.
3284
3285 2012-07-02  Stan Shebs  <stan@codesourcery.com>
3286
3287         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
3288         (ax.o): Add it to build rule.
3289         (ax-ipa.o): Ditto.
3290         (OBS): Add format.o.
3291         (IPA_OBS): Add format.o.
3292         * server.c (handle_query): Claim support for breakpoint commands.
3293         (process_point_options): Add command case.
3294         (process_serial_event): Leave running if there are printfs in
3295         effect.
3296         * mem-break.h (any_persistent_commands): Declare.
3297         (add_breakpoint_commands): Declare.
3298         (gdb_no_commands_at_breakpoint): Declare.
3299         (run_breakpoint_commands): Declare.
3300         * mem-break.c (struct point_command_list): New struct.
3301         (struct breakpoint): New field command_list.
3302         (any_persistent_commands): New function.
3303         (add_commands_to_breakpoint): New function.
3304         (add_breakpoint_commands): New function.
3305         (gdb_no_commands_at_breakpoint): New function.
3306         (run_breakpoint_commands): New function.
3307         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
3308         locally.
3309         * ax.c: Include format.h.
3310         (ax_printf): New function.
3311         (gdb_eval_agent_expr): Add printf opcode.
3312
3313 2012-06-13  Yao Qi  <yao@codesourcery.com>
3314
3315         * server.c (start_inferior): Remove duplicated writes to fields
3316         'last_resume_kind' and 'last_status' of 'current_inferior'.
3317
3318 2012-06-12  Yao Qi  <yao@codesourcery.com>
3319             Pedro Alves  <palves@redhat.com>
3320
3321         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
3322         comment.
3323         * server.c (handle_v_cont): Extend comment.
3324
3325 2012-06-11  Yao Qi  <yao@codesourcery.com>
3326
3327         * linux-low.c (linux_attach): Add 'static'.
3328
3329 2012-06-06  Yao Qi  <yao@codesourcery.com>
3330
3331         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
3332
3333 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
3334
3335         Fix gcc -flto compilation warning.
3336         * server.c (main): Make variable multi_mode and attach volatile.
3337
3338 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
3339
3340         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
3341         if the platform doesn't know about it.
3342
3343 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
3344
3345         * Makefile.in (SFILES): Add linux-tile-low.c.
3346         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
3347         * configure.srv: Handle tilegx-*-linux*.
3348         * linux-tile-low.c: New file.
3349
3350 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
3351
3352         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
3353
3354 2012-05-24  Pedro Alves  <palves@redhat.com>
3355
3356         PR gdb/7205
3357
3358         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
3359
3360 2012-05-24  Pedro Alves  <palves@redhat.com>
3361
3362         PR gdb/7205
3363
3364         Replace target_signal with gdb_signal throughout.
3365
3366 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
3367
3368         * linux-low.c (linux_store_registers): Avoid the copying sequence
3369         when no data has been retrieved by ptrace.
3370
3371 2012-05-22  Will Deacon  <will.deacon@arm.com>
3372
3373         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
3374         Include asm/ptrace.h.
3375         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
3376         already defined.
3377
3378 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
3379
3380         * linux-low.c (linux_store_registers): Don't re-retrieve data
3381         with ptrace that has already been obtained from /proc.  Always
3382         copy any data retrieved with ptrace to the buffer supplied.
3383
3384 2012-05-11  Yao Qi  <yao@codesourcery.com>
3385             Pedro Alves  <palves@redhat.com>
3386
3387         * linux-low.c (enum stopping_threads_kind): New.
3388         (stopping_threads): Change type to `enum stopping_threads_kind'.
3389         (handle_extended_wait): If stopping and suspending threads, leave
3390         the new_lwp suspended too.
3391         (linux_wait_for_event): Adjust.
3392         (stop_all_lwps): Set `stopping_threads' to
3393         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
3394         whether we're suspending threads or just stopping them.  Assert no
3395         recursion happens.
3396
3397 2012-04-29  Yao Qi  <yao@codesourcery.com>
3398
3399         * server.h: Move some code to ...
3400         * gdbthread.h: ... here.  New.
3401         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
3402         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
3403         (nto-low.o, win32-low.o): Likewise.
3404         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
3405         * regcache.c, remote-utils.c, server.c: Likewise.
3406         * target.c, tracepoint.c, win32-low.c: Likewise.
3407
3408 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
3409
3410         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
3411         (PTRACE_ARG4_TYPE): Likewise.
3412         (PTRACE_XFER_TYPE): Likewise.
3413         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
3414         ptrace to PTRACE_ARG3_TYPE.
3415         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
3416         (PTRACE_ARG4_TYPE): Likewise.
3417         (PTRACE_XFER_TYPE): Likewise.
3418         (linux_detach_one_lwp): Cast fourth argument of
3419         ptrace to long then PTRACE_ARG4_TYPE.
3420         (regsets_fetch_inferior_registers): Cast third argument of
3421         ptrace to long then PTRACE_ARG3_TYPE.
3422         (regsets_store_inferior_registers): Likewise.
3423
3424 2012-04-20  Pedro Alves  <palves@redhat.com>
3425
3426         * configure: Regenerate.
3427
3428 2012-04-19  Pedro Alves  <palves@redhat.com>
3429
3430         * Makefile.in (GNULIB_BUILDDIR): New.
3431         (LIBGNU, INCGNU, GNULIB_H): Adjust.
3432         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
3433         (all, install-only, uninstall, clean-info, all-lib, clean): No
3434         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
3435         (maintainer-clean realclean distclean): Use subdir_do.
3436         (subdir_do): New.
3437         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
3438         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
3439         * acinclude.m4: Include acx_configure_dir.m4.
3440         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
3441         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
3442         ACX_CONFIGURE_DIR.
3443         (GNULIB): New.
3444         (GNULIB_STDINT_H): Adjust.
3445         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
3446         * gdbreplay.c: Include build-gnulib/config.h.
3447         * server.h: Likewise.
3448         * aclocal.m4: Regenerate.
3449         * config.in: Regenerate.
3450         * configure: Regenerate.
3451
3452 2012-04-19  Pedro Alves  <palves@redhat.com>
3453
3454         * Makefile.in (LIBGNU, INCGNU): Adjust.
3455         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
3456         (all, install-only, uninstall, clean-info, all-lib, clean)
3457         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
3458         * configure.ac: Adjust AC_OUTPUT output.
3459         * aclocal.m4: Regenerate.
3460         * configure: Regenerate.
3461
3462 2012-04-19  Pedro Alves  <palves@redhat.com>
3463
3464         * Makefile.in (generated_files): New.
3465         (server_h): Remove the explicit dependency on config.h, and depend
3466         on $generated_files.
3467
3468 2012-04-19  Pedro Alves  <palves@redhat.com>
3469
3470         * Makefile.in (INCGNU): Add -Ignulib.
3471
3472 2012-04-19  Pedro Alves  <palves@redhat.com>
3473
3474         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
3475         (INCGNU): ... this, and spell out -I here.
3476         (GNULIB_LIB): Rename to ...
3477         (LIBGNU): ... this.
3478         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
3479
3480 2012-04-19  Pedro Alves  <palves@redhat.com>
3481
3482         * config.in: Regenerate.
3483
3484 2012-04-19  Pedro Alves  <palves@redhat.com>
3485
3486         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
3487         * server.h (memmem): Remove declaration.
3488         * config.in: Regenerate.
3489         * configure: Regenerate.
3490
3491 2012-04-19  Yao Qi  <yao@codesourcery.com>
3492
3493         * Makefile.in (SFILES): Add common/vec.c.
3494         (OBS): Add vec.o.
3495         (vec.o): New rule.
3496
3497 2012-04-19  Yao Qi  <yao@codesourcery.com>
3498
3499         * remote-utils.c (prepare_resume_reply): Replace with macro
3500         target_core_of_thread.
3501         * server.c (handle_qxfer_threads_proper): Likewise.
3502         * target.h (traget_core_of_thread): New macro.
3503
3504 2012-04-18  Pedro Alves  <palves@redhat.com>
3505
3506         * aclocal.m4: Regenerate.
3507         * configure: Regenerate.
3508
3509 2012-04-16  Yao Qi  <yao@codesourcery.com>
3510
3511         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
3512         duplicated on address.
3513
3514 2012-04-16  Yao Qi  <yao@codesourcery.com>
3515
3516         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
3517         (struct tracepoint_action_ops) <send>: New field.
3518         (m_tracepoint_action_send, r_tracepoint_action_send): New.
3519         (agent_expr_send, x_tracepoint_action_send): New.
3520         (l_tracepoint_action_send): New.
3521         (cmd_qtdp): Download and install tracepoint
3522         according to `use_agent'.
3523         (run_inferior_command): Add one more parameter `len'.
3524         Update callers.
3525         (tracepoint_send_agent): New.
3526         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
3527
3528 2012-04-16  Yao Qi  <yao@codesourcery.com>
3529
3530         * tracepoint.c (download_tracepoints): Moved to ...
3531         (cmd_qtstart): ... here.
3532
3533 2012-04-14  Yao Qi  <yao@codesourcery.com>
3534
3535         * tracepoint.c: Include inttypes.h.
3536         (struct collect_memory_action): Use sized types.
3537         (struct tracepoint): Likewise.
3538         (cmd_qtdp, stop_tracing): Update print specifiers.
3539         (cmd_qtp, response_tracepoint): Likewise.
3540         (collect_data_at_tracepoint): Likewise.
3541         (collect_data_at_step): Likewise.
3542
3543 2012-04-14  Yao Qi  <yao@codesourcery.com>
3544
3545         Import gnulib module inttypes.
3546         * aclocal.m4, config.in, configure: Regenerated.
3547
3548 2012-04-14  Yao Qi  <yao@codesourcery.com>
3549
3550         * Makefile.in (maintainer-clean, realclean, distclean): Remove
3551         Makefile and config.status at last.
3552
3553 2012-04-13  Yao Qi  <yao@codesourcery.com>
3554
3555         * tracepoint.c: Include stdint.h unconditionally.
3556
3557 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
3558
3559         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
3560         on BFD_HAVE_SYS_PROCFS_TYPE.
3561         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
3562         * configure: Regenerate.
3563         * config.in: Likewise.
3564
3565 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
3566
3567         * Makefile.in (clean): Also remove x32.c x32-linux.c
3568         x32-avx.c x32-avx-linux.c.
3569         (x32.o): New target.
3570         (x32.c): Likewise.
3571         (x32-linux.o): Likewise.
3572         (x32-linux.c): Likewise.
3573         (x32-avx.o): Likewise.
3574         (x32-avx.c): Likewise.
3575         (x32-avx-linux.o): Likewise.
3576         (x32-avx-linux.c): Likewise.
3577
3578         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
3579         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
3580         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
3581         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
3582         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
3583         i386/x32-avx-linux.xml.
3584
3585         * linux-x86-low.c (init_registers_x32_linux): New prototype.
3586         (init_registers_x32_avx_linux): Likwise.
3587         (x86_linux_update_xmltarget): Call init_registers_x32_linux
3588         or init_registers_x32_avx_linux if linux_is_elf64 is false.
3589
3590 2012-04-13  Pedro Alves  <palves@redhat.com>
3591
3592         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
3593         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
3594         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
3595         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
3596         the sub-make.
3597
3598 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
3599
3600         * linux-x86-low.c (compat_x32_clock_t): New.
3601         (compat_x32_siginfo_t): Likewise.
3602         (compat_x32_siginfo_from_siginfo): Likewise.
3603         (siginfo_from_compat_x32_siginfo): Likewise.
3604         (linux_is_elf64): Likewise.
3605         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
3606         and siginfo_from_compat_x32_siginfo for x32.
3607         (x86_arch_setup): Set linux_is_elf64.
3608
3609 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
3610
3611         PR gdb/13969
3612         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
3613         e_machine field.
3614         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
3615         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
3616         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
3617         compatible with process.
3618
3619 2012-04-12  Yao Qi  <yao@codesourcery.com>
3620
3621         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
3622         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
3623         (install-only, install-info, clean): Handle sub dir gnulib.
3624         (all-lib, am--refresh): New targets.
3625         (memmem.o): Remove target.
3626         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
3627         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
3628         (AC_REPLACE_FUNCS): Remove memmem.
3629         Invoke gl_INIT and AM_INIT_AUTOMAKE.
3630         (AC_OUTPUT): Generate Makefile in gnulib/.
3631         * aclocal.m4, config.in, configure: Regenerated.
3632
3633 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
3634
3635         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
3636
3637 2012-04-05  Pedro Alves  <palves@redhat.com>
3638
3639         -Werror=strict-aliasing
3640
3641         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
3642         pointer.
3643
3644 2012-04-04  Pedro Alves  <palves@redhat.com>
3645
3646         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
3647         (sparc_store_gregset_from_stack, sparc_store_gregset)
3648         (sparc_breakpoint_at): Fix formatting.
3649
3650 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
3651
3652         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
3653         are available.
3654         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
3655         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
3656         * config.in: Regenerate.
3657         * configure: Likewise.
3658
3659 2012-03-29  Pedro Alves  <palves@redhat.com>
3660
3661         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
3662         Correct ptrace arguments.
3663
3664 2012-03-28  Pedro Alves  <palves@redhat.com>
3665
3666         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
3667         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
3668         (IA64_FR1_REGNUM): New defines.
3669         (ia64_fetch_register): New.
3670         (the_low_target): Install it.
3671         * linux-low.h (struct linux_target_ops) <fetch_register>: New
3672         field.
3673         * linux-low.c (linux_fetch_registers): Try the
3674         the_low_target.fetch_register hook first.
3675
3676         * linux-arm-low.c (the_low_target): Adjust.
3677         * linux-bfin-low.c (the_low_target): Adjust.
3678         * linux-cris-low.c (the_low_target): Adjust.
3679         * linux-crisv32-low.c (the_low_target): Adjust.
3680         * linux-m32r-low.c (the_low_target): Adjust.
3681         * linux-m68k-low.c (the_low_target): Adjust.
3682         * linux-mips-low.c (the_low_target): Adjust.
3683         * linux-ppc-low.c (the_low_target): Adjust.
3684         * linux-s390-low.c (the_low_target): Adjust.
3685         * linux-sh-low.c (the_low_target): Adjust.
3686         * linux-sparc-low.c (the_low_target): Adjust.
3687         * linux-tic6x-low.c (the_low_target): Adjust.
3688         * linux-x86-low.c (the_low_target): Adjust.
3689         * linux-xtensa-low.c (the_low_target): Adjust.
3690
3691 2012-03-26  Pedro Alves  <palves@redhat.com>
3692
3693         * server.c (handle_qxfer_libraries): Don't bail early if
3694         the_target->qxfer_libraries_svr4 is not NULL.
3695
3696 2012-03-26  Pedro Alves  <palves@redhat.com>
3697
3698         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
3699
3700 2012-03-23  Pedro Alves  <palves@redhat.com>
3701
3702         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
3703         "library-list-svr4" element's start tag when the the DSO list is
3704         empty.
3705
3706 2012-03-23  Pedro Alves  <palves@redhat.com>
3707
3708         * linux-low.c (read_one_ptr): Read the inferior's pointer through
3709         a variable whose type size is the same as the inferior's pointer
3710         size.
3711
3712 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
3713
3714         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
3715         struct siginfo.
3716         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
3717         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
3718         * linux-low.h: Include <signal.h>.
3719         (struct siginfo): Remove forward declaration.
3720         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
3721         struct siginfo.
3722
3723 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
3724
3725         * .gitignore: Ignore more files.
3726
3727 2012-03-19  Pedro Alves  <palves@redhat.com>
3728             Jan Kratochvil  <jan.kratochvil@redhat.com>
3729
3730         * server.c (cont_thread, general_thread): Add describing comments.
3731         (start_inferior): Clear `cont_thread'.
3732         (handle_v_cont): Don't set `cont_thread' if resuming all threads
3733         of a process.
3734
3735 2012-03-15  Yao Qi  <yao@codesourcery.com>
3736
3737         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
3738         handling to ...
3739         (cmd_qtdp): ... here.
3740
3741 2012-03-15  Yao Qi  <yao@codesourcery.com>
3742
3743         * tracepoint.c (struct tracepoint_action_ops): New.
3744         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
3745         (m_tracepoint_action_download): New.
3746         (r_tracepoint_action_download): New.
3747         (x_tracepoint_action_download): New.
3748         (l_tracepoint_action_download): New.
3749         (add_tracepoint_action): Install `action->ops' according type.
3750         (download_tracepoint_1): Move code `download' function pointer
3751         of various tracepoint_action_ops.
3752
3753 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
3754
3755         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
3756         linux_ptrace_attach_warnings.
3757
3758 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
3759
3760         * Makefile.in (linux-ptrace.o): New.
3761         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
3762         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
3763         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
3764         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
3765         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
3766         of these targets.
3767         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
3768
3769 2012-03-08  Yao Qi  <yao@codesourcery.com>
3770             Pedro Alves  <palves@redhat.com>
3771
3772         Fix PR server/13392.
3773         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
3774         offset of JMP insn.
3775         * tracepoint.c (remove_tracepoint): New.
3776         (cmd_qtdp): Call remove_tracepoint when failed to install.
3777
3778 2012-03-07  Pedro Alves  <palves@redhat.com>
3779
3780         * linux-low.c (get_detach_signal): New.
3781         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
3782         Pass on pending signals to PTRACE_DETACH.  Check the result of the
3783         ptrace call.
3784         * server.c (program_signals, program_signals_p): New.
3785         (handle_general_set): Handle QProgramSignals.
3786         * server.h (program_signals, program_signals_p): Declare.
3787
3788 2012-03-05  Pedro Alves  <palves@redhat.com>
3789             Jan Kratochvil  <jan.kratochvil@redhat.com>
3790
3791         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
3792         New comment why.
3793
3794 2012-03-03  Yao Qi  <yao@codesourcery.com>
3795
3796         * tracepoint.c (tracepoint_look_up_symbols): Update call to
3797         agent_look_up_symbols.
3798
3799 2012-03-03  Yao Qi  <yao@codesourcery.com>
3800
3801         * Makefile.in (linux-low.o): Keep dependence on agent.h.
3802         (linux-x86-low.o): Likewise.
3803         * server.h: Remove in_process_agent_loaded.
3804         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
3805         common/agent.c.
3806         Update callers.
3807
3808 2012-03-03  Yao Qi  <yao@codesourcery.com>
3809
3810         * tracepoint.c (gdb_agent_capability): New global.
3811         (in_process_agent_loaded_ust): Renamed to
3812         `in_process_agent_supports_ust'.
3813         Update callers.
3814         (in_process_agent_supports_ust): Call agent_capability_check.
3815         (clear_installed_tracepoints): Assert that agent supports
3816         agent.
3817
3818 2012-03-03  Yao Qi  <yao@codesourcery.com>
3819
3820         * linux-low.c (linux_supports_agent): New.
3821         (linux_target_ops): Initialize field `supports_agent' with
3822         linux_supports_agent.
3823         * target.h (struct target_ops) <supports_agent>: New.
3824         (target_supports_agent): New macro.
3825         * server.c (handle_general_set): Handle packet 'QAgent'.
3826         (handle_query): Send `QAgent+'.
3827         * Makefile.in (server.o): Depends on agent.h.
3828
3829 2012-03-03  Yao Qi  <yao@codesourcery.com>
3830
3831         * Makefile.in (OBS): Add agent.o.
3832         Add new rule for agent.o.
3833         Track dependence of tracepoint.c on agent.h.
3834         * tracepoint.c (run_inferior_command_1):
3835         (run_inferior_command): Call agent_run_command.
3836         (gdb_ust_connect_sync_socket): Deleted.  Move it to
3837         common/agent.c.
3838         (resume_thread, stop_thread): Likewise.
3839         (gdb_ust_socket_init): Renamed to ...
3840         (gdb_agent_socket_init): ... New.
3841         (gdb_ust_thread): Renamed to ...
3842         (gdb_agent_helper_thread): ... New.
3843         (gdb_ust_init): Move some code to ...
3844         (gdb_agent_init): ... here.  New.
3845         [HAVE_UST]: Call gdb_ust_init.
3846         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
3847         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
3848         * config.in, configure: Regenerated.
3849
3850 2012-03-02  Pedro Alves  <palves@redhat.com>
3851
3852         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
3853         * linux-low.c (struct simple_pid_list): New.
3854         (stopped_pids): New a struct simple_pid_list pointer.
3855         (add_to_pid_list, pull_pid_from_list): New.
3856         (handle_extended_wait): Don't assume the first signal new children
3857         report is SIGSTOP.  Adjust call to pull_pid_from_list.
3858         (linux_wait_for_lwp): Adjust.
3859
3860 2012-03-02  Yao Qi  <yao@codesourcery.com>
3861
3862         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
3863         debug log.
3864
3865 2012-03-02  Yao Qi  <yao@codesourcery.com>
3866
3867         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
3868         `stop_pc' and `tpoint'.  Update caller.
3869
3870 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
3871
3872         * linux-low.h (linux_target_ops): Add regset_bitmap member.
3873         * linux-low.c (use_linux_regsets): New macro.
3874         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
3875         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
3876         (linux_register_in_regsets): New function.
3877         (usr_fetch_inferior_registers): Skip registers covered by
3878         regsets.
3879         (usr_store_inferior_registers): Likewise.
3880         (usr_fetch_inferior_registers): New macro.
3881         (usr_store_inferior_registers): Likewise.
3882         (linux_fetch_registers): Handle mixed regset/non-regset targets.
3883         (linux_store_registers): Likewise.
3884         * linux-mips-low.c (init_registers_mips_dsp_linux): New
3885         prototype.
3886         (init_registers_mips64_dsp_linux): Likewise.
3887         (init_registers_mips_linux): New macro.
3888         (init_registers_mips_dsp_linux): Likewise.
3889         (mips_dsp_num_regs): Likewise.
3890         (DSP_BASE, DSP_CONTROL): New fallback macros.
3891         (mips_base_regs): New macro.
3892         (mips_regmap): Use it.  Fix the size.
3893         (mips_dsp_regmap): New variable.
3894         (mips_dsp_regset_bitmap): Likewise.
3895         (mips_arch_setup): New function.
3896         (mips_cannot_fetch_register): Use the_low_target.regmap rather
3897         than mips_regmap.
3898         (mips_cannot_store_register): Likewise.
3899         (the_low_target): Update .arch_setup, .num_regs and .regmap
3900         initializers.  Add .regset_bitmap initializer.
3901         * linux-arm-low.c (the_low_target): Add .regset_bitmap
3902         initializer.
3903         * linux-bfin-low.c (the_low_target): Likewise.
3904         * linux-cris-low.c (the_low_target): Likewise.
3905         * linux-crisv32-low.c (the_low_target): Likewise.
3906         * linux-ia64-low.c (the_low_target): Likewise.
3907         * linux-m32r-low.c (the_low_target): Likewise.
3908         * linux-m68k-low.c (the_low_target): Likewise.
3909         * linux-ppc-low.c (the_low_target): Likewise.
3910         * linux-s390-low.c (the_low_target): Likewise.
3911         * linux-sh-low.c (the_low_target): Likewise.
3912         * linux-sparc-low.c (the_low_target): Likewise.
3913         * linux-tic6x-low.c (the_low_target): Likewise.
3914         * linux-x86-low.c (the_low_target): Likewise.
3915         * linux-xtensa-low.c (the_low_target): Likewise.
3916         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
3917         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
3918         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
3919         srv_xmlfiles.
3920         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
3921         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
3922
3923 2012-02-29  Yao Qi  <yao@codesourcery.com>
3924             Pedro Alves  <palves@redhat.com>
3925
3926         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
3927         `step_over_finished' is true.
3928
3929 2012-02-27  Pedro Alves  <palves@redhat.com>
3930
3931         * linux-low.c (pid_is_stopped): Delete, moved to common/.
3932         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
3933
3934 2012-02-27  Pedro Alves  <palves@redhat.com>
3935
3936         PR server/9684
3937         * linux-low.c (pid_is_stopped): New.
3938         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
3939
3940 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
3941
3942         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
3943         of conditions.
3944
3945 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
3946
3947         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
3948
3949 2012-02-24  Luis Machado  <lgustavo@codesourcery>
3950
3951         * server.c (handle_query): Advertise support for target-side
3952         breakpoint condition evaluation.
3953         (process_point_options): New function.
3954         (process_serial_event): When inserting a breakpoint, check for
3955         a target-side condition that should be evaluated.
3956
3957         * mem-break.c: Include regcache.h and ax.h.
3958         (point_cond_list_t): New data structure.
3959         (breakpoint) <cond_list>: New field.
3960         (find_gdb_breakpoint_at): Make non-static.
3961         (delete_gdb_breakpoint_at): Clear any target-side
3962         conditions.
3963         (clear_gdb_breakpoint_conditions): New function.
3964         (add_condition_to_breakpoint): Likewise.
3965         (add_breakpoint_condition): Likewise.
3966         (gdb_condition_true_at_breakpoint): Likewise.
3967         (gdb_breakpoint_here): Return result directly instead
3968         of going through a local variable.
3969
3970         * mem-break.h (find_gdb_breakpoint_at): New prototype.
3971         (clear_gdb_breakpoint_conditions): Likewise.
3972         (add_breakpoint_condition): Likewise.
3973         (gdb_condition_true_at_breakpoint): Likewise.
3974
3975         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
3976         (need_step_over_p): Take target-side breakpoint condition into
3977         consideration.
3978
3979 2012-02-24  Luis Machado  <lgustavo@codesourcery>
3980
3981         * server.h: Include tracepoint.h.
3982         (agent_mem_read, agent_get_trace_state_variable_value,
3983         agent_set_trace_state_variable_value,
3984         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
3985         get_set_tsv_func_addr): New prototypes.
3986
3987         * ax.h: New include file.
3988         * ax.c: New source file.
3989
3990         * tracepoint.c: Include ax.h.
3991         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
3992         agent_expr, eval_result_type): Move to ax.h.
3993         (parse_agent_expr): Rename to ...
3994         (gdb_parse_agent_expr): ... this, make it non-static and move
3995         to ax.h.
3996         (unparse_agent_expr) Rename to ...
3997         (gdb_unparse_agent_expr): ... this, make it non-static and move
3998         to ax.h.
3999         (eval_agent_expr): Rename to ...
4000         (eval_tracepoint_agent_expr): ... this.
4001         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
4002         forward declarations.
4003         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
4004         (agent_get_trace_state_variable_value): New function.
4005         (agent_set_trace_state_variable_value): New function.
4006         (cmd_qtdp): Call gdb_parse_agent_expr (...).
4007         (response_tracepoint): Call gdb_unparse_agent_expr (...).
4008         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
4009         (condition_true_at_tracepoint): Likewise.
4010         (parse_agent_expr): Rename to ...
4011         (gdb_parse_agent_expr): ... this and move to ax.c.
4012         (unparse_agent_expr): Rename to ...
4013         (gdb_unparse_agent_expr): ... this and move to ax.c.
4014         (gdb_agent_op_name): Move to ax.c.
4015         (eval_agent_expr): Rename to ...
4016         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
4017         and move to ax.c.
4018         (eval_tracepoint_agent_expr): New function.
4019         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
4020         non-static.
4021         (current_insn_ptr, emit_error, struct bytecode_address): Move to
4022         ax.c.
4023         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
4024         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
4025         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
4026         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
4027         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
4028         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
4029         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
4030         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
4031         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
4032         (compile_bytecodes): Remove forward declaration.
4033         (is_goto_target): Move to ax.c.
4034         (compile_bytecodes): Move to ax.c and call
4035         agent_get_trace_state_variable_value (...) and
4036         agent_set_trace_state_variable_value (...).
4037
4038         * Makefile.in: Update ax.c and IPA dependencies.
4039
4040 2012-02-24  Pedro Alves  <palves@redhat.com>
4041
4042         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
4043         (cmd_bigqtbuffer_circular): ... this.  Only handle
4044         'QTBuffer:circular:'.
4045         (handle_tracepoint_general_set): Adjust.
4046
4047 2012-02-16  Yao Qi  <yao@codesourcery.com>
4048
4049         * inferiors.c: Move code to ...
4050         * dll.c: .... here.  New.
4051         * server.h: Declare clear_dlls.
4052         * Makefile.in (SFILES): Add dll.c.
4053         (OBS): Add dll.o
4054         (dll.o): New rule.
4055
4056 2012-02-11  Yao Qi  <yao@codesourcery.com>
4057
4058         * server.c: (handle_monitor_command): Add a new parameter
4059         `own_buf'.
4060         (handle_query): Update caller.
4061
4062 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
4063
4064         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
4065         * configure, config.in: Regenerate.
4066         * hostio.c: Provide an alternate implementation if HAVE_READLINK
4067         is not defined.
4068
4069 2012-02-02  Pedro Alves  <palves@redhat.com>
4070
4071         Try SIGKILL first, then PTRACE_KILL.
4072         * linux-low.c (linux_kill_one_lwp): New.
4073         (linux_kill_one_lwp): Rename to ...
4074         (kill_one_lwp_callback): ... this.  Use the new
4075         linux_kill_one_lwp.
4076
4077 2012-02-02  Pedro Alves  <palves@redhat.com>
4078
4079         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
4080         inferior.
4081
4082 2012-01-27  Pedro Alves  <palves@redhat.com>
4083
4084         * linux-low.c (linux_child_pid_to_exec_file): Delete.
4085         (elf_64_file_p): Make static.
4086         (linux_pid_exe_is_elf_64_file): New.
4087         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
4088         Delete declarations.
4089         (linux_pid_exe_is_elf_64_file): Declare.
4090         * linux-x86-low.c (x86_arch_setup): Use
4091         linux_pid_exe_is_elf_64_file.
4092
4093 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
4094
4095         * linux-low.c (linux_wait_for_event_1): Rename to ...
4096         (linux_wait_for_event): ... here and merge it with former
4097         linux_wait_for_event - new variable wait_ptid, use it.
4098         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
4099
4100 2012-01-23  Pedro Alves  <palves@redhat.com>
4101
4102         * server.c (main): Avoid yet another case of infinite loop while
4103         detaching/killing after a longjmp.
4104
4105 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
4106
4107         Code cleanup.
4108         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
4109
4110 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
4111
4112         * hostio.c (handle_readlink): New function.
4113         (handle_vFile): Call it to handle "vFile:readlink" packets.
4114
4115 2012-01-20  Pedro Alves  <palves@redhat.com>
4116             Ulrich Weigand  <ulrich.weigand@linaro.org>
4117
4118         * server.c (handle_v_requests): Only support vAttach and vRun to
4119         start multiple processes when in extended protocol mode.
4120
4121 2012-01-17  Pedro Alves  <palves@redhat.com>
4122
4123         * tracepoint.c (initialize_tracepoint): Use mmap instead of
4124         memalign plus mprotect to allocate the scratch buffer.
4125
4126 2012-01-13  Pedro Alves  <palves@redhat.com>
4127
4128         * server.c (attach_inferior): Clear `cont_thread'.
4129
4130 2012-01-13  Pedro Alves  <palves@redhat.com>
4131
4132         * server.c (main): Avoid infinite loop while detaching/killing
4133         after a longjmp.
4134
4135 2012-01-09  Doug Evans  <dje@google.com>
4136
4137         * server.c (start_inferior): Set last_ptid in --wrapper case.
4138
4139 2012-01-06  Yao Qi  <yao@codesourcery.com>
4140
4141         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
4142         defined.
4143         [IN_PROCESS_AGENT] (debug_agent): New global variable.
4144
4145 2012-01-04  Yao Qi  <yao@codesourcery.com>
4146
4147         * tracepoint.c (cmd_qtdp): Print debug message
4148         for static tracepoint.
4149
4150 2012-01-04  Yao Qi  <yao@codesourcery.com>
4151
4152         * tracepoint.c (trace_vdebug): Differentiate debug message
4153         between gdbserver and IPA.
4154
4155 2012-01-03  Yao Qi  <yao@codesourcery.com>
4156
4157         * tracepoint.c (tracepoint_was_hit): Don't collect for
4158         static tracepoint.
4159
4160 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
4161
4162         * terminal.h: Reformat copyright header.
4163
4164 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
4165
4166         * server.c (gdbserver_version): Update copyright year.
4167         * gdbreplay.c (gdbreplay_version): Likewise.
4168
4169 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
4170
4171         * linux-low.c (linux_create_inferior): Put empty if clause for write.
4172
4173         Revert:
4174         2011-12-18  Hui Zhu  <teawater@gmail.com>
4175         * linux-low.c (linux_create_inferior): Save return value to ret.
4176
4177 2011-12-18  Hui Zhu  <teawater@gmail.com>
4178
4179         * linux-low.c (linux_create_inferior): Save return value to ret.
4180
4181 2011-12-16  Doug Evans  <dje@google.com>
4182
4183         * linux-low.c (linux_create_inferior): If stdio connection,
4184         redirect stdin from /dev/null, stdout to stderr.
4185         * remote-utils.c (remote_is_stdio): New static global.
4186         (remote_connection_is_stdio): New function.
4187         (remote_prepare): Handle stdio connection.
4188         (remote_open): Ditto.
4189         (remote_close): Don't close stdin for stdio connections.
4190         (read_prim,write_prim): New functions.  Replace all calls to
4191         read/write to these.
4192         * server.c (main): Watch for "-" argument.  Move call to
4193         remote_prepare before start_inferior.
4194         * server.h (STDIO_CONNECTION_NAME): New macro.
4195         (remote_connection_is_stdio): Declare.
4196
4197         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
4198         in debugging output.
4199
4200 2011-12-15  Yao Qi  <yao@codesourcery.com>
4201
4202         * tracepoint.c: Include sys/syscall.h.
4203         (gdb_ust_thread): Remove preprocessor conditional.
4204
4205 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
4206
4207         * linux-low.c (linux_detach_one_lwp): Call
4208         the_low_target.prepare_to_resume before detaching.
4209
4210 2011-12-14  Yao Qi  <yao@codesourcery.com>
4211
4212         * tracepoint.c (gdb_ust_thread): Don't ignore return value
4213         of write.
4214
4215 2011-12-14  Yao Qi  <yao@codesourcery.com>
4216
4217         * i386-low.c (i386_low_stopped_data_address): Initialize local
4218         variable `control'.
4219
4220 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
4221
4222         PR remote/13492
4223
4224         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
4225         DR_CONTROL unless necessary.  Extend comments.
4226         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
4227         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
4228
4229 2011-12-13  Yao Qi  <yao@codesourcery.com>
4230
4231         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
4232         macros.
4233         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
4234
4235 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
4236
4237         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
4238         Print new debug message for such case.
4239
4240 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
4241
4242         Fix overlapping memcpy.
4243         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
4244         the read_inferior_memory transfer.
4245         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
4246         write_inferior_memory transfer.
4247         (set_fast_tracepoint_jump): New variable buf.  Use it for the
4248         read_inferior_memory and write_inferior_memory transfers.
4249         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
4250         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
4251         Use it for the write_inferior_memory transfer.
4252         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
4253         buffers.
4254
4255 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
4256
4257         * linux-low.c (fetch_register, store_register): Make code
4258         consistent, fix formatting.
4259
4260 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
4261
4262         * linux-low.c (usr_store_inferior_registers): Factor out code
4263         to handle individual registers into...
4264         (store_register): ... this new function.
4265
4266 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
4267
4268         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
4269         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
4270         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
4271         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
4272         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
4273         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
4274         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
4275         (srv_xmlfiles): Add new XML files.
4276
4277         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
4278         and <sys/uio.h>.
4279         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
4280         (init_registers_s390_linux32v1): Add prototype.
4281         (init_registers_s390_linux32v2): Likewise.
4282         (init_registers_s390_linux64v1): Likewise.
4283         (init_registers_s390_linux64v2): Likewise.
4284         (init_registers_s390x_linux64v1): Likewise.
4285         (init_registers_s390x_linux64v2): Likewise.
4286         (s390_num_regs): Increment to 52.
4287         (s390_regmap): Add orig_r2 register.
4288         (s390_num_regs_3264): Increment to 68.
4289         (s390_regmap_3264): Add orig_r2 register.
4290         (s390_collect_ptrace_register): Handle orig_r2 register.
4291         (s390_supply_ptrace_register): Likewise.
4292         (s390_fill_last_break): New function.
4293         (s390_store_last_break): Likewise.
4294         (s390_fill_system_call): New function.
4295         (s390_store_system_call): Likewise.
4296         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
4297         register sets.
4298         (s390_check_regset): New function.
4299         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
4300         NT_S390_SYSTEM_CALL regsets and use appropriate description.
4301         Update target_regsets for available register sets.
4302
4303 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
4304             Jan Kratochvil  <jan.kratochvil@redhat.com>
4305
4306         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
4307         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
4308         New.
4309         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
4310         * linux-low.h (struct process_info_private): New member r_debug.
4311         * server.c (handle_qxfer_libraries): Call
4312         the_target->qxfer_libraries_svr4.
4313         (handle_qxfer_libraries_svr4): New function.
4314         (qxfer_packets): New entry "libraries-svr4".
4315         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
4316         * target.h (struct target_ops): New member qxfer_libraries_svr4.
4317         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
4318         PACKET_qXfer_libraries_svr4.
4319
4320 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
4321
4322         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
4323         PSW address/mask between 8-byte and 16-byte formats.
4324         (s390_supply_ptrace_register): Likewise.
4325         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
4326         basic addressing mode bit.
4327
4328 2011-11-24  Stan Shebs  <stan@codesourcery.com>
4329
4330         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
4331
4332 2011-11-17  Stan Shebs  <stan@codesourcery.com>
4333
4334         * tracepoint.c (struct tracepoint): New field traceframe_usage.
4335         (tracing_start_time): New global.
4336         (tracing_stop_time): New global.
4337         (tracing_user_name): New global.
4338         (tracing_notes): New global.
4339         (tracing_stop_note): New global.
4340         (cmd_qtstart): Set traceframe_usage, start_time.
4341         (stop_tracing): Set stop_time.
4342         (cmd_qtstatus): Report additional status.
4343         (cmd_qtp): New function.
4344         (handle_tracepoint_query): Call it.
4345         (cmd_qtnotes): New function.
4346         (handle_tracepoint_general_set): Call it.
4347         (get_timestamp): Rename from tsv_get_timestamp.
4348
4349 2011-11-14  Stan Shebs  <stan@codesourcery.com>
4350             Kwok Cheung Yeung  <kcy@codesourcery.com>
4351
4352         * linux-x86-low.c (small_jump_insn): New.
4353         (i386_install_fast_tracepoint_jump_pad): Add arguments for
4354         trampoline and error message, build a trampoline and issue a small
4355         jump instruction to it.
4356         (x86_install_fast_tracepoint_jump_pad): Add arguments for
4357         trampoline and error message.
4358         (x86_get_min_fast_tracepoint_insn_len): New.
4359         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
4360         * linux-low.h (struct linux_target_ops): Add arguments to
4361         install_fast_tracepoint_jump_pad operation, add new operation.
4362         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
4363         arguments.
4364         (linux_get_min_fast_tracepoint_insn_len): New function.
4365         (linux_target_op): Add new operation.
4366         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
4367         (gdb_trampoline_buffer_end): Ditto.
4368         (gdb_trampoline_buffer_error): Ditto.
4369         (struct ipa_sym_addresses): Add fields for new IPA variables.
4370         (symbol_list): Add entries for new IPA variables.
4371         (struct tracepoint): Add fields to hold the address range of the
4372         trampoline used by the tracepoint.
4373         (trampoline_buffer_head): New static variable.
4374         (trampoline_buffer_tail): Ditto.
4375         (claim_trampoline_space): New function.
4376         (have_fast_tracepoint_trampoline_buffer): New function.
4377         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
4378         structure.
4379         (install_fast_tracepoint): Ditto, also add error buffer argument.
4380         (cmd_qtminftpilen): New function.
4381         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
4382         (fast_tracepoint_from_trampoline_address): New function.
4383         (fast_tracepoint_collecting): Handle trampoline as part of jump
4384         pad space.
4385         (set_trampoline_buffer_space): New function.
4386         (initialize_tracepoint): Initialize new IPA variables.
4387         * target.h (struct target_ops): Add arguments to
4388         install_fast_tracepoint_jump_pad operation, add new
4389         get_min_fast_tracepoint_insn_len operation.
4390         (target_get_min_fast_tracepoint_insn_len): New.
4391         (install_fast_tracepoint_jump_pad): Add arguments.
4392         * server.h (IPA_BUFSIZ): Define.
4393         * linux-i386-ipa.c: Include extra header files.
4394         (initialize_fast_tracepoint_trampoline_buffer): New function.
4395         (initialize_low_tracepoint): Call it.
4396         * server.h (set_trampoline_buffer_space): Declare.
4397         (claim_trampoline_space): Ditto.
4398         (have_fast_tracepoint_trampoline_buffer): Ditto.
4399
4400 2011-11-14  Yao Qi  <yao@codesourcery.com>
4401
4402         * server.c (handle_query): Handle InstallInTrace for qSupported.
4403         * tracepoint.c (add_tracepoint): Sort list.
4404         (install_tracepoint, download_tracepoint): New.
4405         (cmd_qtdp): Call them to install and download tracepoints.
4406         (sort_tracepoints): Removed.
4407         (cmd_qtstart): Update.
4408
4409 2011-11-14  Yao Qi  <yao@codesourcery.com>
4410
4411         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
4412         * mem-break.h: Declare.
4413         * tracepoint.c (cmd_qtstart): Move some code to ...
4414         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
4415         New.
4416         (download_tracepoints): Move some code to ...
4417         (download_tracepoint_1): ... here.  New.
4418
4419 2011-11-08  Yao Qi  <yao@codesourcery.com>
4420
4421         * remote-utils.c (relocate_instruction): A comment fix.
4422
4423 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
4424
4425         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
4426         (i386_dr_low_get_control, i386_dr_low_get_status): Use
4427         dr_status_mirror and dr_control_mirror from debug_reg_state.
4428         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
4429         (i386_initial_stuff): Remove use of deleted globals.
4430         (i386_get_thread_context, i386_set_thread_context,
4431         i386_thread_added): Use dr_status_mirror and dr_control_mirror
4432         from debug_reg_state.
4433
4434 2011-11-05  Yao Qi  <yao@codesourcery.com>
4435
4436         * tracepoint.c (gdb_collect): Loop over tracepoints of same
4437         address as TPOINT's.
4438
4439 2011-11-02  Stan Shebs  <stan@codesourcery.com>
4440
4441         * tracepoint.c (agent_mem_read_string): New function.
4442         (eval_agent_expr): Call it for tracenz.
4443         * server.c (handle_query): Report support for tracenz.
4444
4445 2011-11-02  Yao Qi  <yao@codesourcery.com>
4446
4447         * tracepoint.c (cmd_qtstart): Remove unused local variables.
4448
4449 2011-11-02  Yao Qi  <yao@codesourcery.com>
4450
4451         * target.h: Fix a typo in comment.
4452
4453 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
4454
4455         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
4456         clobber the breakpoints' shadows with fast tracepoint jumps.
4457         * mem-break.h (check_mem_write): Add `myaddr' parameter.
4458         * target.c (write_inferior_memory): Also pass MYADDR down to
4459         check_mem_write.
4460
4461 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
4462
4463         * configure.ac: Check support for personality routine.
4464         * configure: Regenerate.
4465         * config.in: Likewise.
4466         * linux-low.c: Include <sys/personality.h>.
4467         Define ADDR_NO_RANDOMIZE if necessary.
4468         (linux_create_inferior): Disable address space randomization when
4469         forking inferior, if requested.
4470         (linux_supports_disable_randomization): New function.
4471         (linux_target_ops): Install it.
4472         * server.h (disable_randomization): Declare.
4473         * server.c (disable_randomization): New global variable.
4474         (handle_general_set): Handle QDisableRandomization.
4475         (handle_query): Likewise for qSupported.
4476         (main): Support --disable-randomization and --no-disable-randomization
4477         command line arguments.
4478         * target.h (struct target_ops): Add supports_disable_randomization.
4479         (target_supports_disable_randomization): New macro.
4480
4481 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
4482
4483         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
4484         ifdef check.
4485         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
4486         [!PT_GETDSBT] (target_loadmap): New definition.
4487         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
4488         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
4489         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
4490         and PT_GETDSBT to LINUX_LOADMAP.
4491         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
4492         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
4493
4494 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
4495
4496         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
4497         (arm_linux_hwbp_cap): New static variable.
4498         (arm_linux_get_hwbp_cap): Replace by ...
4499         (arm_linux_init_hwbp_cap): ... this new function.
4500         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
4501         (arm_linux_get_hw_watchpoint_count): Likewise.
4502         (arm_linux_get_hw_watchpoint_max_length): Likewise.
4503         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
4504         (arm_prepare_to_resume): Use perror_with_name instead of error.
4505
4506 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
4507
4508         * linux-arm-low.c: Include <signal.h>.
4509         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
4510         (struct arm_linux_hwbp_cap): New data type.
4511         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
4512         (struct arm_linux_hw_breakpoint): New data type.
4513         (MAX_BPTS, MAX_WPTS): Define.
4514         (struct arch_process_info, struct arch_lwp_info): New data types.
4515         (arm_linux_get_hwbp_cap): New function.
4516         (arm_linux_get_hw_breakpoint_count): Likewise.
4517         (arm_linux_get_hw_watchpoint_count): Likewise.
4518         (arm_linux_get_hw_watchpoint_max_length): Likewise.
4519         (arm_hwbp_control_initialize): Likewise.
4520         (arm_hwbp_control_is_enabled): Likewise.
4521         (arm_hwbp_control_is_initialized): Likewise.
4522         (arm_hwbp_control_disable): Likewise.
4523         (arm_linux_hw_breakpoint_equal): Likewise.
4524         (arm_linux_hw_point_initialize): Likewise.
4525         (struct update_registers_data): New data structure.
4526         (update_registers_callback: New function.
4527         (arm_insert_point): Likewise.
4528         (arm_remove_point): Likewise.
4529         (arm_stopped_by_watchpoint): Likewise.
4530         (arm_stopped_data_address): Likewise.
4531         (arm_new_process): Likewise.
4532         (arm_new_thread): Likewise.
4533         (arm_prepare_to_resume): Likewise.
4534         (the_low_target): Register arm_insert_point, arm_remove_point,
4535         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
4536         arm_new_thread, and arm_prepare_to_resume.
4537
4538 2011-09-15  Stan Shebs  <stan@codesourcery.com>
4539
4540         * server.h (struct emit_ops): Add compare-goto fields.
4541         * tracepoint.c (gdb_agent_op_sizes): New table.
4542         (emit_eq_goto): New function.
4543         (emit_ne_goto): New function.
4544         (emit_lt_goto): New function.
4545         (emit_le_goto): New function.
4546         (emit_gt_goto): New function.
4547         (emit_ge_goto): New function.
4548         (is_goto_target): New function.
4549         (compile_bytecodes): Recognize special cases of compare-goto
4550         combinations and call specialized emitters for them.
4551         * linux-x86-low.c (amd64_emit_eq_goto): New function.
4552         (amd64_emit_ne_goto): New function.
4553         (amd64_emit_lt_goto): New function.
4554         (amd64_emit_le_goto): New function.
4555         (amd64_emit_gt_goto): New function.
4556         (amd64_emit_ge_goto): New function.
4557         (amd64_emit_ops): Add the new functions.
4558         (i386_emit_eq_goto): New function.
4559         (i386_emit_ne_goto): New function.
4560         (i386_emit_lt_goto): New function.
4561         (i386_emit_le_goto): New function.
4562         (i386_emit_gt_goto): New function.
4563         (i386_emit_ge_goto): New function.
4564         (i386_emit_ops): Add the new functions.
4565
4566 2011-09-08  Stan Shebs  <stan@codesourcery.com>
4567
4568         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
4569         (i386_emit_epilogue): Restore %ebx.
4570
4571 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
4572
4573         * server.c (step_thread): Remove definition.
4574         (process_serial_event): Don't handle Hs.
4575         * server.h (step_thread): Remove declaration.
4576         * target.c (set_desired_inferior): Remove use of step_thread.
4577
4578 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
4579
4580         * linux-low.c: Include linux-procfs.h.
4581         (linux_attach_lwp_1): Update comments.
4582         (linux_attach): Scan for existing threads when attaching to a
4583         process that is the tgid.
4584         * Makefile.in: Update dependencies.
4585
4586 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
4587
4588         * configure.srv: Add linux-procfs.o dependencies.
4589
4590 2011-08-14  Yao Qi  <yao@codesourcery.com>
4591
4592         * target.h (struct target_ops): Fix indent.
4593         * win32-low.c (win32_target_ops): Fix comment.
4594
4595 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
4596             Yao Qi  <yao@codesourcery.com>
4597
4598         * Makefile.in (clean): Remove tic6x-*.c files.
4599         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
4600         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
4601         (tic6x-c64xp-linux.c): Likewise.
4602         * configure.srv: Add support for tic6x-*-uclinux.
4603         * linux-tic6x-low.c: New.
4604         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
4605
4606 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
4607             Yao Qi  <yao@codesourcery.com>
4608
4609         * target.h (struct target_ops): Add read_loadmap.
4610         * linux-low.c (struct target_loadseg): New type.
4611         (struct target_loadmap): New type.
4612         (linux_read_loadmap): New function.
4613         (linux_target_ops): Add linux_read_loadmap.
4614         * server.c (handle_query): Support qXfer:fdpic:read packet.
4615         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
4616         to NULL.
4617
4618 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
4619
4620         * win32-low.c: Include <stdint.h>.
4621
4622 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
4623
4624         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
4625         to the inferior here.
4626         (i386_remove_aligned_watchpoint): Ditto.
4627         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
4628         fit part of the watchpoint in the debug registers.
4629         (i386_update_inferior_debug_regs): New.
4630         (i386_low_insert_watchpoint): Work on a local mirror of the debug
4631         registers, and only update the inferior on success.
4632         (i386_low_remove_watchpoint): Ditto.
4633
4634 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
4635
4636         * linux-low.c (compare_ints, unique, list_threads, show_process,
4637         linux_core_of_thread): Delete.
4638         (linux_target_ops): Change linux_core_of_thread to
4639         linux_common_core_of_thread.
4640         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
4641         * utils.c (malloc_failure): Change type of argument.
4642         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
4643         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
4644         common/linux-osdata.c, common/ptid.c and common/buffer.c.
4645         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
4646         (IPA_OBJS): Add common-utils-ipa.o.
4647         (ptid_h, linux_osdata_h): New macros.
4648         (server_h): Add common/common-utils.h, common/xml-utils.h,
4649         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
4650         common/ptid.h.
4651         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
4652         ptid.o, buffer.o): New rules.
4653         (linux-low.o): Add common/linux-osdata.h as a dependency.
4654         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
4655         * configure.ac: Add AC_HEADER_DIRENT check.
4656         * config.in: Regenerate.
4657         * configure: Regenerate.
4658         * remote-utils.c (xml_escape_text): Delete.
4659         (buffer_grow, buffer_free, buffer_init, buffer_finish,
4660         buffer_xml_printf): Move to common/buffer.c.
4661         * server.c (main): Remove call to initialize_inferiors.
4662         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
4663         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
4664         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
4665         internal_error, gdb_assert, gdb_assert_fail): Delete.
4666         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
4667         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
4668         common/buffer.h.
4669         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
4670         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
4671         initialize_inferiors): Delete.
4672
4673 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
4674
4675         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
4676         symbol error.
4677
4678 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
4679
4680         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
4681         assertion.
4682         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
4683
4684 2011-05-26  Yao Qi  <yao@codesourcery.com>
4685
4686         * Makefile.in (thread-db.o): Track dependence to
4687         common/gdb_thread_db.h.
4688         * thread-db.c: include gdb_thread_db.h from right place.
4689
4690 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
4691
4692         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
4693         __FILE__ and __LINE__ to internal_error.
4694
4695 2011-05-13  Doug Evans  <dje@google.com>
4696
4697         * thread-db.c (try_thread_db_load_from_sdir): New function.
4698         (try_thread_db_load_from_dir): New function.
4699         (thread_db_load_search): Handle $sdir, ignore $pdir.
4700         Remove trying of system directories if search of
4701         libthread-db-search-path fails, that is now done via $sdir.
4702
4703 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
4704
4705         * server.c (handle_query): Add EnableDisableTracepoints to the list
4706         of supported features.
4707         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
4708         tracepoints.
4709         (cmd_qtenable_disable): New.
4710         (cmd_qtstart): Install tracepoints even if disabled.
4711         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
4712         receiving a QTEnable or QTDisable packet.
4713         (gdb_collect): Skip data collection if fast tracepoint is disabled.
4714         (ust_marker_to_static_tracepoint): Do not ignore disabled static
4715         tracepoints.
4716         (gdb_probe): Skip data collection if static tracepoint is disabled.
4717
4718 2011-05-10  Doug Evans  <dje@google.com>
4719
4720         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
4721
4722 2011-05-04  Doug Evans  <dje@google.com>
4723
4724         * linux-low.c (linux_join): Skip process lookup.
4725         * spu-low.c (spu_join): Ditto.
4726         * server.c (join_inferiors_callback): Delete.
4727         (process_serial_event): For 'D' packet (detach) call join_inferior
4728         directly.
4729
4730 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
4731
4732         * README: Don't mention xscale*-*-linux*.
4733         * configure.srv (xscale*-*-linux*): Don't handle target.
4734
4735 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
4736
4737         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
4738         casting pointers.
4739         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
4740         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
4741         (i386_emit_void_call_2): Likewise.
4742
4743 2011-04-26  Yao Qi  <yao@codesourcery.com>
4744
4745         * linux-low.c: Move common macros to linux-ptrace.h.
4746         Include linux-ptrace.h.
4747         * Makefile.in (linux_ptrace_h): New.
4748         (linux-low.o): Depends on linux-ptrace.h.
4749
4750 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
4751
4752         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
4753         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
4754         (remote_prepare): New function with most of the TCP code from ...
4755         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
4756         setting transport_is_reliable.
4757         * server.c (run_once): New variable.
4758         (gdbserver_usage): Document it.
4759         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
4760         the first run if RUN_ONCE.
4761         * server.h (run_once, remote_prepare): New declarations.
4762
4763 2011-04-19  Tom Tromey  <tromey@redhat.com>
4764
4765         * win32-low.c (handle_load_dll): Remove duplicate "the".
4766
4767 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
4768
4769         Remove support for old Cygwin 1.5 versions.
4770         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
4771         function to avoid warning.
4772         (win32_add_one_solib): Use cygwin_conv_path function to avoid
4773         warning.
4774
4775 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
4776
4777         * gdbserver/server.h (Macro _): Define it if not available.
4778
4779 2011-03-14  Michael Snyder  <msnyder@vmware.com>
4780
4781         * hostio.c (handle_close): Remove unnecessary null test.
4782
4783 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
4784
4785         * Makefile.in (maintainer-clean realclean distclean): Remove
4786         "make ...  subdir_do" command.
4787
4788 2011-03-10  Michael Snyder  <msnyder@vmware.com>
4789
4790         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
4791
4792         * server.c (handle_v_run): Free alloced buffer on early return.
4793
4794 2011-03-09  Yao Qi  <yao@codesourcery.com>
4795
4796         Revert:
4797         2011-03-04  Yao Qi  <yao@codesourcery.com>
4798
4799         * Makefile.in: Remove GNU make feature --directory.
4800
4801         2011-03-05  Yao Qi  <yao@codesourcery.com>
4802
4803         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
4804         (subdir_do): New make target.  Copied from gdb/Makefile.
4805         (maintainer-clean, realclean, distclean, clean): Call corresponding
4806         make targets in common/Makefile.
4807
4808         2011-02-11  Yao Qi  <yao@codesourcery.com>
4809
4810         * configure.ac: Call AC_PROG_RANLIB.
4811         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
4812         * configure: Regenerate.
4813
4814 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
4815
4816         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
4817
4818 2011-03-06  Yao Qi  <yao@codesourcery.com>
4819
4820         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
4821
4822 2011-03-05  Yao Qi  <yao@codesourcery.com>
4823
4824         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
4825         (subdir_do): New make target.  Copied from gdb/Makefile.
4826         (maintainer-clean, realclean, distclean, clean): Call corresponding
4827         make targets in common/Makefile.
4828
4829 2011-03-04  Yao Qi  <yao@codesourcery.com>
4830
4831         * Makefile.in: Remove GNU make feature --directory.
4832
4833 2011-03-04  Michael Snyder  <msnyder@vmware.com>
4834
4835         * server.c (queue_stop_reply): Call xmalloc not malloc.
4836
4837 2011-03-02  Michael Snyder  <msnyder@vmware.com>
4838
4839         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
4840
4841 2011-02-28  Michael Snyder  <msnyder@vmware.com>
4842
4843         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
4844         (cmd_qtframe): Ditto.
4845         (cmd_qtbuffer): Ditto.
4846         (cmd_bigqtbuffer): Ditto.
4847
4848         * utils.c (decimal2str): Initialize 'width' to nine, then
4849         don't mess with it.
4850
4851 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
4852
4853         * hostio.c (require_data): Free *data, not data.
4854
4855 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4856
4857         * hostio.c (require_data): Use free, not xfree.
4858
4859 2011-02-27  Michael Snyder  <msnyder@vmware.com>
4860
4861         * server.c (handle_query): Discard unused value.
4862
4863         * hostio.c (require_data): Free malloc memory before returning
4864         error.
4865
4866 2011-02-26  Michael Snyder  <msnyder@vmware.com>
4867
4868         * linux-low.c (list_threads): Call closedir for dirent.
4869
4870 2011-02-27  Michael Snyder  <msnyder@vmware.com>
4871
4872         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
4873         a case statement falls through.
4874
4875         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
4876
4877         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
4878         in comparison.
4879
4880 2011-02-26  Michael Snyder  <msnyder@vmware.com>
4881
4882         * utils.c (decimal2str): Eliminate dead code and dead param.
4883         (pulongest): Drop dead param from call to decimal2str.
4884         (plongest): Ditto.
4885
4886 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
4887
4888         Revert the following patch (not approved yet):
4889         2011-02-21  Hui Zhu  <teawater@gmail.com>
4890         * tracepoint.c (tp_printf): New function.
4891         (eval_agent_expr): Handle gdb_agent_op_printf.
4892
4893 2011-02-21  Hui Zhu  <teawater@gmail.com>
4894
4895         * tracepoint.c (tp_printf): New function.
4896         (eval_agent_expr): Handle gdb_agent_op_printf.
4897
4898 2011-02-18  Tom Tromey  <tromey@redhat.com>
4899
4900         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
4901         (tracepoint.o): Likewise.
4902         * tracepoint.c (enum gdb_agent_op): Use ax.def.
4903         (gdb_agent_op_names): Likewise.
4904
4905 2011-02-18  Tom Tromey  <tromey@redhat.com>
4906
4907         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
4908         gdb_agent_op_rot>: New constants.
4909         (gdb_agent_op_names): Add pick and roll.
4910         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
4911         cases.
4912
4913 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
4914
4915         * aclocal.m4: Regenerated with aclocal-1.11.1.
4916
4917 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
4918
4919         * server.c (handle_qxfer_traceframe_info): New.
4920         (qxfer_packets): Register "traceframe-info".
4921         (handle_query): Report support for qXfer:traceframe-info:read+.
4922         * tracepoint.c (match_blocktype): New.
4923         (traceframe_find_block_type): Rename to ...
4924         (traceframe_walk_blocks): ... this.  Add callback filter argument,
4925         and use it.
4926         (traceframe_find_block_type): New, reimplemented on top of
4927         traceframe_walk_blocks.
4928         (build_traceframe_info_xml): New.
4929         (traceframe_read_info): New.
4930         * server.h (traceframe_read_info): Declare.
4931
4932 2011-02-11  Yao Qi  <yao@codesourcery.com>
4933
4934         * configure.ac: Call AC_PROG_RANLIB.
4935         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
4936         * configure: Regenerate.
4937
4938 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
4939
4940         * server.c (gdb_read_memory): Change return semantics to allow
4941         partial transfers.
4942         (handle_search_memory_1): Adjust.
4943         (process_serial_event) <'m' packet>: Handle partial transfers.
4944         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
4945
4946 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
4947
4948         * regcache.c (init_register_cache): Initialize
4949         regcache->register_status.
4950         (free_register_cache): Release regcache->register_status.
4951         (regcache_cpy): Copy register_status.
4952         (registers_to_string): Print 'x's for unavailable registers.
4953         (supply_register): Mark the register's status valid or
4954         unavailable, depending on whether a buffer was passed in or not.
4955         (supply_register_zeroed): New.
4956         (supply_regblock): Mark the registers' status valid or
4957         unavailable, depending on whether a buffer was passed in or not.
4958         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
4959         (struct regcache): New `register_status' field.
4960         (supply_register_zeroed): Declare.
4961         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
4962         supply_register_zeroed, rather than passing a NULL buffer to
4963         supply_register.
4964         * tracepoint.c (fetch_traceframe_registers): Update comment.
4965
4966 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
4967
4968         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
4969         buffer explicit.
4970
4971 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
4972
4973         * server.h (decode_xfer_write): Change prototype.
4974         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
4975         and don't extract the annex here.
4976         * server.c (decode_xfer_read): Remove `annex' parameter,
4977         and don't extract the annex here.
4978         (decode_xfer): New.
4979         (struct qxfer): New.
4980         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
4981         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
4982         (handle_qxfer_statictrace): New functions, abstracted out from
4983         handle_query, and made to use the struct qxfer interface.
4984         (handle_threads_qxfer_proper): Rename to ...
4985         (handle_qxfer_threads_proper): ... this.
4986         (handle_threads_qxfer): Rename to ...
4987         (handle_qxfer_threads): ... this.  Adjust.
4988         (qxfer_packets): New array.
4989         (handle_qxfer): New function.
4990         (handle_query): Use handle_qxfer.
4991
4992 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
4993
4994         * gdbreplay.c: Shorten lines of >= 80 columns.
4995         * linux-low.c: Ditto.
4996         * linux-ppc-low.c: Ditto.
4997         * linux-s390-low.c: Ditto.
4998         * linux-sparc-low.c: Ditto.
4999         * linux-x86-low.c: Ditto.
5000         * linux-xtensa-low.c: Ditto.
5001         * mem-break.c: Ditto.
5002         * nto-low.c: Ditto.
5003         * regcache.h: Ditto.
5004         * remote-utils.c: Ditto.
5005         * server.c: Ditto.
5006         * server.h: Ditto.
5007         * thread-db.c: Ditto.
5008         * tracepoint.c: Ditto.
5009         * utils.c: Ditto.
5010         * win32-low.h: Ditto.
5011
5012 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
5013
5014         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
5015         update.
5016
5017 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
5018
5019         * server.c (gdbserver_version): Update copyright year in version
5020         output.
5021         * gdbreplay.c (gdbreplay_version): Ditto.
5022
5023 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
5024
5025         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
5026         * linux-bfin-low.c: New file.
5027         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
5028         PT_DATA_ADDR for BFIN targets.
5029         * Makefile.in (SFILES): Add linux-bfin-low.c.
5030         (clean): Remove reg-bfin.c.
5031         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
5032         * README: Mention supported Blackfin targets.
5033
5034 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
5035
5036         * .gitignore: New file.
5037
5038 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
5039
5040         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
5041
5042 2010-10-22  Jie Zhang  <jie@codesourcery.com>
5043
5044         * Makefile.in: Add FLAGS_TO_PASS variable.
5045         (install): Remove dependency of install-only and recursively
5046         invoke make for install-only.
5047
5048 2010-10-04  Doug Evans  <dje@google.com>
5049
5050         * Makefile.in (uninstall): Use $(DESTDIR).
5051
5052 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
5053
5054         PR gdb/11842
5055
5056         * linux-x86-low.c (compat_siginfo_from_siginfo)
5057         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
5058         si_code is < 0.  Check for si_code == SI_TIMER before checking for
5059         si_code < 0.
5060
5061 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
5062
5063         * lynx-i386-low.c: New file.
5064         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
5065
5066 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
5067
5068         * lynx-low.c (ptrace_request_to_str): Remove handling for
5069         request values that have been removed in LynxOS 5.x.
5070
5071 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
5072
5073         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
5074         <ptrace.h>
5075
5076 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
5077
5078         * configure.ac: Add --enable-inprocess-agent option.
5079         * configure: Rebuilt.
5080
5081 2010-09-06  Yao Qi  <yao@codesourcery.com>
5082
5083         * linux-low.c (linux_kill): Remove unused variable.
5084         (linux_stabilize_threads): Likewise.
5085         * server.c (start_inferior): Likewise.
5086         (queue_stop_reply_callback): Likewise.
5087         * tracepoint.c (do_action_at_tracepoint): Likewise.
5088
5089 2010-09-06  Yao Qi  <yao@codesourcery.com>
5090
5091         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
5092         on return.
5093
5094 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
5095
5096         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
5097
5098 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
5099
5100         * Makefile.in (install-only): Replace $IPA_DEPFILES with
5101         "$(IPA_DEPFILES)".
5102
5103 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
5104
5105         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
5106         gdbserver/lynx-ppc-low.c: New files.
5107         * Makefile.in (lynx_low_h): New variable.
5108         (lynx-low.o, lynx-ppc-low.o): New rules.
5109         * configure.ac: On LynxOS, link with -lnetinet.
5110         * configure.srv: Add handling of powerpc-*-lynxos* targets.
5111         * configure: regenerate.
5112
5113 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
5114
5115         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
5116         * configure.ac: Add check for vasprintf and vsnprintf.
5117         * configure, config.in: Regenerate.
5118         * server.h (vasprintf, vsnprintf): Add conditional declarations.
5119
5120 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
5121
5122         * gdbreplay.c: Move include of alloca.h up, next to include of
5123         malloc.h.
5124         * server.h: Add include of malloc.h.
5125         * mem-break.c: Remove include of malloc.h.
5126         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
5127
5128 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
5129
5130         * Makefile.in (memmem.o): Build with -Wno-error.
5131
5132 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
5133
5134         * utils.c (xsnprintf): Make non-static.
5135         * server.h: Add xsnprintf declaration.
5136         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
5137         replace calls to snprintf by calls to xsnprintf throughout.
5138
5139 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
5140
5141         * configure.ac: Add configure check for alloca.
5142         * configure, config.in: Regenerate.
5143         * server.h: Include alloca.h if it exists.
5144         * gdbreplay.c: Include alloca.h if it exists.
5145
5146 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
5147
5148         * linux-low.c (__SIGRTMIN): Define if not already defined.
5149         (linux_create_inferior): Check for __ANDROID__ rather than
5150         __SIGRTMIN.
5151         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
5152         are already deferred.
5153         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
5154         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
5155         stopped and already has a pending signal to report.
5156         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
5157         a pending signal to report or is moving out of a jump pad.
5158         (linux_init_signals): Check for __ANDROID__ rather than
5159         __SIGRTMIN.
5160
5161 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
5162
5163         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
5164         debug_threads check.  Avoid a linear search when not doing debug
5165         output.
5166
5167 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
5168
5169         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
5170         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
5171         (struct file_handler) <fd>: Change type to gdb_fildes_t.
5172         (process_event): Change local fd's type to gdb_fildes_t.
5173         (create_file_handler): Adjust prototype.
5174         (delete_file_handler): Adjust prototype.
5175         (handle_file_event): Adjust prototype.  Use pfildes.
5176         (create_file_event): Adjsut prototype.
5177         * remote-utils.c (remote_desc, listen_desc): Change type to
5178         gdb_fildes_t.
5179         * server.h: New gdb_fildes_t typedef.
5180         [USE_WIN32API]: Include winsock2.h.
5181         (delete_file_handler, add_file_handler): Adjust prototypes.
5182         (pfildes): Declare.
5183         * utils.c (pfildes): New.
5184
5185 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
5186
5187         * configure.ac (build_warnings): Add -Wno-char-subscripts.
5188         * configure: Regenerate.
5189
5190 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
5191
5192         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
5193         (linux_done_accessing_memory): ... this.
5194         (linux_target_ops): Adjust.
5195         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
5196         * nto-low.c (nto_target_ops): Adjust comment.
5197         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
5198         * spu-low.c (spu_target_ops): Adjust comment.
5199         * target.h (target_ops): Rename unprepare_to_access_memory field
5200         to done_accessing_memory.
5201         (unprepare_to_access_memory): Rename to ...
5202         (done_accessing_memory): ... this.
5203
5204 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
5205
5206         * linux-low.c (linux_prepare_to_access_memory): New.
5207         (linux_unprepare_to_access_memory): New.
5208         (linux_target_ops): Install them.
5209         * server.c (read_memory): Rename to ...
5210         (gdb_read_memory): ... this.  Use
5211         prepare_to_access_memory/prepare_to_access_memory.
5212         (write_memory): Rename to ...
5213         (gdb_write_memory): ... this.  Use
5214         prepare_to_access_memory/prepare_to_access_memory.
5215         (handle_search_memory_1): Adjust.
5216         (process_serial_event): Adjust.
5217         * target.h (struct target_ops): New fields
5218         prepare_to_access_memory and unprepare_to_access_memory.
5219         (prepare_to_access_memory, unprepare_to_access_memory): New.
5220         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
5221         prepare_to_access_memory/prepare_to_access_memory.
5222         * nto-low.c (nto_target_ops): Adjust.
5223         * spu-low.c (spu_target_ops): Adjust.
5224         * win32-low.c (win32_target_ops): Adjust.
5225
5226 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
5227
5228         * Makefile.in (WARN_CFLAGS): Get it from configure.
5229         (WERROR_CFLAGS): New.
5230         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
5231         * configure.ac: Introduce --enable-werror, which adds -Werror to
5232         the compiler command line.  Enabled by default.  Disable with
5233         --disable-werror.  Add -Wdeclaration-after-statement
5234         Wpointer-arith and -Wformat-nonliteral to warning flags.
5235         * configure: Regenerate.
5236
5237 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
5238
5239         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
5240
5241 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
5242
5243         * gdbreplay.c (remote_error): New.
5244         (gdbchar): New.
5245         (expect): Use gdbchar.  Check for error reading from GDB.
5246         Clarify sync error output.
5247         (play): Check for errors writing to GDB.
5248         * linux-low.c (sigchld_handler): Really ignore `write' errors.
5249         * remote-utils.c (getpkt): Check for errors writing to the remote
5250         descriptor.
5251
5252 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
5253
5254         * linux-low.c (linux_wait_1): Move non-debugging code out of
5255         `debug_threads' control.
5256
5257 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
5258
5259         * linux-low.c (linux_wait_1): Don't set last_status here.
5260         * server.c (push_event, queue_stop_reply_callback): Assert we're
5261         not pushing a TARGET_WAITKIND_IGNORE event.
5262         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
5263         (myresume, handle_target_event): Set the thread's last_resume_kind
5264         and last_status from the target returned status.
5265
5266 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
5267
5268         PR threads/10729
5269
5270         * linux-x86-low.c (update_debug_registers_callback): New.
5271         (i386_dr_low_set_addr): Use it.
5272         (i386_dr_low_get_addr): New.
5273         (i386_dr_low_set_control): Use update_debug_registers_callback.
5274         (i386_dr_low_get_control): New.
5275         (i386_dr_low_get_status): Adjust.
5276         * linux-low.c (linux_stop_lwp): New.
5277         * linux-low.h (linux_stop_lwp): Declare.
5278
5279         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
5280         argument instead of a i386_debug_reg_state.
5281         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
5282         a i386_debug_reg_state.
5283         (i386_insert_aligned_watchpoint): Adjust.
5284         (i386_remove_aligned_watchpoint): Adjust.
5285         (i386_low_stopped_data_address): Read the debug registers from the
5286         inferior instead of from the mirrors.
5287         * i386-low.h (struct i386_debug_reg_state): Extend comment.
5288         (i386_dr_low_get_addr): Declare.
5289         (i386_dr_low_get_control): Declare.
5290         (i386_dr_low_get_status): Change prototype.
5291
5292         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
5293         (i386_dr_low_get_addr): New.
5294         (i386_dr_low_get_control): New.
5295         (i386_dr_low_get_status): Adjust prototype.  Return
5296         dr_status_mirror.
5297         (i386_initial_stuff): Clear dr_status_mirror and
5298         dr_control_mirror.
5299         (i386_get_thread_context): Adjust.
5300         (i386_set_thread_context): Adjust.
5301         (i386_thread_added): Adjust.
5302
5303 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
5304
5305         * linux-low.h (linux_thread_area): Delete declaration.
5306
5307 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
5308
5309         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
5310         after its termination.
5311
5312 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
5313
5314         * linux-low.c (gdb_wants_lwp_stopped): Delete.
5315         (gdb_wants_all_stopped): Delete.
5316         (linux_wait_1): Don't call them.
5317         * server.c (handle_v_cont): Tag all threads as want-stopped.
5318         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
5319         stopped as "client-wants-stopped".
5320
5321 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
5322
5323         * Makefile.in (signals_h): New.
5324         (server_h): Depend on it.
5325         (server.o): Don't depend on $(signals_def).
5326         (signals.o): Depend on $(signals_def).
5327
5328 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
5329
5330         * Makefile.in (signals_def): New.
5331         (server_h): Append include/gdb/signals.h and signals_def.
5332         (server.o): Append signals_def.
5333
5334 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
5335
5336         * server.c (handle_target_event): Use target_signal_to_host for
5337         resume_info.sig initialization.
5338         * target.h (struct thread_resume) <sig>: New comment.
5339
5340 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
5341
5342         * server.c (handle_query): strcpy() the returned string from paddress()
5343         instead of sprintf().
5344         * utils.c (paddress): Return phex_nz().
5345
5346 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
5347
5348         * server.c (handle_v_cont): Call mourn_inferior if process
5349         just exited.
5350         (myresume): Likewise.
5351
5352 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
5353
5354         Static tracepoints, and integration with UST.
5355
5356         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
5357         * mem-break.c (uninsert_all_breakpoints)
5358         (reinsert_all_breakpoints): New.
5359         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
5360         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
5361         (gdb_agent_ust_loaded, helper_thread_id)
5362         (gdb_agent_helper_thread_id): New macros.
5363         (struct ipa_sym_addresses): Add addr_ust_loaded,
5364         addr_helper_thread_id, addr_cmd_buf.
5365         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
5366         (in_process_agent_loaded_ust): New.
5367         (write_e_ust_not_loaded): New.
5368         (maybe_write_ipa_ust_not_loaded): New.
5369         (struct collect_static_trace_data_action): New.
5370         (enum tracepoint_type) <static_tracepoint>: New.
5371         (struct tracepoint) <handle>: Mention static tracepoints.
5372         (struct static_tracepoint_ctx): New.
5373         (CMD_BUF_SIZE): New.
5374         (add_tracepoint_action): Handle static tracepoint actions.
5375         (unprobe_marker_at): New.
5376         (clear_installed_tracepoints): Handle static tracepoints.
5377         (cmd_qtdp): Handle static tracepoints.
5378         (probe_marker_at): New.
5379         (cmd_qtstart): Handle static tracepoints.
5380         (response_tracepoint): Handle static tracepoints.
5381         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
5382         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
5383         (get_context_regcache): Handle static tracepoints.
5384         (do_action_at_tracepoint): Handle static tracepoint actions.
5385         (traceframe_find_block_type): Handle static trace data blocks.
5386         (traceframe_read_sdata): New.
5387         (download_tracepoints): Download static tracepoint actions.
5388         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
5389         (GDB_PROBE_NAME): New.
5390         (ust_ops): New.
5391         (GET_UST_SYM): New.
5392         (USTF): New.
5393         (dlsym_ust): New.
5394         (ust_marker_to_static_tracepoint): New.
5395         (gdb_probe): New.
5396         (collect_ust_data_at_tracepoint): New.
5397         (gdb_ust_probe): New.
5398         (UNIX_PATH_MAX, SOCK_DIR): New.
5399         (gdb_ust_connect_sync_socket): New.
5400         (resume_thread, stop_thread): New.
5401         (run_inferior_command): New.
5402         (init_named_socket): New.
5403         (gdb_ust_socket_init): New.
5404         (cstr_to_hexstr): New.
5405         (next_st): New.
5406         (first_marker, next_marker): New.
5407         (response_ust_marker): New.
5408         (cmd_qtfstm, cmd_qtsstm): New.
5409         (unprobe_marker_at, probe_marker_at): New.
5410         (cmd_qtstmat, gdb_ust_thread): New.
5411         (gdb_ust_init): New.
5412         (initialize_tracepoint_ftlib): Call gdb_ust_init.
5413         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
5414         (ST_REGENTRY): New.
5415         (x86_64_st_collect_regmap): New.
5416         (X86_64_NUM_ST_COLLECT_GREGS): New.
5417         (AMD64_RIP_REGNUM): New.
5418         (supply_static_tracepoint_registers): New.
5419         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
5420         (ST_REGENTRY): New.
5421         (i386_st_collect_regmap): New.
5422         (i386_NUM_ST_COLLECT_GREGS): New.
5423         (supply_static_tracepoint_registers): New.
5424         * server.c (handle_query): Handle qXfer:statictrace:read.
5425         <qSupported>: Report support for StaticTracepoints, and
5426         qXfer:statictrace:read features.
5427         * server.h (traceframe_read_sdata)
5428         (supply_static_tracepoint_registers): Declare.
5429         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
5430         (unpack_varlen_hex): Include in IPA build.
5431         * Makefile.in (ustlibs, ustinc): New.
5432         (IPA_OBJS): Add remote-utils-ipa.o.
5433         ($(IPA_LIB)): Link -ldl and -lpthread.
5434         (UST_CFLAGS): New.
5435         (IPAGENT_CFLAGS): Add UST_CFLAGS.
5436         * config.in, configure: Regenerate.
5437
5438 2010-06-20  Ian Lance Taylor  <iant@google.com>
5439             Pedro Alves  <pedro@codesourcery.com>
5440
5441         * linux-x86-low.c (always_true): Delete.
5442         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
5443         trying to fool the compiler with always_true.
5444
5445 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
5446
5447         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
5448         conditions in gdbserver.
5449
5450 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
5451
5452         * spu-low.c (spu_read_memory): Wrap around local store limit.
5453         (spu_write_memory): Likewise.
5454
5455 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
5456
5457         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
5458         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
5459         LONGEST uses.
5460         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
5461         uses.
5462         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
5463         uses with LONGEST uses.
5464
5465 2010-06-14  Stan Shebs  <stan@codesourcery.com>
5466             Pedro Alves  <pedro@codesourcery.com>
5467
5468         Bytecode compiler.
5469
5470         * linux-x86-low.c: Include limits.h.
5471         (add_insns): New.
5472         (always_true): New.
5473         (EMIT_ASM): New.
5474         (EMIT_ASM32): New.
5475         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
5476         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
5477         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
5478         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
5479         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
5480         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
5481         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
5482         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
5483         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
5484         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
5485         (amd64_emit_void_call_2): New.
5486         (amd64_emit_ops): New.
5487         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
5488         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
5489         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
5490         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
5491         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
5492         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
5493         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
5494         (i386_emit_call, i386_emit_reg, i386_emit_pop)
5495         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
5496         (i386_emit_stack_adjust, i386_emit_int_call_1)
5497         (i386_emit_void_call_2): New.
5498         (i386_emit_ops): New.
5499         (x86_emit_ops): New.
5500         (the_low_target): Install x86_emit_ops.
5501         * server.h (struct emit_ops): New.
5502         (get_raw_reg_func_addr): Declare.
5503         (current_insn_ptr, emit_error): Declare.
5504         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
5505         (set_trace_state_variable_value): New defines.
5506         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
5507         addr_get_trace_state_variable_value and
5508         addr_set_trace_state_variable_value.
5509         (symbol_list): New fields for get_raw_reg,
5510         get_trace_state_variable_value and set_trace_state_variable_value.
5511         (condfn): New typedef.
5512         (struct tracepoint): New field `compiled_cond'.
5513         (do_action_at_tracepoint): Clear compiled_cond.
5514         (get_trace_state_variable_value, set_trace_state_variable_value):
5515         Export in the IPA.
5516         (condition_true_at_tracepoint): If there's a compiled condition,
5517         run that.
5518         (current_insn_ptr, emit_error): New globals.
5519         (struct bytecode_address): New.
5520         (get_raw_reg_func_addr): New.
5521         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
5522         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
5523         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
5524         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
5525         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
5526         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
5527         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
5528         (compile_tracepoint_condition, compile_bytecodes): New.
5529         * target.h (emit_ops): Forward declare.
5530         (struct target_ops): New field emit_ops.
5531         (target_emit_ops): New.
5532         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
5533         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
5534         * linux-low.c (linux_emit_ops): New.
5535         (linux_target_ops): Install it.
5536         * linux-low.h (struct linux_target_ops): New field emit_ops.
5537
5538 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
5539
5540         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
5541         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
5542
5543 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
5544             Stan Shebs  <stan@codesourcery.com>
5545
5546         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
5547         (all): Depend on $(extra_libraries).
5548         (install-only): Install the IPA.
5549         (IPA_OBJS, IPA_LIB): New.
5550         (clean): Remove the IPA lib.
5551         (IPAGENT_CFLAGS): New.
5552         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
5553         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
5554         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
5555         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
5556         * configure.ac: Check for atomic builtins support in the compiler.
5557         (IPA_DEPFILES, extra_libraries): Define.
5558         * configure.srv (ipa_obj): Add description.
5559         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
5560         (i[34567]86-*-linux*): Set ipa_obj.
5561         (x86_64-*-linux*): Set ipa_obj.
5562         * linux-low.c (stabilizing_threads): New.
5563         (supports_fast_tracepoints): New.
5564         (linux_detach): Stabilize threads before detaching.
5565         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
5566         the lwp is either not stabilizing, or is moving out of a jump pad.
5567         (linux_fast_tracepoint_collecting): New.
5568         (maybe_move_out_of_jump_pad): New.
5569         (enqueue_one_deferred_signal): New.
5570         (dequeue_one_deferred_signal): New.
5571         (linux_wait_for_event_1): If moving out of a jump pad, defer
5572         pending signals to later.
5573         (linux_stabilize_threads): New.
5574         (linux_wait_1): Check if threads need moving out of jump pads, and
5575         do it if so.
5576         (stuck_in_jump_pad_callback): New.
5577         (move_out_of_jump_pad_callback): New.
5578         (lwp_running): New.
5579         (linux_resume_one_lwp): Handle moving out of jump pads.
5580         (linux_set_resume_request): Dequeue deferred signals.
5581         (need_step_over_p): Also step over fast tracepoint jumps.
5582         (start_step_over): Also uninsert fast tracepoint jumps.
5583         (finish_step_over): Also reinsert fast tracepoint jumps.
5584         (linux_install_fast_tracepoint_jump): New.
5585         (linux_target_ops): Install linux_stabilize_threads and
5586         linux_install_fast_tracepoint_jump_pad.
5587         * linux-low.h (linux_target_ops) <get_thread_area,
5588         install_fast_tracepoint_jump_pad>: New fields.
5589         (struct lwp_info) <collecting_fast_tracepoint,
5590         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
5591         (linux_get_thread_area): Declare.
5592         * linux-x86-low.c (jump_insn): New.
5593         (x86_get_thread_area): New.
5594         (append_insns): New.
5595         (push_opcode): New.
5596         (amd64_install_fast_tracepoint_jump_pad): New.
5597         (i386_install_fast_tracepoint_jump_pad): New.
5598         (x86_install_fast_tracepoint_jump_pad): New.
5599         (the_low_target): Install x86_get_thread_area and
5600         x86_install_fast_tracepoint_jump_pad.
5601         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
5602         (struct fast_tracepoint_jump): New.
5603         (fast_tracepoint_jump_insn): New.
5604         (fast_tracepoint_jump_shadow): New.
5605         (find_fast_tracepoint_jump_at): New.
5606         (fast_tracepoint_jump_here): New.
5607         (delete_fast_tracepoint_jump): New.
5608         (set_fast_tracepoint_jump): New.
5609         (uninsert_fast_tracepoint_jumps_at): New.
5610         (reinsert_fast_tracepoint_jumps_at): New.
5611         (set_breakpoint_at): Use write_inferior_memory.
5612         (uninsert_raw_breakpoint): Use write_inferior_memory.
5613         (check_mem_read): Mask out fast tracepoint jumps.
5614         (check_mem_write): Mask out fast tracepoint jumps.
5615         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
5616         (set_fast_tracepoint_jump): Declare.
5617         (delete_fast_tracepoint_jump)
5618         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
5619         (reinsert_fast_tracepoint_jumps_at): Declare.
5620         * regcache.c: Don't compile many functions when building the
5621         in-process agent library.
5622         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
5623         the register buffer in the heap.
5624         (free_register_cache): If the register buffer isn't owned by the
5625         regcache, don't free it.
5626         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
5627         pre-existing register caches.
5628         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
5629         type.
5630         (convert_ascii_to_int): : Constify `from' parameter type.
5631         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
5632         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
5633         the needed buffer in-place.
5634         (relocate_instruction): New.
5635         * server.c (handle_query) <qSymbols>: If the target supports
5636         tracepoints, give it a chance of looking up symbols.  Report
5637         support for fast tracepoints.
5638         (handle_status): Stabilize threads.
5639         (process_serial_event): Adjust.
5640         * server.h (struct fast_tracepoint_jump): Forward declare.
5641         (struct process_info) <fast_tracepoint_jumps>: New field.
5642         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
5643         (decode_X_packet, decode_M_packet): Adjust.
5644         (relocate_instruction): Declare.
5645         (in_process_agent_loaded): Declare.
5646         (tracepoint_look_up_symbols): Declare.
5647         (struct fast_tpoint_collect_status): Declare.
5648         (fast_tracepoint_collecting): Declare.
5649         (force_unlock_trace_buffer): Declare.
5650         (handle_tracepoint_bkpts): Declare.
5651         (initialize_low_tracepoint)
5652         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
5653         * target.h (struct target_ops) <stabilize_threads,
5654         install_fast_tracepoint_jump_pad>: New fields.
5655         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
5656         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
5657         [HAVE_STDINT_H]: Include stdint.h.
5658         (trace_debug_1): Rename to ...
5659         (trace_vdebug): ... this.
5660         (trace_debug): Rename to ...
5661         (trace_debug_1): ... this.  Add `level' parameter.
5662         (trace_debug): New.
5663         (ATTR_USED, ATTR_NOINLINE): New.
5664         (IP_AGENT_EXPORT): New.
5665         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
5666         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
5667         (about_to_request_buffer_space, trace_buffer_is_full)
5668         (stopping_tracepoint, expr_eval_result, error_tracepoint)
5669         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
5670         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
5671         (traceframe_write_count, traceframes_created)
5672         (trace_state_variables)
5673         New renaming defines.
5674         (struct ipa_sym_addresses): New.
5675         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
5676         (symbol_list): New.
5677         (ipa_sym_addrs): New.
5678         (all_tracepoint_symbols_looked_up): New.
5679         (in_process_agent_loaded): New.
5680         (write_e_ipa_not_loaded): New.
5681         (maybe_write_ipa_not_loaded): New.
5682         (tracepoint_look_up_symbols): New.
5683         (debug_threads) [IN_PROCESS_AGENT]: New.
5684         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
5685         (UNKNOWN_SIDE_EFFECTS): New.
5686         (stop_tracing): New.
5687         (flush_trace_buffer): New.
5688         (stop_tracing_bkpt): New.
5689         (flush_trace_buffer_bkpt): New.
5690         (read_inferior_integer): New.
5691         (read_inferior_uinteger): New.
5692         (read_inferior_data_pointer): New.
5693         (write_inferior_data_pointer): New.
5694         (write_inferior_integer): New.
5695         (write_inferior_uinteger): New.
5696         (struct collect_static_trace_data_action): Delete.
5697         (enum tracepoint_type): New.
5698         (struct tracepoint) <type>: New field `type'.
5699         <actions_str, step_actions, step_actions_str>: Only include in
5700         GDBserver.
5701         <orig_size, obj_addr_on_target, adjusted_insn_addr>
5702         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
5703         (tracepoints): Use IP_AGENT_EXPORT.
5704         (last_tracepoint): Don't include in the IPA.
5705         (stopping_tracepoint): Use IP_AGENT_EXPORT.
5706         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
5707         (alloced_trace_state_variables): New.
5708         (trace_state_variables): Use IP_AGENT_EXPORT.
5709         (traceframe_t): Delete unused variable.
5710         (circular_trace_buffer): Don't include in the IPA.
5711         (trace_buffer_start): Delete.
5712         (struct trace_buffer_control): New.
5713         (trace_buffer_free): Delete.
5714         (struct ipa_trace_buffer_control): New.
5715         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
5716         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
5717         New.
5718         (trace_buffer_ctrl): New.
5719         (TRACE_BUFFER_CTRL_CURR): New.
5720         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
5721         Reimplement as macros.
5722         (trace_buffer_wrap): Delete.
5723         (traceframe_write_count, traceframe_read_count)
5724         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
5725         (struct tracepoint_hit_ctx) <type>: New field.
5726         (struct fast_tracepoint_ctx): New.
5727         (memory_barrier): New.
5728         (cmpxchg): New.
5729         (record_tracepoint_error): Update atomically in the IPA.
5730         (clear_inferior_trace_buffer): New.
5731         (about_to_request_buffer_space): New.
5732         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
5733         updating the same buffer.
5734         (add_tracepoint): Default the tracepoint's type to trap
5735         tracepoint, and orig_size to -1.
5736         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
5737         internal variables.
5738         (create_trace_state_variable): New parameter `gdb'.  Handle it.
5739         (clear_installed_tracepoints): Clear fast tracepoint jumps.
5740         (cmd_qtdp): Handle fast tracepoints.
5741         (cmd_qtdv): Adjust.
5742         (max_jump_pad_size): New.
5743         (gdb_jump_pad_head): New.
5744         (get_jump_space_head): New.
5745         (claim_jump_space): New.
5746         (sort_tracepoints): New.
5747         (MAX_JUMP_SIZE): New.
5748         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
5749         IPA.
5750         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
5751         support.  Upload fast traceframes, and delete internal IPA
5752         breakpoints.
5753         (stop_tracing_handler): New.
5754         (flush_trace_buffer_handler): New.
5755         (cmd_qtstop): Upload fast tracepoints.
5756         (response_tracepoint): Handle fast tracepoints.
5757         (tracepoint_finished_step): Upload fast traceframes.  Set the
5758         tracepoint hit context's tracepoint type.
5759         (handle_tracepoint_bkpts): New.
5760         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
5761         type.  Add comment about fast tracepoints.
5762         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
5763         non-existing action_str field.
5764         (get_context_regcache): Handle fast tracepoints.
5765         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
5766         to the regcache.
5767         (fast_tracepoint_from_jump_pad_address): New.
5768         (fast_tracepoint_from_ipa_tpoint_address): New.
5769         (collecting_t): New.
5770         (force_unlock_trace_buffer): New.
5771         (fast_tracepoint_collecting): New.
5772         (collecting): New.
5773         (gdb_collect): New.
5774         (write_inferior_data_ptr): New.
5775         (target_tp_heap): New.
5776         (target_malloc): New.
5777         (download_agent_expr): New.
5778         (UALIGN): New.
5779         (download_tracepoints): New.
5780         (download_trace_state_variables): New.
5781         (upload_fast_traceframes): New.
5782         (IPA_FIRST_TRACEFRAME): New.
5783         (IPA_NEXT_TRACEFRAME_1): New.
5784         (IPA_NEXT_TRACEFRAME): New.
5785         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
5786         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
5787         (gdb_jump_pad_buffer_end): New.
5788         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
5789         (initialize_tracepoint): Adjust.
5790         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
5791         buffer.  Initialize the low module.
5792         * utils.c (PREFIX, TOOLNAME): New.
5793         (malloc_failure): Use PREFIX.
5794         (error): In the IPA, an error causes an exit.
5795         (fatal, warning): Use PREFIX.
5796         (internal_error): Use TOOLNAME.
5797         (NUMCELLS): Increase to 10.
5798         * configure, config.in: Regenerate.
5799
5800 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
5801
5802         * server.c (handle_query) <qSupported>: Do two passes over the
5803         qSupported string to avoid nesting strtok.
5804
5805 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5806
5807         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
5808         (CDEPS): New.
5809         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
5810         -Wl,--dynamic-list.
5811         * configure: Regenerate.
5812         * proc-service.list: New.
5813
5814 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5815
5816         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
5817         New comment.
5818
5819 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
5820
5821         * gdbreplay.c (remote_open): Check error return from socket() call by
5822         its equality to -1 not by it being negative.
5823         * remote-utils.c (remote_open): Likewise.
5824
5825 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
5826
5827         * config.h: Regenerate.
5828
5829 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
5830
5831         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
5832         doesn't provide PTRACE_GET_THREAD_AREA.
5833
5834 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
5835
5836         * linux-m68k-low.c: Include <asm/ptrace.h>
5837         (ps_get_thread_area): Implement.
5838
5839 2010-05-03  Doug Evans  <dje@google.com>
5840
5841         * event-loop.c (struct callback_event): New struct.
5842         (callback_list): New global.
5843         (append_callback_event, delete_callback_event): New functions.
5844         (process_callback): New function.
5845         (start_event_loop): Call it.
5846         * remote-utils.c (NOT_SCHEDULED): Define.
5847         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
5848         moved out of readchar.
5849         (readchar): Rewrite.  Call reschedule before returning.
5850         (reset_readchar): New function.
5851         (remote_close): Call it.
5852         (process_remaining, reschedule): New functions.
5853         * server.h (callback_handler_func): New typedef.
5854         (append_callback_event, delete_callback_event): Declare.
5855
5856 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
5857
5858         * proc-service.c (ps_pglobal_lookup): Use
5859         thread_db_look_up_one_symbol.
5860         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
5861         parameter.  Use it instead of all_symbols_looked_up.
5862         * server.h (struct process_info) <all_symbols_looked_up>: Delete
5863         field.
5864         (all_symbols_looked_up): Don't declare.
5865         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
5866         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
5867         field.
5868         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
5869         Set all_symbols_looked_up here.
5870         (thread_db_look_up_one_symbol): New.
5871         (thread_db_get_tls_address): Adjust.
5872         (thread_db_load_search, try_thread_db_load_1): Always allocate the
5873         thread_db object on the heap, and tentatively set it in the
5874         process structure.
5875         (thread_db_init): Don't set all_symbols_looked_up here.
5876         * linux-low.h (thread_db_look_up_one_symbol): Declare.
5877
5878 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
5879
5880         * linux-low.c (linux_kill, linux_detach): Adjust.
5881         (status_pending_p_callback): Remove redundant statement.  Check
5882         for !TARGET_WAITIKIND_IGNORE, instead of
5883         TARGET_WAITKIND_STOPPED.
5884         (handle_tracepoints): Make sure LWP is locked.  Adjust.
5885         (linux_wait_for_event_1): Adjust.
5886         (linux_cancel_breakpoints): New.
5887         (unsuspend_one_lwp): New.
5888         (unsuspend_all_lwps): New.
5889         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
5890         (send_sigstop_callback): Change return type to int, add new
5891         `except' parameter and handle it.
5892         (suspend_and_send_sigstop_callback): New.
5893         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
5894         pass them down.  If SUSPEND, also increment the lwp's suspend
5895         count.
5896         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
5897         (need_step_over_p): Don't consider suspended LWPs.
5898         (start_step_over): Adjust.
5899         (proceed_one_lwp): Change return type to int, add new `except'
5900         parameter and handle it.
5901         (unsuspend_and_proceed_one_lwp): New.
5902         (proceed_all_lwps): Use find_inferior instead of
5903         for_each_inferior.
5904         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
5905         also decrement the suspend count of LWPs.  Pass `except' down,
5906         instead of hacking its suspend count.
5907         (linux_pause_all): Add `freeze' parameter.  Adjust.
5908         (linux_unpause_all): New.
5909         (linux_target_ops): Install linux_unpause_all.
5910         * server.c (handle_status): Adjust.
5911         * target.h (struct target_ops): New fields `unpause_all' and
5912         `cancel_breakpoints'.  Add new parameter to `pause_all'.
5913         (pause_all): Add new `freeze' parameter.
5914         (unpause_all): New.
5915         (cancel_breakpoints): New.
5916         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
5917         cancel breakpoints.
5918         (cmd_qtstart): Pause threads.
5919         (stop_tracing): Pause threads, and cancel breakpoints.
5920         * win32-low.c (win32_target_ops): Adjust.
5921
5922 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
5923
5924         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
5925         the inferior right away from here...
5926         (linux_wait_1): ... to here, and adjust to check the thread's
5927         last_resume_kind instead of the lwp's step or stop_expected flags.
5928
5929 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
5930
5931         * README: Use consistent `GDB' and `GDBserver' spellings.
5932
5933 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
5934
5935         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
5936         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
5937         (linux_detach_one_lwp): Assume the lwp is stopped.
5938         (any_thread_of): Delete.
5939         (linux_detach): Stop all lwps here.  Don't blindly delete all
5940         breakpoints.
5941         (delete_lwp_callback): New.
5942         (linux_mourn): Delete all lwps of the process that is gone.
5943         (linux_wait_1): Don't delete the last lwp of the process here.
5944         * mem-break.h (mark_breakpoints_out): Declare.
5945         * mem-break.c (mark_breakpoints_out): New.
5946         (free_all_breakpoints): Use it.
5947         * server.c (handle_target_event): If the process is gone, mark
5948         breakpoints out.
5949         * thread-db.c (struct thread_db) <create_bp>: New field.
5950         (thread_db_enable_reporting): Fix prototype.  Store a thread event
5951         breakpoint reference in the thread_db struct.
5952         (thread_db_load_search): Clear the thread_db object.
5953         (try_thread_db_load_1): Ditto.
5954         (switch_to_process): New.
5955         (disable_thread_event_reporting): Use it.
5956         (remove_thread_event_breakpoints): New.
5957         (thread_db_detach, thread_db_mourn): Use it.
5958
5959 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
5960
5961         * linux-low.c (linux_enable_event_reporting): New.
5962         (linux_wait_for_event_1, handle_extended_wait): Use it.
5963
5964 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
5965
5966         * linux-low.c (linux_kill_one_lwp, linux_kill)
5967         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
5968         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
5969         SIGSTOP even if the LWP is stopped.
5970         (send_sigstop_callback): New.
5971         (stop_all_lwps): Use send_sigstop_callback instead.
5972         (linux_resume_one_thread): Adjust.
5973         (proceed_one_lwp): Still proceed an LWP that the client has
5974         requested to stop, if we haven't reported it as stopped yet.  Make
5975         sure that LWPs the client want stopped, have a pending SIGSTOP.
5976
5977 2010-04-26  Doug Evans  <dje@google.com>
5978
5979         * server.c (handle_general_set): Make static.
5980
5981         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
5982         Print received char after testing for error/eof instead of before.
5983         (input_interrupt): Tweak comment.
5984
5985 2010-04-23  Doug Evans  <dje@google.com>
5986
5987         * server.c (start_inferior): Print inferior argv if --debug.
5988
5989 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
5990
5991         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
5992         * nto-x86-low.c: Include server.h
5993
5994 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
5995
5996         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
5997         be consistent with other sources of this directory.
5998         (init_registers_amd64): Correct name of source file of this function
5999         in the comment.
6000
6001 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6002
6003         * configure.srv (x86_64-*-mingw*): New configuration for Windows
6004         64-bit executables.
6005
6006 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6007
6008         * win32-i386-low.c: Add 64-bit support.
6009         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
6010         (init_registers_amd64): Declare.
6011         (mappings): Add 64-bit version of array.
6012         (init_windows_x86): New function.
6013         (the_low_target): Change init_arch field to init_windows_x86.
6014
6015 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6016
6017         * win32-low.c: Adapt to support also 64-bit architecture.
6018         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
6019         (get_image_name): Use SIZE_T type for local variable `done'.
6020         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
6021         (toolhelp_get_dll_name): Idem.
6022         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
6023         Use uintptr_t typecast to avoid warning.
6024         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
6025         (handle_exception): Use phex_nz to avoid warning.
6026         (win32_wait): Remove unused local variable `process'.
6027
6028 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
6029
6030         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
6031         `amd64-avx.o'.
6032
6033 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
6034
6035         * configure.ac: Use `ws2_32' library for srv_mingw.
6036         * configure: Regenerate.
6037         * gdbreplay.c: Include winsock2.h instead of winsock.h.
6038         * remote-utils.c: Likewise.
6039
6040 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
6041
6042         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
6043         if __x86_64__ is defined.
6044
6045 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
6046
6047         * configure: Regenerate.
6048
6049 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
6050
6051         * server.c (handle_query): Handle 'qGetTIBAddr' query.
6052         * target.h (target_ops): New get_tib_address field.
6053         * win32-low.h (win32_thread_info): Add thread_local_base field.
6054         * win32-low.c (child_add_thread): Add tlb argument.
6055         Set thread_local_base field to TLB.
6056         (get_child_debug_event): Adapt to child_add_thread change.
6057         (win32_get_tib_address): New function.
6058         (win32_target_ops): Set get_tib_address field to
6059         win32_get_tib_address.
6060         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
6061
6062 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
6063
6064         * linux-low.c (linux_mourn): Also remove the process.
6065         * server.c (handle_target_event): Don't remove the process here.
6066         * nto-low.c (nto_mourn): New.
6067         (nto_target_ops): Install it.
6068         * spu-low.c (spu_mourn): New.
6069         (spu_target_ops): Install it.
6070         * win32-low.c (win32_mourn): New.
6071         (win32_target_ops): Install it.
6072
6073 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
6074
6075         * server.h (buffer_xml_printf): Remove redundant `;'.
6076
6077 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
6078
6079         * regcache.c (set_register_cache): Invalidate regcaches before
6080         changing the register cache layout.
6081         (regcache_invalidate_one): Allow a NULL regcache.
6082         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
6083         regcaches before changing the register cache layout or the target
6084         regsets.
6085
6086 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
6087
6088         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
6089         variable warning on Linux/x86-64.
6090
6091 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
6092
6093         GDBserver disconnected tracing support.
6094
6095         * linux-low.c (linux_remove_process): Delete.
6096         (add_lwp): Don't set last_resume_kind here.
6097         (linux_kill): Use `mourn'.
6098         (linux_detach): Use `thread_db_detach', and `mourn'.
6099         (linux_mourn): New.
6100         (linux_attach_lwp_1): Adjust comment.
6101         (linux_attach): last_resume_kind moved the thread_info; adjust.
6102         (status_pending_p_callback): Adjust.
6103         (linux_wait_for_event_1): Adjust.
6104         (count_events_callback, select_singlestep_lwp_callback)
6105         (select_event_lwp_callback, cancel_breakpoints_callback)
6106         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
6107         (proceed_one_lwp): Adjust.
6108         (linux_async): Add debug output.
6109         (linux_thread_stopped): New.
6110         (linux_pause_all): New.
6111         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
6112         linux_pause_all.
6113         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
6114         (thread_db_free): Delete declaration.
6115         (thread_db_detach, thread_db_mourn): Declare.
6116         * thread-db.c (thread_db_init): Use thread_db_mourn.
6117         (thread_db_free): Delete, split in two.
6118         (disable_thread_event_reporting): New.
6119         (thread_db_detach): New.
6120         (thread_db_mourn): New.
6121
6122         * server.h (struct thread_info) <last_resume_kind>: New field.
6123         <attached>: Add comment.
6124         <gdb_detached>: New field.
6125         (handler_func): Change return type to int.
6126         (handle_serial_event, handle_target_event): Ditto.
6127         (gdb_connected): Declare.
6128         (tracing): Delete.
6129         (disconnected_tracing): Declare.
6130         (stop_tracing): Declare.
6131
6132         * server.c (handle_query) <qSupported>: Report support for
6133         disconnected tracing.
6134         (queue_stop_reply_callback): Account for running threads.
6135         (gdb_wants_thread_stopped): New.
6136         (gdb_wants_all_threads_stopped): New.
6137         (gdb_reattached_process): New.
6138         (handle_status): Clear the `gdb_detached' flag of all processes.
6139         In all-stop, stop all threads.
6140         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
6141         (process_serial_event): If the remote connection breaks, or if an
6142         exit was forced with "monitor exit", force an event loop exit.
6143         Handle disconnected tracing on detach.
6144         (handle_serial_event): Adjust.
6145         (handle_target_event): If GDB isn't connected, forward events back
6146         to the inferior, unless the last process exited, in which case,
6147         exit gdbserver.  Adjust interface.
6148
6149         * remote-utils.c (remote_open): Don't block in accept.  Instead
6150         register an event loop source on the listen socket file
6151         descriptor.  Refactor bits into ...
6152         (listen_desc): ... this new global.
6153         (gdb_connected): ... this new function.
6154         (enable_async_notification): ... this new function.
6155         (handle_accept_event): ... this new function.
6156         (remote_close): Clear remote_desc.
6157
6158         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
6159
6160         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
6161         New fields.
6162         (mourn_inferior): Define.
6163         (target_process_qsupported): Avoid the dangling else problem.
6164         (thread_stopped): Define.
6165         (pause_all): Define.
6166         (target_waitstatus_to_string): Declare.
6167         * target.c (target_waitstatus_to_string): New.
6168
6169         * tracepoint.c (tracing): Make extern.
6170         (disconnected_tracing): New.
6171         (stop_tracing): Make extern.  Handle tracing stops due to GDB
6172         disconnecting.
6173         (cmd_qtdisconnected): New.
6174         (cmd_qtstatus): Report disconnected tracing status in trace reply.
6175         (handle_tracepoint_general_set): Handle QTDisconnected.
6176
6177         * event-loop.c (event_handler_func): Change return type to int.
6178         (process_event): Bail out if the event handler wants the event
6179         loop to stop.
6180         (handle_file_event): Ditto.
6181         (start_event_loop): Bail out if the event handler wants the event
6182         loop to stop.
6183
6184         * nto-low.c (nto_target_ops): Adjust.
6185         * spu-low.c (spu_wait): Don't remove the process here.
6186         (spu_target_ops): Adjust.
6187         * win32-low.c (win32_wait): Don't remove the process here.
6188         (win32_target_ops): Adjust.
6189
6190 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
6191
6192         * regcache.c (realloc_register_cache): Invalidate inferior's
6193         regcache before recreating it.
6194
6195 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
6196
6197         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
6198
6199 2010-04-09  Stan Shebs  <stan@codesourcery.com>
6200             Pedro Alves  <pedro@codesourcery.com>
6201
6202         * server.h (LONGEST): New.
6203         (struct thread_info) <while_stepping>: New field.
6204         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
6205         Declare.
6206         (initialize_tracepoint, handle_tracepoint_general_set)
6207         (handle_tracepoint_query, tracepoint_finished_step)
6208         (tracepoint_was_hit, release_while_stepping_state_list):
6209         (current_traceframe): Declare.
6210         * server.c (handle_general_set): Handle tracepoint packets.
6211         (read_memory): New.
6212         (write_memory): New.
6213         (handle_search_memory_1): Use read_memory.
6214         (handle_query): Report support for conditional tracepoints, trace
6215         state variables, and tracepoint sources.  Handle tracepoint
6216         queries.
6217         (main): Initialize the tracepoints module.
6218         (process_serial_event): Handle traceframe reads/writes.
6219
6220         * linux-low.c (handle_tracepoints): New.
6221         (linux_wait_1): Call it.
6222         (linux_resume_one_lwp): Handle while-stepping.
6223         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
6224         (linux_target_ops): Install them.
6225         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
6226         New field.
6227         * linux-x86-low.c (x86_supports_tracepoints): New.
6228         (the_low_target). Install it.
6229
6230         * mem-break.h (delete_breakpoint): Declare.
6231         * mem-break.c (delete_breakpoint): Make external.
6232
6233         * target.h (struct target_ops): Add `supports_tracepoints',
6234         `read_pc', and `write_pc' fields.
6235         (target_supports_tracepoints): Define.
6236         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
6237         (phex_nz): New.
6238
6239         * regcache.h (struct regcache) <registers_owned>: New field.
6240         (init_register_cache, regcache_cpy): Declare.
6241         (regcache_read_pc, regcache_write_pc): Declare.
6242         (register_cache_size): Declare.
6243         (supply_regblock): Declare.
6244         * regcache.c (init_register_cache): New.
6245         (new_register_cache): Use it.
6246         (regcache_cpy): New.
6247         (register_cache_size): New.
6248         (supply_regblock): New.
6249         (regcache_read_pc, regcache_write_pc): New.
6250
6251         * tracepoint.c: New.
6252
6253         * Makefile.in (OBS): Add tracepoint.o.
6254         (tracepoint.o): New rule.
6255
6256 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
6257
6258         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
6259         (i386-mmx.o): New.
6260         (i386-mmx.c): Likewise.
6261         (i386-mmx-linux.o): Likewise.
6262         (i386-mmx-linux.c): Likewise.
6263
6264         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
6265         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
6266         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
6267         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
6268
6269         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
6270         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
6271         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
6272
6273 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
6274
6275         * Makefile.in (clean): Updated.
6276         (i386-avx.o): New.
6277         (i386-avx.c): Likewise.
6278         (i386-avx-linux.o): Likewise.
6279         (i386-avx-linux.c): Likewise.
6280         (amd64-avx.o): Likewise.
6281         (amd64-avx.c): Likewise.
6282         (amd64-avx-linux.o): Likewise.
6283         (amd64-avx-linux.c): Likewise.
6284
6285         * configure.srv (srv_i386_regobj): Add i386-avx.o.
6286         (srv_i386_linux_regobj): Add i386-avx-linux.o.
6287         (srv_amd64_regobj): Add amd64-avx.o.
6288         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
6289         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
6290         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
6291         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
6292         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
6293         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
6294         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
6295
6296         * i387-fp.c: Include "i386-xstate.h".
6297         (i387_xsave): New.
6298         (i387_cache_to_xsave): Likewise.
6299         (i387_xsave_to_cache): Likewise.
6300         (x86_xcr0): Likewise.
6301
6302         * i387-fp.h (i387_cache_to_xsave): Likewise.
6303         (i387_xsave_to_cache): Likewise.
6304         (x86_xcr0): Likewise.
6305
6306         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
6307         * linux-crisv32-low.c (target_regsets): Likewise.
6308         * linux-m68k-low.c (target_regsets): Likewise.
6309         * linux-mips-low.c (target_regsets): Likewise.
6310         * linux-ppc-low.c (target_regsets): Likewise.
6311         * linux-s390-low.c (target_regsets): Likewise.
6312         * linux-sh-low.c (target_regsets): Likewise.
6313         * linux-sparc-low.c (target_regsets): Likewise.
6314         * linux-xtensa-low.c (target_regsets): Likewise.
6315
6316         * linux-low.c: Include <sys/uio.h>.
6317         (regsets_fetch_inferior_registers): Support nt_type.
6318         (regsets_store_inferior_registers): Likewise.
6319         (linux_process_qsupported): New.
6320         (linux_target_ops): Add linux_process_qsupported.
6321
6322         * linux-low.h (regset_info): Add nt_type.
6323         (linux_target_ops): Add process_qsupported.
6324
6325         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
6326         and <sys/uio.h>.
6327         (init_registers_i386_avx_linux): New.
6328         (init_registers_amd64_avx_linux): Likewise.
6329         (xmltarget_i386_linux_no_xml): Likewise.
6330         (xmltarget_amd64_linux_no_xml): Likewise.
6331         (PTRACE_GETREGSET): Likewise.
6332         (PTRACE_SETREGSET): Likewise.
6333         (x86_fill_xstateregset): Likewise.
6334         (x86_store_xstateregset): Likewise.
6335         (use_xml): Likewise.
6336         (x86_linux_update_xmltarget): Likewise.
6337         (x86_linux_process_qsupported): Likewise.
6338         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
6339         (x86_arch_setup): Don't call init_registers_amd64_linux nor
6340         init_registers_i386_linux here.  Call
6341         x86_linux_update_xmltarget.
6342         (the_low_target): Add x86_linux_process_qsupported.
6343
6344         * server.c (handle_query): Call target_process_qsupported.
6345
6346         * target.h (target_ops): Add process_qsupported.
6347         (target_process_qsupported): New.
6348
6349 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
6350
6351         * inferiors.c (add_thread): Set last_status kind to
6352         TARGET_WAITKIND_IGNORE.
6353         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
6354         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
6355         (linux_wait_1): Move `thread' local definition to block that uses
6356         it.  Don't NULL initialize `event_child'.
6357         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
6358         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
6359         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
6360
6361 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
6362
6363         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
6364         an extended waitstatus, or by a watchpoint.
6365         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
6366         thread was stepping or has been stopped by a watchpoint.
6367
6368 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
6369
6370         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
6371         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
6372         of another, then delete the previous, and validate all
6373         breakpoints.
6374         (validate_inserted_breakpoint): New.
6375         (delete_disabled_breakpoints): New.
6376         (validate_breakpoints): New.
6377         (check_mem_read): Validate breakpoints before trusting their
6378         shadow.  Delete disabled breakpoints.
6379         (check_mem_write): Validate breakpoints before trusting they
6380         should be inserted.  Delete disabled breakpoints.
6381         * mem-break.h (validate_breakpoints):
6382         * server.c (handle_query): Validate breakpoints when we see a
6383         qSymbol query.
6384
6385 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
6386
6387         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
6388         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
6389         if we could tell there's a GDB breakpoint at stop_pc.
6390         (need_step_over_p): Don't do a step over if we find a GDB
6391         breakpoint at the resume PC.
6392
6393         * mem-break.c (struct raw_breakpoint): New.
6394         (enum bkpt_type): New type `gdb_breakpoint'.
6395         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
6396         fields.  New field `raw'.
6397         (find_raw_breakpoint_at): New.
6398         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
6399         breakpoint instead.
6400         (set_breakpoint_at): Adjust.
6401         (delete_raw_breakpoint): New.
6402         (release_breakpoint): New.
6403         (delete_breakpoint): Rename to...
6404         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
6405         release_breakpoint.  Return ENOENT.
6406         (delete_breakpoint): Reimplement.
6407         (find_breakpoint_at): Delete.
6408         (find_gdb_breakpoint_at): New.
6409         (delete_breakpoint_at): Delete.
6410         (set_gdb_breakpoint_at): New.
6411         (delete_gdb_breakpoint_at): New.
6412         (gdb_breakpoint_here): New.
6413         (set_reinsert_breakpoint): Use release_breakpoint.
6414         (uninsert_breakpoint): Rename to ...
6415         (uninsert_raw_breakpoint): ... this.
6416         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
6417         (reinsert_raw_breakpoint): Change parameter type to
6418         raw_breakpoint.
6419         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
6420         instead.
6421         (check_breakpoints): Adjust.  Use release_breakpoint.
6422         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
6423         (breakpoint_inserted_here): Ditto.
6424         (check_mem_read): Adjust to iterate over raw breakpoints instead.
6425         Don't trust the breakpoint's shadow if it is not inserted.
6426         (check_mem_write): Adjust to iterate over raw breakpoints instead.
6427         (delete_all_breakpoints): Adjust.
6428         (free_all_breakpoints): Mark all breakpoints as uninserted, and
6429         use delete_breakpoint_1.
6430
6431         * mem-break.h (breakpoints_supported): Delete declaration.
6432         (set_gdb_breakpoint_at): Declare.
6433         (gdb_breakpoint_here): Declare.
6434         (delete_breakpoint_at): Delete.
6435         (delete_gdb_breakpoint_at): Declare.
6436
6437         * server.h (struct raw_breakpoint): Forward declare.
6438         (struct process_info): New field `raw_breakpoints'.
6439
6440         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
6441         breakpoints.
6442
6443 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
6444
6445         * linux-low.c (status_pending_p_callback): Fix comment.
6446         (linux_wait_for_event_1): Move most of the internal breakpoint
6447         handling from here...
6448         (linux_wait_1): ... to here.
6449         (count_events_callback): New.
6450         (select_singlestep_lwp_callback): New.
6451         (select_event_lwp_callback): New.
6452         (cancel_breakpoints_callback): New.
6453         (select_event_lwp): New.
6454         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
6455         priority to all LWPs that have had events that should be reported
6456         to the client.  Cancel breakpoints when about to reporting the
6457         event to the client, not while stopping lwps.  No longer cancel
6458         finished single-steps here.
6459         (cancel_finished_single_step): Delete.
6460         (cancel_finished_single_steps): Delete.
6461
6462 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
6463
6464         * mem-break.c (enum bkpt_type): New.
6465         (struct breakpoint): New field `type'.
6466         (set_breakpoint_at): Change return type to struct breakpoint
6467         pointer.  Set type to `other_breakpoint' by default.
6468         (delete_breakpoint): Rewrite, supporting more than one breakpoint
6469         in the breakpoint list.
6470         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
6471         (reinsert_breakpoint): Rename to ...
6472         (reinsert_raw_breakpoint): ... this.
6473         (reinsert_breakpoints_at): Adjust.
6474         * mem-break.h (struct breakpoint): Declare.
6475         (set_breakpoint_at): Change return type to struct breakpoint
6476         pointer.
6477
6478 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
6479
6480         * server.c (handle_query): Assign, not compare.
6481
6482 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
6483
6484         Teach linux gdbserver to step-over-breakpoints.
6485
6486         * linux-low.c (can_hardware_single_step): New.
6487         (supports_breakpoints): New.
6488         (handle_extended_wait): If stopping threads, read the stop pc of
6489         the new cloned LWP.
6490         (get_pc): New.
6491         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
6492         low target doesn't support retrieving the PC.
6493         (add_lwp): Set last_resume_kind to resume_continue.
6494         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
6495         (linux_attach): Don't clear stop_expected.  Set the lwp's
6496         last_resume_kind to resume_stop.
6497         (linux_detach_one_lwp): Don't check for removed breakpoints.
6498         (check_removed_breakpoint): Delete.
6499         (status_pending_p): Rename to ...
6500         (status_pending_p_callback): ... this.  Don't check for removed
6501         breakpoints.  Don't consider threads that are stopped from GDB's
6502         perspective.
6503         (linux_wait_for_lwp): Always read the stop_pc here.
6504         (cancel_breakpoint): New.
6505         (step_over_bkpt): New global.
6506         (linux_wait_for_event_1): Implement stepping over breakpoints.
6507         (gdb_wants_lwp_stopped): New.
6508         (gdb_wants_all_stopped): New.
6509         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
6510         single-step traps here.  Store the thread's last reported target
6511         wait status.
6512         (send_sigstop): Don't clear stop_expected.  Always set it,
6513         instead.
6514         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
6515         (cancel_finished_single_step): New.
6516         (cancel_finished_single_steps): New.
6517         (wait_for_sigstop): Don't cancel finished single-step traps here.
6518         (linux_resume_one_lwp): Don't check for removed breakpoints.
6519         Don't set `step' on non-hardware step archs.
6520         (linux_set_resume_request): Ignore resume_stop requests if already
6521         stopping or stopped.  Set the lwp's last_resume_kind.
6522         (resume_status_pending_p): Don't check for removed breakpoints.
6523         (need_step_over_p): New.
6524         (start_step_over): New.
6525         (finish_step_over): New.
6526         (linux_resume_one_thread): Always queue a sigstop for resume_stop
6527         requests.  Clear the thread's last reported target waitstatus.
6528         Don't use the `suspended' flag.  Don't consider pending breakpoints.
6529         (linux_resume): Start a step-over if necessary.
6530         (proceed_one_lwp): New.
6531         (proceed_all_lwps): New.
6532         (unstop_all_lwps): New.
6533         * linux-low.h (struct lwp_info): Rewrite comment for the
6534         `suspended' flag.  Add the `stop_pc' field.  Delete the
6535         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
6536         Add `'last_resume_kind' and `need_step_over' fields.
6537         * inferiors.c (struct thread_info): Delete, moved elsewhere.
6538         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
6539         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
6540         (set_raw_breakpoint_at): New.
6541         (set_breakpoint_at): Rewrite to use it.
6542         (reinsert_breakpoint_handler): Delete.
6543         (set_reinsert_breakpoint): New.
6544         (reinsert_breakpoint_by_bp): Delete.
6545         (delete_reinsert_breakpoints): New.
6546         (uninsert_breakpoint): Rewrite.
6547         (uninsert_breakpoints_at): New.
6548         (reinsert_breakpoint): Rewrite.
6549         (reinsert_breakpoints_at): New.
6550         (check_breakpoints): Rewrite.
6551         (breakpoint_here): New.
6552         (breakpoint_inserted_here): New.
6553         (check_mem_read): Adjust.
6554         * mem-break.h (breakpoints_supported, breakpoint_here)
6555         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
6556         (reinsert_breakpoint_by_bp): Delete declaration.
6557         (delete_reinsert_breakpoints): Declare.
6558         (reinsert_breakpoint): Delete declaration.
6559         (reinsert_breakpoints_at): Declare.
6560         (uninsert_breakpoint): Delete declaration.
6561         (uninsert_breakpoints_at): Declare.
6562         (check_breakpoints): Adjust prototype.
6563         * server.h: Adjust include order.
6564         (struct thread_info): Declare here.  Add a `last_status' field.
6565
6566 2010-03-23  Michael Snyder  <msnyder@vmware.com>
6567
6568         * server.c (crc32): New function.
6569         (handle_query): Add handling for 'qCRC:' request.
6570
6571 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
6572
6573         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
6574         lwp had been stopped by a watchpoint.
6575
6576 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
6577
6578         * server.h (internal_error): Declare.
6579         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
6580         * utils.c (internal_error): New function.
6581
6582 2010-03-15  Andreas Schwab  <schwab@redhat.com>
6583
6584         * configure.srv: Fix typo setting srv_regobj.
6585
6586 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
6587
6588         * linux-low.c (fetch_register): Avoid passing a non string literal
6589         format to `error'.
6590         (usr_store_inferior_registers): Ditto.
6591
6592 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
6593
6594         * linux-low.c (linux_write_memory): Bail out early if peeking
6595         memory failed.
6596
6597 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
6598
6599         * linux-low.h (struct lwp_info): New fields
6600         `stopped_by_watchpoint' and `stopped_data_address'.
6601         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
6602         here, and cache them in the lwp object.
6603         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
6604         directly.
6605         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
6606         field.
6607         (linux_stopped_by_watchpoint): Rewrite.
6608         (linux_stopped_data_address): Rewrite.
6609
6610 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
6611
6612         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
6613         switching the current inferior, not before.
6614
6615 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
6616
6617         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
6618         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
6619         i386-linux.c and amd64-linux.c.
6620         (reg-i386.o): Removed.
6621         (reg-i386.c): Likewise.
6622         (reg-i386-linux.o): Likewise.
6623         (reg-i386-linux.c): Likewise.
6624         (reg-x86-64.o): Likewise.
6625         (reg-x86-64.c): Likewise.
6626         (reg-x86-64-linux.o): Likewise.
6627         (reg-x86-64-linux.c): Likewise.
6628         (i386.o): New.
6629         (i386.c): Likewise.
6630         (i386-linux.o): Likewise.
6631         (i386-linux.c): Likewise.
6632         (amd64.o): Likewise.
6633         (amd64.c): Likewise.
6634         (amd64-linux.o): Likewise.
6635         (amd64-linux.c): Likewise.
6636
6637         * configure.srv (srv_i386_regobj): New.
6638         (srv_i386_linux_regobj): Likewise.
6639         (srv_amd64_regobj): Likewise.
6640         (srv_amd64_linux_regobj): Likewise.
6641         (srv_i386_32bit_xmlfiles): Likewise.
6642         (srv_i386_64bit_xmlfiles): Likewise.
6643         (srv_i386_xmlfiles): Likewise.
6644         (srv_amd64_xmlfiles): Likewise.
6645         (srv_i386_linux_xmlfiles): Likewise.
6646         (srv_amd64_linux_xmlfiles): Likewise.
6647         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
6648         srv_xmlfiles to $srv_i386_xmlfiles.
6649         (i[34567]86-*-mingw32ce*): Likewise.
6650         (i[34567]86-*-mingw*): Likewise.
6651         (i[34567]86-*-nto*): Likewise.
6652         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
6653         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
6654         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
6655         (x86_64-*-linux*): Likewise.
6656
6657         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
6658         (init_registers_amd64_linux): New.
6659         (x86_arch_setup): Replace init_registers_x86_64_linux with
6660         init_registers_amd64_linux.
6661
6662 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
6663
6664         * configure.ac: Check for libdl.  If it is not available link against
6665         static libthread_db.
6666         * configure: Regenerate.
6667
6668 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
6669
6670         PR9605
6671
6672         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
6673         handing a read watchpoint.
6674         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
6675
6676 2010-02-12  Doug Evans  <dje@google.com>
6677
6678         * linux-low.c (linux_supports_tracefork_flag): Document.
6679         (linux_look_up_symbols): Add comment.
6680
6681 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
6682
6683         * regcache.c (supply_register): Clear regcache if buf is NULL.
6684
6685 2010-02-02  Nicolas Roche  <roche@sourceware.org>
6686             Joel Brobecker  <brobecker@adacore.com>
6687
6688         * inferiors.c (find_inferior): Add function documentation.
6689         (unloaded_dll): Handle the case where the unloaded dll has not
6690         been previously registered in the dll list.
6691
6692 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
6693
6694         * linux-arm-low.c (thumb_breakpoint_len): Delete.
6695         (thumb2_breakpoint): New.
6696         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
6697
6698 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
6699
6700         * linux-low.c (get_stop_pc): Check for SIGTRAP.
6701         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
6702         breakpoints.
6703
6704 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
6705
6706         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
6707
6708 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
6709
6710         * linux-s390-low.c (s390_collect_ptrace_register)
6711         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
6712
6713 2010-01-21  Doug Evans  <dje@google.com>
6714
6715         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
6716         (PTRACE_ARG4_TYPE): New macro.
6717         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
6718         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
6719         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
6720         (usr_store_inferior_registers): Ditto.
6721         (linux_read_memory, linux_write_memory): Ditto.
6722         (linux_test_for_tracefork): Ditto.
6723
6724         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
6725         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
6726
6727 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
6728
6729         * proc-service.c (ps_lgetregs): Don't refetch registers from the
6730         target.
6731
6732 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
6733
6734         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
6735         prototype to take a regcache.  Adjust.
6736
6737 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
6738
6739         * regcache.h (struct thread_info): Forward declare.
6740         (struct regcache): New.
6741         (new_register_cache): Adjust prototype.
6742         (get_thread_regcache): Declare.
6743         (free_register_cache): Adjust prototype.
6744         (registers_to_string, registers_from_string): Ditto.
6745         (supply_register, supply_register_by_name, collect_register)
6746         (collect_register_as_string, collect_register_by_name): Ditto.
6747         * regcache.c (struct inferior_regcache_data): Delete.
6748         (get_regcache): Rename to ...
6749         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
6750         fetching registers.
6751         (regcache_invalidate_one): Adjust.
6752         (regcache_invalidate): Fix prototype.
6753         (new_register_cache): Return the new register cache.
6754         (free_register_cache): Change prototype.
6755         (realloc_register_cache): Adjust.
6756         (registers_to_string): Change prototype to take a regcache.  Adjust.
6757         (registers_from_string): Ditto.
6758         (register_data): Ditto.
6759         (supply_register): Ditto.
6760         (supply_register_by_name): Ditto.
6761         (collect_register): Ditto.
6762         (collect_register_as_string): Ditto.
6763         (collect_register_by_name): Ditto.
6764         * server.c (process_serial_event): Adjust.
6765         * linux-low.h (regset_fill_func, regset_store_func): Change
6766         prototype.
6767         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
6768         Change prototype.
6769         * linux-low.c (get_stop_pc): Adjust.
6770         (check_removed_breakpoint): Adjust.
6771         (linux_wait_for_event): Adjust.
6772         (linux_resume_one_lwp): Adjust.
6773         (fetch_register): Add regcache parameter.  Adjust.
6774         (usr_store_inferior_registers): Ditto.
6775         (regsets_fetch_inferior_registers): Ditto.
6776         (regsets_store_inferior_registers): Ditto.
6777         (linux_fetch_registers, linux_store_registers): Ditto.
6778         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
6779         regcache.  Adjust.
6780         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
6781         Ditto.
6782         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
6783         prototype to take a regcache.
6784         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
6785         * remote-utils.c (convert_ascii_to_int, outreg)
6786         (prepare_resume_reply): Change prototype to take a regcache.
6787         Adjust.
6788         * target.h (struct target_ops) <fetch_registers, store_registers>:
6789         Change prototype to take a regcache.
6790         (fetch_inferior_registers, store_inferior_registers): Change
6791         prototype to take a regcache.  Adjust.
6792         * proc-service.c (ps_lgetregs): Adjust.
6793         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
6794         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
6795         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
6796         take a regcache.  Adjust.
6797         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
6798         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
6799         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
6800         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
6801         * linux-cris-low.c (cris_get_pc, cris_set_pc)
6802         (cris_cannot_fetch_register):
6803         (cris_breakpoint_at): Change prototype to take a regcache.
6804         Adjust.
6805         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
6806         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
6807         to take a regcache.  Adjust.
6808         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
6809         Adjust.
6810         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
6811         take a regcache.  Adjust.
6812         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
6813         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
6814         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
6815         * linux-mips-low.c (mips_get_pc):
6816         (mips_set_pc): Change prototype to take a regcache.  Adjust.
6817         (mips_reinsert_addr): Adjust.
6818         (mips_collect_register): Change prototype to take a regcache.
6819         Adjust.
6820         (mips_supply_register):
6821         (mips_collect_register_32bit, mips_supply_register_32bit)
6822         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
6823         (mips_store_fpregset): Ditto.
6824         * linux-ppc-low.c (ppc_supply_ptrace_register)
6825         (ppc_supply_ptrace_register): Ditto.
6826         (parse_spufs_run): Adjust.
6827         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
6828         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
6829         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
6830         take a regcache.  Adjust.
6831         * linux-s390-low.c (s390_collect_ptrace_register)
6832         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
6833         (s390_set_pc): Change prototype to take a regcache.  Adjust.
6834         (s390_arch_setup): Adjust.
6835         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
6836         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
6837         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6838         (sparc_fill_gregset, sparc_store_gregset_from_stack)
6839         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
6840         regcache.  Adjust.
6841         (sparc_breakpoint_at): Adjust.
6842         * linux-xtensa-low.c (xtensa_fill_gregset):
6843         (xtensa_store_gregset):
6844         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
6845         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
6846         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
6847         prototype to take a regcache.  Adjust.
6848         * win32-arm-low.c (arm_fetch_inferior_register)
6849         (arm_store_inferior_register): Change prototype to take a
6850         regcache.  Adjust.
6851         * win32-i386-low.c (i386_fetch_inferior_register)
6852         (i386_store_inferior_register): Change prototype to take a
6853         regcache.  Adjust.
6854         * win32-low.c (child_fetch_inferior_registers)
6855         (child_store_inferior_registers): Change prototype to take a
6856         regcache.  Adjust.
6857         (win32_wait): Adjust.
6858         (win32_fetch_inferior_registers): Change prototype to take a
6859         regcache.  Adjust.
6860         (win32_store_inferior_registers): Adjust.
6861         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
6862         store_inferior_register>: Change prototype to take a regcache.
6863
6864 2010-01-20  Doug Evans  <dje@google.com>
6865
6866         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
6867         #ifdef.
6868         (linux_wait_for_event1, linux_init_signals): Ditto.
6869         (W_STOPCODE): Provide definition if missing.
6870
6871 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
6872
6873         * linux-low.c (linux_core_of_thread): New.
6874         (compare_ints, show_process, list_threads): New.
6875         (linux_qxfer_osdata): Report threads and cores.
6876         (linux_target_op): Register linux_core_of_thread.
6877         * remote-utils.c (prepare_resume_reply): Report the core.
6878         (buffer_xml_printf): Support %d specifier.
6879         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
6880         New.
6881         (handle_query): Handle qXfer:threads.  Announce availability
6882         thereof.
6883         * target.h (struct target_ops): New field core_of_thread.
6884
6885 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
6886
6887         * Makefile.in (clean): Remove new generated files.
6888         (reg-s390.o, reg-s390.c): Remove rules.
6889         (reg-s390x.o, reg-s390x.c): Likewise.
6890         (s390-linux32.o, s390-linux32.c): Add rules.
6891         (s390-linux64.o, s390-linux64.c): Likewise.
6892         (s390x-linux64.o, s390x-linux64.c): Likewise.
6893         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
6894         * linux-s390-low.c: Include <elf.h>.
6895         (HWCAP_S390_HIGH_GPRS): Define if undefined.
6896         (init_registers_s390): Remove prototype.
6897         (init_registers_s390x): Likewise.
6898         (init_registers_s390_linux32): Add prototype.
6899         (init_registers_s390_linux64): Likewise.
6900         (init_registers_s390x_linux64): Likewise.
6901         (s390_num_regs_3264): New define.
6902         (s390_regmap_3264): New global variable.
6903         (s390_cannot_fetch_register): Remove obsolete check.
6904         (s390_cannot_store_register): Likewise.
6905         (s390_collect_ptrace_register): Handle upper/lower register halves.
6906         (s390_supply_ptrace_register): Likewise.
6907         (s390_fill_gregset): Update to register number changes.
6908         (s390_get_hwcap): New routine.
6909         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
6910         Install appropriate regmap and register set.
6911
6912 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
6913
6914         * server.c (gdbserver_version): Update copyright year to 2010.
6915         * gdbreplay.c (gdbreplay_version): Likewise.
6916
6917 2009-12-28  Doug Evans  <dje@google.com>
6918
6919         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
6920         elf/external.h.  Include <elf.h> instead but only if necessary.
6921
6922 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
6923
6924         * linux-low.c (linux_remove_process): Remove `detaching'
6925         parameter.  Don't release/detach from thread_db here.
6926         (linux_kill): Release/detach from thread_db here, ...
6927         (linux_detach): ... and here, before actually detaching.
6928         (linux_wait_1): ... and here, when a process exits.
6929         * thread-db.c (any_thread_of): New.
6930         (thread_db_free): Switch the current inferior to a thread of the
6931         passed in process.
6932
6933 2009-12-21  Doug Evans  <dje@google.com>
6934
6935         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
6936
6937         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
6938         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
6939         warning ifndef __NR_tkill.  Move setting of errno there too.
6940         Delete unnecessary resetting of errno after syscall.
6941         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
6942
6943         * configure.ac: Check for dladdr.
6944         * config.in: Regenerate.
6945         * configure: Regenerate.
6946         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
6947         (try_thread_db_load): Update.
6948
6949         * linux-low.c (my_waitpid): Delete unnecessary prototype.
6950
6951 2009-12-18  Doug Evans  <dje@google.com>
6952
6953         * event-loop.c: Include unistd.h if it exists.
6954
6955         * linux-low.c (my_waitpid): Move definition away from being in
6956         between linux_tracefork_child/linux_test_for_tracefork.
6957
6958         * gdb_proc_service.h (psaddr_t): Fix type.
6959         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
6960         signature to match glibc.
6961
6962 2009-12-16  Doug Evans  <dje@google.com>
6963
6964         * linux-low.c (linux_read_memory): Fix argument to read.
6965
6966 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
6967
6968         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
6969         events, don't leave current_inferior pointing at null.
6970
6971 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
6972
6973         * win32-low.c (LOG): Delete.
6974         (OUTMSG): Output to stderr.
6975         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
6976         on compile time LOG macro.
6977         (win32_wait): Fix debug output.
6978
6979 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
6980
6981         * win32-low.c (win32_add_one_solib): If the dll name is
6982         "ntdll.dll", prepend the system directory to the dll path.
6983
6984 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
6985
6986         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
6987
6988 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
6989             Vladimir Prus  <vladimir@codesourcery.com>
6990
6991         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
6992         * configure.ac: Check for __mcoldfire__ and set
6993         gdb_cv_m68k_is_coldfire.
6994         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
6995         reg-cf.o and reg-m68k.o.
6996         * configure: Regenerated.
6997
6998 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
6999
7000         * linux-low.c (linux_remove_process): Add `detaching' parameter.
7001         Pass it to thread_db_free.
7002         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
7003         proper `detaching' argument to linux_remove_process.
7004         * linux-low.h (thread_db_free): Add `detaching' parameter.
7005         * thread-db.c (thread_db_init): Pass false as `detaching' argument
7006         to thread_db_free.
7007         (thread_db_free): Add `detaching' parameter.  Only
7008         call td_ta_clear_event if detaching from process.
7009
7010 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
7011
7012         * thread-db.c (thread_db_free): Fix typo.
7013
7014 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
7015
7016         PR gdb/10838
7017         * thread-db.c (thread_db_free): Call td_ta_clear_event.
7018
7019 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
7020
7021         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
7022         with an i686 compiler.
7023         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
7024         needed.
7025         * configure: Rebuilt.
7026
7027 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
7028
7029         PR gdb/10783
7030
7031         * server.c (handle_search_memory_1): Correct read_addr initialization
7032         in loop for searching subsequent chunks.
7033
7034 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
7035
7036         * configure.ac: New --with-libthread-db option.
7037         * thread-db.c: Allow direct dependence on libthread_db.
7038         (thread_db_free): Adjust.
7039         * config.in: Regenerate.
7040         * configure: Likewise.
7041
7042 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
7043
7044         PR gdb/10757
7045         * thread-db.c (attach_thread): New function.
7046         (maybe_attach_thread): Return success/failure.
7047         (find_new_threads_callback): Adjust.
7048         (thread_db_find_new_threads): Loop until no new threads.
7049
7050 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
7051
7052         * proc-service.c (ps_lgetregs): Formatting.
7053
7054 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
7055
7056         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
7057         * configure.ac: Adjust.
7058         * linux-low.h (struct process_info_private): Move members to struct
7059         thread_db.
7060         (thread_db_free, thread_db_handle_monitor_command): New prototype.
7061         * linux-low.c (linux_remove_process): Adjust.
7062         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
7063         * server.c (handle_query): Move code ...
7064         (handle_monitor_command): ... here. New function.
7065         * target.h (struct target_ops): New member.
7066         * thread-db.c (struct thread_db): New.
7067         (libthread_db_search_path): New variable.
7068         (thread_db_create_event, thread_db_enable_reporting)
7069         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
7070         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
7071         (try_thread_db_load_1, dladdr_to_soname): New functions.
7072         (try_thread_db_load, thread_db_load_search): New functions.
7073         (thread_db_init): Search for libthread_db.
7074         (thread_db_free): New function.
7075         (thread_db_handle_monitor_command): Likewise.
7076         * config.in: Regenerate.
7077         * configure: Regenerate.
7078
7079 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
7080
7081         * spu-low.c (spu_kill): Wait for inferior to terminate.
7082         Call clear_inferiors.
7083         (spu_detach): Call clear_inferiors.
7084
7085 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7086
7087         * aclocal.m4: Regenerate.
7088         * config.in: Likewise.
7089         * configure: Likewise.
7090
7091 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
7092
7093         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
7094         (parse_spufs_run): New function.
7095         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
7096         (ppc_breakpoint_at): Handle SPU breakpoints.
7097
7098 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
7099
7100         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
7101         (SPUFS_MAGIC): Define.
7102         (spu_enumerate_spu_ids): New function.
7103         (linux_qxfer_spu): New function.
7104         (linux_target_ops): Install linux_qxfer_spu.
7105
7106 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
7107
7108         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
7109         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
7110         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
7111         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
7112         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
7113         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
7114         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
7115         (init_registers_powerpc_cell32l): Add prototype.
7116         (init_registers_powerpc_cell64l): Likewise.
7117         (ppc_arch_setup): Detect Cell/B.E. architecture.
7118
7119 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7120
7121         * Makefile.in (datarootdir): New variable.
7122
7123 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
7124
7125         * linux-low.c (linux_write_memory): Update debugging output.
7126         * Makefile.in (clean): Add new descriptions.
7127         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
7128         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
7129         * configure.srv: Add new files for arm*-*-linux*.
7130         * linux-arm-low.c: Add new declarations.
7131         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
7132         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
7133         (HWCAP_VFPv3D16): New.
7134         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
7135         instead of __IWMMXT__.
7136         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
7137         (arm_arch_setup): New.
7138         (target_regsets): Remove #ifdef.  Add VFP regset.
7139         (the_low_target): Use arm_arch_setup.
7140
7141 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
7142
7143         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
7144         the main thread again.
7145
7146 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
7147
7148         Adding Neutrino gdbserver.
7149         * configure: Regenerated.
7150         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
7151         * configure.srv (i[34567]86-*-nto*): New target.
7152         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
7153         * remote-utils.c [__QNX__]: Include sys/iomgr.h
7154         (nto_comctrl) [__QNX__]: New function.
7155         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
7156
7157 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
7158
7159         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
7160         srv_tgtobj.
7161
7162 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
7163             Pedro Alves  <pedro@codesourcery.com>
7164
7165         * win32-i386-low.c (i386_get_thread_context): Handle systems that
7166         don't support CONTEXT_EXTENDED_REGISTERS.
7167         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
7168         (the_low_target): Install them.
7169         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
7170         failing with ERROR_PIPE_NOT_CONNECTED.
7171
7172 2009-06-30  Doug Evans  <dje@google.com>
7173             Pierre Muller  <muller@ics.u-strasbg.fr>
7174
7175         Add h/w watchpoint support to x86-linux, win32-i386.
7176         * Makefile.in (SFILES): Add i386-low.c
7177         (i386_low_h): Define.
7178         (i386-low.o): Add dependencies.
7179         (linux-x86-low.o): Add i386-low.h dependency.
7180         (win32-i386-low.o): Ditto.
7181         * i386-low.c: New file.
7182         * i386-low.h: New file.
7183         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
7184         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
7185         * linux-low.c (linux_add_process): Initialize arch_private.
7186         (linux_remove_process): Free arch_private.
7187         (add_lwp): Initialize arch_private.
7188         (delete_lwp): Free arch_private.
7189         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
7190         provided.
7191         * linux-low.h (process_info_private): New member arch_private.
7192         (lwp_info): New member arch_private.
7193         (linux_target_ops): New members new_process, new_thread,
7194         prepare_to_resume.
7195         (ptid_of): New macro.
7196         * linux-x86-low.c: Include stddef.h, i386-low.h.
7197         (arch_process_info): New struct.
7198         (arch_lwp_info): New struct.
7199         (x86_linux_dr_get, x86_linux_dr_set): New functions.
7200         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
7201         (i386_dr_low_get_status): New function.
7202         (x86_insert_point, x86_remove_point): New functions.
7203         (x86_stopped_by_watchpoint): New function.
7204         (x86_stopped_data_address): New function.
7205         (x86_linux_new_process, x86_linux_new_thread): New functions.
7206         (x86_linux_prepare_to_resume): New function.
7207         (the_low_target): Add entries for insert_point, remove_point,
7208         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
7209         prepare_to_resume.
7210         * server.c (debug_hw_points): New global.
7211         (monitor_show_help): Document set debug-hw-points.
7212         (handle_query): Process "set debug-hw-points".
7213         * server.h (debug_hw_points): Declare.
7214         (paddress): Declare.
7215         * utils.c (NUMCELLS, CELLSIZE): New macros.
7216         (get_sell, xsnprintf, paddress): New functions.
7217         * win32-arm-low.c (the_low_target): Add entries for insert_point,
7218         remove_point, stopped_by_watchpoint, stopped_data_address.
7219         * win32-i386-low.c: Include i386-low.h.
7220         (debug_reg_state): Replaces dr.
7221         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
7222         (i386_dr_low_get_status): New function.
7223         (i386_insert_point, i386_remove_point): New functions.
7224         (i386_stopped_by_watchpoint): New function.
7225         (i386_stopped_data_address): New function.
7226         (i386_initial_stuff): Update.
7227         (get_thread_context,set_thread_context,i386_thread_added): Update.
7228         (the_low_target): Add entries for insert_point,
7229         remove_point, stopped_by_watchpoint, stopped_data_address.
7230         * win32-low.c (win32_insert_watchpoint): New function.
7231         (win32_remove_watchpoint): New function.
7232         (win32_stopped_by_watchpoint): New function.
7233         (win32_stopped_data_address): New function.
7234         (win32_target_ops): Add entries for insert_watchpoint,
7235         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
7236         * win32-low.h (win32_target_ops): New members insert_point,
7237         remove_point, stopped_by_watchpoint, stopped_data_address.
7238
7239 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
7240
7241         * server.c (process_serial_event): Re-return unsupported, not
7242         error, if the type isn't recognized.  Re-allow supporting only
7243         insert or remove packets.  Also call require_running for
7244         breakpoints.  Add missing break statement to default case.  Tidy.
7245         * target.h (struct target_ops): Rename insert_watchpoint to
7246         insert_point, and remove_watchpoint to remove_point.
7247
7248         * linux-low.h (struct linux_target_ops): Likewise.
7249         * linux-low.c (linux_insert_watchpoint): Rename to ...
7250         (linux_insert_point): ... this.  Adjust.
7251         (linux_remove_watchpoint): Rename to ...
7252         (linux_remove_point): ... this.  Adjust.
7253         (linux_target_ops): Adjust.
7254         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
7255         (cris_insert_point): ... this.
7256         (cris_remove_watchpoint): Rename to ...
7257         (cris_remove_point): ... this.
7258         (the_low_target): Adjust.
7259
7260 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
7261
7262         * server.c (handle_v_kill): Pass signal_pid to
7263         kill_inferior if multi_process is zero.
7264
7265 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
7266
7267         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
7268         * target.h (target_ops): Comment for *_watchpoint to make it clear
7269         the functions can get types '0' and '1'.
7270
7271 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
7272
7273         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
7274         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
7275         * regcache.c (get_regcache): Likewise.
7276         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
7277         * win32-low.c (child_fetch_inferior_registers): Remove check for
7278         regno 0.
7279
7280 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
7281             Pedro Alves <pedro@codesourcery.com>
7282
7283         * target.h (struct target_ops) <supports_multi_process>: New
7284         callback.
7285         (target_supports_multi_process): New.
7286         * server.c (handle_query): Even if GDB reports support, only
7287         enable multi-process if the target also supports it.  Report
7288         multi-process support only if the target backend supports it.
7289         * linux-low.c (linux_supports_multi_process): New function.
7290         (linux_target_ops): Install it as target_supports_multi_process
7291         callback.
7292
7293 2009-05-24  Doug Evans  <dje@google.com>
7294
7295         Global renaming of find_thread_pid to find_thread_ptid.
7296         * server.h (find_thread_ptid): Renamed from find_thread_pid.
7297         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
7298         All callers updated.
7299
7300         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
7301         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
7302         directly.
7303
7304         * linux-low.c (get_stop_pc): Print pc if debug_threads.
7305         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
7306         (linux_resume_one_lwp): Ditto.
7307
7308 2009-05-23  Doug Evans  <dje@google.com>
7309
7310         * linux-low.c (linux_resume_one_lwp): Change type of first arg
7311         from struct inferior_list_entry * to struct lwp_info *.
7312         All callers updated.
7313
7314 2009-05-13  Doug Evans  <dje@google.com>
7315
7316         * linux-x86-low.c: Don't include assert.h.
7317         (x86_siginfo_fixup): Use fatal, not assert.
7318         (x86_arch_setup): Fix comment.
7319
7320 2009-05-12  Doug Evans  <dje@google.com>
7321
7322         Biarch support for i386/amd64 gdbserver.
7323         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
7324         Add linux-x86-low.c.
7325         (linux-i386-low.o, linux-x86-64-low.o): Delete.
7326         (linux-x86-low.o): Add.
7327         * linux-x86-64-low.c: Delete.
7328         * linux-i386-low.c: Delete.
7329         * linux-x86-low.c: New file.
7330         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
7331         linux-x86-low.o.
7332         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
7333         linux-x86-low.o.
7334         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
7335         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
7336         (linux_child_pid_to_exec_file): New function.
7337         (elf_64_header_p, elf_64_file_p): New functions.
7338         (siginfo_fixup): New function.
7339         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
7340         give target a chance to convert layout.
7341         * linux-low.h (linux_target_ops): New member siginfo_fixup.
7342         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
7343
7344 2009-05-07  Doug Evans  <dje@google.com>
7345
7346         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
7347         (regsets_store_inferior_registers): Ditto.
7348
7349 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
7350
7351         PR server/10048
7352
7353         * linux-low.c (must_set_ptrace_flags): Delete.
7354         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
7355         of the global.
7356         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
7357         `lwp->must_set_ptrace_flags' instead.
7358         (linux_wait_for_event_1): Set ptrace options here.
7359         (linux_wait_1): ... not here.
7360
7361 2009-04-30  Doug Evans  <dje@google.com>
7362
7363         * inferiors.c (started_inferior_callback): New function.
7364         (attached_inferior_callback): New function.
7365         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
7366         * server.c (print_started_pid, print_attached_pid): New functions.
7367         (detach_or_kill_for_exit): New function.
7368         (main): Call it instead of for_each_inferior (kill_inferior_callback).
7369         * server.h (have_started_inferiors_p): Declare.
7370         (have_attached_inferiors_p): Declare.
7371
7372         * inferiors.c (remove_process): Fix memory leak, free process.
7373         * linux-low.c (linux_remove_process): New function.
7374         (linux_kill): Call it instead of remove_process.
7375         (linux_detach, linux_wait_1): Ditto.
7376
7377 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
7378
7379         * configure.srv: Add x86 Windows CE target.
7380
7381 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
7382
7383         * inferiors.c (get_thread_process): Make global.
7384         * server.h (get_thread_process): Add prototype.
7385         * thread-db.c (find_one_thread): Use get_thread_process
7386         instead of current_process.
7387         (thread_db_get_tls_address): Do not crash if called when
7388         thread layer is not yet initialized.
7389
7390 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
7391
7392         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
7393         * spu-low.c (current_tid): Rename to ...
7394         (current_ptid): ... this.
7395         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
7396         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
7397         ptid_get_lwp (current_ptid) instead of current_tid.
7398         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
7399         instead of current_tid.  Use find_process_pid to verify pid
7400         argument is valid.  Pass proper argument to remove_process.
7401         (spu_thread_alive): Compare current_ptid instead of current_tid.
7402         (spu_resume): Likewise.
7403
7404 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
7405
7406         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
7407         variable.
7408
7409 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
7410
7411         Implement the multiprocess extensions, and add linux multiprocess
7412         support.
7413
7414         * server.h (ULONGEST): Declare.
7415         (struct ptid, ptid_t): New.
7416         (minus_one_ptid, null_ptid): Declare.
7417         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
7418         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
7419         (struct inferior_list_entry): Change `id' type from unsigned from
7420         to ptid_t.
7421         (struct sym_cache, struct breakpoint, struct
7422         process_info_private): Forward declare.
7423         (struct process_info): Declare.
7424         (current_process): Declare.
7425         (all_processes): Declare.
7426         (initialize_inferiors): Declare.
7427         (add_thread): Adjust to use ptid_t.
7428         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
7429         (add_process, remove_process, find_thread_pid): Declare.
7430         (find_inferior_id): Adjust to use ptid_t.
7431         (cont_thread, general_thread, step_thread): Change type to ptid_t.
7432         (multi_process): Declare.
7433         (push_event): Adjust to use ptid_t.
7434         (read_ptid, write_ptid): Declare.
7435         (prepare_resume_reply): Adjust to use ptid_t.
7436         (clear_symbol_cache): Declare.
7437         * inferiors.c (all_processes): New.
7438         (null_ptid, minus_one_ptid): New.
7439         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
7440         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
7441         (add_thread): Change unsigned long to ptid.  Remove gdb_id
7442         parameter.  Adjust.
7443         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
7444         (gdb_id_to_thread): Rename to ...
7445         (find_thread_pid): ... this.  Change unsigned long to ptid.
7446         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
7447         (loaded_dll, pull_pid_from_list): Adjust.
7448         (add_process, remove_process, find_process_pid)
7449         (get_thread_process, current_process, initialize_inferiors): New.
7450         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
7451         (struct target_waitstatus) <related_pid>: Ditto.
7452         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
7453         return type to int.
7454         (struct target_ops) <join>: Add `pid' argument.
7455         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
7456         (struct target_ops) <wait>: Add `ptid' field.  Change return type
7457         to ptid.
7458         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
7459         (mywait): Add `ptid' argument.  Change return type to ptid_t.
7460         (target_pid_to_str): Declare.
7461         * target.c (set_desired_inferior): Adjust to use ptids.
7462         (mywait): Add new `ptid' argument.  Adjust.
7463         (target_pid_to_str): New.
7464         * mem-break.h (free_all_breakpoints): Declare.
7465         * mem-break.c (breakpoints): Delelete.
7466         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
7467         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
7468         to use per-process breakpoint list.
7469         (free_all_breakpoints): New.
7470         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
7471         (symbol_cache, all_symbols_looked_up): Delete.
7472         (hexchars): New.
7473         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
7474         read_ptid): New.
7475         (prepare_resume_reply): Change ptid argument's type from unsigned
7476         long to ptid_t.  Adjust.  Implement W;process and X;process.
7477         (free_sym_cache, clear_symbol_cache): New.
7478         (look_up_one_symbol): Adjust to per-process symbol cache.  *
7479         * server.c (cont_thread, general_thread, step_thread): Change type
7480         to ptid_t.
7481         (attached): Delete.
7482         (multi_process): New.
7483         (last_ptid): Change type to ptid_t.
7484         (struct vstop_notif) <ptid>: Change type to ptid_t.
7485         (queue_stop_reply, push_event): Change `ptid' argument's type to
7486         ptid_t.
7487         (discard_queued_stop_replies): Add `pid' argument.
7488         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
7489         changes.  Don't reference the `attached' global.
7490         (attach_inferior): Adjust to mywait interface changes.
7491         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
7492         features.  Handle and report "multiprocess+".  Handle
7493         "qAttached:PID".
7494         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
7495         changes.
7496         (handle_v_kill): New.
7497         (handle_v_stopped): Adjust to use target_pid_to_str.
7498         (handle_v_requests): Allow multiple attaches and runs when
7499         multiprocess extensions are in effect.  Handle "vKill".
7500         (myresume): Adjust to use ptids.
7501         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
7502         (handle_status): Adjust to discard_queued_stop_replies interface
7503         change.
7504         (first_thread_of, kill_inferior_callback)
7505         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
7506         (main): Call initialize_inferiors.  Adjust to use ptids, killing
7507         and detaching from all inferiors.  Handle multiprocess packet
7508         variants.
7509         * linux-low.h: Include gdb_proc_service.h.
7510         (struct process_info_private): New.
7511         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
7512         <lwpid_of>: Use ptid_get_lwp.
7513         (get_lwp_thread): Adjust.
7514         (struct lwp_info): Add `dead' member.
7515         (find_lwp_pid): Declare.
7516         * linux-low.c (thread_db_active): Delete.
7517         (new_inferior): Adjust comment.
7518         (inferior_pid): Delete.
7519         (linux_add_process): New.
7520         (handle_extended_wait): Adjust.
7521         (add_lwp): Change unsigned long to ptid.
7522         (linux_create_inferior): Add process to processes table.  Adjust
7523         to use ptids.  Don't set new_inferior here.
7524         (linux_attach_lwp): Rename to ...
7525         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
7526         it.  Adjust to use ptids.
7527         (linux_attach_lwp): New.
7528         (linux_attach): Add process to processes table.  Don't set
7529         new_inferior here.
7530         (struct counter): New.
7531         (second_thread_of_pid_p, last_thread_of_process_p): New.
7532         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
7533         multiple processes.
7534         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
7535         processes.  Remove process from process table.
7536         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
7537         to multiple processes.
7538         (any_thread_of): New.
7539         (linux_detach): Add `pid' argument, and handle it.  Remove process
7540         from processes table.
7541         (linux_join): Add `pid' argument.  Handle it.
7542         (linux_thread_alive): Change unsighed long argument to ptid_t.
7543         Consider dead lwps as not being alive.
7544         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
7545         threads we're not interested in.
7546         (same_lwp, find_lwp_pid): New.
7547         (linux_wait_for_lwp): Change `pid' argument's type from int to
7548         ptid_t.  Adjust.
7549         (linux_wait_for_event): Rename to ...
7550         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
7551         from int to ptid_t.  Adjust.
7552         (linux_wait_for_event): New.
7553         (linux_wait_1): Add `ptid' argument.  Change return type to
7554         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
7555         that exit from the process table.
7556         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
7557         Adjust.
7558         (mark_lwp_dead): New.
7559         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
7560         stopping all threads, mark its main lwp as dead.
7561         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
7562         ptids.
7563         (fetch_register, usr_store_inferior_registers)
7564         (regsets_fetch_inferior_registers)
7565         (regsets_store_inferior_registers, linux_read_memory)
7566         (linux_write_memory): Inline `inferior_pid'.
7567         (linux_look_up_symbols): Adjust to use per-process
7568         `thread_db_active'.
7569         (linux_request_interrupt): Adjust to use ptids.
7570         (linux_read_auxv): Inline `inferior_pid'.
7571         (initialize_low): Don't reference thread_db_active.
7572         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
7573         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
7574         (ps_getpid): Return the pid of the current inferior.
7575         * thread-db.c (proc_handle, thread_agent): Delete.
7576         (thread_db_create_event, thread_db_enable_reporting): Adjust to
7577         per-process data.
7578         (find_one_thread): Change argument type to ptid_t.  Adjust to
7579         per-process data.
7580         (maybe_attach_thread): Adjust to per-process data and ptids.
7581         (thread_db_find_new_threads): Ditto.
7582         (thread_db_init): Ditto.
7583         * spu-low.c (spu_create_inferior, spu_attach): Add process to
7584         processes table.  Adjust to use ptids.
7585         (spu_kill, spu_detach): Adjust interface.  Remove process from
7586         processes table.
7587         (spu_join, spu_thread_alive): Adjust interface.
7588         (spu_wait): Adjust interface.  Remove process from processes
7589         table.  Adjust to use ptids.
7590         * win32-low.c (current_inferior_tid): Delete.
7591         (current_inferior_ptid): New.
7592         (debug_event_ptid): New.
7593         (thread_rec): Take a ptid.  Adjust.
7594         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
7595         (child_delete_thread): Ditto.
7596         (do_initial_child_stuff): Add `attached' argument.  Add process to
7597         processes table.
7598         (child_fetch_inferior_registers, child_store_inferior_registers):
7599         Adjust.
7600         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
7601         (win32_attach): Pass 1 to do_initial_child_stuff.
7602         (win32_kill): Adjust interface.  Remove process from processes
7603         table.
7604         (win32_detach): Ditto.
7605         (win32_join): Adjust interface.
7606         (win32_thread_alive): Take a ptid.
7607         (win32_resume): Adjust to use ptids.
7608         (get_child_debug_event): Ditto.
7609         (win32_wait): Adjust interface.  Remove exiting process from
7610         processes table.
7611
7612 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
7613
7614         Non-stop mode support.
7615
7616         * server.h (non_stop): Declare.
7617         (gdb_client_data, handler_func): Declare.
7618         (delete_file_handler, add_file_handler, start_event_loop):
7619         Declare.
7620         (handle_serial_event, handle_target_event, push_event)
7621         (putpkt_notif): Declare.
7622         * target.h (enum resume_kind): New.
7623         (struct thread_resume): Replace `step' field by `kind' field.
7624         (TARGET_WNOHANG): Define.
7625         (struct target_ops) <wait>: Add `options' argument.
7626         <supports_non_stop, async, start_non_stop>: New fields.
7627         (target_supports_non_stop, target_async): New.
7628         (start_non_stop): Declare.
7629         (mywait): Add `options' argument.
7630         * target.c (mywait): Add `options' argument.  Print child exit
7631         notifications here.
7632         (start_non_stop): New.
7633         * server.c (non_stop, own_buf, mem_buf): New globals.
7634         (struct vstop_notif): New.
7635         (notif_queue): New global.
7636         (queue_stop_reply, push_event, discard_queued_stop_replies)
7637         (send_next_stop_reply): New.
7638         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
7639         interface changes.
7640         (attach_inferior): In non-stop mode, don't wait for the target
7641         here.
7642         (handle_general_set): Handle QNonStop.
7643         (handle_query): When handling qC, return the current general
7644         thread, instead of the first thread of the list.
7645         (handle_query): If the backend supports non-stop mode, include
7646         QNonStop+ in the qSupported query response.
7647         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
7648         and non-stop mode.
7649         (handle_v_attach, handle_v_run): Handle non-stop mode.
7650         (handle_v_stopped): New.
7651         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
7652         (myresume): Adjust to use resume_kind.  Handle non-stop.
7653         (queue_stop_reply_callback): New.
7654         (handle_status): Handle non-stop mode.
7655         (main): Clear non_stop flag on reconnection.  Use the event-loop.
7656         Refactor serial protocol handling from here ...
7657         (process_serial_event): ... to this new function.  When GDB
7658         selects any thread, select one here.  In non-stop mode, wait until
7659         GDB acks all pending events before exiting.
7660         (handle_serial_event, handle_target_event): New.
7661         * remote-utils.c (remote_open): Install remote_desc in the event
7662         loop.
7663         (remote_close): Remove remote_desc from the event loop.
7664         (putpkt_binary): Rename to...
7665         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
7666         (putpkt_binary): New as wrapper around putpkt_binary_1.
7667         (putpkt_notif): New.
7668         (prepare_resume_reply): In non-stop mode, don't change the
7669         general_thread.
7670         * event-loop.c: New.
7671         * Makefile.in (OBJ): Add event-loop.o.
7672         (event-loop.o): New rule.
7673
7674         * linux-low.h (pid_of): Moved here.
7675         (lwpid_of): New.
7676         (get_lwp_thread): Use lwpid_of.
7677         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
7678         * linux-low.c (pid_of): Delete.
7679         (inferior_pid): Use lwpid_of.
7680         (linux_event_pipe): New.
7681         (target_is_async_p): New.
7682         (delete_lwp): New.
7683         (handle_extended_wait): Use lwpid_of.
7684         (add_lwp): Don't set lwpid field.
7685         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
7686         (linux_kill_one_lwp): If killing a running lwp, stop it first.
7687         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
7688         (linux_detach_one_lwp): If detaching from a running lwp, stop it
7689         first.  Adjust to linux_wait_for_event interface changes.  Use
7690         lwpid_of.
7691         (linux_detach): Don't delete the main lwp here.
7692         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
7693         (status_pending_p): Don't consider explicitly suspended lwps.
7694         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
7695         pointer.  Add OPTIONS argument.  Change return type to int.  Use
7696         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
7697         (linux_wait_for_event): Take an integer pid instead of a lwp_info
7698         pointer.  Add status pointer argument.  Return a pid instead of a
7699         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
7700         changes.  In non-stop mode, don't switch to a random thread.
7701         (linux_wait): Rename to...
7702         (linux_wait_1): ... this.  Add target_options argument, and handle
7703         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
7704         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
7705         clean exit and signal exit code.  Don't stop all threads in
7706         non-stop mode.  In all-stop mode, only stop all threads when
7707         reporting a stop to GDB.  Handle explicit thread stop requests.
7708         (async_file_flush, async_file_mark): New.
7709         (linux_wait): New.
7710         (send_sigstop): Use lwpid_of.
7711         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
7712         interface changes.  In non-stop mode, don't switch to a random
7713         thread.
7714         (linux_resume_one_lwp): Use lwpid_of.
7715         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
7716         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
7717         non-stop mode, don't look for pending flag in all threads.
7718         (resume_status_pending_p): Don't consider explicitly suspended
7719         threads.
7720         (my_waitpid): Reimplement.  Emulate __WALL.
7721         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
7722         Use lwpid_of.
7723         (sigchld_handler, linux_supports_non_stop, linux_async)
7724         (linux_start_non_stop): New.
7725         (linux_target_ops): Register linux_supports_non_stop, linux_async
7726         and linux_start_non_stop.
7727         (initialize_low): Install SIGCHLD handler.
7728         * thread-db.c (thread_db_create_event, find_one_thread)
7729         (thread_db_get_tls_address): Use lwpid_of.
7730         * win32-low.c (win32_detach): Adjust to use resume_kind.
7731         (win32_wait): Add `options' argument.
7732         * spu-low.c (spu_resume): Adjust to use resume_kind.
7733         (spu_wait): Add `options' argument.
7734
7735 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
7736
7737         Decouple target code from remote protocol.
7738
7739         * target.h (enum target_waitkind): New.
7740         (struct target_waitstatus): New.
7741         (struct target_ops) <wait>: Return an unsigned long.  Take a
7742         target_waitstatus pointer instead of a char pointer.
7743         (mywait): Likewise.
7744         * target.c (mywait): Change prototype to return an unsigned long.
7745         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
7746         * server.h (thread_from_wait, old_thread_from_wait): Delete
7747         declarations.
7748         (prepare_resume_reply): Change prototype to take a
7749         target_waitstatus.
7750         * server.c (thread_from_wait, old_thread_from_wait): Delete.
7751         (last_status, last_ptid): New.
7752         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
7753         pid instead of a signal.
7754         (attach_inferior): Remove "status" and "signal" parameters.
7755         Adjust.
7756         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
7757         not as an address.
7758         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
7759         (handle_v_requests, myresume): Remove "status" and "signal"
7760         parameters.  Adjust.
7761         (handle_status): New.
7762         (main): Delete local `status'.  Adjust.
7763         * remote-utils.c: Include target.h.
7764         (prepare_resume_reply): Change prototype to take a
7765         target_waitstatus.  Adjust.
7766
7767         * linux-low.c (linux_wait): Adjust to new target_ops->wait
7768         interface.
7769         * spu-low.c (spu_wait): Adjust.
7770         * win32-low.c (enum target_waitkind, struct target_waitstatus):
7771         Delete.
7772         (win32_wait): Adjust.
7773
7774 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
7775
7776         * target.h (struct thread_resume): Delete leave_stopped member.
7777         (struct target_ops): Add a `n' argument to the `resume' callback.
7778         * server.c (start_inferior): Adjust.
7779         (handle_v_cont, myresume): Adjust.
7780         * linux-low.c (check_removed_breakpoint): Adjust to resume
7781         interface change, and to removed leave_stopped field.
7782         (resume_ptr): Delete.
7783         (struct thread_resume_array): New.
7784         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
7785         resume interface change.
7786         (linux_continue_one_thread, linux_queue_one_thread)
7787         (resume_status_pending_p): Check if the resume field is NULL
7788         instead of checking the leave_stopped member.
7789         (linux_resume): Adjust to the target resume interface change.
7790         * spu-low.c (spu_resume): Adjust to the target resume interface
7791         change.
7792         * win32-low.c (win32_detach, win32_resume): Ditto.
7793
7794 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
7795
7796         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
7797         flag.
7798         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
7799         pending.
7800         (linux_continue_one_thread): Only preserve the stepping flag if
7801         there's a pending breakpoint.
7802
7803 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
7804
7805         * server.c (main): After the inferior having exited, call
7806         remote_close before exiting gdbserver.
7807
7808 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
7809
7810         Fix size of FPSCR in Power 7 processors.
7811         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
7812         (PPC_FEATURE_HAS_DFP): New #define.
7813         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
7814         size of the FPSCR.
7815
7816 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
7817
7818         * server.c (handle_query) Whitespace and formatting.
7819
7820 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
7821
7822         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
7823         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
7824         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
7825         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
7826         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
7827         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
7828         Makefile.in, configure.ac: Fix whitespace throughout.
7829         * configure: Regenerate.
7830
7831 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
7832
7833         * inferiors.c (find_inferior): Make it safe for the callback
7834         function to delete the currently iterated inferior.
7835
7836 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
7837
7838         * Makefile.in (linuw_low_h): Move higher.
7839         (thread-db.o): Depend on $(linux_low_h).
7840
7841 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
7842
7843         Rename "process" to "lwp" throughout.
7844
7845         * linux-low.c (all_processes): Rename to...
7846         (all_lwps): ... this.
7847         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
7848         (add_process): Rename to ...
7849         (add_lwp): ... this.  Adjust.
7850         (linux_create_inferior): Adjust.
7851         (linux_attach_lwp): Adjust.
7852         (linux_attach): Adjust.
7853         (linux_kill_one_process): Rename to ...
7854         (linux_kill_one_lwp): ... this.  Adjust.
7855         (linux_kill): Adjust.
7856         (linux_detach_one_process): Rename to ...
7857         (linux_detach_one_lwp): ... this.  Adjust.
7858         (linux_detach): Adjust.
7859         (check_removed_breakpoint): Adjust.
7860         (status_pending_p): Adjust.
7861         (linux_wait_for_process): Rename to ...
7862         (linux_wait_for_lwp): ... this.  Adjust.
7863         (linux_wait_for_event): Adjust.
7864         (send_sigstop): Adjust.
7865         (wait_for_sigstop): Adjust.
7866         (stop_all_processes): Rename to ...
7867         (stop_all_lwps): ... this.
7868         (linux_resume_one_process): Rename to ...
7869         (linux_resume_one_lwp): ... this.  Adjust.
7870         (linux_set_resume_request, linux_continue_one_thread)
7871         (linux_queue_one_thread, resume_status_pending_p)
7872         (usr_store_inferior_registers, regsets_store_inferior_registers)
7873         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
7874         Adjust.
7875         * linux-low.h (get_process): Rename to ...
7876         (get_lwp): ... this.  Adjust.
7877         (get_thread_process): Rename to ...
7878         (get_thread_lwp): ... this.  Adjust.
7879         (get_process_thread): Rename to ...
7880         (get_lwp_thread): ... this.  Adjust.
7881         (struct process_info): Rename to ...
7882         (struct lwp_info): ... this.
7883         (all_processes): Rename to ...
7884         (all_lwps): ... this.
7885         * proc-service.c (ps_lgetregs): Adjust.
7886         * thread-db.c (thread_db_create_event, find_one_thread)
7887         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
7888
7889 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
7890
7891         * server.c (handle_query): Handle "qAttached".
7892
7893 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
7894
7895         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
7896         GPLv3, update license URL.
7897
7898 2009-03-01  Doug Evans  <dje@google.com>
7899
7900         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
7901         (server_h): Add gdb_signals.h.
7902         (signals.o): Update.
7903         * server.h (target_signal_from_host,target_signal_to_host_p)
7904         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
7905
7906 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
7907
7908         * remote-utils.c (getpkt): Also generate remote-debug
7909         information if noack_mode is set.
7910
7911 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
7912
7913         * server.c (handle_query): Report qXfer:siginfo:read and
7914         qXfer:siginfo:write as supported and handle them.
7915         * target.h (struct target_ops) <qxfer_siginfo>: New field.
7916         * linux-low.c (linux_xfer_siginfo): New.
7917         (linux_target_ops): Set it.
7918
7919 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
7920
7921         * server.c (gdbserver_usage): Mention --remote-debug.
7922         (main): Accept '--remote-debug' switch.
7923
7924 2009-01-18  Doug Evans  <dje@google.com>
7925
7926         * regcache.c (new_register_cache): No need to check result of xcalloc.
7927         * server.c (handle_search_memory): Back out calls to xmalloc,
7928         result is checked and error is returned to user upon failure.
7929         (handle_query): Ditto.  Add more checks for result of malloc.
7930         (handle_v_cont): Check result of malloc, report error back to
7931         user upon failure.
7932         (handle_v_run): Ditto.  Call freeargv.
7933         * server.h (freeargv): Declare.
7934         * utils.c (freeargv): New fn.
7935
7936 2009-01-15  Doug Evans  <dje@google.com>
7937
7938         * gdbreplay.c (perror_with_name): Make arg const char *.
7939         * server.h (target_signal_to_name): Make return type const char *.
7940         * thread-db.c (thread_db_err_str): Make return type const char *.
7941         * utils.c (perror_with_name): Make arg const char *.
7942
7943 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
7944
7945         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
7946         when handling a EXIT_PROCESS_DEBUG_EVENT.
7947
7948 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
7949
7950         * gdbreplay.c (gdbreplay_version): Update copyright year.
7951         * server.c (gdbserver_version): Likewise.
7952
7953 2009-01-05  Doug Evans  <dje@google.com>
7954
7955         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
7956         (handle_extended_wait): Improve comment.
7957
7958 2008-12-13  Doug Evans  <dje@google.com>
7959
7960         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
7961         * server.h (ATTR_MALLOC): New macro.
7962         (xmalloc,xcalloc,xstrdup): Declare.
7963         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
7964         * inferiors.c: Ditto.
7965         * linux-low.c: Ditto.
7966         * mem-break.c: Ditto.
7967         * regcache.c: Ditto.
7968         * remote-utils.c: Ditto.
7969         * server.c: Ditto.
7970         * target.c: Ditto.
7971         * win32-low.c: Ditto.
7972
7973 2008-12-12  Doug Evans  <dje@google.com>
7974
7975         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
7976         in debugging printf.
7977
7978         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
7979
7980 2008-12-09  Doug Evans  <dje@google.com>
7981
7982         * linux-low.h (struct process_info): Delete member tid, unused.
7983         * thread-db.c (find_one_thread): Update.
7984         (maybe_attach_thread): Update.
7985
7986 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
7987
7988         * target.h (struct target_ops): Add qxfer_osdata member.
7989         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
7990         and dirent.h.
7991         (linux_qxfer_osdata): New functions.
7992         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
7993         callback.
7994         * server.c (handle_query): Handle "qXfer:osdata:read:".
7995         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
7996         (buffer_xml_printf): New functions.
7997         * server.h (struct buffer): New.
7998         (buffer_grow_str, buffer_grow_str0): New macros.
7999         (buffer_grow, buffer_free, buffer_init, buffer_finish)
8000         (buffer_xml_printf): Declare.
8001
8002 2008-11-24  Doug Evans  <dje@google.com>
8003
8004         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
8005
8006 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
8007
8008         * server.c (handle_v_run): Always use the supplied argument list.
8009
8010 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
8011
8012         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
8013         (xtensa_regmap_table): Add entry for scompare1.
8014
8015 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
8016
8017         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
8018         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
8019         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
8020         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
8021         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
8022         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
8023         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
8024         XML target descriptions.
8025         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
8026         when inferior is running on an ISA 2.05 or later processor.  Add
8027         special case to return offset for full 64-bit slot of FPSCR when
8028         in 32-bits.
8029
8030 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
8031
8032         * Makefile.in (SFILES, clean): Added sparc64 files.
8033         (reg-sparc64.o, reg-sparc64.c): New.
8034         * configure.srv (sparc*-*-linux*): New configuration.
8035         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
8036         syscall arguments for SPARC.
8037         (regsets_store_inferior_registers): Likewise.
8038         * linux-sparc-low.c: New file.
8039
8040 2008-10-21  Doug Evans  <dje@google.com>
8041
8042         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
8043         (READLINE_DIR,READLINE_DEP): Delete.
8044         (INTERNAL_CFLAGS): Update.
8045         (LINTFLAGS): Update.
8046
8047 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
8048
8049         * server.c (handle_v_run): If GDB didn't specify an argv, use the
8050         whole argv from the last run, not just argv[0].
8051
8052 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
8053
8054         * regcache.c (new_register_cache): Return NULL if the register
8055         cache size isn't known yet.
8056         (free_register_cache): Avoid dereferencing a NULL regcache.
8057
8058 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
8059
8060         * configure.srv: Merge MIPS and MIPS64.
8061
8062 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
8063
8064         * Makefile.in (uninstall): Apply $(EXEEXT) too.
8065
8066 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
8067
8068         * Makefile.in: Add required vsx dependencies.
8069
8070         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
8071         Declare init_registers_powerpc_vsx32l.
8072         Declare init_registers_powerpc_vsx64l.
8073         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
8074         (ppc_arch_setup): Check for VSX in hwcap.
8075         (ppc_fill_vsxregset): New function.
8076         (ppc_store_vsxregset): New function.
8077         Add new VSX entry in regset_info target_regsets.
8078
8079         * configure.srv: Add new VSX dependencies.
8080
8081 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
8082
8083         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
8084         (remote_open): Set or clear transport_is_reliable.
8085         (putpkt_binary): Don't expect acks in noack mode.
8086         (getpkt): Don't send ack/nac in noack mode.
8087         * server.c (handle_general_set): Handle QStartNoAckMode.
8088         (handle_query): If connected by tcp pass QStartNoAckMode+ in
8089         qSupported.
8090         (main): Reset noack_mode on every connection.
8091         * server.h (noack_mode): Declare.
8092
8093 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
8094
8095         * Makefile.in (GDBREPLAY_OBS): New variable.
8096         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
8097
8098 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
8099             Daniel Jacobowitz  <dan@codesourcery.com>
8100
8101         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
8102         (usr_store_inferior_registers): Likewise.
8103         (regsets_store_inferior_registers): Likewise.
8104
8105 2008-07-31  Rolf Jansen  <rj@surtec.com>
8106             Pedro Alves  <pedro@codesourcery.com>
8107
8108         * configure.ac: Check for memmem declaration.
8109         * server.c [HAVE_MALLOC_H]: Include malloc.h.
8110         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
8111         (disable_packet_qfThreadInfo): Unconditionally compile.
8112         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
8113         * configure, config.in: Regenerate.
8114
8115 2008-07-28  Doug Kwan  <dougkwan@google.com>
8116
8117         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
8118         (linux_write_memory): Remove declaration of errno.
8119
8120 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
8121
8122         * linux-low.c (handle_extended_wait): Do not use "status"
8123         variable uninitialized.
8124
8125 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
8126
8127         * server.c (handle_v_attach): Inhibit reporting dll changes.
8128
8129 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
8130
8131         * remote-utils.c (prepare_resume_reply): If requested, don't
8132         output "thread:TID" in the T stop reply.
8133
8134         * server.c (disable_packet_vCont, disable_packet_Tthread)
8135         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
8136         (handle_query): If requested, disable support for qC, qfThreadInfo
8137         and qsThreadInfo.
8138         (handle_v_requests): If requested, disable support for vCont.
8139         (gdbserver_show_disableable): New.
8140         (main): Handle --disable-packet and --disable-packet=LIST.
8141
8142         * server.h (disable_packet_vCont, disable_packet_Tthread)
8143         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
8144
8145 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
8146
8147         * server.c (gdbserver_usage): Mention --version.
8148
8149 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
8150
8151         * Makefile.in (gdbreplay.o): New rule.
8152
8153 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
8154
8155         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
8156         message, not gdbserver.
8157
8158 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
8159             Nathan Sidwell  <nathan@codesourcery.com>
8160             Joseph Myers  <joseph@codesourcery.com>
8161
8162         * acinclude.m4: Include ../../config/acx.m4.
8163         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
8164         * configure, config.in: Regenerate.
8165         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
8166         * server.c (gdbserver_version): Print PKGVERSION.
8167         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
8168         (main): Adjust gdbserver_usage calls.
8169         * gdbreplay.c (version, host_name): Add declarations.
8170         (gdbreplay_version, gdbreplay_usage): New.
8171         (main): Accept --version and --help options.
8172
8173 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
8174
8175         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
8176         (arm_breakpoint_at): Handle Thumb.
8177         (the_low_target): Add comment.
8178
8179 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
8180
8181         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
8182
8183 2008-05-09  Doug Evans  <dje@google.com>
8184
8185         * server.h (decode_search_memory_packet): Declare.
8186         * remote-utils.c (decode_search_memory_packet): New fn.
8187         * server.c (handle_search_memory_1): New fn.
8188         (handle_search_memory): New fn.
8189         (handle_query): Process qSearch:memory packets.
8190
8191 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
8192
8193         * regcache.c (registers_length): Remove.
8194         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
8195         full register packet.
8196         * regcache.h (registers_length): Remove prototype.
8197         * server.h (PBUFSIZ): Define to 16384.
8198
8199 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
8200
8201         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
8202         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
8203         powerpc-64l.o, and powerpc-altivec64l.o.
8204         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
8205         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
8206         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
8207         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
8208         rs6000/power-linux.xml, and rs6000/power64-linux.xml
8209         to srv_xmlfiles.
8210
8211         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
8212         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
8213         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
8214         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
8215         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
8216         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
8217         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
8218         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
8219         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
8220         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
8221         (clean): Update.
8222
8223         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
8224         (init_registers_powerpc_32l): ... this new prototype.
8225         (init_registers_powerpc_32): Remove, replace by ...
8226         (init_registers_powerpc_altivec32l): ... this new prototype.
8227         (init_registers_powerpc_e500): Remove, replace by ...
8228         (init_registers_powerpc_e500l): ... this new prototype.
8229         (init_registers_ppc64): Remove, replace by ...
8230         (init_registers_powerpc_64l): ... this new prototype.
8231         (init_registers_powerpc_64): Remove, replace by ...
8232         (init_registers_powerpc_altivec64l): ... this new prototype.
8233         (ppc_num_regs): Set to 73.
8234         (PT_ORIG_R3, PT_TRAP): Define if necessary.
8235         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
8236         (ppc_cannot_store_register): Handle orig_r3 and trap.
8237         (ppc_arch_setup): Update init_registers_... calls.
8238         (ppc_fill_gregset): Handle orig_r3 and trap.
8239
8240         * inferiors.c (clear_inferiors): Reset current_inferior.
8241
8242 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
8243
8244         * acinclude.m4: Add override.m4.
8245         * configure: Regenerate.
8246
8247 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
8248
8249         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
8250         initial call to init_register_ppc64.
8251
8252 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
8253
8254         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
8255         single powerpc*-*-linux* case.
8256         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
8257
8258 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
8259
8260         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
8261         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
8262         from reg_xmlfiles.
8263         * linux-ppc-low.c: Include <elf.h>.
8264         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
8265         (ppc_hwcap): New global variable.
8266         (ppc_regmap): Remove __SPE__ #ifdef sections.
8267         (ppc_regmap_e500): New global variable.
8268         (ppc_cannot_store_register): Update __SPE__ special case.
8269         (ppc_get_hwcap): New function.
8270         (ppc_arch_setup): Use it to determine whether inferior supports
8271         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
8272         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
8273         Do not access registers if target does not support AltiVec.
8274         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
8275         Do not access registers if target does not support SPE.
8276         (target_regsets): Unconditionally include AltiVec and SPE regsets.
8277
8278 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
8279
8280         * linux-low.c (disabled_regsets, num_regsets): New.
8281         (use_regsets_p): Delete.
8282         (linux_wait_for_process): Clear disabled_regsets.
8283         (regsets_fetch_inferior_registers): Check and set it.
8284         (regsets_store_inferior_registers): Likewise.
8285         (linux_fetch_registers, linux_store_registers): Do not use
8286         use_regsets_p.
8287         (initialize_low): Allocate disabled_regsets.
8288
8289 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
8290
8291         * Makefile.in (LIBOBJS): New.
8292         (OBS): Use LIBOBJS.
8293         (memmem.o): New rule.
8294         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
8295         * configure: Regenerated.
8296
8297 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
8298
8299         * server.c (handle_query): Never return "unsupported" for
8300         qXfer:features:read queries.
8301
8302 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
8303
8304         * server.c (get_features_xml): Fix inverted condition.
8305         (handle_query): Always support qXfer:feature:read.
8306
8307 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
8308
8309         * server.c (wrapper_argv): New.
8310         (start_inferior): Handle wrapper_argv.  If set, expect an extra
8311         trap.
8312         (gdbserver_usage): Document --wrapper.
8313         (main): Parse --wrapper.
8314
8315 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
8316
8317         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
8318         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
8319         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
8320         (ppc_set_pc): Likewise.
8321         (ppc_arch_setup): New function.
8322         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
8323         of collect_register.
8324         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
8325
8326 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
8327
8328         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
8329         instead of linux-ppc64-low.o.
8330         * linux-ppc64-low.c: Remove file.
8331         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
8332         (linux-ppc64-low.o): Remove rule.
8333
8334         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
8335         (init_registers_powerpc_64): Likewise.
8336         (ppc_regmap): Conditionally define depending on __powerpc64__.
8337         (ppc_cannot_store_register): Do not special-case "fpscr" when
8338         compiled on __powerpc64__.
8339         (ppc_collect_ptrace_register): New function.
8340         (ppc_supply_ptrace_register): New function.
8341         (ppc_breakpoint): Change type to "unsigned int".
8342         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
8343         (the_low_target): Conditionally provide initializers for the
8344         arch_setup member depending on __powerpc64__.  Install
8345         collect_ptrace_register and supply_ptrace_register members.
8346
8347 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
8348
8349         * regcache.h (gdbserver_xmltarget): Add extern declaration.
8350         * server.c (gdbserver_xmltarget): Define.
8351         (get_features_xml): Use it to replace "target.xml" and arch_string.
8352
8353         * configure.srv: Remove srv_xmltarget.  Add XML files that were
8354         mentioned there to srv_xmlfiles instead.  Remove conditional tests
8355         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
8356         srv_xmlfiles and srv_regobj to include all possible choices.
8357         * configure.ac (srv_xmltarget): Remove.
8358         (srv_xmlfiles): Do not add "target.xml".
8359         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
8360         checks for supplementary target information.
8361         * configure: Regenerate.
8362         * Makefile.in (XML_TARGET): Remove.
8363         (target.xml): Remove rule.
8364         (clean): Do not clean up target.xml.
8365         (.PRECIOUS): Do not mention target.xml.
8366
8367         * target.h (struct target_ops): Remove arch_string member.
8368         * linux-low.c (linux_arch_string): Remove.
8369         (linux_target_ops): Remove arch_string initializer.
8370         * linux-low.h (struct linux_target_ops): Remove arch_string member.
8371         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
8372         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
8373         * spu-low.c (spu_arch_string): Remove.
8374         (spu_target_ops): Remove arch_string initializer.
8375         * win32-low.c (win32_arch_string): Remove.
8376         (win32_target_ops): Remove arch_string initializer.
8377         * win32-low.h (struct win32_target_ops): Remove arch_string member.
8378         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
8379         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
8380
8381 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
8382
8383         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
8384         by collect_ptrace_register and supply_ptrace_register hooks.
8385         * linux-low.c (fetch_register): Use supply_ptrace_register callback
8386         instead of checking for the_low_target.left_pad_xfer.
8387         (usr_store_inferior_registers): Use collect_ptrace_register callback
8388         instead of checking for the_low_target.left_pad_xfer.
8389
8390         * linux-s390-low.c (s390_collect_ptrace_register): New function.
8391         (s390_supply_ptrace_register): Likewise.
8392         (s390_fill_gregset): Call s390_collect_ptrace_register.
8393         (the_low_target): Update.
8394
8395         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
8396         (ppc_supply_ptrace_register): Likewise.
8397         (the_low_target): Update.
8398
8399         * linux-i386-low.c (the_low_target): Update.
8400         * linux-x86-64-low.c (the_low_target): Update.
8401
8402 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
8403
8404         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
8405         reg-s390.o and reg-s390x.o.
8406
8407         * linux-low.c (new_inferior): New global variable.
8408         (linux_create_inferior, linux_attach): Set it.
8409         (linux_wait_for_process): Call the_low_target.arch_setup after the
8410         target has stopped for the first time.
8411         (initialize_low): Do not call the_low_target.arch_setup.
8412
8413         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
8414         (s390_set_pc): Likewise.
8415         (s390_arch_setup): New function.
8416         (the_low_target): Use s390_arch_setup as arch_setup routine.
8417
8418         * regcache.c (realloc_register_cache): New function.
8419         (set_register_cache): Call it for each existing regcache.
8420
8421 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
8422
8423         * server.h (init_registers): Remove prototype.
8424
8425         * linux-low.h (struct linux_target_ops): Add arch_setup field.
8426         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
8427         instead of init_registers ().
8428         * linux-arm-low.c (init_registers_arm): Add prototype.
8429         (init_registers_arm_with_iwmmxt): Likewise.
8430         (the_low_target): Add initializer for arch_setup field.
8431         * linux-cris-low.c (init_registers_cris): Add prototype.
8432         (the_low_target): Add initializer for arch_setup field.
8433         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
8434         (the_low_target): Add initializer for arch_setup field.
8435         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
8436         (the_low_target): Add initializer for arch_setup field.
8437         * linux-ia64-low.c (init_registers_ia64): Add prototype.
8438         (the_low_target): Add initializer for arch_setup field.
8439         * linux-m32r-low.c (init_registers_m32r): Add prototype.
8440         (the_low_target): Add initializer for arch_setup field.
8441         * linux-m68k-low.c (init_registers_m68k): Add prototype.
8442         (the_low_target): Add initializer for arch_setup field.
8443         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
8444         (init_registers_mips64_linux): Likewise.
8445         (the_low_target): Add initializer for arch_setup field.
8446         * linux-ppc-low.c (init_registers_ppc): Add prototype.
8447         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
8448         (the_low_target): Add initializer for arch_setup field.
8449         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
8450         (init_registers_powerpc_64): Likewise.
8451         (the_low_target): Add initializer for arch_setup field.
8452         * linux-s390-low.c (init_registers_s390): Add prototype.
8453         (init_registers_s390x): Likewise.
8454         (the_low_target): Add initializer for arch_setup field.
8455         * linux-sh-low.c (init_registers_sh): Add prototype.
8456         (the_low_target): Add initializer for arch_setup field.
8457         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
8458         (the_low_target): Add initializer for arch_setup field.
8459         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
8460         (the_low_target): Add initializer for arch_setup field.
8461
8462         * win32-low.h (struct win32_target_ops): Add arch_setup field.
8463         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
8464         instead of init_registers ().
8465         * win32-arm-low.c (init_registers_arm): Add prototype.
8466         (the_low_target): Add initializer for arch_setup field.
8467         * win32-i386-low.c (init_registers_i386): Add prototype.
8468         (the_low_target): Add initializer for arch_setup field.
8469
8470         * spu-low.c (init_registers_spu): Add prototype.
8471         (initialize_low): Call initialie_registers_spu () instead of
8472         initialize_registers ().
8473
8474 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
8475
8476         * server.c (handle_v_requests): When handling the vRun and vAttach
8477         packets, if already debugging a process, don't kill it.  Return an
8478         error instead.
8479
8480 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
8481
8482         * server.c (handle_query): Correct length check.
8483
8484 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
8485
8486         * win32-low.c (do_initial_child_stuff): Add process handle
8487         parameter.  Set current_process_handle and current_process_id from the
8488         parameters. Clear globals.
8489         (win32_create_inferior): Don't set current_process_handle and
8490         current_process_id here.  Instead pass them on the call to
8491         do_initial_child_stuff.
8492         (win32_attach): Likewise.
8493         (win32_clear_inferiors): New.
8494         (win32_kill): Don't close the current process handle or the
8495         current thread handle here.  Instead call win32_clear_inferiors.
8496         (win32_detach): Don't open a new handle to the process.  Call
8497         win32_clear_inferiors.
8498         (win32_join): Don't rely on current_process_handle; open a new
8499         handle using the process id.
8500         (win32_wait): Call win32_clear_inferiors when the inferior process
8501         has exited.
8502
8503 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
8504
8505         * server.c (monitor_show_help): Add "exit".
8506
8507 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
8508
8509         * Makefile.in (SFILES): Add linux-xtensa-low.c.
8510         (clean): Add reg-xtensa.c.
8511         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
8512         * configure.srv (xtensa*-*-linux*) New target.
8513         * linux-xtensa-low.c: New.
8514         * xtensa-xtregs.c: New.
8515
8516 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
8517
8518         * hostio.c: Don't include errno.h.
8519         (errno_to_fileio_errno): Move to hostio-errno.
8520         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
8521         error number outputting to the target->hostio_last_error callback.
8522         (hostio_packet_error): Use FILEIO_EINVAL directly.
8523         (handle_open, handle_pread, hostio_error, handle_unlink): Update
8524         calls to hostio_error.
8525         * hostio-errno.c: New.
8526         * server.h (hostio_last_error_from_errno): Declare.
8527         * target.h (target_ops): Add hostio_last_error member.
8528         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
8529         as hostio_last_error handler.
8530         * spu-low.c (spu_target_ops): Likewise.
8531         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
8532         (wince_hostio_last_error): New functions.
8533         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
8534         as hostio_last_error handler.
8535         (win32_target_ops) [!_WIN32_WCE]: Register
8536         hostio_last_error_from_errno as hostio_last_error handler.
8537         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
8538         (hostio-errno.o): New rule.
8539         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
8540         * configure.srv (srv_hostio_err_objs): New variable.  Default to
8541         hostio-errno.o.
8542         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
8543         * configure: Regenerate.
8544
8545 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
8546
8547         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
8548         (linux_kill, linux_detach): Clean up the process list.
8549         * remote-utils.c (remote_open): Improve port number parsing.
8550         (putpkt_binary, input_interrupt): Only send interrupts if the target
8551         is running.
8552         * server.c (extended_protocol): Make static.
8553         (attached): Define earlier.
8554         (exit_requested, response_needed, program_argv): New variables.
8555         (target_running): New.
8556         (start_inferior): Clear attached here.
8557         (attach_inferior): Set attached here.
8558         (require_running): Define.
8559         (handle_query): Use require_running and target_running.  Implement
8560         "monitor exit".
8561         (handle_v_attach, handle_v_run): New.
8562         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
8563         (gdbserver_usage): Update.
8564         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
8565         --attach along with other options or after the port.  Save
8566         program_argv.  Support no initial program.  Resynchronize
8567         communication with GDB after an error.  Handle "monitor exit".
8568         Use require_running and target_running.  Always allow the extended
8569         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
8570         restart in extended mode.
8571         * README: Refer to the GDB manual.  Update --attach usage.
8572
8573 2007-12-20  Andreas Schwab  <schwab@suse.de>
8574
8575         * linux-low.c (STACK_SIZE): Define.
8576         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
8577         (linux_test_for_tracefork): Likewise.
8578
8579 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
8580
8581         * linux-low.c (linux_wait_for_event): Update messages.  Do not
8582         reinsert auto-delete breakpoints.
8583         * mem-break.c (struct breakpoint): Change return type of handler to
8584         int.
8585         (set_breakpoint_at): Update handler type.
8586         (reinsert_breakpoint_handler): Return 1 instead of calling
8587         delete_breakpoint.
8588         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
8589         setting a new one.
8590         (check_breakpoints): Delete auto-delete breakpoints and return 2.
8591         * mem-break.h (set_breakpoint_at): Update handler type.
8592         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
8593         * win32-low.c (auto_delete_breakpoint): New.
8594         (get_child_debug_event): Use it.
8595
8596 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
8597
8598         * configure.ac: Check for pread and pwrite.
8599         * hostio.c (handle_pread): Fall back to lseek and read.
8600         (handle_pwrite): Fall back to lseek and write.
8601         * config.in, configure: Regenerated.
8602
8603 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
8604
8605         * server.c (myresume): Add own_buf argument.
8606         (main): Update calls.
8607
8608 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
8609
8610         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
8611         * remote-utils.c (remote_open): Do not call disable_async_io.
8612         (block_async_io): Delete.
8613         (unblock_async_io): Make static.
8614         (initialize_async_io): New.
8615         * server.c (handle_v_cont): Handle async I/O here.
8616         (myresume): Likewise.  Move other common resume tasks here...
8617         (main): ... from here.  Call initialize_async_io.  Disable async
8618         I/O before the main loop.
8619         * server.h (initialize_async_io): Declare.
8620         (block_async_io, unblock_async_io): Delete prototypes.
8621         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
8622
8623 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
8624
8625         * remote-utils.c (readchar): Allow binary data in received messages.
8626
8627 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
8628
8629         * win32-low.c (attaching): New global.
8630         (win32_create_inferior): Clear the `attaching' global.
8631         (win32_attach): Set the `attaching' global.
8632         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
8633         attaching.  Only set a breakpoint at the entry point if not
8634         attaching.
8635
8636 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
8637
8638         * server.c (main): Don't report dll events on the initial
8639         connection on attaches.
8640
8641 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
8642
8643         * server.c (main): Relax numerical bases supported for the pid of
8644         the --attach command line argument.
8645
8646 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
8647
8648         * win32-low.c (win32_attach): Call OpenProcess before
8649         DebugActiveProcess, not after.  Add last error output to error
8650         call.
8651
8652 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
8653
8654         * win32-low.c (win32_get_thread_context)
8655         (win32_set_thread_context): New functions.
8656         (thread_rec): Use win32_get_thread_context.
8657         (continue_one_thread, win32_resume): Use win32_set_thread_context.
8658         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
8659         field.
8660
8661 2007-12-03  Leo Zayas
8662             Pedro Alves  <pedro_alves@portugalmail.pt>
8663
8664         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
8665         global variables.
8666         (child_add_thread): Minor cleanup.
8667         (child_continue): Resume artificially suspended threads before
8668         calling ContinueDebugEvent.
8669         (suspend_one_thread): New.
8670         (fake_breakpoint_event): New.
8671         (get_child_debug_event): Change return type to int.  Check here if
8672         gdb sent an interrupt request.  If a soft interrupt was requested,
8673         fake a breakpoint event.  Return 0 if there is no event to handle,
8674         and 1 otherwise.
8675         (win32_wait): Don't check here if gdb sent an interrupt request.
8676         Ensure there is a valid event to handle.
8677         (win32_request_interrupt): Add soft interruption method as last
8678         resort.
8679
8680 2007-12-03  Leo Zayas
8681             Pedro Alves  <pedro_alves@portugalmail.pt>
8682
8683         * win32-low.h (win32_thread_info): Add descriptions to the
8684         structure members.  Replace `suspend_count' counter by a
8685         `suspended' flag.
8686         * win32-low.c (thread_rec): Update condition of when to get the
8687         context from the inferior.  Rely on ContextFlags being set if it
8688         has already been retrieved.  Only suspend the inferior thread if
8689         we haven't already.  Warn if that fails.
8690         (continue_one_thread): s/suspend_count/suspended/.  Only call
8691         ResumeThread once.  Warn if that fails.
8692
8693 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
8694
8695         * win32-low.c (win32_wait): Don't read from the inferior when it
8696         has already exited.
8697
8698 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
8699
8700         * Makefile.in (win32_low_h): New variable.
8701         (win32-low.o): Add dependency on $(win32_low_h).
8702         (win32-arm-low.o, win32-i386-low.o): New rules.
8703
8704 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
8705
8706         * hostio.c: Correct copyright year.
8707
8708 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
8709
8710         * Makefile.in (OBS): Add hostio.o.
8711         (hostio.o): New rule.
8712         * server.h (handle_vFile): Declare.
8713         * hostio.c: New file.
8714         * server.c (handle_v_requests): Take packet_len and new_packet_len
8715         for binary packets.  Call handle_vFile.
8716         (main): Update call to handle_v_requests.
8717
8718 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
8719
8720         * linux-low.c: Include <sched.h>.
8721
8722 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
8723
8724         * linux-low.c (linux_tracefork_grandchild): New.
8725         (linux_tracefork_child): Use clone.
8726         (linux_test_for_tracefork): Use clone; allocate and free a stack.
8727
8728 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
8729
8730         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
8731
8732 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
8733
8734         * linux-low.c (handle_extended_wait): Handle unexpected signals.
8735
8736 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
8737
8738         * inferiors.c (change_inferior_id): Delete.
8739         (add_pid_to_list, pull_pid_from_list): New.
8740         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
8741         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
8742         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
8743         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
8744         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
8745         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
8746         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
8747         (using_threads): Always set to 1.
8748         (handle_extended_wait): New.
8749         (add_process): Do not set TID.
8750         (linux_create_inferior): Set must_set_ptrace_flags.
8751         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
8752         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
8753         (linux_thread_alive): Rename TID argument to LWPID.
8754         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
8755         (linux_wait_for_event): Do not use TID or check using_threads.  Update
8756         call to dead_thread_notify.  Call handle_extended_wait.
8757         (linux_create_inferior): Use PTRACE_SETOPTIONS.
8758         (send_sigstop): Delete sigstop_sent.
8759         (wait_for_sigstop): Avoid TID.
8760         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
8761         (linux_test_for_tracefork): New.
8762         (linux_lookup_signals): Use thread_db_active and
8763         linux_supports_tracefork_flag.
8764         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
8765         * linux-low.h (get_process_thread): Avoid TID.
8766         (struct process_ifo): Move thread_known and tid to the end.  Remove
8767         sigstop_sent.
8768         (linux_attach_lwp, thread_db_init): Update prototypes.
8769         * server.h (change_inferior_id): Delete prototype.
8770         (add_pid_to_list, pull_pid_from_list): New prototypes.
8771         * thread-db.c (thread_db_use_events): New.
8772         (find_first_thread): Rename to...
8773         (find_one_thread): ...this.  Update callers and messages.  Do not
8774         call fatal.  Check thread_db_use_events.  Do not call
8775         change_inferior_id or new_thread_notify.
8776         (maybe_attach_thread): Update.  Do not call new_thread_notify.
8777         (thread_db_init): Set thread_db_use_events.  Check use_events.
8778         * utils.c (fatal, warning): Correct message prefix.
8779
8780 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
8781
8782         * Makefile.in (clean): Remove new files.
8783         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
8784         (powerpc-64.o, powerpc-64.c): New rules.
8785         * configure.srv: Use alternate register sets for powerpc64-*-linux*
8786         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
8787         with SPE.
8788         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
8789         SPE targets.
8790         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
8791         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
8792         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
8793         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
8794         (target_regsets): Add AltiVec and SPE register sets.
8795         * configure.ac: Check for AltiVec and SPE.
8796         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
8797         (ppc_fill_vrregset, ppc_store_vrregset): New.
8798         (target_regsets): Add AltiVec register set.
8799         * configure: Regenerated.
8800
8801 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
8802
8803         * linux-low.c (O_LARGEFILE): Define.
8804         (linux_read_memory): Use /proc/PID/mem.
8805         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
8806         * configure, config.in: Regenerated.
8807
8808 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
8809
8810         * linux-low.c (linux_wait_for_event): Do not pass signals while
8811         single-stepping.
8812
8813 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
8814
8815         * win32-low.c (create_process): New.
8816         (win32_create_inferior): Use create_process instead of
8817         CreateProcess.  If create_process failed retry appending an ".exe"
8818         suffix.  Store the GetLastError result immediatelly after
8819         create_process calls and use it on the call to error.
8820
8821 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
8822
8823         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
8824
8825 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
8826
8827         * configure.ac: Switch license to GPLv3.
8828
8829 2007-08-01  Michael Snyder  <msnyder@access-company.com>
8830
8831         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
8832
8833 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
8834
8835         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
8836         typedef.
8837         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
8838         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
8839         CloseToolhelp32Snapshot.
8840         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
8841         CloseToolhelp32Snapshot.
8842
8843 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
8844
8845         * server.c (main): Check for inferior exit before main loop.
8846
8847 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
8848
8849         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
8850         instead of on tmp_desc.
8851
8852 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
8853             Daniel Jacobowitz  <dan@codesourcery.com>
8854
8855         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
8856         (add_thread): Minor cleanups.
8857         (clear_inferiors): Move lower in the file.  Clear the DLL
8858         list.
8859         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
8860         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
8861         (xml_escape_text): New.
8862         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
8863         for qSupported.
8864         (handle_v_cont): Report errors.
8865         (gdbserver_version): Update.
8866         (main): Correct size of own_buf.  Do not report initial DLL events.
8867         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
8868         (unloaded_dll, xml_escape_text): New.
8869         * win32-low.c (enum target_waitkind): Update comments.
8870         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
8871         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
8872         (win32_EnumProcessModules, win32_GetModuleInformation)
8873         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
8874         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
8875         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
8876         (win32_Module32First, win32_Module32Next, load_toolhelp)
8877         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
8878         (get_child_debug_event): Handle DLL events.
8879         (win32_wait): Likewise.
8880
8881 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
8882
8883         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
8884         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
8885
8886 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
8887
8888         * win32-low.c (handle_output_debug_string): Ignore event if not
8889         waiting.
8890
8891 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
8892
8893         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
8894
8895 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
8896
8897         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
8898
8899 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
8900
8901         * inferiors.c (change_inferior_id): Add comment.
8902         * linux-low.c (check_removed_breakpoint): Add an early
8903         prototype.  Improve debug output.
8904         (linux_attach): Doc update.
8905         (linux_detach_one_process, linux_detach): Clean up before releasing
8906         each process.
8907         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
8908         * linux-low.h (struct process_info): Doc improvement.
8909         * mem-break.c (delete_all_breakpoints): New.
8910         * mem-break.h (delete_all_breakpoints): New prototype.
8911         * thread-db.c (find_first_thread): New.
8912         (thread_db_create_event): Call it instead of
8913         thread_db_find_new_threads.  Clean up unused variables.
8914         (maybe_attach_thread): Remove first thread handling.
8915         (thread_db_find_new_threads): Use find_first_thread.
8916         (thread_db_get_tls_address): Likewise.
8917
8918 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
8919
8920         * thread-db.c (thread_db_find_new_threads): Add prototype.
8921         (thread_db_create_event): Check for the main thread before adding
8922         a new thread.
8923         (maybe_attach_thread): Only enable event reporting if TID == 0.
8924         (thread_db_get_tls_address): Check for new threads.
8925
8926 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
8927
8928         * linux-low.c (linux_create_inferior): Try execv before execvp.
8929         * spu-low.c (spu_create_inferior): Likewise.
8930
8931 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
8932
8933         * linux-low.c (linux_create_inferior): Change execv to execvp.
8934         * spu-low.c (spu_create_inferior): Likewies.
8935
8936 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
8937
8938         * Makefile.in (clean): Clean new files instead of deleted ones.
8939         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
8940         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
8941         rules.
8942         * configure.srv: Specify XML files and new regformats for MIPS and
8943         MIPS64 GNU/Linux.
8944         * linux-mips-low.c (mips_num_regs): Set to only used registers.
8945         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
8946         an entry for the restart register.
8947         (mips_cannot_fetch_register, mips_cannot_store_register)
8948         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
8949         register names to match the XML descriptions.
8950         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
8951         restart register instead of $0.
8952
8953 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
8954             Markus Deuling  <deuling@de.ibm.com>
8955
8956         * remote-utils.c (decode_xfer_write): New function.
8957         * server.h (decode_xfer_write): Add prototype.
8958         * server.c (handle_query): Add PACKET_LEN argument.  Support
8959         qXfer:spu:read and qXfer:spu:write packets.
8960         (main): Pass packet_len to handle_query.
8961         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
8962         * target.h (target_ops): Add qxfer_spu.
8963
8964 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
8965
8966         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
8967         accessing non-seekable spufs files.
8968
8969 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
8970
8971         * server.c (handle_query): Add reply for qC packet.
8972
8973 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
8974             Leo Zayas  <lerele@champenstudios@com>
8975
8976         * server.h (check_remote_input_interrupt_request): New function.
8977         * remote_utils.c (INVALID_DESCRIPTOR): New define.
8978         (remote_desc): Initialize with INVALID_DESCRIPTOR.
8979         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
8980         (check_remote_input_interrupt_request): New function.
8981         * server.h (check_remote_input_interrupt_request): Declare.
8982         * win32-low.c (winapi_DebugBreakProcess,
8983         winapi_GenerateConsoleCtrlEvent): New typedefs.
8984         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
8985         to 250 ms.
8986         (win32_wait): Check for remote interrupt request
8987         with check_remote_input_interrupt_request.
8988         (win32_request_interrupt): New function.
8989         (win32_target_op): Set request_interrupt to win32_request_interrupt.
8990
8991 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
8992
8993         * win32-low.c (debug_registers_changed,
8994         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
8995         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
8996         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
8997         (thread_rec): Get context using the low target.
8998         (child_add_thread): Call thread_added on the low target,
8999         which does the same thing.
9000         (regptr): Delete.
9001         (do_initial_child_stuff): Remove debug registers references.
9002         Set context using the low target.  Resume threads after
9003         setting the contexts.
9004         (child_continue): Remove dead variable.  Remove debug
9005         registers references.
9006         (child_fetch_inferior_registers): Go through the low target.
9007         (do_child_store_inferior_registers): Remove.
9008         (child_store_inferior_registers): Go through the low target.
9009         (win32_resume): Remove debug registers references.
9010         Set context using the low target.
9011         (handle_exception): Change return type to void.  Don't record
9012         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
9013         first chance exception.
9014         (get_child_debug_event): Change return type to void.  Remove
9015         goto loop.  Always return after waiting for debug event.
9016         (win32_wait): Convert to switch statement.  Handle spurious
9017         events.
9018
9019         * win32-i386-low.c (debug_registers_changed,
9020         debug_registers_used): New.
9021         (initial_stuff): Rename to ...
9022         (i386_initial_stuff): ... this.  Clear debug registers
9023         state variables.
9024         (store_debug_registers): Delete.
9025         (i386_get_thread_context): New.
9026         (load_debug_registers): Delete.
9027         (i386_set_thread_context): New.
9028         (i386_thread_added): New.
9029         (single_step): Rename to ...
9030         (i386_single_step): ... this.
9031         (do_fetch_inferior_registers): Rename to ...
9032         (i386_fetch_inferior_register): ... this.
9033         (i386_store_inferior_register): New.
9034         (the_low_target): Adapt to new interface.
9035
9036         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
9037         (arm_get_thread_context): New.
9038         (arm_set_thread_context): New.
9039         (regptr): New.
9040         (do_fetch_inferior_registers): Rename to ...
9041         (arm_fetch_inferior_register): ... this.
9042         (arm_store_inferior_register): New.
9043         (arm_wince_breakpoint): Reimplement as unsigned long.
9044         (arm_wince_breakpoint_len): Define.
9045         (the_low_target): Adapt to new interface.
9046
9047         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
9048         load_debug_registers.  Add get_thread_context, set_thread_context,
9049         thread_added and store_inferior_register.  Rename
9050         fetch_inferior_registers to fetch_inferior_register.
9051         (regptr): Remove declaration.
9052
9053 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
9054
9055         * linux-low.c (linux_detach): Change return type to int.  Return 0.
9056         * spu-low.c (spu_detach): Likewise.
9057
9058 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
9059
9060         * target.h (target_ops): Change return type of detach to int.
9061         Add join.
9062         (join_inferior): New.
9063         * server.c (main): Don't skip detach support on mingw32.
9064         If the inferior doesn't support detaching return error.
9065         Call join_inferior instead of using waitpid.
9066         * linux-low.c (linux_join): New.
9067         (linux_target_op): Add linux_join.
9068         * spu-low.c (spu_join): New.
9069         (spu_target_ops): Add spu_join.
9070         * win32-low.c (win32_detach): Adapt to new interface.
9071         Reopen current_process_handle before detaching.  Issue a child
9072         resume before detaching.
9073         (win32_join): New.
9074         (win32_target_op): Add win32_join.
9075
9076 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
9077
9078         * win32-low.c (win32-attach): Fix return value.
9079         * target.h (target_ops): Describe ATTACH return values.
9080
9081 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
9082
9083         * win32-low.c (GETPROCADDRESS): Define.
9084         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
9085         (winapi_DebugSetProcessKillOnExit): Likewise.
9086         (win32_create_inferior): Force usage of ansi CreateProcessA.
9087         (win32_attach): Use GETPROCADDRESS.
9088         (win32_detach): Likewise.
9089
9090 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
9091
9092         * win32-low.c (win32_wait): Don't use WSTOPSIG.
9093
9094 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
9095
9096         * win32-low.c: Commit leftover changes from 2007-03-29.
9097
9098 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
9099
9100         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
9101         fields short instead of int.  Add explicit padding.
9102         (i387_cache_to_fsave): Remove unnecessary casts.
9103         (i387_fsave_to_cache): Doc fix.
9104         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
9105
9106 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
9107
9108         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
9109         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
9110
9111 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
9112
9113         * configure.srv (arm*-*-mingw32ce*): Move near the other
9114         arm targets.
9115
9116 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
9117
9118         * configure.ac: Add errno checking.
9119         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
9120         sys/file.h and malloc.h.
9121         (AC_CHECK_DECLS): Add perror.
9122         (srv_mingwce): Handle.
9123         * configure.srv (i[34567]86-*-cygwin*): Add
9124         win32-i386-low.o to srv_tgtobj.
9125         (i[34567]86-*-mingw*): Likewise.
9126         (arm*-*-mingw32ce*): Add case.
9127         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
9128         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
9129         [__MINGW32CE__] (strerror): New function.
9130         [__MINGW32CE__] (errno): Define to GetLastError.
9131         [__MINGW32CE__] (COUNTOF): New macro.
9132         (remote_open): Remove extra close call.
9133         * mem-break.c (delete_breakpoint_at): New function.
9134         * mem-break.h (delete_breakpoint_at): Declare.
9135         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
9136         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
9137         [USE_WIN32API] (read, write): Add char* casts.
9138         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
9139         * server.h: Include wincecompat.h on Windows CE.
9140         [HAVE_ERRNO_H]: Check.
9141         (perror): Declare if not declared.
9142         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
9143         (perror_with_name): Remove errno declaration.
9144         * wincecompat.h: New.
9145         * wincecompat.c: New.
9146         * win32-low.h: New.
9147         * win32-arm-low.c: New.
9148         * win32-i386-low.c: New.
9149         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
9150         (OUTMSG2): Make it safe.
9151         (_T): New macro.
9152         (COUNTOF): New macro.
9153         (NUM_REGS): Get it from the low target.
9154         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
9155         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
9156         (thread_rec): Let low target handle debug registers.
9157         (child_add_thread): Likewise.
9158         (child_init_thread_list): Likewise.
9159         (continue_one_thread): Likewise.
9160         (regptr): New.
9161         (do_child_fetch_inferior_registers): Move to ...
9162         * win32-i386-low.c: ... here, and rename to ...
9163         (do_fetch_inferior_registers): ... this.
9164         * win32-low.c (child_fetch_inferior_registers):
9165         Go through the low target.
9166         (do_child_store_inferior_registers): Use regptr.
9167         (strwinerror): New function.
9168         (win32_create_inferior): Handle Windows CE.
9169         Use strwinerror instead of strerror on Windows error
9170         codes.  Add program to the error output.
9171         Don't close the main thread handle on Windows CE.
9172         (win32_attach): Use coredll.dll on Windows CE.
9173         (win32_kill): Close current process and current
9174         thread handles.
9175         (win32_detach): Use coredll.dll on Windows CE.
9176         (win32_resume): Let low target handle debug registers, and
9177         step request.
9178         (handle_exception): Add/Remove initial breakpoint.  Avoid
9179         non-existant WSTOPSIG on Windows CE.
9180         (win32_read_inferior_memory): Cast to remove warning.
9181         (win32_arch_string): Go through the low target.
9182         (initialize_low): Call set_breakpoint_data with the low
9183         target's breakpoint.
9184         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
9185         FOP_REGNUM, mappings): Move to ...
9186         * win32-i386-low.c: ... here.
9187         * win32-low.c (win32_thread_info): Move to ...
9188         * win32-low.h: ... here.
9189         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
9190         win32-arm-low.c and wincecompat.c.
9191         (all:): Add $EXEEXT.
9192         (install-only:): Likewise.
9193         (gdbserver:): Likewise.
9194         (gdbreplay:): Likewise.
9195         * config.in: Regenerate.
9196         * configure: Regenerate.
9197
9198 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
9199
9200         * win32-low.c: Rename typedef thread_info to
9201         win32_thread_info throughout.
9202
9203 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
9204
9205         * win32-i386-low.c: Rename to ...
9206         * win32-low.c: ... this.
9207         * configure.srv: Replace win32-i386-low.o with win32-low.o.
9208         * Makefile.in: Likewise.
9209
9210 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
9211
9212         * remote-utils.c (monitor_output): Constify msg parameter.
9213         * server.h (monitor_output): Likewise.
9214         * win32-i386-low.c (handle_output_debug_string): New.
9215         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
9216         handle_output_debug_string.
9217         (get_child_debug_event): Likewise.
9218
9219 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
9220
9221         * server.c (main): Correct strtoul check.
9222
9223 2007-03-27  Jon Ringle  <jon@ringle.org>
9224
9225         * linux-low.c: Check __ARCH_HAS_MMU__ also.
9226
9227 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
9228
9229         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
9230
9231 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
9232
9233         * terminal.h: Check HAVE_SGTTY_H.
9234
9235 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
9236
9237         * remote-utils.c (remote_open): Print out the assigned port number.
9238
9239 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
9240
9241         * remote-utils.c (monitor_output): New function.
9242         * server.c (debug_threads): Define here.
9243         (monitor_show_help): New function.
9244         (handle_query): Handle qRcmd.
9245         (main): Do not handle 'd' packet.
9246         * server.h (debug_threads, remote_debug, monitor_output): Declare.
9247         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
9248         of debug_threads.
9249
9250 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
9251
9252         * Makefile.in (EXEEXT): New.
9253         (clean): Use $(EXEEXT).
9254
9255 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
9256
9257         * target.h (target_ops): Rename send_signal to request_interrupt,
9258         and remove enum target_signal parameter.
9259         * linux-low.c (linux_request_interrupt): Rename from
9260         linux_send_signal, and always send SIGINT.
9261         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
9262         and always send SIGINT.
9263         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
9264         of send_signal.
9265         (input_interrupt): Likewise.
9266
9267 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
9268
9269         * server.c (get_features_xml): Check if target implemented
9270         arch_string.
9271         * win32-i386-low.c (win32_arch_string): New.
9272         (win32_target_ops): Add win32_arch_string as arch_string member.
9273
9274 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
9275
9276         * spu-low.c (spu_arch_string): New.
9277         (spu_target_ops): Add spu_arch_string.
9278
9279 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
9280
9281         * remote-utils.c: Remove HAVE_TERMINAL_H check.
9282         * configure.ac: Do not check for terminal.h.
9283         * configure, config.in: Regenerated.
9284
9285 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
9286
9287         * Makefile.in (OBS): Add $(XML_BUILTIN).
9288         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
9289         (clean): Update.
9290         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
9291         (arm-with-iwmmxt.c): New.
9292         * config.in, configure: Regenerate.
9293         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
9294         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
9295         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
9296         (arm*-*-linux*): Add iWMMXt and regset support.
9297         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
9298         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
9299         (arm_store_wmmxregset, target_regsets): New.
9300         * server.c (get_features_xml): Take annex argument.  Check builtin
9301         XML documents.
9302         (handle_query): Handle multiple annexes.
9303
9304 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9305
9306         * remote-utils.c [USE_WIN32API] (read, write): Define.
9307         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
9308         write.
9309
9310 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
9311
9312         * linux-i386-low.c (the_low_target): Set arch_string.
9313         * linux-x86-64-low.c (the_low_target): Likewise.
9314         * linux-low.c (linux_arch_string): New.
9315         (linux_target_ops): Add it.
9316         * linux-low.h (struct linux_target_ops): Add arch_string.
9317         * server.c (write_qxfer_response): Use const void * for DATA.
9318         (get_features_xml): New.
9319         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
9320         * target.h (struct target_ops): Add arch_string method.
9321
9322 2007-01-03  Denis Pilat  <denis.pilat@st.com>
9323             Daniel Jacobowitz  <dan@codesourcery.com>
9324
9325         * linux-low.c (linux_kill): Handle being called with no threads.
9326         * win32-i386-low.c (win32_kill): Likewise.
9327         (get_child_debug_event): Clear current_process_handle.
9328
9329 2006-12-30  Denis PILAT  <denis.pilat@st.com>
9330             Daniel Jacobowitz  <dan@codesourcery.com>
9331
9332         * remote-utils.c (remote_open): Check the type of specified
9333         serial port devices before opening them.
9334         * server.c (main): Kill the inferior if an error occurs during
9335         the first remote_open.
9336
9337 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
9338
9339         * README: Update supported targets.
9340
9341 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
9342
9343         * Makefile.in (clean): Remove reg-mips64.c.
9344         (reg-mips64.c, reg-mips64.o): New rules.
9345         * configure.srv: Handle mips64.  Include regset support for mips.
9346         * linux-mips-low.c (union mips_register): New.
9347         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
9348         (mips_breakpoint, mips_breakpoint_at): Use int.
9349         (mips_collect_register, mips_supply_register)
9350         (mips_collect_register_32bit, mips_supply_register_32bit)
9351         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9352         (mips_store_fpregset, target_regsets): New.
9353         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
9354
9355 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
9356
9357         * configure.srv: Add target "spu*-*-*".
9358         * Makefile.in (clean): Remove reg-spu.c.
9359         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
9360         * spu-low.c: New file.
9361
9362 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
9363
9364         * configure.ac: Correct td_thr_tls_get_addr test.
9365         * configure: Regenerated.
9366
9367 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
9368
9369         * linux-low.c (linux_wait_for_event): Reformat.  Use the
9370         pass_signals array.
9371         * remote-utils.c (decode_address_to_semicolon): New.
9372         * server.c (pass_signals, handle_general_set): New.
9373         (handle_query): Mention QPassSignals for qSupported.
9374         (main): Call handle_general_set.
9375         * server.h (pass_signals, decode_address_to_semicolon): New.
9376
9377 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
9378
9379         * server.c (handle_query): Correct error handling for read_auxv.
9380
9381 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
9382
9383         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
9384         and srv_linux_thread_db to yes.
9385         * linux-s390-low.c (s390_fill_gregset): New function.
9386         (target_regsets): Define data structure.
9387
9388 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
9389
9390         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
9391         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
9392         * config.in, configure: Regenerated.
9393         * inferiors.c (gdb_id_to_thread): New function.
9394         (gdb_id_to_thread_id): Use it.
9395         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
9396         * linux-low.h (struct process_info): Add th member.
9397         (thread_db_get_tls_address): New prototype.
9398         * remote-utils.c (decode_address): Make non-static.
9399         * server.c (handle_query): Handle qGetTLSAddr.
9400         * server.h (gdb_id_to_thread, decode_address): New prototypes.
9401         * target.h (struct target_ops): Add get_tls_address.
9402         * thread-db.c (maybe_attach_thread): Save the thread handle.
9403         (thread_db_get_tls_address): New.
9404
9405 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
9406
9407         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
9408         (linux_resume_one_process): Take a siginfo_t *.  Update all
9409         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
9410         (struct pending_signals): Add a siginfo_t.
9411         (linux_wait_for_process): Always set last_status.
9412         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
9413         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
9414         * linux-low.h (struct process_info): Add last_status.
9415
9416 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
9417
9418         * remote-utils.c (try_rle): New function.
9419         (putpkt_binary): Use it.
9420
9421 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
9422
9423         * Makefile.in (clean): Clean reg-x86-64-linux.c.
9424         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
9425         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
9426         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
9427         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
9428         point registers.
9429
9430 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
9431
9432         * server.c (terminal_fd): New variable.
9433         (old_foreground_pgrp): Likewise.
9434         (restore_old_foreground_pgrp): New function.
9435         (start_inferior): Record the terminal file descriptor in terminal_fd
9436         and its original foreground group in old_foreground_pgrp.  Register
9437         restore_old_foreground_pgrp with atexit().
9438
9439 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
9440
9441         * server.c (handle_query): Correct qPart to qXfer.
9442
9443 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
9444
9445         * configure.ac: Check for more headers which are missing on
9446         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
9447         * configure.srv: Add Cygwin and mingw32.
9448         * remote-utils.c: Don't include headers unconditionally which
9449         are missing on mingw32.  Include <winsock.h> for mingw32.
9450         (remote_open): Adjust for mingw32 support.  Flush
9451         standard error after writing to it.
9452         (remote_close, putpkt_binary, input_interrupt, block_async_io)
9453         (unblock_async_io, enable_async_io, disable_async_io)
9454         (readchar, getpkt): Update for Winsock support.
9455         (prepare_resume_reply): Expect a protocol signal number.
9456         * server.c: Disable <sys/wait.h> on mingw32.
9457         (start_inferior): Adjust for mingw32 support.  Flush
9458         standard error after writing to it.
9459         (attach_inferior): Likewise.  Use protocol signal
9460         numbers.
9461         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
9462         and names.
9463         * win32-i386-low.c: New file.
9464         * Makefile.in (XM_CLIBS): Set.
9465         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
9466         (win32-i386-low.o): New dependency rule.
9467         * linux-low.c (linux_wait): Use target signal numbers.
9468         * target.h (struct target_ops): Doc fix.
9469         * server.h (target_signal_to_name): New prototype.
9470         * gdbreplay.c: Don't include headers unconditionally which
9471         are missing on mingw32.  Include <winsock.h> for mingw32.
9472         (remote_close, remote_open): Adjust for Winsock support.
9473         * configure, config.in: Regenerated.
9474
9475 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
9476
9477         * server.c (decode_xfer_read, write_qxfer_response): New.
9478         (handle_query): Take a packet length argument.  Handle
9479         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
9480         the qSupported response.
9481         (main): Update call to handle_query.
9482
9483 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
9484
9485         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
9486         (putpkt_binary): Renamed from putpkt and adjusted for binary
9487         data.
9488         (putpkt): New wrapper for putpkt_binary.
9489         (readchar): Don't mask off the high bit.
9490         (decode_X_packet): New function.
9491         * server.c (main): Call putpkt_binary if a handler sets the packet
9492         length.  Save the length of the incoming packet.  Handle 'X'.
9493         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
9494
9495 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
9496
9497         * server.c (handle_query): Handle qSupported.
9498
9499 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
9500
9501         * remote-utils.c (all_symbols_looked_up): New variable.
9502         (look_up_one_symbol): Check it.
9503         * server.h (look_up_one_symbol): New declaration.
9504         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
9505
9506 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
9507
9508         * Makefile.in (linux-arm-low.o): Update dependencies.
9509         * linux-arm-low.c: Include "gdb_proc_service.h".
9510         (PTRACE_GET_THREAD_AREA): Define.
9511         (ps_get_thread_area): New function.
9512
9513 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
9514
9515         * configure.srv (m68k*-*-uclinux*): New target.
9516         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
9517         (linux_resume_one_process): Remove extraneous cast.
9518         (linux_read_offsets): New.
9519         (linux_target_op): Add linux_read_offsets on mmuless systems.
9520         * server.c (handle_query): Add qOffsets logic.
9521         * target.h (struct target_ops): Add read_offsets.
9522
9523 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
9524
9525         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
9526         (PTRACE_GET_THREAD_AREA): Define.
9527         (ps_get_thread_area): New function.
9528         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
9529         (linux-x86-64-low.o): Update.
9530
9531 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
9532
9533         * configure.ac: Remove checks for prfpregset_t.
9534         * gdb_proc_service.h: New file.
9535         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
9536         new "gdb_proc_service.h".
9537         * proc-service.c: Likewise.
9538         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
9539         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
9540         * Makefile.in (gdb_proc_service_h): Updated.
9541         * configure, config.in: Regenerated.
9542
9543 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
9544
9545         * remote-utils.c (prepare_resume_reply): Move declaration
9546         of gdb_id_from_wait to the top of the block.
9547
9548 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
9549
9550         * linux-low.c (regsets_store_inferior_registers): Read the regset
9551         from the target before filling it.
9552
9553 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
9554
9555         * server.c (attach_inferior): Return SIGTRAP for a successful
9556         attach.
9557
9558 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
9559
9560         * Makefile.in (OBS): Add version.o.
9561         (STAGESTUFF): Delete.
9562         (version.o): Add dependencies.
9563         (version.c): Replace rule.
9564         (clean): Remove version.c.
9565         * server.c (gdbserver_version): New.
9566         (gdbserver_usage): Use printf.
9567         (main): Handle --version and --help.
9568         * server.h (version, host_name): Add declarations.
9569
9570 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
9571
9572         * linux-arm-low.c:
9573         * linux-arm-low.c:
9574         * inferiors.c:
9575         * i387-fp.h:
9576         * i387-fp.c:
9577         * gdbreplay.c:
9578         * regcache.c:
9579         * proc-service.c:
9580         * mem-break.h:
9581         * mem-break.c:
9582         * linux-x86-64-low.c:
9583         * linux-sh-low.c:
9584         * linux-s390-low.c:
9585         * linux-ppc64-low.c:
9586         * linux-ppc-low.c:
9587         * linux-mips-low.c:
9588         * linux-m68k-low.c:
9589         * linux-m32r-low.c:
9590         * linux-low.h:
9591         * linux-low.c:
9592         * linux-ia64-low.c:
9593         * linux-i386-low.c:
9594         * linux-crisv32-low.c:
9595         * thread-db.c:
9596         * terminal.h:
9597         * target.h:
9598         * target.c:
9599         * server.h:
9600         * server.c:
9601         * remote-utils.c:
9602         * regcache.h:
9603         * utils.c:
9604         * Makefile.in:
9605         * configure.ac:
9606         * gdbserver.1: Add (C) after Copyright.  Update the FSF
9607         address.
9608
9609 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
9610
9611         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
9612         (arm_breakpoint_at): Recognize both breakpoints.
9613         (the_low_target): Use the correct breakpoint instruction.
9614
9615 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
9616
9617         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
9618         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
9619         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
9620         (the_low_target): Update.
9621
9622 2005-10-25  Andreas Schwab  <schwab@suse.de>
9623
9624         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
9625
9626         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
9627         (ia64_num_regs): Reduce to 462.
9628
9629 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
9630
9631         * acinclude.m4: Correct quoting.
9632         * aclocal.m4: Regenerated.
9633
9634         Suggested by SZOKOVACS Robert <szo@ies.hu>:
9635         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
9636         (thread_db_init): Call thread_db_err_str.
9637         * configure.ac: Check for TD_VERSION.
9638         * config.in, configure: Regenerated.
9639
9640 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
9641
9642         * server.h (error, fatal, warning): Add ATTR_FORMAT.
9643
9644 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
9645
9646         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
9647         is not available.  Define HAVE_PTRACE_GETREGS if it is.
9648         * config.in, configure: Regenerated.
9649         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
9650         * linux-i386-low.c, linux-m68k-low.c: Update to use
9651         HAVE_PTRACE_GETREGS.
9652         * linux-low.c (regsets_fetch_inferior_registers)
9653         (regsets_store_inferior_registers): Only return 0 if we processed
9654         GENERAL_REGS.
9655         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
9656         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
9657
9658 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
9659
9660         * inferiors.c (struct thread_info): Add gdb_id.
9661         (add_thread): Add gdb_id argument.
9662         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
9663         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
9664         calls to add_thread.
9665         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
9666         * server.c (handle_query): Use thread_to_gdb_id.
9667         (handle_v_cont, main): Use gdb_id_to_thread_id.
9668         * server.h (add_thread): Update prototype.
9669         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
9670         prototypes.
9671
9672 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
9673
9674         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
9675         left-padded registers.
9676         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
9677         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
9678
9679 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
9680
9681         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
9682         * configure: Regenerate.
9683         * config.in: Regenerate.
9684         * server.h (NEED_DECLARATION_STRERROR):
9685         Replace with !HAVE_DECL_STRERROR.
9686
9687 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
9688
9689         * linux-low.c (linux_wait, linux_send_signal): Don't test
9690         an unsigned long variable for > 0 if it could be MAX_ULONG.
9691         * server.c (myresume): Likewise.
9692         * target.c (set_desired_inferior): Likewise.
9693
9694 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
9695
9696         * configure.ac: Simplify and improve check for socklen_t.
9697         * configure, config.in: Regenerate.
9698
9699 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
9700
9701         * acconfig.h: Remove.
9702         * configure.ac: Add a test for socklen_t.  Use three-argument
9703         AC_DEFINE throughout.
9704         * config.in: Regenerated using autoheader 2.59.
9705         * configure: Regenerated.
9706
9707         * gdbreplay.c (socklen_t): Provide a default.
9708         (remote_open): Use socklen_t.
9709         * remote-utils.c (socklen_t): Provide a default.
9710         (remote_open): Use socklen_t.
9711         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
9712         unsigned char.
9713
9714         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
9715         char for buffers.
9716         * linux-low.c (linux_read_memory, linux_write_memory)
9717         (linux_read_auxv): Likewise.
9718         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
9719         (check_mem_write): Likewise.
9720         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
9721         Likewise.
9722         * regcache.c (struct inferior_rgcache_data, registers_to_string)
9723         (registers_from_string, register_data): Likewise.
9724         * server.c (handle_query, main): Likewise.
9725         * server.h (convert_ascii_to_int, convert_int_to_ascii)
9726         (decode_M_packet): Likewise.
9727         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
9728         * target.h (struct target_ops): Update read_memory, write_memory,
9729         and read_auxv.
9730         (read_inferior_memory, write_inferior_memory): Update.
9731         * linux-low.h (struct linux_target_ops): Change type of breakpoint
9732         to unsigned char *.
9733         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
9734         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
9735         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
9736         linux-s390-low.c, linux-sh-low.c: Update for changes in
9737         read_inferior_memory and the_low_target->breakpoint.
9738
9739 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
9740
9741         * Makefile.in (SFILES): Add linux-ppc64-low.c.
9742         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
9743         * configure.srv: Add powerpc64-*-linux*.
9744         * linux-ppc64-low.c: New file.
9745
9746 2005-05-23  Orjan Friberg  <orjanf@axis.com>
9747
9748         * linux-cris-low.c: New file with support for CRIS.
9749         * linux-crisv32-low.c: Ditto for CRISv32.
9750         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
9751         (clean): Add reg-cris.c and reg-crisv32.c.
9752         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
9753         reg-crisv32.o, and reg-crisv32.c to make rules.
9754         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
9755         recognized targets.
9756
9757 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
9758
9759         * linux-low.c (fetch_register): Ensure buffer size is a multiple
9760         of sizeof (PTRACE_XFER_TYPE).
9761         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
9762
9763 2005-05-12  Orjan Friberg  <orjanf@axis.com>
9764
9765         * target.h (struct target_ops): Add insert_watchpoint,
9766         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
9767         pointers for hardware watchpoint support.
9768         * linux-low.h (struct linux_target_ops): Ditto.
9769         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
9770         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
9771         to linux_target_ops.
9772         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
9773         reply packet.
9774         * server.c (main): Recognize 'Z' and 'z' packets.
9775
9776 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
9777
9778         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
9779         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
9780         (the_low_target): Add new members.
9781
9782 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
9783
9784         * proc-service.c (ps_lgetregs): Search all_processes instead of
9785         all_threads.
9786
9787 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
9788
9789         * server.c (start_inferior): Change return type to int.
9790         (attach_inferior): Change sigptr to int *.
9791         (handle_v_cont, handle_v_requests): Change signal to int *.
9792         (main): Change signal to int.
9793
9794 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
9795
9796         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
9797         * configure.srv: Add m32r*-*-linux*.
9798         * linux-m32r-low.c: New file.
9799
9800 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
9801
9802         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
9803
9804 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
9805
9806         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
9807         Take unsigned long arguments for PIDs.
9808         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
9809         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
9810         (wait_for_sigstop, linux_resume_one_process)
9811         (regsets_fetch_inferior_registers, linux_send_signal)
9812         (linux_read_auxv): Likewise.  Update the types of variables holding
9813         PIDs.  Update format string specifiers.
9814         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
9815         * remote-utils.c (prepare_resume_reply): Likewise.
9816         * server.c (cont_thread, general_thread, step_thread)
9817         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
9818         unsigned long.
9819         (handle_query): Update format specifiers.
9820         (handle_v_cont, main): Use strtoul for thread IDs.
9821         * server.h (struct inferior_list_entry): Use unsigned long for ID.
9822         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
9823         (general_thread, step_thread, thread_from_wait)
9824         (old_thread_from_wait): Update.
9825         * target.h (struct thread_resume): Use unsigned long for THREAD.
9826         (struct target_ops): Use unsigned long for arguments to attach and
9827         thread_alive.
9828
9829 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
9830
9831         * acinclude.m4: Include bfd/bfd.m4 directly.
9832         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
9833         <agriffis@toolchain.org>.
9834         * aclocal.m4, configure: Regenerated.
9835
9836 2005-01-07  Andrew Cagney  <cagney@gnu.org>
9837
9838         * configure.ac: Rename configure.in, require autoconf 2.59.
9839         * configure: Re-generate.
9840
9841 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
9842
9843         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
9844         LIBS when finished.
9845         * aclocal.m4: Regenerated.
9846         * configure: Regenerated.
9847
9848 2004-11-21  Andreas Schwab  <schwab@suse.de>
9849
9850         * linux-m68k-low.c (m68k_num_gregs): Define.
9851         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
9852         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
9853         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
9854         (m68k_breakpoint_at): New.  Add to the_low_target.
9855
9856         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
9857         srv_linux_thread_db to yes.
9858
9859 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
9860
9861         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
9862         (ARCH_SET_FS): Likewise.
9863         (ARCH_GET_FS): Likewise.
9864         (ARCH_GET_GS): Likewise.
9865
9866 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
9867
9868         * linux-i386-low.c (ps_get_thread_area): New.
9869         * linux-x86-64-low.c (ps_get_thread_area): New.
9870         * linux-low.c: Include <sys/syscall.h>.
9871         (linux_kill_one_process): Don't kill the first thread here.
9872         (linux_kill): Kill the first thread here.
9873         (kill_lwp): New function.
9874         (send_sigstop, linux_send_signal): Use it.
9875         * proc-service.c: Clean up #ifdefs.
9876         (fpregset_info): Delete.
9877         (ps_lgetregs): Update and enable implementation.
9878         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
9879         implementations.
9880         * remote-utils.c (struct sym_cache, symbol_cache): New.
9881         (input_interrupt): Print a clearer message.
9882         (async_io_enabled): New variable.
9883         (enable_async_io, disable_async_io): Use it.  Update comments.
9884         (look_up_one_symbol): Use the symbol cache.
9885         * thread-db.c (thread_db_look_up_symbols): New function.
9886         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
9887
9888 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
9889
9890         * configure.in: Test for -rdynamic.
9891         * configure: Regenerated.
9892         * Makefile (INTERNAL_LDFLAGS): New.
9893         (gdbserver, gdbreplay): Use it.
9894
9895 2004-09-02  Andrew Cagney  <cagney@gnu.org>
9896
9897         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
9898
9899 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
9900
9901         * linux-low.c (linux_wait): Clear all_processes list also.
9902
9903 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
9904
9905         * linux-low.c: Include <errno.h>.  Remove extern declaration of
9906         errno.
9907
9908 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
9909
9910         * gdbreplay.c, server.h, utils.c: Update copyright years.
9911
9912 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
9913
9914         * server.c (main): Print child status or termination signal from
9915         variable 'signal', not 'sig'.
9916
9917 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
9918
9919         * linux-low.c (linux_read_memory): Change return type to
9920         int.  Check for and return error from ptrace().
9921         * target.c (read_inferior_memory): Change return type to int.  Pass
9922         back return status from the_target->read_memory().
9923         * target.h (struct target_ops): Adapt *read_memory() prototype.
9924         Update comment.
9925         (read_inferior_memory): Adapt prototype.
9926         * server.c (main): Return an error packet if
9927         read_inferior_memory() returns an error.
9928
9929 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
9930
9931         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
9932         Unify with other clean targets.
9933
9934 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
9935
9936         * server.c (handle_v_cont): Call set_desired_inferior.
9937
9938 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
9939
9940         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
9941
9942 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
9943
9944         * linux-low.c (linux_wait): Unblock async I/O.
9945         (linux_resume): Block and enable async I/O.
9946         * remote-utils.c (block_async_io, unblock_async_io): New functions.
9947         * server.h (block_async_io, unblock_async_io): Add prototypes.
9948
9949 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
9950
9951         * remote-utils.c (remote_open): Print a status notice after
9952         opening a TCP port.
9953         * server.c (attach_inferior): Print a status notice after
9954         attaching.
9955
9956 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
9957
9958         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
9959
9960 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
9961
9962         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
9963         error packet.
9964         * server.c, target.h: Update copyright years.
9965
9966 2004-02-25  Roland McGrath  <roland@redhat.com>
9967
9968         * target.h (struct target_ops): New member `read_auxv'.
9969         * server.c (handle_query): Handle qPart:auxv:read: query using that.
9970         * linux-low.c (linux_read_auxv): New function.
9971         (linux_target_ops): Initialize `read_auxv' member to that.
9972
9973 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
9974
9975         Committed by Jim Blandy  <jimb@redhat.com>.
9976
9977         * linux-s390-low.c (s390_num_regs): Update.
9978         (s390_regmap): Remove control registers.  Use __s390x__ predefine
9979         instead of GPR_SIZE to distiguish s390 and s390x targets.
9980
9981 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
9982
9983         * linux-low.c: Update copyright year.
9984         (check_removed_breakpoint): Clear pending_is_breakpoint.
9985         (linux_set_resume_request, linux_queue_one_thread)
9986         (resume_status_pending_p): New functions.
9987         (linux_continue_one_thread): Use process->resume.
9988         (linux_resume): Only resume threads if there are no pending events.
9989         * linux-low.h (struct process_info): Add resume request
9990         pointer.
9991
9992 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
9993
9994         * regcache.c (new_register_cache): Clear the allocated register
9995         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
9996
9997 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
9998
9999         * linux-low.c (linux_resume): Take a struct thread_resume *
10000         argument.
10001         (linux_wait): Update call.
10002         (resume_ptr): New static variable.
10003         (linux_continue_one_thread): Renamed from
10004         linux_continue_one_process.  Use resume_ptr.
10005         (linux_resume): Use linux_continue_one_thread.
10006         * server.c (handle_v_cont, handle_v_requests): New functions.
10007         (myresume): New function.
10008         (main): Handle 'v' case.
10009         * target.h (struct thread_resume): New type.
10010         (struct target_ops): Change argument of "resume" to struct
10011         thread_resume *.
10012         (myresume): Delete macro.
10013
10014 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
10015
10016         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
10017         (uninstall): Support DESTDIR.
10018
10019 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
10020
10021         * configure.srv: Add xscale*linux copy of arm*linux entry.
10022
10023 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
10024
10025         * linux-arm-low.c (arm_reinsert_addr): New function.
10026         (the_low_target): Add arm_reinsert_addr.
10027
10028 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
10029
10030         * mem-break.c: Remove whitespace at end of file.
10031
10032 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
10033
10034         * configure.in: Check whether we need to prototype strerror.
10035         * server.h: Optionally prototype strerror.
10036         * gdbreplay.c (perror_with_name): Use strerror.
10037         * linux-low.c (linux_attach_lwp): Use strerror.
10038         * utils.c (perror_with_name): Use strerror.
10039         * config.in, configure: Regenerated.
10040
10041 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
10042
10043         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
10044         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
10045
10046 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
10047
10048         * Makefile.in (SFILES): Update.
10049         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
10050         low-sun3.c: Remove files.
10051
10052 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
10053
10054         * linux-low.c: Move comment to linux_thread_alive where it belonged.
10055         (linux_detach_one_process, linux_detach): New functions.
10056         (linux_target_ops): Add linux_detach.
10057         * server.c (main): Handle 'D' packet.
10058         * target.h (struct target_ops): Add "detach" member.
10059         (detach_inferior): Define.
10060
10061 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
10062
10063         From Kelley Cook  <kelleycook@wideopenwest.com>:
10064         * configure.srv: Accept i[34567]86 variants.
10065
10066 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
10067
10068         * linux-low.c (linux_wait_for_event): Correct comment typos.
10069         (linux_resume_one_process): Call check_removed_breakpoint.
10070         (linux_send_signal): New function.
10071         (linux_target_ops): Add linux_send_signal.
10072         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
10073         of kill.
10074         * target.h (struct target_ops): Add send_signal.
10075
10076 2003-05-29  Jim Blandy  <jimb@redhat.com>
10077
10078         * linux-low.c (usr_store_inferior_registers): Transfer buf in
10079         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
10080         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
10081         away part of the register's value.
10082
10083 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
10084
10085         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
10086         (linux_wait_for_event, linux_init_signals): Likewise.
10087
10088 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
10089
10090         * configure.in: Check for stdlib.h.
10091         * configure: Regenerated.
10092         * config.in: Regenerated.
10093
10094 2003-01-04  Andreas Schwab  <schwab@suse.de>
10095
10096         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
10097
10098 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
10099
10100         * Makefile.in: Remove obsolete code.
10101
10102 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
10103
10104         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
10105         defined(PT_FPR0_HI).
10106
10107 2002-11-17  Stuart Hughes  <seh@zee2.com>
10108
10109         * linux-arm-low.c (arm_num_regs): Increase.
10110         (arm_regmap): Include status register.
10111
10112 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
10113
10114         * linux-low.c (register_addr): Remove incorrect -1 check.
10115
10116 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
10117
10118         * linux-low.c (linux_create_inferior): Call setpgid.  Return
10119         the new PID.
10120         (unstopped_p, linux_signal_pid): Remove.
10121         (linux_target_ops): Remove linux_signal_pid.
10122         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
10123         global instead of target method.
10124         * target.h (struct target_ops): Remove signal_pid.  Update comment
10125         for create_inferior.
10126         * server.c (signal_pid): New variable.
10127         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
10128         gdbserver.  Set the child to be the foreground process group.
10129         (attach_inferior): Set signal_pid.
10130
10131 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
10132
10133         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
10134
10135 2002-08-20  Jim Blandy  <jimb@redhat.com>
10136
10137         * Makefile.in (LDFLAGS): Allow the configure script to establish a
10138         default for this.
10139
10140 2002-08-01  Andrew Cagney  <cagney@redhat.com>
10141
10142         * Makefile.in: Make chill references obsolete.
10143
10144 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
10145
10146         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
10147         * configure: Regenerate.
10148         * config.in: Regenerate.
10149
10150 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
10151
10152         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
10153         (perror_with_name, remote_close, remote_open, expect, play): Static.
10154
10155 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
10156
10157         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
10158         byte offsets instead of an array of indexes.
10159         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
10160
10161 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
10162
10163         * regcache.c: Add comment.
10164
10165 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
10166
10167         * thread-db.c: New file.
10168         * proc-service.c: New file.
10169         * acinclude.m4: New file.
10170         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
10171         proc-service.o, and thread-db.o.
10172         (linux-low.o): Add USE_THREAD_DB.
10173         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
10174         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
10175         * aclocal.m4: Regenerated.
10176         * config.in: Regenerated.
10177         * configure: Regenerated.
10178         * configure.in: Check for proc_service.h, sys/procfs.h,
10179         thread_db.h, and linux/elf.h headrs.
10180         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
10181         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
10182         Check for -lthread_db and thread support.
10183         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
10184         PowerPC, and SuperH.
10185         * i387-fp.c: Constify arguments.
10186         * i387-fp.h: Likewise.
10187         * inferiors.c: (struct thread_info): Renamed from
10188         `struct inferior_info'.  Remove PID member.  Use generic inferior
10189         list header.  All uses updated.
10190         (inferiors, signal_pid): Removed.
10191         (all_threads): New variable.
10192         (get_thread): Define.
10193         (add_inferior_to_list): New function.
10194         (for_each_inferior): New function.
10195         (change_inferior_id): New function.
10196         (add_inferior): Removed.
10197         (remove_inferior): New function.
10198         (add_thread): New function.
10199         (free_one_thread): New function.
10200         (remove_thread): New function.
10201         (clear_inferiors): Use for_each_inferior and free_one_thread.
10202         (find_inferior): New function.
10203         (find_inferior_id): New function.
10204         (inferior_target_data): Update argument type.
10205         (set_inferior_target_data): Likewise.
10206         (inferior_regcache_data): Likewise.
10207         (set_inferior_regcache_data): Likewise.
10208         * linux-low.c (linux_bp_reinsert): Remove.
10209         (all_processes, stopping_threads, using_thrads)
10210         (struct pending_signals, debug_threads, pid_of): New.
10211         (inferior_pid): Replace with macro.
10212         (struct inferior_linux_data): Remove.
10213         (get_stop_pc, add_process): New functions.
10214         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
10215         Use add_process and add_thread.
10216         (linux_attach_lwp): New function, based on old linux_attach.  Use
10217         add_process and add_thread.  Set stop_expected for new threads.
10218         (linux_attach): New function.
10219         (linux_kill_one_process): New function.
10220         (linux_kill): Kill all LWPs.
10221         (linux_thread_alive): Use find_inferior_id.
10222         (check_removed_breakpoints, status_pending_p): New functions.
10223         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
10224         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
10225         struct for the found process.
10226         (linux_wait_for_event): New function.
10227         (linux_wait): Use it.  Support LWPs.
10228         (send_sigstop, wait_for_sigstop, stop_all_processes)
10229         (linux_resume_one_process, linux_continue_one_process): New functions.
10230         (linux_resume): Support LWPs.
10231         (REGISTER_RAW_SIZE): Remove.
10232         (fetch_register): Use register_size instead.  Call supply_register.
10233         (usr_store_inferior_registers): Likewise.  Call collect_register.
10234         Fix recursive case.
10235         (regsets_fetch_inferior_registers): Improve error message.
10236         (regsets_store_inferior_registers): Add debugging.
10237         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
10238         (unstopped_p, linux_signal_pid): New functions.
10239         (linux_target_ops): Add linux_signal_pid.
10240         (linux_init_signals): New function.
10241         (initialize_low): Call it.  Initialize using_threads.
10242         * regcache.c (inferior_regcache_data): Add valid
10243         flag.
10244         (get_regcache): Fetch registers lazily.  Add fetch argument
10245         and update all callers.
10246         (regcache_invalidate_one, regcache_invalidate): New
10247         functions.
10248         (new_register_cache): Renamed from create_register_cache.
10249         Return the new regcache.
10250         (free_register_cache): Change argument to a void *.
10251         (registers_to_string, registers_from_string): Call get_regcache
10252         with fetch flag set.
10253         (register_data): Make static.  Pass fetch flag to get_regcache.
10254         (supply_register): Call get_regcache with fetch flag clear.
10255         (collect_register): Call get_regcache with fetch flag set.
10256         (collect_register_as_string): New function.
10257         * regcache.h: Update.
10258         * remote-utils.c (putpkt): Flush after debug output and use
10259         stderr.
10260         Handle input interrupts while waiting for an ACK.
10261         (input_interrupt): Use signal_pid method.
10262         (getpkt): Flush after debug output and use stderr.
10263         (outreg): Use collect_register_as_string.
10264         (new_thread_notify, dead_thread_notify): New functions.
10265         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
10266         and general_thread.
10267         (look_up_one_symbol): Flush after debug output.
10268         * server.c (step_thread, server_waiting): New variables.
10269         (start_inferior): Don't use signal_pid.  Update call to mywait.
10270         (attach_inferior): Update call to mywait.
10271         (handle_query): Handle qfThreadInfo and qsThreadInfo.
10272         (main): Don't fetch/store registers explicitly.  Use
10273         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
10274         calls to mywait.
10275         * server.h: Update.
10276         (struct inferior_list, struct_inferior_list_entry): New.
10277         * target.c (set_desired_inferior): New.
10278         (write_inferior_memory): Constify.
10279         (mywait): New function.
10280         * target.h: Update.
10281         (struct target_ops): New signal_pid method.
10282         (mywait): Removed macro, added prototype.
10283
10284         * linux-low.h (regset_func): Removed.
10285         (regset_fill_func, regset_store_func): New.
10286         (enum regset_type): New.
10287         (struct regset_info): Add type field.  Use new operation types.
10288         (struct linux_target_ops): stop_pc renamed to get_pc.
10289         Add decr_pc_after_break and breakpoint_at.
10290         (get_process, get_thread_proess, get_process_thread)
10291         (strut process_info, all_processes, linux_attach_lwp)
10292         (thread_db_init): New.
10293
10294         * linux-arm-low.c (arm_get_pc, arm_set_pc,
10295         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
10296         (the_low_target): Add new members.
10297         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
10298         (i386_store_fpxregset): Constify.
10299         (target_regsets): Add new kind identifier.
10300         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
10301         (i386_set_pc): Add debugging.
10302         (i386_breakpoint_at): New function.
10303         (the_low_target): Add new members.
10304         * linux-mips-low.c (mips_get_pc, mips_set_pc)
10305         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
10306         (mips_breakpoint_at): New.
10307         (the_low_target): Add new members.
10308         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
10309         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
10310         (the_low_target): Add new members.
10311         * linux-sh-low.c (sh_get_pc, sh_set_pc)
10312         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
10313         (the_low_target): Add new members.
10314         * linux-x86-64-low.c (target_regsets): Add new kind
10315         identifier.
10316
10317 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
10318
10319         From Martin Pool <mbp@samba.org>:
10320         * server.c (gdbserver_usage): New function.
10321         (main): Call it.
10322
10323 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
10324
10325         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
10326         stop_at -> stop_pc.
10327
10328 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
10329
10330         * Makefile.in: Remove obsolete code.
10331
10332 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
10333
10334         * linux-low.c (regsets_fetch_inferior_registers),
10335         (regsets_store_inferior_registers): Removed cast to int from
10336         ptrace() calls.
10337         * regcache.h: Added declaration of struct inferior_info.
10338
10339 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
10340
10341         * inferiors.c (struct inferior_info): Add regcache_data.
10342         (add_inferior): Call create_register_cache.
10343         (clear_inferiors): Call free_register_cache.
10344         (inferior_regcache_data, set_inferior_regcache_data): New functions.
10345         * regcache.c (struct inferior_regcache_data): New.
10346         (registers): Remove.
10347         (get_regcache): New function.
10348         (create_register_cache, free_register_cache): New functions.
10349         (set_register_cache): Don't initialize the register cache here.
10350         (registers_to_string, registers_from_string, register_data): Call
10351         get_regcache.
10352         * regcache.h: Add prototypes.
10353         * server.h: Likewise.
10354
10355 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
10356
10357         * mem-break.c: New file.
10358         * mem-break.h: New file.
10359         * Makefile.in: Add mem-break.o rule; update server.h
10360         dependencies.
10361         * inferiors.c (struct inferior_info): Add target_data
10362         member.
10363         (clear_inferiors): Free target_data member if set.
10364         (inferior_target_data, set_inferior_target_data): New functions.
10365         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
10366         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
10367         * linux-low.c (linux_bp_reinsert): New variable.
10368         (struct inferior_linux_data): New.
10369         (linux_create_inferior): Use set_inferior_target_data.
10370         (linux_attach): Likewise.  Call add_inferior.
10371         (linux_wait_for_one_inferior): New function.
10372         (linux_wait): Call it.
10373         (linux_write_memory): Add const.
10374         (initialize_low): Call set_breakpoint_data.
10375         * linux-low.h (struct linux_target_ops): Add breakpoint
10376         handling members.
10377         * server.c (attach_inferior): Remove extra add_inferior
10378         call.
10379         * server.h: Include mem-break.h.  Update inferior.c
10380         prototypes.
10381         * target.c (read_inferior_memory)
10382         (write_inferior_memory): New functions.
10383         * target.h (read_inferior_memory)
10384         (write_inferior_memory): Change macros to prototypes.
10385         (struct target_ops): Update comments.  Add const to write_memory
10386         definition.
10387
10388 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
10389
10390         * linux-low.c (usr_store_inferior_registers): Support
10391         registers which are allowed to fail to store.
10392         * linux-low.h (linux_target_ops): Likewise.
10393         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
10394         (ppc_cannot_store_register): FPSCR may not be storable.
10395
10396 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
10397
10398         * server.h: Include <string.h> if HAVE_STRING_H.
10399         * ChangeLog: Correct paths in last ChangeLog entry.
10400
10401 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
10402
10403         * linux-low.h: Remove obsolete prototypes.
10404         (struct linux_target_ops): New.
10405         (extern the_low_target): New.
10406         * linux-low.c (num_regs, regmap): Remove declarations.
10407         (register_addr): Use the_low_target explicitly.
10408         (fetch_register): Likewise.
10409         (usr_fetch_inferior_registers): Likewise.
10410         (usr_store_inferior_registers): Likewise.
10411         * linux-arm-low.c (num_regs): Remove.
10412         (arm_num_regs): Define.
10413         (arm_regmap): Renamed from regmap, made static.
10414         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
10415         made static.
10416         (arm_cannot_store_register): Renamed from cannot_store_register,
10417         made static.
10418         (the_low_target): New.
10419         * linux-i386-low.c (num_regs): Remove.
10420         (i386_num_regs): Define.
10421         (i386_regmap): Renamed from regmap, made static.
10422         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
10423         made static.
10424         (i386_cannot_store_register): Renamed from cannot_store_register,
10425         made static.
10426         (the_low_target): New.
10427         * linux-ia64-low.c (num_regs): Remove.
10428         (ia64_num_regs): Define.
10429         (ia64_regmap): Renamed from regmap, made static.
10430         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
10431         made static.
10432         (ia64_cannot_store_register): Renamed from cannot_store_register,
10433         made static.
10434         (the_low_target): New.
10435         * linux-m68k-low.c (num_regs): Remove.
10436         (m68k_num_regs): Define.
10437         (m68k_regmap): Renamed from regmap, made static.
10438         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
10439         made static.
10440         (m68k_cannot_store_register): Renamed from cannot_store_register,
10441         made static.
10442         (the_low_target): New.
10443         * linux-mips-low.c (num_regs): Remove.
10444         (mips_num_regs): Define.
10445         (mips_regmap): Renamed from regmap, made static.
10446         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
10447         made static.
10448         (mips_cannot_store_register): Renamed from cannot_store_register,
10449         made static.
10450         (the_low_target): New.
10451         * linux-ppc-low.c (num_regs): Remove.
10452         (ppc_num_regs): Define.
10453         (ppc_regmap): Renamed from regmap, made static.
10454         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
10455         made static.
10456         (ppc_cannot_store_register): Renamed from cannot_store_register,
10457         made static.
10458         (the_low_target): New.
10459         * linux-s390-low.c (num_regs): Remove.
10460         (s390_num_regs): Define.
10461         (s390_regmap): Renamed from regmap, made static.
10462         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
10463         made static.
10464         (s390_cannot_store_register): Renamed from cannot_store_register,
10465         made static.
10466         (the_low_target): New.
10467         * linux-sh-low.c (num_regs): Remove.
10468         (sh_num_regs): Define.
10469         (sh_regmap): Renamed from regmap, made static.
10470         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
10471         made static.
10472         (sh_cannot_store_register): Renamed from cannot_store_register,
10473         made static.
10474         (the_low_target): New.
10475         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
10476         (the_low_target): New.
10477
10478 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
10479
10480         * Makefile.in: Add stamp-h target.
10481         * configure.in: Create stamp-h.
10482         * configure: Regenerated.
10483
10484 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
10485
10486         * inferiors.c: New file.
10487         * target.c: New file.
10488         * target.h: New file.
10489         * Makefile.in:  Add target.o and inferiors.o.  Update
10490         dependencies.
10491         * linux-low.c (inferior_pid): New static variable,
10492         moved from server.c.
10493         (linux_create_inferior): Renamed from create_inferior.
10494         Call add_inferior.  Return 0 on success instead of a PID.
10495         (linux_attach): Renamed from myattach.
10496         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
10497         (linux_thread_alive): Renamed from mythread_alive.
10498         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
10499         child dies.
10500         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
10501         (regsets_store_inferior_registers): Correct error message.
10502         Add missing ``return 0''.
10503         (linux_fetch_registers): Renamed from fetch_inferior_registers.
10504         (linux_store_registers): Renamed from store_inferior_registers.
10505         (linux_read_memory): Renamed from read_inferior_memory.
10506         (linux_write_memory): Renamed from write_inferior_memory.
10507         (linux_target_ops): New structure.
10508         (initialize_low): Call set_target_ops ().
10509         * remote-utils.c (unhexify): New function.
10510         (hexify): New function.
10511         (input_interrupt): Send signals to ``signal_pid''.
10512         * server.c (inferior_pid): Remove.
10513         (start_inferior): Update create_inferior call.
10514         (attach_inferior): Call add_inferior.
10515         (handle_query): New function.
10516         (main): Call handle_query for `q' packets.
10517         * server.h: Include "target.h".  Remove obsolete prototypes.
10518         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
10519
10520 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
10521
10522         * Makefile.in: Add WARN_CFLAGS.  Update configury
10523         dependencies.
10524         * configure.in: Check for <string.h>
10525         * configure: Regenerate.
10526         * config.in: Regenerate.
10527         * gdbreplay.c: Include needed system headers.
10528         (remote_open): Remove strchr prototype.
10529         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
10530         * regcache.c (supply_register): Change buf argument to const void *.
10531         (supply_register_by_name): Likewise.
10532         (collect_register): Change buf argument to void *.
10533         (collect_register_by_name): Likewise.
10534         * regcache.h: Add missing prototypes.
10535         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
10536         * server.c (handle_query): New function.
10537         (attached): New static variable, moved out of main.
10538         (main): Quiet longjmp clobber warnings.
10539         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
10540         * utils.c (error): Remove NORETURN.
10541         (fatal): Likewise.