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