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