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