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