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