Update copyright year in version of output (gdb/gdbserver/gdbreplay)
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
2
3         * server.c (gdbserver_version): Update copyright year in version
4         output.
5         * gdbreplay.c (gdbreplay_version): Ditto.
6
7 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
8
9         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
10         * linux-bfin-low.c: New file.
11         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
12         PT_DATA_ADDR for BFIN targets.
13         * Makefile.in (SFILES): Add linux-bfin-low.c.
14         (clean): Remove reg-bfin.c.
15         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
16         * README: Mention supported Blackfin targets.
17
18 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
19
20         * .gitignore: New file.
21
22 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
23
24         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
25
26 2010-10-22  Jie Zhang  <jie@codesourcery.com>
27
28         * Makefile.in: Add FLAGS_TO_PASS variable.
29         (install): Remove dependency of install-only and recursively
30         invoke make for install-only.
31
32 2010-10-04  Doug Evans  <dje@google.com>
33
34         * Makefile.in (uninstall): Use $(DESTDIR).
35
36 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
37
38         PR gdb/11842
39
40         * linux-x86-low.c (compat_siginfo_from_siginfo)
41         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
42         si_code is < 0.  Check for si_code == SI_TIMER before checking for
43         si_code < 0.
44
45 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
46
47         * lynx-i386-low.c: New file.
48         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
49
50 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
51
52         * lynx-low.c (ptrace_request_to_str): Remove handling for
53         request values that have been removed in LynxOS 5.x.
54
55 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
56
57         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
58         <ptrace.h>
59
60 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
61
62         * configure.ac: Add --enable-inprocess-agent option.
63         * configure: Rebuilt.
64
65 2010-09-06  Yao Qi  <yao@codesourcery.com>
66
67         * linux-low.c (linux_kill): Remove unused variable.
68         (linux_stabilize_threads): Likewise.
69         * server.c (start_inferior): Likewise.
70         (queue_stop_reply_callback): Likewise.
71         * tracepoint.c (do_action_at_tracepoint): Likewise.
72
73 2010-09-06  Yao Qi  <yao@codesourcery.com>
74
75         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
76         on return.
77
78 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
79
80         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
81
82 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
83
84         * Makefile.in (install-only): Replace $IPA_DEPFILES with
85         "$(IPA_DEPFILES)".
86
87 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
88
89         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
90         gdbserver/lynx-ppc-low.c: New files.
91         * Makefile.in (lynx_low_h): New variable.
92         (lynx-low.o, lynx-ppc-low.o): New rules.
93         * configure.ac: On LynxOS, link with -lnetinet.
94         * configure.srv: Add handling of powerpc-*-lynxos* targets.
95         * configure: regenerate.
96
97 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
98
99         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
100         * configure.ac: Add check for vasprintf and vsnprintf.
101         * configure, config.in: Regenerate.
102         * server.h (vasprintf, vsnprintf): Add conditional declarations.
103
104 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
105
106         * gdbreplay.c: Move include of alloca.h up, next to include of
107         malloc.h.
108         * server.h: Add include of malloc.h.
109         * mem-break.c: Remove include of malloc.h.
110         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
111
112 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
113
114         * Makefile.in (memmem.o): Build with -Wno-error.
115
116 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
117
118         * utils.c (xsnprintf): Make non-static.
119         * server.h: Add xsnprintf declaration.
120         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
121         replace calls to snprintf by calls to xsnprintf throughout.
122
123 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
124
125         * configure.ac: Add configure check for alloca.
126         * configure, config.in: Regenerate.
127         * server.h: Include alloca.h if it exists.
128         * gdbreplay.c: Include alloca.h if it exists.
129
130 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
131
132         * linux-low.c (__SIGRTMIN): Define if not already defined.
133         (linux_create_inferior): Check for __ANDROID__ rather than
134         __SIGRTMIN.
135         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
136         are already deferred.
137         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
138         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
139         stopped and already has a pending signal to report.
140         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
141         a pending signal to report or is moving out of a jump pad.
142         (linux_init_signals): Check for __ANDROID__ rather than
143         __SIGRTMIN.
144
145 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
146
147         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
148         debug_threads check.  Avoid a linear search when not doing debug
149         output.
150
151 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
152
153         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
154         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
155         (struct file_handler) <fd>: Change type to gdb_fildes_t.
156         (process_event): Change local fd's type to gdb_fildes_t.
157         (create_file_handler): Adjust prototype.
158         (delete_file_handler): Adjust prototype.
159         (handle_file_event): Adjust prototype.  Use pfildes.
160         (create_file_event): Adjsut prototype.
161         * remote-utils.c (remote_desc, listen_desc): Change type to
162         gdb_fildes_t.
163         * server.h: New gdb_fildes_t typedef.
164         [USE_WIN32API]: Include winsock2.h.
165         (delete_file_handler, add_file_handler): Adjust prototypes.
166         (pfildes): Declare.
167         * utils.c (pfildes): New.
168
169 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
170
171         * configure.ac (build_warnings): Add -Wno-char-subscripts.
172         * configure: Regenerate.
173
174 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
175
176         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
177         (linux_done_accessing_memory): ... this.
178         (linux_target_ops): Adjust.
179         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
180         * nto-low.c (nto_target_ops): Adjust comment.
181         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
182         * spu-low.c (spu_target_ops): Adjust comment.
183         * target.h (target_ops): Rename unprepare_to_access_memory field
184         to done_accessing_memory.
185         (unprepare_to_access_memory): Rename to ...
186         (done_accessing_memory): ... this.
187
188 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
189
190         * linux-low.c (linux_prepare_to_access_memory): New.
191         (linux_unprepare_to_access_memory): New.
192         (linux_target_ops): Install them.
193         * server.c (read_memory): Rename to ...
194         (gdb_read_memory): ... this.  Use
195         prepare_to_access_memory/prepare_to_access_memory.
196         (write_memory): Rename to ...
197         (gdb_write_memory): ... this.  Use
198         prepare_to_access_memory/prepare_to_access_memory.
199         (handle_search_memory_1): Adjust.
200         (process_serial_event): Adjust.
201         * target.h (struct target_ops): New fields
202         prepare_to_access_memory and unprepare_to_access_memory.
203         (prepare_to_access_memory, unprepare_to_access_memory): New.
204         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
205         prepare_to_access_memory/prepare_to_access_memory.
206         * nto-low.c (nto_target_ops): Adjust.
207         * spu-low.c (spu_target_ops): Adjust.
208         * win32-low.c (win32_target_ops): Adjust.
209
210 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
211
212         * Makefile.in (WARN_CFLAGS): Get it from configure.
213         (WERROR_CFLAGS): New.
214         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
215         * configure.ac: Introduce --enable-werror, which adds -Werror to
216         the compiler command line.  Enabled by default.  Disable with
217         --disable-werror.  Add -Wdeclaration-after-statement
218         Wpointer-arith and -Wformat-nonliteral to warning flags.
219         * configure: Regenerate.
220
221 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
222
223         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
224
225 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
226
227         * gdbreplay.c (remote_error): New.
228         (gdbchar): New.
229         (expect): Use gdbchar.  Check for error reading from GDB.
230         Clarify sync error output.
231         (play): Check for errors writing to GDB.
232         * linux-low.c (sigchld_handler): Really ignore `write' errors.
233         * remote-utils.c (getpkt): Check for errors writing to the remote
234         descriptor.
235
236 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
237
238         * linux-low.c (linux_wait_1): Move non-debugging code out of
239         `debug_threads' control.
240
241 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
242
243         * linux-low.c (linux_wait_1): Don't set last_status here.
244         * server.c (push_event, queue_stop_reply_callback): Assert we're
245         not pushing a TARGET_WAITKIND_IGNORE event.
246         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
247         (myresume, handle_target_event): Set the thread's last_resume_kind
248         and last_status from the target returned status.
249
250 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
251
252         PR threads/10729
253
254         * linux-x86-low.c (update_debug_registers_callback): New.
255         (i386_dr_low_set_addr): Use it.
256         (i386_dr_low_get_addr): New.
257         (i386_dr_low_set_control): Use update_debug_registers_callback.
258         (i386_dr_low_get_control): New.
259         (i386_dr_low_get_status): Adjust.
260         * linux-low.c (linux_stop_lwp): New.
261         * linux-low.h (linux_stop_lwp): Declare.
262
263         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
264         argument instead of a i386_debug_reg_state.
265         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
266         a i386_debug_reg_state.
267         (i386_insert_aligned_watchpoint): Adjust.
268         (i386_remove_aligned_watchpoint): Adjust.
269         (i386_low_stopped_data_address): Read the debug registers from the
270         inferior instead of from the mirrors.
271         * i386-low.h (struct i386_debug_reg_state): Extend comment.
272         (i386_dr_low_get_addr): Declare.
273         (i386_dr_low_get_control): Declare.
274         (i386_dr_low_get_status): Change prototype.
275
276         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
277         (i386_dr_low_get_addr): New.
278         (i386_dr_low_get_control): New.
279         (i386_dr_low_get_status): Adjust prototype.  Return
280         dr_status_mirror.
281         (i386_initial_stuff): Clear dr_status_mirror and
282         dr_control_mirror.
283         (i386_get_thread_context): Adjust.
284         (i386_set_thread_context): Adjust.
285         (i386_thread_added): Adjust.
286
287 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
288
289         * linux-low.h (linux_thread_area): Delete declaration.
290
291 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
292
293         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
294         after its termination.
295
296 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
297
298         * linux-low.c (gdb_wants_lwp_stopped): Delete.
299         (gdb_wants_all_stopped): Delete.
300         (linux_wait_1): Don't call them.
301         * server.c (handle_v_cont): Tag all threads as want-stopped.
302         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
303         stopped as "client-wants-stopped".
304
305 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
306
307         * Makefile.in (signals_h): New.
308         (server_h): Depend on it.
309         (server.o): Don't depend on $(signals_def).
310         (signals.o): Depend on $(signals_def).
311
312 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
313
314         * Makefile.in (signals_def): New.
315         (server_h): Append include/gdb/signals.h and signals_def.
316         (server.o): Append signals_def.
317
318 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
319
320         * server.c (handle_target_event): Use target_signal_to_host for
321         resume_info.sig initialization.
322         * target.h (struct thread_resume) <sig>: New comment.
323
324 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
325
326         * server.c (handle_query): strcpy() the returned string from paddress()
327         instead of sprintf().
328         * utils.c (paddress): Return phex_nz().
329
330 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
331
332         * server.c (handle_v_cont): Call mourn_inferior if process
333         just exited.
334         (myresume): Likewise.
335
336 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
337
338         Static tracepoints, and integration with UST.
339
340         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
341         * mem-break.c (uninsert_all_breakpoints)
342         (reinsert_all_breakpoints): New.
343         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
344         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
345         (gdb_agent_ust_loaded, helper_thread_id)
346         (gdb_agent_helper_thread_id): New macros.
347         (struct ipa_sym_addresses): Add addr_ust_loaded,
348         addr_helper_thread_id, addr_cmd_buf.
349         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
350         (in_process_agent_loaded_ust): New.
351         (write_e_ust_not_loaded): New.
352         (maybe_write_ipa_ust_not_loaded): New.
353         (struct collect_static_trace_data_action): New.
354         (enum tracepoint_type) <static_tracepoint>: New.
355         (struct tracepoint) <handle>: Mention static tracepoints.
356         (struct static_tracepoint_ctx): New.
357         (CMD_BUF_SIZE): New.
358         (add_tracepoint_action): Handle static tracepoint actions.
359         (unprobe_marker_at): New.
360         (clear_installed_tracepoints): Handle static tracepoints.
361         (cmd_qtdp): Handle static tracepoints.
362         (probe_marker_at): New.
363         (cmd_qtstart): Handle static tracepoints.
364         (response_tracepoint): Handle static tracepoints.
365         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
366         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
367         (get_context_regcache): Handle static tracepoints.
368         (do_action_at_tracepoint): Handle static tracepoint actions.
369         (traceframe_find_block_type): Handle static trace data blocks.
370         (traceframe_read_sdata): New.
371         (download_tracepoints): Download static tracepoint actions.
372         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
373         (GDB_PROBE_NAME): New.
374         (ust_ops): New.
375         (GET_UST_SYM): New.
376         (USTF): New.
377         (dlsym_ust): New.
378         (ust_marker_to_static_tracepoint): New.
379         (gdb_probe): New.
380         (collect_ust_data_at_tracepoint): New.
381         (gdb_ust_probe): New.
382         (UNIX_PATH_MAX, SOCK_DIR): New.
383         (gdb_ust_connect_sync_socket): New.
384         (resume_thread, stop_thread): New.
385         (run_inferior_command): New.
386         (init_named_socket): New.
387         (gdb_ust_socket_init): New.
388         (cstr_to_hexstr): New.
389         (next_st): New.
390         (first_marker, next_marker): New.
391         (response_ust_marker): New.
392         (cmd_qtfstm, cmd_qtsstm): New.
393         (unprobe_marker_at, probe_marker_at): New.
394         (cmd_qtstmat, gdb_ust_thread): New.
395         (gdb_ust_init): New.
396         (initialize_tracepoint_ftlib): Call gdb_ust_init.
397         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
398         (ST_REGENTRY): New.
399         (x86_64_st_collect_regmap): New.
400         (X86_64_NUM_ST_COLLECT_GREGS): New.
401         (AMD64_RIP_REGNUM): New.
402         (supply_static_tracepoint_registers): New.
403         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
404         (ST_REGENTRY): New.
405         (i386_st_collect_regmap): New.
406         (i386_NUM_ST_COLLECT_GREGS): New.
407         (supply_static_tracepoint_registers): New.
408         * server.c (handle_query): Handle qXfer:statictrace:read.
409         <qSupported>: Report support for StaticTracepoints, and
410         qXfer:statictrace:read features.
411         * server.h (traceframe_read_sdata)
412         (supply_static_tracepoint_registers): Declare.
413         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
414         (unpack_varlen_hex): Include in IPA build.
415         * Makefile.in (ustlibs, ustinc): New.
416         (IPA_OBJS): Add remote-utils-ipa.o.
417         ($(IPA_LIB)): Link -ldl and -lpthread.
418         (UST_CFLAGS): New.
419         (IPAGENT_CFLAGS): Add UST_CFLAGS.
420         * config.in, configure: Regenerate.
421
422 2010-06-20  Ian Lance Taylor  <iant@google.com>
423             Pedro Alves  <pedro@codesourcery.com>
424
425         * linux-x86-low.c (always_true): Delete.
426         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
427         trying to fool the compiler with always_true.
428
429 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
430
431         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
432         conditions in gdbserver.
433
434 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
435
436         * spu-low.c (spu_read_memory): Wrap around local store limit.
437         (spu_write_memory): Likewise.
438
439 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
440
441         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
442         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
443         LONGEST uses.
444         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
445         uses.
446         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
447         uses with LONGEST uses.
448
449 2010-06-14  Stan Shebs  <stan@codesourcery.com>
450             Pedro Alves  <pedro@codesourcery.com>
451
452         Bytecode compiler.
453
454         * linux-x86-low.c: Include limits.h.
455         (add_insns): New.
456         (always_true): New.
457         (EMIT_ASM): New.
458         (EMIT_ASM32): New.
459         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
460         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
461         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
462         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
463         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
464         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
465         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
466         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
467         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
468         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
469         (amd64_emit_void_call_2): New.
470         (amd64_emit_ops): New.
471         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
472         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
473         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
474         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
475         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
476         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
477         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
478         (i386_emit_call, i386_emit_reg, i386_emit_pop)
479         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
480         (i386_emit_stack_adjust, i386_emit_int_call_1)
481         (i386_emit_void_call_2): New.
482         (i386_emit_ops): New.
483         (x86_emit_ops): New.
484         (the_low_target): Install x86_emit_ops.
485         * server.h (struct emit_ops): New.
486         (get_raw_reg_func_addr): Declare.
487         (current_insn_ptr, emit_error): Declare.
488         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
489         (set_trace_state_variable_value): New defines.
490         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
491         addr_get_trace_state_variable_value and
492         addr_set_trace_state_variable_value.
493         (symbol_list): New fields for get_raw_reg,
494         get_trace_state_variable_value and set_trace_state_variable_value.
495         (condfn): New typedef.
496         (struct tracepoint): New field `compiled_cond'.
497         (do_action_at_tracepoint): Clear compiled_cond.
498         (get_trace_state_variable_value, set_trace_state_variable_value):
499         Export in the IPA.
500         (condition_true_at_tracepoint): If there's a compiled condition,
501         run that.
502         (current_insn_ptr, emit_error): New globals.
503         (struct bytecode_address): New.
504         (get_raw_reg_func_addr): New.
505         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
506         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
507         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
508         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
509         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
510         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
511         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
512         (compile_tracepoint_condition, compile_bytecodes): New.
513         * target.h (emit_ops): Forward declare.
514         (struct target_ops): New field emit_ops.
515         (target_emit_ops): New.
516         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
517         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
518         * linux-low.c (linux_emit_ops): New.
519         (linux_target_ops): Install it.
520         * linux-low.h (struct linux_target_ops): New field emit_ops.
521
522 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
523
524         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
525         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
526
527 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
528             Stan Shebs  <stan@codesourcery.com>
529
530         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
531         (all): Depend on $(extra_libraries).
532         (install-only): Install the IPA.
533         (IPA_OBJS, IPA_LIB): New.
534         (clean): Remove the IPA lib.
535         (IPAGENT_CFLAGS): New.
536         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
537         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
538         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
539         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
540         * configure.ac: Check for atomic builtins support in the compiler.
541         (IPA_DEPFILES, extra_libraries): Define.
542         * configure.srv (ipa_obj): Add description.
543         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
544         (i[34567]86-*-linux*): Set ipa_obj.
545         (x86_64-*-linux*): Set ipa_obj.
546         * linux-low.c (stabilizing_threads): New.
547         (supports_fast_tracepoints): New.
548         (linux_detach): Stabilize threads before detaching.
549         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
550         the lwp is either not stabilizing, or is moving out of a jump pad.
551         (linux_fast_tracepoint_collecting): New.
552         (maybe_move_out_of_jump_pad): New.
553         (enqueue_one_deferred_signal): New.
554         (dequeue_one_deferred_signal): New.
555         (linux_wait_for_event_1): If moving out of a jump pad, defer
556         pending signals to later.
557         (linux_stabilize_threads): New.
558         (linux_wait_1): Check if threads need moving out of jump pads, and
559         do it if so.
560         (stuck_in_jump_pad_callback): New.
561         (move_out_of_jump_pad_callback): New.
562         (lwp_running): New.
563         (linux_resume_one_lwp): Handle moving out of jump pads.
564         (linux_set_resume_request): Dequeue deferred signals.
565         (need_step_over_p): Also step over fast tracepoint jumps.
566         (start_step_over): Also uninsert fast tracepoint jumps.
567         (finish_step_over): Also reinsert fast tracepoint jumps.
568         (linux_install_fast_tracepoint_jump): New.
569         (linux_target_ops): Install linux_stabilize_threads and
570         linux_install_fast_tracepoint_jump_pad.
571         * linux-low.h (linux_target_ops) <get_thread_area,
572         install_fast_tracepoint_jump_pad>: New fields.
573         (struct lwp_info) <collecting_fast_tracepoint,
574         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
575         (linux_get_thread_area): Declare.
576         * linux-x86-low.c (jump_insn): New.
577         (x86_get_thread_area): New.
578         (append_insns): New.
579         (push_opcode): New.
580         (amd64_install_fast_tracepoint_jump_pad): New.
581         (i386_install_fast_tracepoint_jump_pad): New.
582         (x86_install_fast_tracepoint_jump_pad): New.
583         (the_low_target): Install x86_get_thread_area and
584         x86_install_fast_tracepoint_jump_pad.
585         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
586         (struct fast_tracepoint_jump): New.
587         (fast_tracepoint_jump_insn): New.
588         (fast_tracepoint_jump_shadow): New.
589         (find_fast_tracepoint_jump_at): New.
590         (fast_tracepoint_jump_here): New.
591         (delete_fast_tracepoint_jump): New.
592         (set_fast_tracepoint_jump): New.
593         (uninsert_fast_tracepoint_jumps_at): New.
594         (reinsert_fast_tracepoint_jumps_at): New.
595         (set_breakpoint_at): Use write_inferior_memory.
596         (uninsert_raw_breakpoint): Use write_inferior_memory.
597         (check_mem_read): Mask out fast tracepoint jumps.
598         (check_mem_write): Mask out fast tracepoint jumps.
599         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
600         (set_fast_tracepoint_jump): Declare.
601         (delete_fast_tracepoint_jump)
602         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
603         (reinsert_fast_tracepoint_jumps_at): Declare.
604         * regcache.c: Don't compile many functions when building the
605         in-process agent library.
606         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
607         the register buffer in the heap.
608         (free_register_cache): If the register buffer isn't owned by the
609         regcache, don't free it.
610         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
611         pre-existing register caches.
612         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
613         type.
614         (convert_ascii_to_int): : Constify `from' parameter type.
615         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
616         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
617         the needed buffer in-place.
618         (relocate_instruction): New.
619         * server.c (handle_query) <qSymbols>: If the target supports
620         tracepoints, give it a chance of looking up symbols.  Report
621         support for fast tracepoints.
622         (handle_status): Stabilize threads.
623         (process_serial_event): Adjust.
624         * server.h (struct fast_tracepoint_jump): Forward declare.
625         (struct process_info) <fast_tracepoint_jumps>: New field.
626         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
627         (decode_X_packet, decode_M_packet): Adjust.
628         (relocate_instruction): Declare.
629         (in_process_agent_loaded): Declare.
630         (tracepoint_look_up_symbols): Declare.
631         (struct fast_tpoint_collect_status): Declare.
632         (fast_tracepoint_collecting): Declare.
633         (force_unlock_trace_buffer): Declare.
634         (handle_tracepoint_bkpts): Declare.
635         (initialize_low_tracepoint)
636         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
637         * target.h (struct target_ops) <stabilize_threads,
638         install_fast_tracepoint_jump_pad>: New fields.
639         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
640         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
641         [HAVE_STDINT_H]: Include stdint.h.
642         (trace_debug_1): Rename to ...
643         (trace_vdebug): ... this.
644         (trace_debug): Rename to ...
645         (trace_debug_1): ... this.  Add `level' parameter.
646         (trace_debug): New.
647         (ATTR_USED, ATTR_NOINLINE): New.
648         (IP_AGENT_EXPORT): New.
649         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
650         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
651         (about_to_request_buffer_space, trace_buffer_is_full)
652         (stopping_tracepoint, expr_eval_result, error_tracepoint)
653         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
654         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
655         (traceframe_write_count, traceframes_created)
656         (trace_state_variables)
657         New renaming defines.
658         (struct ipa_sym_addresses): New.
659         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
660         (symbol_list): New.
661         (ipa_sym_addrs): New.
662         (all_tracepoint_symbols_looked_up): New.
663         (in_process_agent_loaded): New.
664         (write_e_ipa_not_loaded): New.
665         (maybe_write_ipa_not_loaded): New.
666         (tracepoint_look_up_symbols): New.
667         (debug_threads) [IN_PROCESS_AGENT]: New.
668         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
669         (UNKNOWN_SIDE_EFFECTS): New.
670         (stop_tracing): New.
671         (flush_trace_buffer): New.
672         (stop_tracing_bkpt): New.
673         (flush_trace_buffer_bkpt): New.
674         (read_inferior_integer): New.
675         (read_inferior_uinteger): New.
676         (read_inferior_data_pointer): New.
677         (write_inferior_data_pointer): New.
678         (write_inferior_integer): New.
679         (write_inferior_uinteger): New.
680         (struct collect_static_trace_data_action): Delete.
681         (enum tracepoint_type): New.
682         (struct tracepoint) <type>: New field `type'.
683         <actions_str, step_actions, step_actions_str>: Only include in GDBserver.
684         <orig_size, obj_addr_on_target, adjusted_insn_addr>
685         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
686         (tracepoints): Use IP_AGENT_EXPORT.
687         (last_tracepoint): Don't include in the IPA.
688         (stopping_tracepoint): Use IP_AGENT_EXPORT.
689         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
690         (alloced_trace_state_variables): New.
691         (trace_state_variables): Use IP_AGENT_EXPORT.
692         (traceframe_t): Delete unused variable.
693         (circular_trace_buffer): Don't include in the IPA.
694         (trace_buffer_start): Delete.
695         (struct trace_buffer_control): New.
696         (trace_buffer_free): Delete.
697         (struct ipa_trace_buffer_control): New.
698         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
699         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
700         New.
701         (trace_buffer_ctrl): New.
702         (TRACE_BUFFER_CTRL_CURR): New.
703         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
704         Reimplement as macros.
705         (trace_buffer_wrap): Delete.
706         (traceframe_write_count, traceframe_read_count)
707         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
708         (struct tracepoint_hit_ctx) <type>: New field.
709         (struct fast_tracepoint_ctx): New.
710         (memory_barrier): New.
711         (cmpxchg): New.
712         (record_tracepoint_error): Update atomically in the IPA.
713         (clear_inferior_trace_buffer): New.
714         (about_to_request_buffer_space): New.
715         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
716         updating the same buffer.
717         (add_tracepoint): Default the tracepoint's type to trap
718         tracepoint, and orig_size to -1.
719         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
720         internal variables.
721         (create_trace_state_variable): New parameter `gdb'.  Handle it.
722         (clear_installed_tracepoints): Clear fast tracepoint jumps.
723         (cmd_qtdp): Handle fast tracepoints.
724         (cmd_qtdv): Adjust.
725         (max_jump_pad_size): New.
726         (gdb_jump_pad_head): New.
727         (get_jump_space_head): New.
728         (claim_jump_space): New.
729         (sort_tracepoints): New.
730         (MAX_JUMP_SIZE): New.
731         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
732         IPA.
733         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
734         support.  Upload fast traceframes, and delete internal IPA
735         breakpoints.
736         (stop_tracing_handler): New.
737         (flush_trace_buffer_handler): New.
738         (cmd_qtstop): Upload fast tracepoints.
739         (response_tracepoint): Handle fast tracepoints.
740         (tracepoint_finished_step): Upload fast traceframes.  Set the
741         tracepoint hit context's tracepoint type.
742         (handle_tracepoint_bkpts): New.
743         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
744         type.  Add comment about fast tracepoints.
745         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
746         non-existing action_str field.
747         (get_context_regcache): Handle fast tracepoints.
748         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
749         to the regcache.
750         (fast_tracepoint_from_jump_pad_address): New.
751         (fast_tracepoint_from_ipa_tpoint_address): New.
752         (collecting_t): New.
753         (force_unlock_trace_buffer): New.
754         (fast_tracepoint_collecting): New.
755         (collecting): New.
756         (gdb_collect): New.
757         (write_inferior_data_ptr): New.
758         (target_tp_heap): New.
759         (target_malloc): New.
760         (download_agent_expr): New.
761         (UALIGN): New.
762         (download_tracepoints): New.
763         (download_trace_state_variables): New.
764         (upload_fast_traceframes): New.
765         (IPA_FIRST_TRACEFRAME): New.
766         (IPA_NEXT_TRACEFRAME_1): New.
767         (IPA_NEXT_TRACEFRAME): New.
768         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
769         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
770         (gdb_jump_pad_buffer_end): New.
771         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
772         (initialize_tracepoint): Adjust.
773         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
774         buffer.  Initialize the low module.
775         * utils.c (PREFIX, TOOLNAME): New.
776         (malloc_failure): Use PREFIX.
777         (error): In the IPA, an error causes an exit.
778         (fatal, warning): Use PREFIX.
779         (internal_error): Use TOOLNAME.
780         (NUMCELLS): Increase to 10.
781         * configure, config.in: Regenerate.
782
783 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
784
785         * server.c (handle_query) <qSupported>: Do two passes over the
786         qSupported string to avoid nesting strtok.
787
788 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
789
790         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
791         (CDEPS): New.
792         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
793         -Wl,--dynamic-list.
794         * configure: Regenerate.
795         * proc-service.list: New.
796
797 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
798
799         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
800         New comment.
801
802 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
803
804         * gdbreplay.c (remote_open): Check error return from socket() call by
805         its equality to -1 not by it being negative.
806         * remote-utils.c (remote_open): Likewise.
807
808 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
809
810         * config.h: Regenerate.
811
812 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
813
814         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
815         doesn't provide PTRACE_GET_THREAD_AREA.
816
817 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
818
819         * linux-m68k-low.c: Include <asm/ptrace.h>
820         (ps_get_thread_area): Implement.
821
822 2010-05-03  Doug Evans  <dje@google.com>
823
824         * event-loop.c (struct callback_event): New struct.
825         (callback_list): New global.
826         (append_callback_event, delete_callback_event): New functions.
827         (process_callback): New function.
828         (start_event_loop): Call it.
829         * remote-utils.c (NOT_SCHEDULED): Define.
830         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
831         moved out of readchar.
832         (readchar): Rewrite.  Call reschedule before returning.
833         (reset_readchar): New function.
834         (remote_close): Call it.
835         (process_remaining, reschedule): New functions.
836         * server.h (callback_handler_func): New typedef.
837         (append_callback_event, delete_callback_event): Declare.
838
839 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
840
841         * proc-service.c (ps_pglobal_lookup): Use
842         thread_db_look_up_one_symbol.
843         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
844         parameter.  Use it instead of all_symbols_looked_up.
845         * server.h (struct process_info) <all_symbols_looked_up>: Delete
846         field.
847         (all_symbols_looked_up): Don't declare.
848         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
849         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
850         field.
851         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
852         Set all_symbols_looked_up here.
853         (thread_db_look_up_one_symbol): New.
854         (thread_db_get_tls_address): Adjust.
855         (thread_db_load_search, try_thread_db_load_1): Always allocate the
856         thread_db object on the heap, and tentatively set it in the
857         process structure.
858         (thread_db_init): Don't set all_symbols_looked_up here.
859         * linux-low.h (thread_db_look_up_one_symbol): Declare.
860
861 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
862
863         * linux-low.c (linux_kill, linux_detach): Adjust.
864         (status_pending_p_callback): Remove redundant statement.  Check
865         for !TARGET_WAITIKIND_IGNORE, instead of
866         TARGET_WAITKIND_STOPPED.
867         (handle_tracepoints): Make sure LWP is locked.  Adjust.
868         (linux_wait_for_event_1): Adjust.
869         (linux_cancel_breakpoints): New.
870         (unsuspend_one_lwp): New.
871         (unsuspend_all_lwps): New.
872         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
873         (send_sigstop_callback): Change return type to int, add new
874         `except' parameter and handle it.
875         (suspend_and_send_sigstop_callback): New.
876         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
877         pass them down.  If SUSPEND, also increment the lwp's suspend
878         count.
879         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
880         (need_step_over_p): Don't consider suspended LWPs.
881         (start_step_over): Adjust.
882         (proceed_one_lwp): Change return type to int, add new `except'
883         parameter and handle it.
884         (unsuspend_and_proceed_one_lwp): New.
885         (proceed_all_lwps): Use find_inferior instead of
886         for_each_inferior.
887         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
888         also decrement the suspend count of LWPs.  Pass `except' down,
889         instead of hacking its suspend count.
890         (linux_pause_all): Add `freeze' parameter.  Adjust.
891         (linux_unpause_all): New.
892         (linux_target_ops): Install linux_unpause_all.
893         * server.c (handle_status): Adjust.
894         * target.h (struct target_ops): New fields `unpause_all' and
895         `cancel_breakpoints'.  Add new parameter to `pause_all'.
896         (pause_all): Add new `freeze' parameter.
897         (unpause_all): New.
898         (cancel_breakpoints): New.
899         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
900         cancel breakpoints.
901         (cmd_qtstart): Pause threads.
902         (stop_tracing): Pause threads, and cancel breakpoints.
903         * win32-low.c (win32_target_ops): Adjust.
904
905 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
906
907         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
908         the inferior right away from here...
909         (linux_wait_1): ... to here, and adjust to check the thread's
910         last_resume_kind instead of the lwp's step or stop_expected flags.
911
912 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
913
914         * README: Use consistent `GDB' and `GDBserver' spellings.
915
916 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
917
918         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
919         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
920         (linux_detach_one_lwp): Assume the lwp is stopped.
921         (any_thread_of): Delete.
922         (linux_detach): Stop all lwps here.  Don't blindly delete all
923         breakpoints.
924         (delete_lwp_callback): New.
925         (linux_mourn): Delete all lwps of the process that is gone.
926         (linux_wait_1): Don't delete the last lwp of the process here.
927         * mem-break.h (mark_breakpoints_out): Declare.
928         * mem-break.c (mark_breakpoints_out): New.
929         (free_all_breakpoints): Use it.
930         * server.c (handle_target_event): If the process is gone, mark
931         breakpoints out.
932         * thread-db.c (struct thread_db) <create_bp>: New field.
933         (thread_db_enable_reporting): Fix prototype.  Store a thread event
934         breakpoint reference in the thread_db struct.
935         (thread_db_load_search): Clear the thread_db object.
936         (try_thread_db_load_1): Ditto.
937         (switch_to_process): New.
938         (disable_thread_event_reporting): Use it.
939         (remove_thread_event_breakpoints): New.
940         (thread_db_detach, thread_db_mourn): Use it.
941
942 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
943
944         * linux-low.c (linux_enable_event_reporting): New.
945         (linux_wait_for_event_1, handle_extended_wait): Use it.
946
947 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
948
949         * linux-low.c (linux_kill_one_lwp, linux_kill)
950         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
951         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
952         SIGSTOP even if the LWP is stopped.
953         (send_sigstop_callback): New.
954         (stop_all_lwps): Use send_sigstop_callback instead.
955         (linux_resume_one_thread): Adjust.
956         (proceed_one_lwp): Still proceed an LWP that the client has
957         requested to stop, if we haven't reported it as stopped yet.  Make
958         sure that LWPs the client want stopped, have a pending SIGSTOP.
959
960 2010-04-26  Doug Evans  <dje@google.com>
961
962         * server.c (handle_general_set): Make static.
963
964         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
965         Print received char after testing for error/eof instead of before.
966         (input_interrupt): Tweak comment.
967
968 2010-04-23  Doug Evans  <dje@google.com>
969
970         * server.c (start_inferior): Print inferior argv if --debug.
971
972 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
973
974         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
975         * nto-x86-low.c: Include server.h
976
977 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
978
979         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
980         be consistent with other sources of this directory.
981         (init_registers_amd64): Correct name of source file of this function
982         in the comment.
983
984 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
985
986         * configure.srv (x86_64-*-mingw*): New configuration for Windows
987         64-bit executables.
988
989 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
990
991         * win32-i386-low.c: Add 64-bit support.
992         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
993         (init_registers_amd64): Declare.
994         (mappings): Add 64-bit version of array.
995         (init_windows_x86): New function.
996         (the_low_target): Change init_arch field to init_windows_x86.
997
998 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
999
1000         * win32-low.c: Adapt to support also 64-bit architecture.
1001         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
1002         (get_image_name): Use SIZE_T type for local variable `done'.
1003         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
1004         (toolhelp_get_dll_name): Idem.
1005         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
1006         Use uintptr_t typecast to avoid warning.
1007         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
1008         (handle_exception): Use phex_nz to avoid warning.
1009         (win32_wait): Remove unused local variable `process'.
1010
1011 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
1012
1013         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
1014         `amd64-avx.o'.
1015
1016 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
1017
1018         * configure.ac: Use `ws2_32' library for srv_mingw.
1019         * configure: Regenerate.
1020         * gdbreplay.c: Include winsock2.h instead of winsock.h.
1021         * remote-utils.c: Likewise.
1022
1023 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
1024
1025         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
1026         if __x86_64__ is defined.
1027
1028 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
1029
1030         * configure: Regenerate.
1031
1032 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
1033
1034         * server.c (handle_query): Handle 'qGetTIBAddr' query.
1035         * target.h (target_ops): New get_tib_address field.
1036         * win32-low.h (win32_thread_info): Add thread_local_base field.
1037         * win32-low.c (child_add_thread): Add tlb argument.
1038         Set thread_local_base field to TLB.
1039         (get_child_debug_event): Adapt to child_add_thread change.
1040         (win32_get_tib_address): New function.
1041         (win32_target_ops): Set get_tib_address field to
1042         win32_get_tib_address.
1043         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
1044
1045 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
1046
1047         * linux-low.c (linux_mourn): Also remove the process.
1048         * server.c (handle_target_event): Don't remove the process here.
1049         * nto-low.c (nto_mourn): New.
1050         (nto_target_ops): Install it.
1051         * spu-low.c (spu_mourn): New.
1052         (spu_target_ops): Install it.
1053         * win32-low.c (win32_mourn): New.
1054         (win32_target_ops): Install it.
1055
1056 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
1057
1058         * server.h (buffer_xml_printf): Remove redundant `;'.
1059
1060 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
1061
1062         * regcache.c (set_register_cache): Invalidate regcaches before
1063         changing the register cache layout.
1064         (regcache_invalidate_one): Allow a NULL regcache.
1065         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
1066         regcaches before changing the register cache layout or the target
1067         regsets.
1068
1069 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
1070
1071         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
1072         variable warning on Linux/x86-64.
1073
1074 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
1075
1076         GDBserver disconnected tracing support.
1077
1078         * linux-low.c (linux_remove_process): Delete.
1079         (add_lwp): Don't set last_resume_kind here.
1080         (linux_kill): Use `mourn'.
1081         (linux_detach): Use `thread_db_detach', and `mourn'.
1082         (linux_mourn): New.
1083         (linux_attach_lwp_1): Adjust comment.
1084         (linux_attach): last_resume_kind moved the thread_info; adjust.
1085         (status_pending_p_callback): Adjust.
1086         (linux_wait_for_event_1): Adjust.
1087         (count_events_callback, select_singlestep_lwp_callback)
1088         (select_event_lwp_callback, cancel_breakpoints_callback)
1089         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
1090         (proceed_one_lwp): Adjust.
1091         (linux_async): Add debug output.
1092         (linux_thread_stopped): New.
1093         (linux_pause_all): New.
1094         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
1095         linux_pause_all.
1096         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
1097         (thread_db_free): Delete declaration.
1098         (thread_db_detach, thread_db_mourn): Declare.
1099         * thread-db.c (thread_db_init): Use thread_db_mourn.
1100         (thread_db_free): Delete, split in two.
1101         (disable_thread_event_reporting): New.
1102         (thread_db_detach): New.
1103         (thread_db_mourn): New.
1104
1105         * server.h (struct thread_info) <last_resume_kind>: New field.
1106         <attached>: Add comment.
1107         <gdb_detached>: New field.
1108         (handler_func): Change return type to int.
1109         (handle_serial_event, handle_target_event): Ditto.
1110         (gdb_connected): Declare.
1111         (tracing): Delete.
1112         (disconnected_tracing): Declare.
1113         (stop_tracing): Declare.
1114
1115         * server.c (handle_query) <qSupported>: Report support for
1116         disconnected tracing.
1117         (queue_stop_reply_callback): Account for running threads.
1118         (gdb_wants_thread_stopped): New.
1119         (gdb_wants_all_threads_stopped): New.
1120         (gdb_reattached_process): New.
1121         (handle_status): Clear the `gdb_detached' flag of all processes.
1122         In all-stop, stop all threads.
1123         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
1124         (process_serial_event): If the remote connection breaks, or if an
1125         exit was forced with "monitor exit", force an event loop exit.
1126         Handle disconnected tracing on detach.
1127         (handle_serial_event): Adjust.
1128         (handle_target_event): If GDB isn't connected, forward events back
1129         to the inferior, unless the last process exited, in which case,
1130         exit gdbserver.  Adjust interface.
1131
1132         * remote-utils.c (remote_open): Don't block in accept.  Instead
1133         register an event loop source on the listen socket file
1134         descriptor.  Refactor bits into ...
1135         (listen_desc): ... this new global.
1136         (gdb_connected): ... this new function.
1137         (enable_async_notification): ... this new function.
1138         (handle_accept_event): ... this new function.
1139         (remote_close): Clear remote_desc.
1140
1141         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
1142
1143         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
1144         New fields.
1145         (mourn_inferior): Define.
1146         (target_process_qsupported): Avoid the dangling else problem.
1147         (thread_stopped): Define.
1148         (pause_all): Define.
1149         (target_waitstatus_to_string): Declare.
1150         * target.c (target_waitstatus_to_string): New.
1151
1152         * tracepoint.c (tracing): Make extern.
1153         (disconnected_tracing): New.
1154         (stop_tracing): Make extern.  Handle tracing stops due to GDB
1155         disconnecting.
1156         (cmd_qtdisconnected): New.
1157         (cmd_qtstatus): Report disconnected tracing status in trace reply.
1158         (handle_tracepoint_general_set): Handle QTDisconnected.
1159
1160         * event-loop.c (event_handler_func): Change return type to int.
1161         (process_event): Bail out if the event handler wants the event
1162         loop to stop.
1163         (handle_file_event): Ditto.
1164         (start_event_loop): Bail out if the event handler wants the event
1165         loop to stop.
1166
1167         * nto-low.c (nto_target_ops): Adjust.
1168         * spu-low.c (spu_wait): Don't remove the process here.
1169         (spu_target_ops): Adjust.
1170         * win32-low.c (win32_wait): Don't remove the process here.
1171         (win32_target_ops): Adjust.
1172
1173 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
1174
1175         * regcache.c (realloc_register_cache): Invalidate inferior's
1176         regcache before recreating it.
1177
1178 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
1179
1180         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
1181
1182 2010-04-09  Stan Shebs  <stan@codesourcery.com>
1183             Pedro Alves  <pedro@codesourcery.com>
1184
1185         * server.h (LONGEST): New.
1186         (struct thread_info) <while_stepping>: New field.
1187         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
1188         Declare.
1189         (initialize_tracepoint, handle_tracepoint_general_set)
1190         (handle_tracepoint_query, tracepoint_finished_step)
1191         (tracepoint_was_hit, release_while_stepping_state_list):
1192         (current_traceframe): Declare.
1193         * server.c (handle_general_set): Handle tracepoint packets.
1194         (read_memory): New.
1195         (write_memory): New.
1196         (handle_search_memory_1): Use read_memory.
1197         (handle_query): Report support for conditional tracepoints, trace
1198         state variables, and tracepoint sources.  Handle tracepoint
1199         queries.
1200         (main): Initialize the tracepoints module.
1201         (process_serial_event): Handle traceframe reads/writes.
1202
1203         * linux-low.c (handle_tracepoints): New.
1204         (linux_wait_1): Call it.
1205         (linux_resume_one_lwp): Handle while-stepping.
1206         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
1207         (linux_target_ops): Install them.
1208         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
1209         New field.
1210         * linux-x86-low.c (x86_supports_tracepoints): New.
1211         (the_low_target). Install it.
1212
1213         * mem-break.h (delete_breakpoint): Declare.
1214         * mem-break.c (delete_breakpoint): Make external.
1215
1216         * target.h (struct target_ops): Add `supports_tracepoints',
1217         `read_pc', and `write_pc' fields.
1218         (target_supports_tracepoints): Define.
1219         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
1220         (phex_nz): New.
1221
1222         * regcache.h (struct regcache) <registers_owned>: New field.
1223         (init_register_cache, regcache_cpy): Declare.
1224         (regcache_read_pc, regcache_write_pc): Declare.
1225         (register_cache_size): Declare.
1226         (supply_regblock): Declare.
1227         * regcache.c (init_register_cache): New.
1228         (new_register_cache): Use it.
1229         (regcache_cpy): New.
1230         (register_cache_size): New.
1231         (supply_regblock): New.
1232         (regcache_read_pc, regcache_write_pc): New.
1233
1234         * tracepoint.c: New.
1235
1236         * Makefile.in (OBS): Add tracepoint.o.
1237         (tracepoint.o): New rule.
1238
1239 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
1240
1241         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
1242         (i386-mmx.o): New.
1243         (i386-mmx.c): Likewise.
1244         (i386-mmx-linux.o): Likewise.
1245         (i386-mmx-linux.c): Likewise.
1246
1247         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
1248         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
1249         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
1250         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
1251
1252         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
1253         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
1254         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
1255
1256 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
1257
1258         * Makefile.in (clean): Updated.
1259         (i386-avx.o): New.
1260         (i386-avx.c): Likewise.
1261         (i386-avx-linux.o): Likewise.
1262         (i386-avx-linux.c): Likewise.
1263         (amd64-avx.o): Likewise.
1264         (amd64-avx.c): Likewise.
1265         (amd64-avx-linux.o): Likewise.
1266         (amd64-avx-linux.c): Likewise.
1267
1268         * configure.srv (srv_i386_regobj): Add i386-avx.o.
1269         (srv_i386_linux_regobj): Add i386-avx-linux.o.
1270         (srv_amd64_regobj): Add amd64-avx.o.
1271         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
1272         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
1273         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
1274         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
1275         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
1276         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
1277         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
1278
1279         * i387-fp.c: Include "i386-xstate.h".
1280         (i387_xsave): New.
1281         (i387_cache_to_xsave): Likewise.
1282         (i387_xsave_to_cache): Likewise.
1283         (x86_xcr0): Likewise.
1284
1285         * i387-fp.h (i387_cache_to_xsave): Likewise.
1286         (i387_xsave_to_cache): Likewise.
1287         (x86_xcr0): Likewise.
1288
1289         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
1290         * linux-crisv32-low.c (target_regsets): Likewise.
1291         * linux-m68k-low.c (target_regsets): Likewise.
1292         * linux-mips-low.c (target_regsets): Likewise.
1293         * linux-ppc-low.c (target_regsets): Likewise.
1294         * linux-s390-low.c (target_regsets): Likewise.
1295         * linux-sh-low.c (target_regsets): Likewise.
1296         * linux-sparc-low.c (target_regsets): Likewise.
1297         * linux-xtensa-low.c (target_regsets): Likewise.
1298
1299         * linux-low.c: Include <sys/uio.h>.
1300         (regsets_fetch_inferior_registers): Support nt_type.
1301         (regsets_store_inferior_registers): Likewise.
1302         (linux_process_qsupported): New.
1303         (linux_target_ops): Add linux_process_qsupported.
1304
1305         * linux-low.h (regset_info): Add nt_type.
1306         (linux_target_ops): Add process_qsupported.
1307
1308         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
1309         and <sys/uio.h>.
1310         (init_registers_i386_avx_linux): New.
1311         (init_registers_amd64_avx_linux): Likewise.
1312         (xmltarget_i386_linux_no_xml): Likewise.
1313         (xmltarget_amd64_linux_no_xml): Likewise.
1314         (PTRACE_GETREGSET): Likewise.
1315         (PTRACE_SETREGSET): Likewise.
1316         (x86_fill_xstateregset): Likewise.
1317         (x86_store_xstateregset): Likewise.
1318         (use_xml): Likewise.
1319         (x86_linux_update_xmltarget): Likewise.
1320         (x86_linux_process_qsupported): Likewise.
1321         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
1322         (x86_arch_setup): Don't call init_registers_amd64_linux nor
1323         init_registers_i386_linux here.  Call
1324         x86_linux_update_xmltarget.
1325         (the_low_target): Add x86_linux_process_qsupported.
1326
1327         * server.c (handle_query): Call target_process_qsupported.
1328
1329         * target.h (target_ops): Add process_qsupported.
1330         (target_process_qsupported): New.
1331
1332 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
1333
1334         * inferiors.c (add_thread): Set last_status kind to
1335         TARGET_WAITKIND_IGNORE.
1336         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
1337         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
1338         (linux_wait_1): Move `thread' local definition to block that uses
1339         it.  Don't NULL initialize `event_child'.
1340         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
1341         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
1342         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
1343
1344 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
1345
1346         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
1347         an extended waitstatus, or by a watchpoint.
1348         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
1349         thread was stepping or has been stopped by a watchpoint.
1350
1351 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
1352
1353         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
1354         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
1355         of another, then delete the previous, and validate all
1356         breakpoints.
1357         (validate_inserted_breakpoint): New.
1358         (delete_disabled_breakpoints): New.
1359         (validate_breakpoints): New.
1360         (check_mem_read): Validate breakpoints before trusting their
1361         shadow.  Delete disabled breakpoints.
1362         (check_mem_write): Validate breakpoints before trusting they
1363         should be inserted.  Delete disabled breakpoints.
1364         * mem-break.h (validate_breakpoints):
1365         * server.c (handle_query): Validate breakpoints when we see a
1366         qSymbol query.
1367
1368 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
1369
1370         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
1371         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
1372         if we could tell there's a GDB breakpoint at stop_pc.
1373         (need_step_over_p): Don't do a step over if we find a GDB
1374         breakpoint at the resume PC.
1375
1376         * mem-break.c (struct raw_breakpoint): New.
1377         (enum bkpt_type): New type `gdb_breakpoint'.
1378         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
1379         fields.  New field `raw'.
1380         (find_raw_breakpoint_at): New.
1381         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
1382         breakpoint instead.
1383         (set_breakpoint_at): Adjust.
1384         (delete_raw_breakpoint): New.
1385         (release_breakpoint): New.
1386         (delete_breakpoint): Rename to...
1387         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
1388         release_breakpoint.  Return ENOENT.
1389         (delete_breakpoint): Reimplement.
1390         (find_breakpoint_at): Delete.
1391         (find_gdb_breakpoint_at): New.
1392         (delete_breakpoint_at): Delete.
1393         (set_gdb_breakpoint_at): New.
1394         (delete_gdb_breakpoint_at): New.
1395         (gdb_breakpoint_here): New.
1396         (set_reinsert_breakpoint): Use release_breakpoint.
1397         (uninsert_breakpoint): Rename to ...
1398         (uninsert_raw_breakpoint): ... this.
1399         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
1400         (reinsert_raw_breakpoint): Change parameter type to
1401         raw_breakpoint.
1402         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
1403         instead.
1404         (check_breakpoints): Adjust.  Use release_breakpoint.
1405         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
1406         (breakpoint_inserted_here): Ditto.
1407         (check_mem_read): Adjust to iterate over raw breakpoints instead.
1408         Don't trust the breakpoint's shadow if it is not inserted.
1409         (check_mem_write): Adjust to iterate over raw breakpoints instead.
1410         (delete_all_breakpoints): Adjust.
1411         (free_all_breakpoints): Mark all breakpoints as uninserted, and
1412         use delete_breakpoint_1.
1413
1414         * mem-break.h (breakpoints_supported): Delete declaration.
1415         (set_gdb_breakpoint_at): Declare.
1416         (gdb_breakpoint_here): Declare.
1417         (delete_breakpoint_at): Delete.
1418         (delete_gdb_breakpoint_at): Declare.
1419
1420         * server.h (struct raw_breakpoint): Forward declare.
1421         (struct process_info): New field `raw_breakpoints'.
1422
1423         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
1424         breakpoints.
1425
1426 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
1427
1428         * linux-low.c (status_pending_p_callback): Fix comment.
1429         (linux_wait_for_event_1): Move most of the internal breakpoint
1430         handling from here...
1431         (linux_wait_1): ... to here.
1432         (count_events_callback): New.
1433         (select_singlestep_lwp_callback): New.
1434         (select_event_lwp_callback): New.
1435         (cancel_breakpoints_callback): New.
1436         (select_event_lwp): New.
1437         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
1438         priority to all LWPs that have had events that should be reported
1439         to the client.  Cancel breakpoints when about to reporting the
1440         event to the client, not while stopping lwps.  No longer cancel
1441         finished single-steps here.
1442         (cancel_finished_single_step): Delete.
1443         (cancel_finished_single_steps): Delete.
1444
1445 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
1446
1447         * mem-break.c (enum bkpt_type): New.
1448         (struct breakpoint): New field `type'.
1449         (set_breakpoint_at): Change return type to struct breakpoint
1450         pointer.  Set type to `other_breakpoint' by default.
1451         (delete_breakpoint): Rewrite, supporting more than one breakpoint
1452         in the breakpoint list.
1453         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
1454         (reinsert_breakpoint): Rename to ...
1455         (reinsert_raw_breakpoint): ... this.
1456         (reinsert_breakpoints_at): Adjust.
1457         * mem-break.h (struct breakpoint): Declare.
1458         (set_breakpoint_at): Change return type to struct breakpoint
1459         pointer.
1460
1461 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
1462
1463         * server.c (handle_query): Assign, not compare.
1464
1465 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
1466
1467         Teach linux gdbserver to step-over-breakpoints.
1468
1469         * linux-low.c (can_hardware_single_step): New.
1470         (supports_breakpoints): New.
1471         (handle_extended_wait): If stopping threads, read the stop pc of
1472         the new cloned LWP.
1473         (get_pc): New.
1474         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
1475         low target doesn't support retrieving the PC.
1476         (add_lwp): Set last_resume_kind to resume_continue.
1477         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
1478         (linux_attach): Don't clear stop_expected.  Set the lwp's
1479         last_resume_kind to resume_stop.
1480         (linux_detach_one_lwp): Don't check for removed breakpoints.
1481         (check_removed_breakpoint): Delete.
1482         (status_pending_p): Rename to ...
1483         (status_pending_p_callback): ... this.  Don't check for removed
1484         breakpoints.  Don't consider threads that are stopped from GDB's
1485         perspective.
1486         (linux_wait_for_lwp): Always read the stop_pc here.
1487         (cancel_breakpoint): New.
1488         (step_over_bkpt): New global.
1489         (linux_wait_for_event_1): Implement stepping over breakpoints.
1490         (gdb_wants_lwp_stopped): New.
1491         (gdb_wants_all_stopped): New.
1492         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
1493         single-step traps here.  Store the thread's last reported target
1494         wait status.
1495         (send_sigstop): Don't clear stop_expected.  Always set it,
1496         instead.
1497         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
1498         (cancel_finished_single_step): New.
1499         (cancel_finished_single_steps): New.
1500         (wait_for_sigstop): Don't cancel finished single-step traps here.
1501         (linux_resume_one_lwp): Don't check for removed breakpoints.
1502         Don't set `step' on non-hardware step archs.
1503         (linux_set_resume_request): Ignore resume_stop requests if already
1504         stopping or stopped.  Set the lwp's last_resume_kind.
1505         (resume_status_pending_p): Don't check for removed breakpoints.
1506         (need_step_over_p): New.
1507         (start_step_over): New.
1508         (finish_step_over): New.
1509         (linux_resume_one_thread): Always queue a sigstop for resume_stop
1510         requests.  Clear the thread's last reported target waitstatus.
1511         Don't use the `suspended' flag.  Don't consider pending breakpoints.
1512         (linux_resume): Start a step-over if necessary.
1513         (proceed_one_lwp): New.
1514         (proceed_all_lwps): New.
1515         (unstop_all_lwps): New.
1516         * linux-low.h (struct lwp_info): Rewrite comment for the
1517         `suspended' flag.  Add the `stop_pc' field.  Delete the
1518         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
1519         Add `'last_resume_kind' and `need_step_over' fields.
1520         * inferiors.c (struct thread_info): Delete, moved elsewhere.
1521         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
1522         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
1523         (set_raw_breakpoint_at): New.
1524         (set_breakpoint_at): Rewrite to use it.
1525         (reinsert_breakpoint_handler): Delete.
1526         (set_reinsert_breakpoint): New.
1527         (reinsert_breakpoint_by_bp): Delete.
1528         (delete_reinsert_breakpoints): New.
1529         (uninsert_breakpoint): Rewrite.
1530         (uninsert_breakpoints_at): New.
1531         (reinsert_breakpoint): Rewrite.
1532         (reinsert_breakpoints_at): New.
1533         (check_breakpoints): Rewrite.
1534         (breakpoint_here): New.
1535         (breakpoint_inserted_here): New.
1536         (check_mem_read): Adjust.
1537         * mem-break.h (breakpoints_supported, breakpoint_here)
1538         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
1539         (reinsert_breakpoint_by_bp): Delete declaration.
1540         (delete_reinsert_breakpoints): Declare.
1541         (reinsert_breakpoint): Delete declaration.
1542         (reinsert_breakpoints_at): Declare.
1543         (uninsert_breakpoint): Delete declaration.
1544         (uninsert_breakpoints_at): Declare.
1545         (check_breakpoints): Adjust prototype.
1546         * server.h: Adjust include order.
1547         (struct thread_info): Declare here.  Add a `last_status' field.
1548
1549 2010-03-23  Michael Snyder  <msnyder@vmware.com>
1550
1551         * server.c (crc32): New function.
1552         (handle_query): Add handling for 'qCRC:' request.
1553
1554 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
1555
1556         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
1557         lwp had been stopped by a watchpoint.
1558
1559 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
1560
1561         * server.h (internal_error): Declare.
1562         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
1563         * utils.c (internal_error): New function.
1564
1565 2010-03-15  Andreas Schwab  <schwab@redhat.com>
1566
1567         * configure.srv: Fix typo setting srv_regobj.
1568
1569 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
1570
1571         * linux-low.c (fetch_register): Avoid passing a non string literal
1572         format to `error'.
1573         (usr_store_inferior_registers): Ditto.
1574
1575 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
1576
1577         * linux-low.c (linux_write_memory): Bail out early if peeking
1578         memory failed.
1579
1580 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
1581
1582         * linux-low.h (struct lwp_info): New fields
1583         `stopped_by_watchpoint' and `stopped_data_address'.
1584         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
1585         here, and cache them in the lwp object.
1586         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
1587         directly.
1588         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
1589         field.
1590         (linux_stopped_by_watchpoint): Rewrite.
1591         (linux_stopped_data_address): Rewrite.
1592
1593 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
1594
1595         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
1596         switching the current inferior, not before.
1597
1598 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
1599
1600         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
1601         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
1602         i386-linux.c and amd64-linux.c.
1603         (reg-i386.o): Removed.
1604         (reg-i386.c): Likewise.
1605         (reg-i386-linux.o): Likewise.
1606         (reg-i386-linux.c): Likewise.
1607         (reg-x86-64.o): Likewise.
1608         (reg-x86-64.c): Likewise.
1609         (reg-x86-64-linux.o): Likewise.
1610         (reg-x86-64-linux.c): Likewise.
1611         (i386.o): New.
1612         (i386.c): Likewise.
1613         (i386-linux.o): Likewise.
1614         (i386-linux.c): Likewise.
1615         (amd64.o): Likewise.
1616         (amd64.c): Likewise.
1617         (amd64-linux.o): Likewise.
1618         (amd64-linux.c): Likewise.
1619
1620         * configure.srv (srv_i386_regobj): New.
1621         (srv_i386_linux_regobj): Likewise.
1622         (srv_amd64_regobj): Likewise.
1623         (srv_amd64_linux_regobj): Likewise.
1624         (srv_i386_32bit_xmlfiles): Likewise.
1625         (srv_i386_64bit_xmlfiles): Likewise.
1626         (srv_i386_xmlfiles): Likewise.
1627         (srv_amd64_xmlfiles): Likewise.
1628         (srv_i386_linux_xmlfiles): Likewise.
1629         (srv_amd64_linux_xmlfiles): Likewise.
1630         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
1631         srv_xmlfiles to $srv_i386_xmlfiles.
1632         (i[34567]86-*-mingw32ce*): Likewise.
1633         (i[34567]86-*-mingw*): Likewise.
1634         (i[34567]86-*-nto*): Likewise.
1635         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
1636         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
1637         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
1638         (x86_64-*-linux*): Likewise.
1639
1640         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
1641         (init_registers_amd64_linux): New.
1642         (x86_arch_setup): Replace init_registers_x86_64_linux with
1643         init_registers_amd64_linux.
1644
1645 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
1646
1647         * configure.ac: Check for libdl.  If it is not available link against
1648         static libthread_db.
1649         * configure: Regenerate.
1650
1651 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
1652
1653         PR9605
1654
1655         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
1656         handing a read watchpoint.
1657         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
1658
1659 2010-02-12  Doug Evans  <dje@google.com>
1660
1661         * linux-low.c (linux_supports_tracefork_flag): Document.
1662         (linux_look_up_symbols): Add comment.
1663
1664 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
1665
1666         * regcache.c (supply_register): Clear regcache if buf is NULL.
1667
1668 2010-02-02  Nicolas Roche  <roche@sourceware.org>
1669             Joel Brobecker  <brobecker@adacore.com>
1670
1671         * inferiors.c (find_inferior): Add function documentation.
1672         (unloaded_dll): Handle the case where the unloaded dll has not
1673         been previously registered in the dll list.
1674
1675 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
1676
1677         * linux-arm-low.c (thumb_breakpoint_len): Delete.
1678         (thumb2_breakpoint): New.
1679         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
1680
1681 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
1682
1683         * linux-low.c (get_stop_pc): Check for SIGTRAP.
1684         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
1685         breakpoints.
1686
1687 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
1688
1689         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
1690
1691 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
1692
1693         * linux-s390-low.c (s390_collect_ptrace_register)
1694         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
1695
1696 2010-01-21  Doug Evans  <dje@google.com>
1697
1698         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
1699         (PTRACE_ARG4_TYPE): New macro.
1700         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
1701         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
1702         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
1703         (usr_store_inferior_registers): Ditto.
1704         (linux_read_memory, linux_write_memory): Ditto.
1705         (linux_test_for_tracefork): Ditto.
1706
1707         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
1708         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
1709
1710 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
1711
1712         * proc-service.c (ps_lgetregs): Don't refetch registers from the
1713         target.
1714
1715 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
1716
1717         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
1718         prototype to take a regcache.  Adjust.
1719
1720 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
1721
1722         * regcache.h (struct thread_info): Forward declare.
1723         (struct regcache): New.
1724         (new_register_cache): Adjust prototype.
1725         (get_thread_regcache): Declare.
1726         (free_register_cache): Adjust prototype.
1727         (registers_to_string, registers_from_string): Ditto.
1728         (supply_register, supply_register_by_name, collect_register)
1729         (collect_register_as_string, collect_register_by_name): Ditto.
1730         * regcache.c (struct inferior_regcache_data): Delete.
1731         (get_regcache): Rename to ...
1732         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
1733         fetching registers.
1734         (regcache_invalidate_one): Adjust.
1735         (regcache_invalidate): Fix prototype.
1736         (new_register_cache): Return the new register cache.
1737         (free_register_cache): Change prototype.
1738         (realloc_register_cache): Adjust.
1739         (registers_to_string): Change prototype to take a regcache.  Adjust.
1740         (registers_from_string): Ditto.
1741         (register_data): Ditto.
1742         (supply_register): Ditto.
1743         (supply_register_by_name): Ditto.
1744         (collect_register): Ditto.
1745         (collect_register_as_string): Ditto.
1746         (collect_register_by_name): Ditto.
1747         * server.c (process_serial_event): Adjust.
1748         * linux-low.h (regset_fill_func, regset_store_func): Change
1749         prototype.
1750         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
1751         Change prototype.
1752         * linux-low.c (get_stop_pc): Adjust.
1753         (check_removed_breakpoint): Adjust.
1754         (linux_wait_for_event): Adjust.
1755         (linux_resume_one_lwp): Adjust.
1756         (fetch_register): Add regcache parameter.  Adjust.
1757         (usr_store_inferior_registers): Ditto.
1758         (regsets_fetch_inferior_registers): Ditto.
1759         (regsets_store_inferior_registers): Ditto.
1760         (linux_fetch_registers, linux_store_registers): Ditto.
1761         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
1762         regcache.  Adjust.
1763         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
1764         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
1765         prototype to take a regcache.
1766         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
1767         * remote-utils.c (convert_ascii_to_int, outreg)
1768         (prepare_resume_reply): Change prototype to take a regcache.
1769         Adjust.
1770         * target.h (struct target_ops) <fetch_registers, store_registers>:
1771         Change prototype to take a regcache.
1772         (fetch_inferior_registers, store_inferior_registers): Change
1773         prototype to take a regcache.  Adjust.
1774         * proc-service.c (ps_lgetregs): Adjust.
1775         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
1776         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
1777         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
1778         take a regcache.  Adjust.
1779         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
1780         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
1781         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
1782         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
1783         * linux-cris-low.c (cris_get_pc, cris_set_pc)
1784         (cris_cannot_fetch_register):
1785         (cris_breakpoint_at): Change prototype to take a regcache.
1786         Adjust.
1787         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
1788         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
1789         to take a regcache.  Adjust.
1790         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
1791         Adjust.
1792         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
1793         take a regcache.  Adjust.
1794         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
1795         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
1796         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
1797         * linux-mips-low.c (mips_get_pc):
1798         (mips_set_pc): Change prototype to take a regcache.  Adjust.
1799         (mips_reinsert_addr): Adjust.
1800         (mips_collect_register): Change prototype to take a regcache.
1801         Adjust.
1802         (mips_supply_register):
1803         (mips_collect_register_32bit, mips_supply_register_32bit)
1804         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
1805         (mips_store_fpregset): Ditto.
1806         * linux-ppc-low.c (ppc_supply_ptrace_register, ppc_supply_ptrace_register):
1807         Ditto.
1808         (parse_spufs_run): Adjust.
1809         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
1810         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
1811         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
1812         take a regcache.  Adjust.
1813         * linux-s390-low.c (s390_collect_ptrace_register)
1814         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
1815         (s390_set_pc): Change prototype to take a regcache.  Adjust.
1816         (s390_arch_setup): Adjust.
1817         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
1818         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
1819         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
1820         (sparc_fill_gregset, sparc_store_gregset_from_stack)
1821         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
1822         regcache.  Adjust.
1823         (sparc_breakpoint_at): Adjust.
1824         * linux-xtensa-low.c (xtensa_fill_gregset):
1825         (xtensa_store_gregset):
1826         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
1827         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
1828         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
1829         prototype to take a regcache.  Adjust.
1830         * win32-arm-low.c (arm_fetch_inferior_register)
1831         (arm_store_inferior_register): Change prototype to take a
1832         regcache.  Adjust.
1833         * win32-i386-low.c (i386_fetch_inferior_register)
1834         (i386_store_inferior_register): Change prototype to take a
1835         regcache.  Adjust.
1836         * win32-low.c (child_fetch_inferior_registers)
1837         (child_store_inferior_registers): Change prototype to take a
1838         regcache.  Adjust.
1839         (win32_wait): Adjust.
1840         (win32_fetch_inferior_registers): Change prototype to take a
1841         regcache.  Adjust.
1842         (win32_store_inferior_registers): Adjust.
1843         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
1844         store_inferior_register>: Change prototype to take a regcache.
1845
1846 2010-01-20  Doug Evans  <dje@google.com>
1847
1848         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
1849         #ifdef.
1850         (linux_wait_for_event1, linux_init_signals): Ditto.
1851         (W_STOPCODE): Provide definition if missing.
1852
1853 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
1854
1855         * linux-low.c (linux_core_of_thread): New.
1856         (compare_ints, show_process, list_threads): New.
1857         (linux_qxfer_osdata): Report threads and cores.
1858         (linux_target_op): Register linux_core_of_thread.
1859         * remote-utils.c (prepare_resume_reply): Report the core.
1860         (buffer_xml_printf): Support %d specifier.
1861         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
1862         New.
1863         (handle_query): Handle qXfer:threads.  Announce availability
1864         thereof.
1865         * target.h (struct target_ops): New field core_of_thread.
1866
1867 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
1868
1869         * Makefile.in (clean): Remove new generated files.
1870         (reg-s390.o, reg-s390.c): Remove rules.
1871         (reg-s390x.o, reg-s390x.c): Likewise.
1872         (s390-linux32.o, s390-linux32.c): Add rules.
1873         (s390-linux64.o, s390-linux64.c): Likewise.
1874         (s390x-linux64.o, s390x-linux64.c): Likewise.
1875         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
1876         * linux-s390-low.c: Include <elf.h>.
1877         (HWCAP_S390_HIGH_GPRS): Define if undefined.
1878         (init_registers_s390): Remove prototype.
1879         (init_registers_s390x): Likewise.
1880         (init_registers_s390_linux32): Add prototype.
1881         (init_registers_s390_linux64): Likewise.
1882         (init_registers_s390x_linux64): Likewise.
1883         (s390_num_regs_3264): New define.
1884         (s390_regmap_3264): New global variable.
1885         (s390_cannot_fetch_register): Remove obsolete check.
1886         (s390_cannot_store_register): Likewise.
1887         (s390_collect_ptrace_register): Handle upper/lower register halves.
1888         (s390_supply_ptrace_register): Likewise.
1889         (s390_fill_gregset): Update to register number changes.
1890         (s390_get_hwcap): New routine.
1891         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
1892         Install appropriate regmap and register set.
1893
1894 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
1895
1896         * server.c (gdbserver_version): Update copyright year to 2010.
1897         * gdbreplay.c (gdbreplay_version): Likewise.
1898
1899 2009-12-28  Doug Evans  <dje@google.com>
1900
1901         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
1902         elf/external.h.  Include <elf.h> instead but only if necessary.
1903
1904 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
1905
1906         * linux-low.c (linux_remove_process): Remove `detaching'
1907         parameter.  Don't release/detach from thread_db here.
1908         (linux_kill): Release/detach from thread_db here, ...
1909         (linux_detach): ... and here, before actually detaching.
1910         (linux_wait_1): ... and here, when a process exits.
1911         * thread-db.c (any_thread_of): New.
1912         (thread_db_free): Switch the current inferior to a thread of the
1913         passed in process.
1914
1915 2009-12-21  Doug Evans  <dje@google.com>
1916
1917         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
1918
1919         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
1920         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
1921         warning ifndef __NR_tkill.  Move setting of errno there too.
1922         Delete unnecessary resetting of errno after syscall.
1923         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
1924
1925         * configure.ac: Check for dladdr.
1926         * config.in: Regenerate.
1927         * configure: Regenerate.
1928         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
1929         (try_thread_db_load): Update.
1930
1931         * linux-low.c (my_waitpid): Delete unnecessary prototype.
1932
1933 2009-12-18  Doug Evans  <dje@google.com>
1934
1935         * event-loop.c: Include unistd.h if it exists.
1936
1937         * linux-low.c (my_waitpid): Move definition away from being in
1938         between linux_tracefork_child/linux_test_for_tracefork.
1939
1940         * gdb_proc_service.h (psaddr_t): Fix type.
1941         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
1942         signature to match glibc.
1943
1944 2009-12-16  Doug Evans  <dje@google.com>
1945
1946         * linux-low.c (linux_read_memory): Fix argument to read.
1947
1948 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
1949
1950         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
1951         events, don't leave current_inferior pointing at null.
1952
1953 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
1954
1955         * win32-low.c (LOG): Delete.
1956         (OUTMSG): Output to stderr.
1957         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
1958         on compile time LOG macro.
1959         (win32_wait): Fix debug output.
1960
1961 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
1962
1963         * win32-low.c (win32_add_one_solib): If the dll name is
1964         "ntdll.dll", prepend the system directory to the dll path.
1965
1966 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
1967
1968         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
1969
1970 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
1971             Vladimir Prus  <vladimir@codesourcery.com>
1972
1973         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
1974         * configure.ac: Check for __mcoldfire__ and set
1975         gdb_cv_m68k_is_coldfire.
1976         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
1977         reg-cf.o and reg-m68k.o.
1978         * configure: Regenerated.
1979
1980 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
1981
1982         * linux-low.c (linux_remove_process): Add `detaching' parameter.
1983         Pass it to thread_db_free.
1984         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
1985         proper `detaching' argument to linux_remove_process.
1986         * linux-low.h (thread_db_free): Add `detaching' parameter.
1987         * thread-db.c (thread_db_init): Pass false as `detaching' argument
1988         to thread_db_free.
1989         (thread_db_free): Add `detaching' parameter.  Only
1990         call td_ta_clear_event if detaching from process.
1991
1992 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
1993
1994         * thread-db.c (thread_db_free): Fix typo.
1995
1996 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
1997
1998         PR gdb/10838
1999         * thread-db.c (thread_db_free): Call td_ta_clear_event.
2000
2001 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
2002
2003         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
2004         with an i686 compiler.
2005         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
2006         needed.
2007         * configure: Rebuilt.
2008
2009 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
2010
2011         PR gdb/10783
2012
2013         * server.c (handle_search_memory_1): Correct read_addr initialization
2014         in loop for searching subsequent chunks.
2015
2016 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
2017
2018         * configure.ac: New --with-libthread-db option.
2019         * thread-db.c: Allow direct dependence on libthread_db.
2020         (thread_db_free): Adjust.
2021         * config.in: Regenerate.
2022         * configure: Likewise.
2023
2024 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
2025
2026         PR gdb/10757
2027         * thread-db.c (attach_thread): New function.
2028         (maybe_attach_thread): Return success/failure.
2029         (find_new_threads_callback): Adjust.
2030         (thread_db_find_new_threads): Loop until no new threads.
2031
2032 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
2033
2034         * proc-service.c (ps_lgetregs): Formatting.
2035
2036 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
2037
2038         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
2039         * configure.ac: Adjust.
2040         * linux-low.h (struct process_info_private): Move members to struct
2041         thread_db.
2042         (thread_db_free, thread_db_handle_monitor_command): New prototype.
2043         * linux-low.c (linux_remove_process): Adjust.
2044         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
2045         * server.c (handle_query): Move code ...
2046         (handle_monitor_command): ... here. New function.
2047         * target.h (struct target_ops): New member.
2048         * thread-db.c (struct thread_db): New.
2049         (libthread_db_search_path): New variable.
2050         (thread_db_create_event, thread_db_enable_reporting)
2051         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
2052         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
2053         (try_thread_db_load_1, dladdr_to_soname): New functions.
2054         (try_thread_db_load, thread_db_load_search): New functions.
2055         (thread_db_init): Search for libthread_db.
2056         (thread_db_free): New function.
2057         (thread_db_handle_monitor_command): Likewise.
2058         * config.in: Regenerate.
2059         * configure: Regenerate.
2060
2061 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
2062
2063         * spu-low.c (spu_kill): Wait for inferior to terminate.
2064         Call clear_inferiors.
2065         (spu_detach): Call clear_inferiors.
2066
2067 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2068
2069         * aclocal.m4: Regenerate.
2070         * config.in: Likewise.
2071         * configure: Likewise.
2072
2073 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
2074
2075         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
2076         (parse_spufs_run): New function.
2077         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
2078         (ppc_breakpoint_at): Handle SPU breakpoints.
2079
2080 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
2081
2082         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
2083         (SPUFS_MAGIC): Define.
2084         (spu_enumerate_spu_ids): New function.
2085         (linux_qxfer_spu): New function.
2086         (linux_target_ops): Install linux_qxfer_spu.
2087
2088 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
2089
2090         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
2091         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
2092         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
2093         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
2094         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
2095         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
2096         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
2097         (init_registers_powerpc_cell32l): Add prototype.
2098         (init_registers_powerpc_cell64l): Likewise.
2099         (ppc_arch_setup): Detect Cell/B.E. architecture.
2100
2101 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2102
2103         * Makefile.in (datarootdir): New variable.
2104
2105 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
2106
2107         * linux-low.c (linux_write_memory): Update debugging output.
2108         * Makefile.in (clean): Add new descriptions.
2109         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
2110         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
2111         * configure.srv: Add new files for arm*-*-linux*.
2112         * linux-arm-low.c: Add new declarations.
2113         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
2114         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
2115         (HWCAP_VFPv3D16): New.
2116         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
2117         instead of __IWMMXT__.
2118         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
2119         (arm_arch_setup): New.
2120         (target_regsets): Remove #ifdef.  Add VFP regset.
2121         (the_low_target): Use arm_arch_setup.
2122
2123 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
2124
2125         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
2126         the main thread again.
2127
2128 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
2129
2130         Adding Neutrino gdbserver.
2131         * configure: Regenerated.
2132         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
2133         * configure.srv (i[34567]86-*-nto*): New target.
2134         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
2135         * remote-utils.c [__QNX__]: Include sys/iomgr.h
2136         (nto_comctrl) [__QNX__]: New function.
2137         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
2138
2139 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
2140
2141         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
2142         srv_tgtobj.
2143
2144 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
2145             Pedro Alves  <pedro@codesourcery.com>
2146
2147         * win32-i386-low.c (i386_get_thread_context): Handle systems that
2148         don't support CONTEXT_EXTENDED_REGISTERS.
2149         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
2150         (the_low_target): Install them.
2151         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
2152         failing with ERROR_PIPE_NOT_CONNECTED.
2153
2154 2009-06-30  Doug Evans  <dje@google.com>
2155             Pierre Muller  <muller@ics.u-strasbg.fr>
2156
2157         Add h/w watchpoint support to x86-linux, win32-i386.
2158         * Makefile.in (SFILES): Add i386-low.c
2159         (i386_low_h): Define.
2160         (i386-low.o): Add dependencies.
2161         (linux-x86-low.o): Add i386-low.h dependency.
2162         (win32-i386-low.o): Ditto.
2163         * i386-low.c: New file.
2164         * i386-low.h: New file.
2165         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
2166         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
2167         * linux-low.c (linux_add_process): Initialize arch_private.
2168         (linux_remove_process): Free arch_private.
2169         (add_lwp): Initialize arch_private.
2170         (delete_lwp): Free arch_private.
2171         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
2172         provided.
2173         * linux-low.h (process_info_private): New member arch_private.
2174         (lwp_info): New member arch_private.
2175         (linux_target_ops): New members new_process, new_thread,
2176         prepare_to_resume.
2177         (ptid_of): New macro.
2178         * linux-x86-low.c: Include stddef.h, i386-low.h.
2179         (arch_process_info): New struct.
2180         (arch_lwp_info): New struct.
2181         (x86_linux_dr_get, x86_linux_dr_set): New functions.
2182         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
2183         (i386_dr_low_get_status): New function.
2184         (x86_insert_point, x86_remove_point): New functions.
2185         (x86_stopped_by_watchpoint): New function.
2186         (x86_stopped_data_address): New function.
2187         (x86_linux_new_process, x86_linux_new_thread): New functions.
2188         (x86_linux_prepare_to_resume): New function.
2189         (the_low_target): Add entries for insert_point, remove_point,
2190         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
2191         prepare_to_resume.
2192         * server.c (debug_hw_points): New global.
2193         (monitor_show_help): Document set debug-hw-points.
2194         (handle_query): Process "set debug-hw-points".
2195         * server.h (debug_hw_points): Declare.
2196         (paddress): Declare.
2197         * utils.c (NUMCELLS, CELLSIZE): New macros.
2198         (get_sell, xsnprintf, paddress): New functions.
2199         * win32-arm-low.c (the_low_target): Add entries for insert_point,
2200         remove_point, stopped_by_watchpoint, stopped_data_address.
2201         * win32-i386-low.c: Include i386-low.h.
2202         (debug_reg_state): Replaces dr.
2203         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
2204         (i386_dr_low_get_status): New function.
2205         (i386_insert_point, i386_remove_point): New functions.
2206         (i386_stopped_by_watchpoint): New function.
2207         (i386_stopped_data_address): New function.
2208         (i386_initial_stuff): Update.
2209         (get_thread_context,set_thread_context,i386_thread_added): Update.
2210         (the_low_target): Add entries for insert_point,
2211         remove_point, stopped_by_watchpoint, stopped_data_address.
2212         * win32-low.c (win32_insert_watchpoint): New function.
2213         (win32_remove_watchpoint): New function.
2214         (win32_stopped_by_watchpoint): New function.
2215         (win32_stopped_data_address): New function.
2216         (win32_target_ops): Add entries for insert_watchpoint,
2217         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
2218         * win32-low.h (win32_target_ops): New members insert_point,
2219         remove_point, stopped_by_watchpoint, stopped_data_address.
2220
2221 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
2222
2223         * server.c (process_serial_event): Re-return unsupported, not
2224         error, if the type isn't recognized.  Re-allow supporting only
2225         insert or remove packets.  Also call require_running for
2226         breakpoints.  Add missing break statement to default case.  Tidy.
2227         * target.h (struct target_ops): Rename insert_watchpoint to
2228         insert_point, and remove_watchpoint to remove_point.
2229
2230         * linux-low.h (struct linux_target_ops): Likewise.
2231         * linux-low.c (linux_insert_watchpoint): Rename to ...
2232         (linux_insert_point): ... this.  Adjust.
2233         (linux_remove_watchpoint): Rename to ...
2234         (linux_remove_point): ... this.  Adjust.
2235         (linux_target_ops): Adjust.
2236         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
2237         (cris_insert_point): ... this.
2238         (cris_remove_watchpoint): Rename to ...
2239         (cris_remove_point): ... this.
2240         (the_low_target): Adjust.
2241
2242 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
2243
2244         * server.c (handle_v_kill): Pass signal_pid to
2245         kill_inferior if multi_process is zero.
2246
2247 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
2248
2249         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
2250         * target.h (target_ops): Comment for *_watchpoint to make it clear
2251         the functions can get types '0' and '1'.
2252
2253 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
2254
2255         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
2256         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
2257         * regcache.c (get_regcache): Likewise.
2258         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
2259         * win32-low.c (child_fetch_inferior_registers): Remove check for
2260         regno 0.
2261
2262 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
2263             Pedro Alves <pedro@codesourcery.com>
2264
2265         * target.h (struct target_ops) <supports_multi_process>: New
2266         callback.
2267         (target_supports_multi_process): New.
2268         * server.c (handle_query): Even if GDB reports support, only
2269         enable multi-process if the target also supports it.  Report
2270         multi-process support only if the target backend supports it.
2271         * linux-low.c (linux_supports_multi_process): New function.
2272         (linux_target_ops): Install it as target_supports_multi_process
2273         callback.
2274
2275 2009-05-24  Doug Evans  <dje@google.com>
2276
2277         Global renaming of find_thread_pid to find_thread_ptid.
2278         * server.h (find_thread_ptid): Renamed from find_thread_pid.
2279         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
2280         All callers updated.
2281
2282         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
2283         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
2284         directly.
2285
2286         * linux-low.c (get_stop_pc): Print pc if debug_threads.
2287         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
2288         (linux_resume_one_lwp): Ditto.
2289
2290 2009-05-23  Doug Evans  <dje@google.com>
2291
2292         * linux-low.c (linux_resume_one_lwp): Change type of first arg
2293         from struct inferior_list_entry * to struct lwp_info *.
2294         All callers updated.
2295
2296 2009-05-13  Doug Evans  <dje@google.com>
2297
2298         * linux-x86-low.c: Don't include assert.h.
2299         (x86_siginfo_fixup): Use fatal, not assert.
2300         (x86_arch_setup): Fix comment.
2301
2302 2009-05-12  Doug Evans  <dje@google.com>
2303
2304         Biarch support for i386/amd64 gdbserver.
2305         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
2306         Add linux-x86-low.c.
2307         (linux-i386-low.o, linux-x86-64-low.o): Delete.
2308         (linux-x86-low.o): Add.
2309         * linux-x86-64-low.c: Delete.
2310         * linux-i386-low.c: Delete.
2311         * linux-x86-low.c: New file.
2312         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
2313         linux-x86-low.o.
2314         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
2315         linux-x86-low.o.
2316         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
2317         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
2318         (linux_child_pid_to_exec_file): New function.
2319         (elf_64_header_p, elf_64_file_p): New functions.
2320         (siginfo_fixup): New function.
2321         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
2322         give target a chance to convert layout.
2323         * linux-low.h (linux_target_ops): New member siginfo_fixup.
2324         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
2325
2326 2009-05-07  Doug Evans  <dje@google.com>
2327
2328         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
2329         (regsets_store_inferior_registers): Ditto.
2330
2331 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
2332
2333         PR server/10048
2334
2335         * linux-low.c (must_set_ptrace_flags): Delete.
2336         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
2337         of the global.
2338         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
2339         `lwp->must_set_ptrace_flags' instead.
2340         (linux_wait_for_event_1): Set ptrace options here.
2341         (linux_wait_1): ... not here.
2342
2343 2009-04-30  Doug Evans  <dje@google.com>
2344
2345         * inferiors.c (started_inferior_callback): New function.
2346         (attached_inferior_callback): New function.
2347         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
2348         * server.c (print_started_pid, print_attached_pid): New functions.
2349         (detach_or_kill_for_exit): New function.
2350         (main): Call it instead of for_each_inferior (kill_inferior_callback).
2351         * server.h (have_started_inferiors_p): Declare.
2352         (have_attached_inferiors_p): Declare.
2353
2354         * inferiors.c (remove_process): Fix memory leak, free process.
2355         * linux-low.c (linux_remove_process): New function.
2356         (linux_kill): Call it instead of remove_process.
2357         (linux_detach, linux_wait_1): Ditto.
2358
2359 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
2360
2361         * configure.srv: Add x86 Windows CE target.
2362
2363 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
2364
2365         * inferiors.c (get_thread_process): Make global.
2366         * server.h (get_thread_process): Add prototype.
2367         * thread-db.c (find_one_thread): Use get_thread_process
2368         instead of current_process.
2369         (thread_db_get_tls_address): Do not crash if called when
2370         thread layer is not yet initialized.
2371
2372 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
2373
2374         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
2375         * spu-low.c (current_tid): Rename to ...
2376         (current_ptid): ... this.
2377         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
2378         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
2379         ptid_get_lwp (current_ptid) instead of current_tid.
2380         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
2381         instead of current_tid.  Use find_process_pid to verify pid
2382         argument is valid.  Pass proper argument to remove_process.
2383         (spu_thread_alive): Compare current_ptid instead of current_tid.
2384         (spu_resume): Likewise.
2385
2386 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
2387
2388         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
2389         variable.
2390
2391 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
2392
2393         Implement the multiprocess extensions, and add linux multiprocess
2394         support.
2395
2396         * server.h (ULONGEST): Declare.
2397         (struct ptid, ptid_t): New.
2398         (minus_one_ptid, null_ptid): Declare.
2399         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
2400         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
2401         (struct inferior_list_entry): Change `id' type from unsigned from
2402         to ptid_t.
2403         (struct sym_cache, struct breakpoint, struct
2404         process_info_private): Forward declare.
2405         (struct process_info): Declare.
2406         (current_process): Declare.
2407         (all_processes): Declare.
2408         (initialize_inferiors): Declare.
2409         (add_thread): Adjust to use ptid_t.
2410         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
2411         (add_process, remove_process, find_thread_pid): Declare.
2412         (find_inferior_id): Adjust to use ptid_t.
2413         (cont_thread, general_thread, step_thread): Change type to ptid_t.
2414         (multi_process): Declare.
2415         (push_event): Adjust to use ptid_t.
2416         (read_ptid, write_ptid): Declare.
2417         (prepare_resume_reply): Adjust to use ptid_t.
2418         (clear_symbol_cache): Declare.
2419         * inferiors.c (all_processes): New.
2420         (null_ptid, minus_one_ptid): New.
2421         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
2422         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
2423         (add_thread): Change unsigned long to ptid.  Remove gdb_id
2424         parameter.  Adjust.
2425         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
2426         (gdb_id_to_thread): Rename to ...
2427         (find_thread_pid): ... this.  Change unsigned long to ptid.
2428         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
2429         (loaded_dll, pull_pid_from_list): Adjust.
2430         (add_process, remove_process, find_process_pid)
2431         (get_thread_process, current_process, initialize_inferiors): New.
2432         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
2433         (struct target_waitstatus) <related_pid>: Ditto.
2434         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
2435         return type to int.
2436         (struct target_ops) <join>: Add `pid' argument.
2437         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
2438         (struct target_ops) <wait>: Add `ptid' field.  Change return type
2439         to ptid.
2440         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
2441         (mywait): Add `ptid' argument.  Change return type to ptid_t.
2442         (target_pid_to_str): Declare.
2443         * target.c (set_desired_inferior): Adjust to use ptids.
2444         (mywait): Add new `ptid' argument.  Adjust.
2445         (target_pid_to_str): New.
2446         * mem-break.h (free_all_breakpoints): Declare.
2447         * mem-break.c (breakpoints): Delelete.
2448         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
2449         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
2450         to use per-process breakpoint list.
2451         (free_all_breakpoints): New.
2452         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
2453         (symbol_cache, all_symbols_looked_up): Delete.
2454         (hexchars): New.
2455         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
2456         read_ptid): New.
2457         (prepare_resume_reply): Change ptid argument's type from unsigned
2458         long to ptid_t.  Adjust.  Implement W;process and X;process.
2459         (free_sym_cache, clear_symbol_cache): New.
2460         (look_up_one_symbol): Adjust to per-process symbol cache.  *
2461         * server.c (cont_thread, general_thread, step_thread): Change type
2462         to ptid_t.
2463         (attached): Delete.
2464         (multi_process): New.
2465         (last_ptid): Change type to ptid_t.
2466         (struct vstop_notif) <ptid>: Change type to ptid_t.
2467         (queue_stop_reply, push_event): Change `ptid' argument's type to
2468         ptid_t.
2469         (discard_queued_stop_replies): Add `pid' argument.
2470         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
2471         changes.  Don't reference the `attached' global.
2472         (attach_inferior): Adjust to mywait interface changes.
2473         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
2474         features.  Handle and report "multiprocess+".  Handle
2475         "qAttached:PID".
2476         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
2477         changes.
2478         (handle_v_kill): New.
2479         (handle_v_stopped): Adjust to use target_pid_to_str.
2480         (handle_v_requests): Allow multiple attaches and runs when
2481         multiprocess extensions are in effect.  Handle "vKill".
2482         (myresume): Adjust to use ptids.
2483         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
2484         (handle_status): Adjust to discard_queued_stop_replies interface
2485         change.
2486         (first_thread_of, kill_inferior_callback)
2487         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
2488         (main): Call initialize_inferiors.  Adjust to use ptids, killing
2489         and detaching from all inferiors.  Handle multiprocess packet
2490         variants.
2491         * linux-low.h: Include gdb_proc_service.h.
2492         (struct process_info_private): New.
2493         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
2494         <lwpid_of>: Use ptid_get_lwp.
2495         (get_lwp_thread): Adjust.
2496         (struct lwp_info): Add `dead' member.
2497         (find_lwp_pid): Declare.
2498         * linux-low.c (thread_db_active): Delete.
2499         (new_inferior): Adjust comment.
2500         (inferior_pid): Delete.
2501         (linux_add_process): New.
2502         (handle_extended_wait): Adjust.
2503         (add_lwp): Change unsigned long to ptid.
2504         (linux_create_inferior): Add process to processes table.  Adjust
2505         to use ptids.  Don't set new_inferior here.
2506         (linux_attach_lwp): Rename to ...
2507         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
2508         it.  Adjust to use ptids.
2509         (linux_attach_lwp): New.
2510         (linux_attach): Add process to processes table.  Don't set
2511         new_inferior here.
2512         (struct counter): New.
2513         (second_thread_of_pid_p, last_thread_of_process_p): New.
2514         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
2515         multiple processes.
2516         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
2517         processes.  Remove process from process table.
2518         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
2519         to multiple processes.
2520         (any_thread_of): New.
2521         (linux_detach): Add `pid' argument, and handle it.  Remove process
2522         from processes table.
2523         (linux_join): Add `pid' argument.  Handle it.
2524         (linux_thread_alive): Change unsighed long argument to ptid_t.
2525         Consider dead lwps as not being alive.
2526         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
2527         threads we're not interested in.
2528         (same_lwp, find_lwp_pid): New.
2529         (linux_wait_for_lwp): Change `pid' argument's type from int to
2530         ptid_t.  Adjust.
2531         (linux_wait_for_event): Rename to ...
2532         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
2533         from int to ptid_t.  Adjust.
2534         (linux_wait_for_event): New.
2535         (linux_wait_1): Add `ptid' argument.  Change return type to
2536         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
2537         that exit from the process table.
2538         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
2539         Adjust.
2540         (mark_lwp_dead): New.
2541         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
2542         stopping all threads, mark its main lwp as dead.
2543         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
2544         ptids.
2545         (fetch_register, usr_store_inferior_registers)
2546         (regsets_fetch_inferior_registers)
2547         (regsets_store_inferior_registers, linux_read_memory)
2548         (linux_write_memory): Inline `inferior_pid'.
2549         (linux_look_up_symbols): Adjust to use per-process
2550         `thread_db_active'.
2551         (linux_request_interrupt): Adjust to use ptids.
2552         (linux_read_auxv): Inline `inferior_pid'.
2553         (initialize_low): Don't reference thread_db_active.
2554         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
2555         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
2556         (ps_getpid): Return the pid of the current inferior.
2557         * thread-db.c (proc_handle, thread_agent): Delete.
2558         (thread_db_create_event, thread_db_enable_reporting): Adjust to
2559         per-process data.
2560         (find_one_thread): Change argument type to ptid_t.  Adjust to
2561         per-process data.
2562         (maybe_attach_thread): Adjust to per-process data and ptids.
2563         (thread_db_find_new_threads): Ditto.
2564         (thread_db_init): Ditto.
2565         * spu-low.c (spu_create_inferior, spu_attach): Add process to
2566         processes table.  Adjust to use ptids.
2567         (spu_kill, spu_detach): Adjust interface.  Remove process from
2568         processes table.
2569         (spu_join, spu_thread_alive): Adjust interface.
2570         (spu_wait): Adjust interface.  Remove process from processes
2571         table.  Adjust to use ptids.
2572         * win32-low.c (current_inferior_tid): Delete.
2573         (current_inferior_ptid): New.
2574         (debug_event_ptid): New.
2575         (thread_rec): Take a ptid.  Adjust.
2576         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
2577         (child_delete_thread): Ditto.
2578         (do_initial_child_stuff): Add `attached' argument.  Add process to
2579         processes table.
2580         (child_fetch_inferior_registers, child_store_inferior_registers):
2581         Adjust.
2582         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
2583         (win32_attach): Pass 1 to do_initial_child_stuff.
2584         (win32_kill): Adjust interface.  Remove process from processes
2585         table.
2586         (win32_detach): Ditto.
2587         (win32_join): Adjust interface.
2588         (win32_thread_alive): Take a ptid.
2589         (win32_resume): Adjust to use ptids.
2590         (get_child_debug_event): Ditto.
2591         (win32_wait): Adjust interface.  Remove exiting process from
2592         processes table.
2593
2594 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
2595
2596         Non-stop mode support.
2597
2598         * server.h (non_stop): Declare.
2599         (gdb_client_data, handler_func): Declare.
2600         (delete_file_handler, add_file_handler, start_event_loop):
2601         Declare.
2602         (handle_serial_event, handle_target_event, push_event)
2603         (putpkt_notif): Declare.
2604         * target.h (enum resume_kind): New.
2605         (struct thread_resume): Replace `step' field by `kind' field.
2606         (TARGET_WNOHANG): Define.
2607         (struct target_ops) <wait>: Add `options' argument.
2608         <supports_non_stop, async, start_non_stop>: New fields.
2609         (target_supports_non_stop, target_async): New.
2610         (start_non_stop): Declare.
2611         (mywait): Add `options' argument.
2612         * target.c (mywait): Add `options' argument.  Print child exit
2613         notifications here.
2614         (start_non_stop): New.
2615         * server.c (non_stop, own_buf, mem_buf): New globals.
2616         (struct vstop_notif): New.
2617         (notif_queue): New global.
2618         (queue_stop_reply, push_event, discard_queued_stop_replies)
2619         (send_next_stop_reply): New.
2620         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
2621         interface changes.
2622         (attach_inferior): In non-stop mode, don't wait for the target
2623         here.
2624         (handle_general_set): Handle QNonStop.
2625         (handle_query): When handling qC, return the current general
2626         thread, instead of the first thread of the list.
2627         (handle_query): If the backend supports non-stop mode, include
2628         QNonStop+ in the qSupported query response.
2629         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
2630         and non-stop mode.
2631         (handle_v_attach, handle_v_run): Handle non-stop mode.
2632         (handle_v_stopped): New.
2633         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
2634         (myresume): Adjust to use resume_kind.  Handle non-stop.
2635         (queue_stop_reply_callback): New.
2636         (handle_status): Handle non-stop mode.
2637         (main): Clear non_stop flag on reconnection.  Use the event-loop.
2638         Refactor serial protocol handling from here ...
2639         (process_serial_event): ... to this new function.  When GDB
2640         selects any thread, select one here.  In non-stop mode, wait until
2641         GDB acks all pending events before exiting.
2642         (handle_serial_event, handle_target_event): New.
2643         * remote-utils.c (remote_open): Install remote_desc in the event
2644         loop.
2645         (remote_close): Remove remote_desc from the event loop.
2646         (putpkt_binary): Rename to...
2647         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
2648         (putpkt_binary): New as wrapper around putpkt_binary_1.
2649         (putpkt_notif): New.
2650         (prepare_resume_reply): In non-stop mode, don't change the
2651         general_thread.
2652         * event-loop.c: New.
2653         * Makefile.in (OBJ): Add event-loop.o.
2654         (event-loop.o): New rule.
2655
2656         * linux-low.h (pid_of): Moved here.
2657         (lwpid_of): New.
2658         (get_lwp_thread): Use lwpid_of.
2659         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
2660         * linux-low.c (pid_of): Delete.
2661         (inferior_pid): Use lwpid_of.
2662         (linux_event_pipe): New.
2663         (target_is_async_p): New.
2664         (delete_lwp): New.
2665         (handle_extended_wait): Use lwpid_of.
2666         (add_lwp): Don't set lwpid field.
2667         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
2668         (linux_kill_one_lwp): If killing a running lwp, stop it first.
2669         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
2670         (linux_detach_one_lwp): If detaching from a running lwp, stop it
2671         first.  Adjust to linux_wait_for_event interface changes.  Use
2672         lwpid_of.
2673         (linux_detach): Don't delete the main lwp here.
2674         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
2675         (status_pending_p): Don't consider explicitly suspended lwps.
2676         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
2677         pointer.  Add OPTIONS argument.  Change return type to int.  Use
2678         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
2679         (linux_wait_for_event): Take an integer pid instead of a lwp_info
2680         pointer.  Add status pointer argument.  Return a pid instead of a
2681         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
2682         changes.  In non-stop mode, don't switch to a random thread.
2683         (linux_wait): Rename to...
2684         (linux_wait_1): ... this.  Add target_options argument, and handle
2685         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
2686         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
2687         clean exit and signal exit code.  Don't stop all threads in
2688         non-stop mode.  In all-stop mode, only stop all threads when
2689         reporting a stop to GDB.  Handle explicit thread stop requests.
2690         (async_file_flush, async_file_mark): New.
2691         (linux_wait): New.
2692         (send_sigstop): Use lwpid_of.
2693         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
2694         interface changes.  In non-stop mode, don't switch to a random
2695         thread.
2696         (linux_resume_one_lwp): Use lwpid_of.
2697         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
2698         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
2699         non-stop mode, don't look for pending flag in all threads.
2700         (resume_status_pending_p): Don't consider explicitly suspended
2701         threads.
2702         (my_waitpid): Reimplement.  Emulate __WALL.
2703         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
2704         Use lwpid_of.
2705         (sigchld_handler, linux_supports_non_stop, linux_async)
2706         (linux_start_non_stop): New.
2707         (linux_target_ops): Register linux_supports_non_stop, linux_async
2708         and linux_start_non_stop.
2709         (initialize_low): Install SIGCHLD handler.
2710         * thread-db.c (thread_db_create_event, find_one_thread)
2711         (thread_db_get_tls_address): Use lwpid_of.
2712         * win32-low.c (win32_detach): Adjust to use resume_kind.
2713         (win32_wait): Add `options' argument.
2714         * spu-low.c (spu_resume): Adjust to use resume_kind.
2715         (spu_wait): Add `options' argument.
2716
2717 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
2718
2719         Decouple target code from remote protocol.
2720
2721         * target.h (enum target_waitkind): New.
2722         (struct target_waitstatus): New.
2723         (struct target_ops) <wait>: Return an unsigned long.  Take a
2724         target_waitstatus pointer instead of a char pointer.
2725         (mywait): Likewise.
2726         * target.c (mywait): Change prototype to return an unsigned long.
2727         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
2728         * server.h (thread_from_wait, old_thread_from_wait): Delete
2729         declarations.
2730         (prepare_resume_reply): Change prototype to take a
2731         target_waitstatus.
2732         * server.c (thread_from_wait, old_thread_from_wait): Delete.
2733         (last_status, last_ptid): New.
2734         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
2735         pid instead of a signal.
2736         (attach_inferior): Remove "status" and "signal" parameters.
2737         Adjust.
2738         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
2739         not as an address.
2740         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
2741         (handle_v_requests, myresume): Remove "status" and "signal"
2742         parameters.  Adjust.
2743         (handle_status): New.
2744         (main): Delete local `status'.  Adjust.
2745         * remote-utils.c: Include target.h.
2746         (prepare_resume_reply): Change prototype to take a
2747         target_waitstatus.  Adjust.
2748
2749         * linux-low.c (linux_wait): Adjust to new target_ops->wait
2750         interface.
2751         * spu-low.c (spu_wait): Adjust.
2752         * win32-low.c (enum target_waitkind, struct target_waitstatus):
2753         Delete.
2754         (win32_wait): Adjust.
2755
2756 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
2757
2758         * target.h (struct thread_resume): Delete leave_stopped member.
2759         (struct target_ops): Add a `n' argument to the `resume' callback.
2760         * server.c (start_inferior): Adjust.
2761         (handle_v_cont, myresume): Adjust.
2762         * linux-low.c (check_removed_breakpoint): Adjust to resume
2763         interface change, and to removed leave_stopped field.
2764         (resume_ptr): Delete.
2765         (struct thread_resume_array): New.
2766         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
2767         resume interface change.
2768         (linux_continue_one_thread, linux_queue_one_thread)
2769         (resume_status_pending_p): Check if the resume field is NULL
2770         instead of checking the leave_stopped member.
2771         (linux_resume): Adjust to the target resume interface change.
2772         * spu-low.c (spu_resume): Adjust to the target resume interface
2773         change.
2774         * win32-low.c (win32_detach, win32_resume): Ditto.
2775
2776 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
2777
2778         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
2779         flag.
2780         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
2781         pending.
2782         (linux_continue_one_thread): Only preserve the stepping flag if
2783         there's a pending breakpoint.
2784
2785 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
2786
2787         * server.c (main): After the inferior having exited, call
2788         remote_close before exiting gdbserver.
2789
2790 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
2791
2792         Fix size of FPSCR in Power 7 processors.
2793         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
2794         (PPC_FEATURE_HAS_DFP): New #define.
2795         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
2796         size of the FPSCR.
2797
2798 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
2799
2800         * server.c (handle_query) Whitespace and formatting.
2801
2802 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
2803
2804         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
2805         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
2806         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
2807         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
2808         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
2809         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
2810         Makefile.in, configure.ac: Fix whitespace throughout.
2811         * configure: Regenerate.
2812
2813 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
2814
2815         * inferiors.c (find_inferior): Make it safe for the callback
2816         function to delete the currently iterated inferior.
2817
2818 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
2819
2820         * Makefile.in (linuw_low_h): Move higher.
2821         (thread-db.o): Depend on $(linux_low_h).
2822
2823 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
2824
2825         Rename "process" to "lwp" throughout.
2826
2827         * linux-low.c (all_processes): Rename to...
2828         (all_lwps): ... this.
2829         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
2830         (add_process): Rename to ...
2831         (add_lwp): ... this.  Adjust.
2832         (linux_create_inferior): Adjust.
2833         (linux_attach_lwp): Adjust.
2834         (linux_attach): Adjust.
2835         (linux_kill_one_process): Rename to ...
2836         (linux_kill_one_lwp): ... this.  Adjust.
2837         (linux_kill): Adjust.
2838         (linux_detach_one_process): Rename to ...
2839         (linux_detach_one_lwp): ... this.  Adjust.
2840         (linux_detach): Adjust.
2841         (check_removed_breakpoint): Adjust.
2842         (status_pending_p): Adjust.
2843         (linux_wait_for_process): Rename to ...
2844         (linux_wait_for_lwp): ... this.  Adjust.
2845         (linux_wait_for_event): Adjust.
2846         (send_sigstop): Adjust.
2847         (wait_for_sigstop): Adjust.
2848         (stop_all_processes): Rename to ...
2849         (stop_all_lwps): ... this.
2850         (linux_resume_one_process): Rename to ...
2851         (linux_resume_one_lwp): ... this.  Adjust.
2852         (linux_set_resume_request, linux_continue_one_thread)
2853         (linux_queue_one_thread, resume_status_pending_p)
2854         (usr_store_inferior_registers, regsets_store_inferior_registers)
2855         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
2856         Adjust.
2857         * linux-low.h (get_process): Rename to ...
2858         (get_lwp): ... this.  Adjust.
2859         (get_thread_process): Rename to ...
2860         (get_thread_lwp): ... this.  Adjust.
2861         (get_process_thread): Rename to ...
2862         (get_lwp_thread): ... this.  Adjust.
2863         (struct process_info): Rename to ...
2864         (struct lwp_info): ... this.
2865         (all_processes): Rename to ...
2866         (all_lwps): ... this.
2867         * proc-service.c (ps_lgetregs): Adjust.
2868         * thread-db.c (thread_db_create_event, find_one_thread)
2869         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
2870
2871 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
2872
2873         * server.c (handle_query): Handle "qAttached".
2874
2875 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
2876
2877         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
2878         GPLv3, update license URL.
2879
2880 2009-03-01  Doug Evans  <dje@google.com>
2881
2882         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
2883         (server_h): Add gdb_signals.h.
2884         (signals.o): Update.
2885         * server.h (target_signal_from_host,target_signal_to_host_p)
2886         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
2887
2888 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
2889
2890         * remote-utils.c (getpkt): Also generate remote-debug
2891         information if noack_mode is set.
2892
2893 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
2894
2895         * server.c (handle_query): Report qXfer:siginfo:read and
2896         qXfer:siginfo:write as supported and handle them.
2897         * target.h (struct target_ops) <qxfer_siginfo>: New field.
2898         * linux-low.c (linux_xfer_siginfo): New.
2899         (linux_target_ops): Set it.
2900
2901 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
2902
2903         * server.c (gdbserver_usage): Mention --remote-debug.
2904         (main): Accept '--remote-debug' switch.
2905
2906 2009-01-18  Doug Evans  <dje@google.com>
2907
2908         * regcache.c (new_register_cache): No need to check result of xcalloc.
2909         * server.c (handle_search_memory): Back out calls to xmalloc,
2910         result is checked and error is returned to user upon failure.
2911         (handle_query): Ditto.  Add more checks for result of malloc.
2912         (handle_v_cont): Check result of malloc, report error back to
2913         user upon failure.
2914         (handle_v_run): Ditto.  Call freeargv.
2915         * server.h (freeargv): Declare.
2916         * utils.c (freeargv): New fn.
2917
2918 2009-01-15  Doug Evans  <dje@google.com>
2919
2920         * gdbreplay.c (perror_with_name): Make arg const char *.
2921         * server.h (target_signal_to_name): Make return type const char *.
2922         * thread-db.c (thread_db_err_str): Make return type const char *.
2923         * utils.c (perror_with_name): Make arg const char *.
2924
2925 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
2926
2927         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
2928         when handling a EXIT_PROCESS_DEBUG_EVENT.
2929
2930 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
2931
2932         * gdbreplay.c (gdbreplay_version): Update copyright year.
2933         * server.c (gdbserver_version): Likewise.
2934
2935 2009-01-05  Doug Evans  <dje@google.com>
2936
2937         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
2938         (handle_extended_wait): Improve comment.
2939
2940 2008-12-13  Doug Evans  <dje@google.com>
2941
2942         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
2943         * server.h (ATTR_MALLOC): New macro.
2944         (xmalloc,xcalloc,xstrdup): Declare.
2945         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
2946         * inferiors.c: Ditto.
2947         * linux-low.c: Ditto.
2948         * mem-break.c: Ditto.
2949         * regcache.c: Ditto.
2950         * remote-utils.c: Ditto.
2951         * server.c: Ditto.
2952         * target.c: Ditto.
2953         * win32-low.c: Ditto.
2954
2955 2008-12-12  Doug Evans  <dje@google.com>
2956
2957         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
2958         in debugging printf.
2959
2960         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
2961
2962 2008-12-09  Doug Evans  <dje@google.com>
2963
2964         * linux-low.h (struct process_info): Delete member tid, unused.
2965         * thread-db.c (find_one_thread): Update.
2966         (maybe_attach_thread): Update.
2967
2968 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
2969
2970         * target.h (struct target_ops): Add qxfer_osdata member.
2971         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
2972         and dirent.h.
2973         (linux_qxfer_osdata): New functions.
2974         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
2975         callback.
2976         * server.c (handle_query): Handle "qXfer:osdata:read:".
2977         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
2978         (buffer_xml_printf): New functions.
2979         * server.h (struct buffer): New.
2980         (buffer_grow_str, buffer_grow_str0): New macros.
2981         (buffer_grow, buffer_free, buffer_init, buffer_finish)
2982         (buffer_xml_printf): Declare.
2983
2984 2008-11-24  Doug Evans  <dje@google.com>
2985
2986         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
2987
2988 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
2989
2990         * server.c (handle_v_run): Always use the supplied argument list.
2991
2992 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
2993
2994         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
2995         (xtensa_regmap_table): Add entry for scompare1.
2996
2997 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
2998
2999         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
3000         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
3001         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
3002         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
3003         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
3004         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
3005         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
3006         XML target descriptions.
3007         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
3008         when inferior is running on an ISA 2.05 or later processor.  Add
3009         special case to return offset for full 64-bit slot of FPSCR when
3010         in 32-bits.
3011
3012 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
3013
3014         * Makefile.in (SFILES, clean): Added sparc64 files.
3015         (reg-sparc64.o, reg-sparc64.c): New.
3016         * configure.srv (sparc*-*-linux*): New configuration.
3017         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
3018         syscall arguments for SPARC.
3019         (regsets_store_inferior_registers): Likewise.
3020         * linux-sparc-low.c: New file.
3021
3022 2008-10-21  Doug Evans  <dje@google.com>
3023
3024         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
3025         (READLINE_DIR,READLINE_DEP): Delete.
3026         (INTERNAL_CFLAGS): Update.
3027         (LINTFLAGS): Update.
3028
3029 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
3030
3031         * server.c (handle_v_run): If GDB didn't specify an argv, use the
3032         whole argv from the last run, not just argv[0].
3033
3034 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
3035
3036         * regcache.c (new_register_cache): Return NULL if the register
3037         cache size isn't known yet.
3038         (free_register_cache): Avoid dereferencing a NULL regcache.
3039
3040 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
3041
3042         * configure.srv: Merge MIPS and MIPS64.
3043
3044 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
3045
3046         * Makefile.in (uninstall): Apply $(EXEEXT) too.
3047
3048 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
3049
3050         * Makefile.in: Add required vsx dependencies.
3051
3052         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
3053         Declare init_registers_powerpc_vsx32l.
3054         Declare init_registers_powerpc_vsx64l.
3055         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
3056         (ppc_arch_setup): Check for VSX in hwcap.
3057         (ppc_fill_vsxregset): New function.
3058         (ppc_store_vsxregset): New function.
3059         Add new VSX entry in regset_info target_regsets.
3060
3061         * configure.srv: Add new VSX dependencies.
3062
3063 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
3064
3065         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
3066         (remote_open): Set or clear transport_is_reliable.
3067         (putpkt_binary): Don't expect acks in noack mode.
3068         (getpkt): Don't send ack/nac in noack mode.
3069         * server.c (handle_general_set): Handle QStartNoAckMode.
3070         (handle_query): If connected by tcp pass QStartNoAckMode+ in
3071         qSupported.
3072         (main): Reset noack_mode on every connection.
3073         * server.h (noack_mode): Declare.
3074
3075 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
3076
3077         * Makefile.in (GDBREPLAY_OBS): New variable.
3078         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
3079
3080 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
3081             Daniel Jacobowitz  <dan@codesourcery.com>
3082
3083         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
3084         (usr_store_inferior_registers): Likewise.
3085         (regsets_store_inferior_registers): Likewise.
3086
3087 2008-07-31  Rolf Jansen  <rj@surtec.com>
3088             Pedro Alves  <pedro@codesourcery.com>
3089
3090         * configure.ac: Check for memmem declaration.
3091         * server.c [HAVE_MALLOC_H]: Include malloc.h.
3092         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
3093         (disable_packet_qfThreadInfo): Unconditionally compile.
3094         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
3095         * configure, config.in: Regenerate.
3096
3097 2008-07-28  Doug Kwan  <dougkwan@google.com>
3098
3099         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
3100         (linux_write_memory): Remove declaration of errno.
3101
3102 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
3103
3104         * linux-low.c (handle_extended_wait): Do not use "status"
3105         variable uninitialized.
3106
3107 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
3108
3109         * server.c (handle_v_attach): Inhibit reporting dll changes.
3110
3111 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
3112
3113         * remote-utils.c (prepare_resume_reply): If requested, don't
3114         output "thread:TID" in the T stop reply.
3115
3116         * server.c (disable_packet_vCont, disable_packet_Tthread)
3117         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
3118         (handle_query): If requested, disable support for qC, qfThreadInfo
3119         and qsThreadInfo.
3120         (handle_v_requests): If requested, disable support for vCont.
3121         (gdbserver_show_disableable): New.
3122         (main): Handle --disable-packet and --disable-packet=LIST.
3123
3124         * server.h (disable_packet_vCont, disable_packet_Tthread)
3125         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
3126
3127 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
3128
3129         * server.c (gdbserver_usage): Mention --version.
3130
3131 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
3132
3133         * Makefile.in (gdbreplay.o): New rule.
3134
3135 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
3136
3137         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
3138         message, not gdbserver.
3139
3140 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
3141             Nathan Sidwell  <nathan@codesourcery.com>
3142             Joseph Myers  <joseph@codesourcery.com>
3143
3144         * acinclude.m4: Include ../../config/acx.m4.
3145         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
3146         * configure, config.in: Regenerate.
3147         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
3148         * server.c (gdbserver_version): Print PKGVERSION.
3149         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
3150         (main): Adjust gdbserver_usage calls.
3151         * gdbreplay.c (version, host_name): Add declarations.
3152         (gdbreplay_version, gdbreplay_usage): New.
3153         (main): Accept --version and --help options.
3154
3155 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
3156
3157         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
3158         (arm_breakpoint_at): Handle Thumb.
3159         (the_low_target): Add comment.
3160
3161 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
3162
3163         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
3164
3165 2008-05-09  Doug Evans  <dje@google.com>
3166
3167         * server.h (decode_search_memory_packet): Declare.
3168         * remote-utils.c (decode_search_memory_packet): New fn.
3169         * server.c (handle_search_memory_1): New fn.
3170         (handle_search_memory): New fn.
3171         (handle_query): Process qSearch:memory packets.
3172
3173 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
3174
3175         * regcache.c (registers_length): Remove.
3176         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
3177         full register packet.
3178         * regcache.h (registers_length): Remove prototype.
3179         * server.h (PBUFSIZ): Define to 16384.
3180
3181 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
3182
3183         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
3184         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
3185         powerpc-64l.o, and powerpc-altivec64l.o.
3186         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
3187         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
3188         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
3189         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
3190         rs6000/power-linux.xml, and rs6000/power64-linux.xml
3191         to srv_xmlfiles.
3192
3193         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
3194         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
3195         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
3196         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
3197         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
3198         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
3199         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
3200         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
3201         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
3202         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
3203         (clean): Update.
3204
3205         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
3206         (init_registers_powerpc_32l): ... this new prototype.
3207         (init_registers_powerpc_32): Remove, replace by ...
3208         (init_registers_powerpc_altivec32l): ... this new prototype.
3209         (init_registers_powerpc_e500): Remove, replace by ...
3210         (init_registers_powerpc_e500l): ... this new prototype.
3211         (init_registers_ppc64): Remove, replace by ...
3212         (init_registers_powerpc_64l): ... this new prototype.
3213         (init_registers_powerpc_64): Remove, replace by ...
3214         (init_registers_powerpc_altivec64l): ... this new prototype.
3215         (ppc_num_regs): Set to 73.
3216         (PT_ORIG_R3, PT_TRAP): Define if necessary.
3217         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
3218         (ppc_cannot_store_register): Handle orig_r3 and trap.
3219         (ppc_arch_setup): Update init_registers_... calls.
3220         (ppc_fill_gregset): Handle orig_r3 and trap.
3221
3222         * inferiors.c (clear_inferiors): Reset current_inferior.
3223
3224 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
3225
3226         * acinclude.m4: Add override.m4.
3227         * configure: Regenerate.
3228
3229 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
3230
3231         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
3232         initial call to init_register_ppc64.
3233
3234 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
3235
3236         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into single
3237         powerpc*-*-linux* case.
3238         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
3239
3240 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
3241
3242         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
3243         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
3244         from reg_xmlfiles.
3245         * linux-ppc-low.c: Include <elf.h>.
3246         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
3247         (ppc_hwcap): New global variable.
3248         (ppc_regmap): Remove __SPE__ #ifdef sections.
3249         (ppc_regmap_e500): New global variable.
3250         (ppc_cannot_store_register): Update __SPE__ special case.
3251         (ppc_get_hwcap): New function.
3252         (ppc_arch_setup): Use it to determine whether inferior supports
3253         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
3254         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
3255         Do not access registers if target does not support AltiVec.
3256         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
3257         Do not access registers if target does not support SPE.
3258         (target_regsets): Unconditionally include AltiVec and SPE regsets.
3259
3260 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
3261
3262         * linux-low.c (disabled_regsets, num_regsets): New.
3263         (use_regsets_p): Delete.
3264         (linux_wait_for_process): Clear disabled_regsets.
3265         (regsets_fetch_inferior_registers): Check and set it.
3266         (regsets_store_inferior_registers): Likewise.
3267         (linux_fetch_registers, linux_store_registers): Do not use
3268         use_regsets_p.
3269         (initialize_low): Allocate disabled_regsets.
3270
3271 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
3272
3273         * Makefile.in (LIBOBJS): New.
3274         (OBS): Use LIBOBJS.
3275         (memmem.o): New rule.
3276         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
3277         * configure: Regenerated.
3278
3279 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
3280
3281         * server.c (handle_query): Never return "unsupported" for
3282         qXfer:features:read queries.
3283
3284 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
3285
3286         * server.c (get_features_xml): Fix inverted condition.
3287         (handle_query): Always support qXfer:feature:read.
3288
3289 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
3290
3291         * server.c (wrapper_argv): New.
3292         (start_inferior): Handle wrapper_argv.  If set, expect an extra
3293         trap.
3294         (gdbserver_usage): Document --wrapper.
3295         (main): Parse --wrapper.
3296
3297 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
3298
3299         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
3300         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
3301         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
3302         (ppc_set_pc): Likewise.
3303         (ppc_arch_setup): New function.
3304         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
3305         of collect_register.
3306         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
3307
3308 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
3309
3310         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
3311         instead of linux-ppc64-low.o.
3312         * linux-ppc64-low.c: Remove file.
3313         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
3314         (linux-ppc64-low.o): Remove rule.
3315
3316         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
3317         (init_registers_powerpc_64): Likewise.
3318         (ppc_regmap): Conditionally define depending on __powerpc64__.
3319         (ppc_cannot_store_register): Do not special-case "fpscr" when
3320         compiled on __powerpc64__.
3321         (ppc_collect_ptrace_register): New function.
3322         (ppc_supply_ptrace_register): New function.
3323         (ppc_breakpoint): Change type to "unsigned int".
3324         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
3325         (the_low_target): Conditionally provide initializers for the
3326         arch_setup member depending on __powerpc64__.  Install
3327         collect_ptrace_register and supply_ptrace_register members.
3328
3329 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
3330
3331         * regcache.h (gdbserver_xmltarget): Add extern declaration.
3332         * server.c (gdbserver_xmltarget): Define.
3333         (get_features_xml): Use it to replace "target.xml" and arch_string.
3334
3335         * configure.srv: Remove srv_xmltarget.  Add XML files that were
3336         mentioned there to srv_xmlfiles instead.  Remove conditional tests
3337         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
3338         srv_xmlfiles and srv_regobj to include all possible choices.
3339         * configure.ac (srv_xmltarget): Remove.
3340         (srv_xmlfiles): Do not add "target.xml".
3341         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
3342         checks for supplementary target information.
3343         * configure: Regenerate.
3344         * Makefile.in (XML_TARGET): Remove.
3345         (target.xml): Remove rule.
3346         (clean): Do not clean up target.xml.
3347         (.PRECIOUS): Do not mention target.xml.
3348
3349         * target.h (struct target_ops): Remove arch_string member.
3350         * linux-low.c (linux_arch_string): Remove.
3351         (linux_target_ops): Remove arch_string initializer.
3352         * linux-low.h (struct linux_target_ops): Remove arch_string member.
3353         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
3354         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
3355         * spu-low.c (spu_arch_string): Remove.
3356         (spu_target_ops): Remove arch_string initializer.
3357         * win32-low.c (win32_arch_string): Remove.
3358         (win32_target_ops): Remove arch_string initializer.
3359         * win32-low.h (struct win32_target_ops): Remove arch_string member.
3360         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
3361         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
3362
3363 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
3364
3365         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
3366         by collect_ptrace_register and supply_ptrace_register hooks.
3367         * linux-low.c (fetch_register): Use supply_ptrace_register callback
3368         instead of checking for the_low_target.left_pad_xfer.
3369         (usr_store_inferior_registers): Use collect_ptrace_register callback
3370         instead of checking for the_low_target.left_pad_xfer.
3371
3372         * linux-s390-low.c (s390_collect_ptrace_register): New function.
3373         (s390_supply_ptrace_register): Likewise.
3374         (s390_fill_gregset): Call s390_collect_ptrace_register.
3375         (the_low_target): Update.
3376
3377         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
3378         (ppc_supply_ptrace_register): Likewise.
3379         (the_low_target): Update.
3380
3381         * linux-i386-low.c (the_low_target): Update.
3382         * linux-x86-64-low.c (the_low_target): Update.
3383
3384 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
3385
3386         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
3387         reg-s390.o and reg-s390x.o.
3388
3389         * linux-low.c (new_inferior): New global variable.
3390         (linux_create_inferior, linux_attach): Set it.
3391         (linux_wait_for_process): Call the_low_target.arch_setup after the
3392         target has stopped for the first time.
3393         (initialize_low): Do not call the_low_target.arch_setup.
3394
3395         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
3396         (s390_set_pc): Likewise.
3397         (s390_arch_setup): New function.
3398         (the_low_target): Use s390_arch_setup as arch_setup routine.
3399
3400         * regcache.c (realloc_register_cache): New function.
3401         (set_register_cache): Call it for each existing regcache.
3402
3403 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
3404
3405         * server.h (init_registers): Remove prototype.
3406
3407         * linux-low.h (struct linux_target_ops): Add arch_setup field.
3408         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
3409         instead of init_registers ().
3410         * linux-arm-low.c (init_registers_arm): Add prototype.
3411         (init_registers_arm_with_iwmmxt): Likewise.
3412         (the_low_target): Add initializer for arch_setup field.
3413         * linux-cris-low.c (init_registers_cris): Add prototype.
3414         (the_low_target): Add initializer for arch_setup field.
3415         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
3416         (the_low_target): Add initializer for arch_setup field.
3417         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
3418         (the_low_target): Add initializer for arch_setup field.
3419         * linux-ia64-low.c (init_registers_ia64): Add prototype.
3420         (the_low_target): Add initializer for arch_setup field.
3421         * linux-m32r-low.c (init_registers_m32r): Add prototype.
3422         (the_low_target): Add initializer for arch_setup field.
3423         * linux-m68k-low.c (init_registers_m68k): Add prototype.
3424         (the_low_target): Add initializer for arch_setup field.
3425         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
3426         (init_registers_mips64_linux): Likewise.
3427         (the_low_target): Add initializer for arch_setup field.
3428         * linux-ppc-low.c (init_registers_ppc): Add prototype.
3429         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
3430         (the_low_target): Add initializer for arch_setup field.
3431         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
3432         (init_registers_powerpc_64): Likewise.
3433         (the_low_target): Add initializer for arch_setup field.
3434         * linux-s390-low.c (init_registers_s390): Add prototype.
3435         (init_registers_s390x): Likewise.
3436         (the_low_target): Add initializer for arch_setup field.
3437         * linux-sh-low.c (init_registers_sh): Add prototype.
3438         (the_low_target): Add initializer for arch_setup field.
3439         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
3440         (the_low_target): Add initializer for arch_setup field.
3441         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
3442         (the_low_target): Add initializer for arch_setup field.
3443
3444         * win32-low.h (struct win32_target_ops): Add arch_setup field.
3445         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
3446         instead of init_registers ().
3447         * win32-arm-low.c (init_registers_arm): Add prototype.
3448         (the_low_target): Add initializer for arch_setup field.
3449         * win32-i386-low.c (init_registers_i386): Add prototype.
3450         (the_low_target): Add initializer for arch_setup field.
3451
3452         * spu-low.c (init_registers_spu): Add prototype.
3453         (initialize_low): Call initialie_registers_spu () instead of
3454         initialize_registers ().
3455
3456 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
3457
3458         * server.c (handle_v_requests): When handling the vRun and vAttach
3459         packets, if already debugging a process, don't kill it.  Return an
3460         error instead.
3461
3462 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
3463
3464         * server.c (handle_query): Correct length check.
3465
3466 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
3467
3468         * win32-low.c (do_initial_child_stuff): Add process handle
3469         parameter.  Set current_process_handle and current_process_id from the
3470         parameters. Clear globals.
3471         (win32_create_inferior): Don't set current_process_handle and
3472         current_process_id here.  Instead pass them on the call to
3473         do_initial_child_stuff.
3474         (win32_attach): Likewise.
3475         (win32_clear_inferiors): New.
3476         (win32_kill): Don't close the current process handle or the
3477         current thread handle here.  Instead call win32_clear_inferiors.
3478         (win32_detach): Don't open a new handle to the process.  Call
3479         win32_clear_inferiors.
3480         (win32_join): Don't rely on current_process_handle; open a new
3481         handle using the process id.
3482         (win32_wait): Call win32_clear_inferiors when the inferior process
3483         has exited.
3484
3485 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
3486
3487         * server.c (monitor_show_help): Add "exit".
3488
3489 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
3490
3491         * Makefile.in (SFILES): Add linux-xtensa-low.c.
3492         (clean): Add reg-xtensa.c.
3493         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
3494         * configure.srv (xtensa*-*-linux*) New target.
3495         * linux-xtensa-low.c: New.
3496         * xtensa-xtregs.c: New.
3497
3498 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
3499
3500         * hostio.c: Don't include errno.h.
3501         (errno_to_fileio_errno): Move to hostio-errno.
3502         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
3503         error number outputting to the target->hostio_last_error callback.
3504         (hostio_packet_error): Use FILEIO_EINVAL directly.
3505         (handle_open, handle_pread, hostio_error, handle_unlink): Update
3506         calls to hostio_error.
3507         * hostio-errno.c: New.
3508         * server.h (hostio_last_error_from_errno): Declare.
3509         * target.h (target_ops): Add hostio_last_error member.
3510         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
3511         as hostio_last_error handler.
3512         * spu-low.c (spu_target_ops): Likewise.
3513         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
3514         (wince_hostio_last_error): New functions.
3515         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
3516         as hostio_last_error handler.
3517         (win32_target_ops) [!_WIN32_WCE]: Register
3518         hostio_last_error_from_errno as hostio_last_error handler.
3519         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
3520         (hostio-errno.o): New rule.
3521         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
3522         * configure.srv (srv_hostio_err_objs): New variable.  Default to
3523         hostio-errno.o.
3524         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
3525         * configure: Regenerate.
3526
3527 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
3528
3529         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
3530         (linux_kill, linux_detach): Clean up the process list.
3531         * remote-utils.c (remote_open): Improve port number parsing.
3532         (putpkt_binary, input_interrupt): Only send interrupts if the target
3533         is running.
3534         * server.c (extended_protocol): Make static.
3535         (attached): Define earlier.
3536         (exit_requested, response_needed, program_argv): New variables.
3537         (target_running): New.
3538         (start_inferior): Clear attached here.
3539         (attach_inferior): Set attached here.
3540         (require_running): Define.
3541         (handle_query): Use require_running and target_running.  Implement
3542         "monitor exit".
3543         (handle_v_attach, handle_v_run): New.
3544         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
3545         (gdbserver_usage): Update.
3546         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
3547         --attach along with other options or after the port.  Save
3548         program_argv.  Support no initial program.  Resynchronize
3549         communication with GDB after an error.  Handle "monitor exit".
3550         Use require_running and target_running.  Always allow the extended
3551         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
3552         restart in extended mode.
3553         * README: Refer to the GDB manual.  Update --attach usage.
3554
3555 2007-12-20  Andreas Schwab  <schwab@suse.de>
3556
3557         * linux-low.c (STACK_SIZE): Define.
3558         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
3559         (linux_test_for_tracefork): Likewise.
3560
3561 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
3562
3563         * linux-low.c (linux_wait_for_event): Update messages.  Do not
3564         reinsert auto-delete breakpoints.
3565         * mem-break.c (struct breakpoint): Change return type of handler to
3566         int.
3567         (set_breakpoint_at): Update handler type.
3568         (reinsert_breakpoint_handler): Return 1 instead of calling
3569         delete_breakpoint.
3570         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
3571         setting a new one.
3572         (check_breakpoints): Delete auto-delete breakpoints and return 2.
3573         * mem-break.h (set_breakpoint_at): Update handler type.
3574         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
3575         * win32-low.c (auto_delete_breakpoint): New.
3576         (get_child_debug_event): Use it.
3577
3578 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
3579
3580         * configure.ac: Check for pread and pwrite.
3581         * hostio.c (handle_pread): Fall back to lseek and read.
3582         (handle_pwrite): Fall back to lseek and write.
3583         * config.in, configure: Regenerated.
3584
3585 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
3586
3587         * server.c (myresume): Add own_buf argument.
3588         (main): Update calls.
3589
3590 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
3591
3592         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
3593         * remote-utils.c (remote_open): Do not call disable_async_io.
3594         (block_async_io): Delete.
3595         (unblock_async_io): Make static.
3596         (initialize_async_io): New.
3597         * server.c (handle_v_cont): Handle async I/O here.
3598         (myresume): Likewise.  Move other common resume tasks here...
3599         (main): ... from here.  Call initialize_async_io.  Disable async
3600         I/O before the main loop.
3601         * server.h (initialize_async_io): Declare.
3602         (block_async_io, unblock_async_io): Delete prototypes.
3603         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
3604
3605 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
3606
3607         * remote-utils.c (readchar): Allow binary data in received messages.
3608
3609 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
3610
3611         * win32-low.c (attaching): New global.
3612         (win32_create_inferior): Clear the `attaching' global.
3613         (win32_attach): Set the `attaching' global.
3614         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
3615         attaching.  Only set a breakpoint at the entry point if not
3616         attaching.
3617
3618 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
3619
3620         * server.c (main): Don't report dll events on the initial
3621         connection on attaches.
3622
3623 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
3624
3625         * server.c (main): Relax numerical bases supported for the pid of
3626         the --attach command line argument.
3627
3628 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
3629
3630         * win32-low.c (win32_attach): Call OpenProcess before
3631         DebugActiveProcess, not after.  Add last error output to error
3632         call.
3633
3634 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
3635
3636         * win32-low.c (win32_get_thread_context)
3637         (win32_set_thread_context): New functions.
3638         (thread_rec): Use win32_get_thread_context.
3639         (continue_one_thread, win32_resume): Use win32_set_thread_context.
3640         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
3641         field.
3642
3643 2007-12-03  Leo Zayas
3644             Pedro Alves  <pedro_alves@portugalmail.pt>
3645
3646         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
3647         global variables.
3648         (child_add_thread): Minor cleanup.
3649         (child_continue): Resume artificially suspended threads before
3650         calling ContinueDebugEvent.
3651         (suspend_one_thread): New.
3652         (fake_breakpoint_event): New.
3653         (get_child_debug_event): Change return type to int.  Check here if
3654         gdb sent an interrupt request.  If a soft interrupt was requested,
3655         fake a breakpoint event.  Return 0 if there is no event to handle,
3656         and 1 otherwise.
3657         (win32_wait): Don't check here if gdb sent an interrupt request.
3658         Ensure there is a valid event to handle.
3659         (win32_request_interrupt): Add soft interruption method as last
3660         resort.
3661
3662 2007-12-03  Leo Zayas
3663             Pedro Alves  <pedro_alves@portugalmail.pt>
3664
3665         * win32-low.h (win32_thread_info): Add descriptions to the
3666         structure members.  Replace `suspend_count' counter by a
3667         `suspended' flag.
3668         * win32-low.c (thread_rec): Update condition of when to get the
3669         context from the inferior.  Rely on ContextFlags being set if it
3670         has already been retrieved.  Only suspend the inferior thread if
3671         we haven't already.  Warn if that fails.
3672         (continue_one_thread): s/suspend_count/suspended/.  Only call
3673         ResumeThread once.  Warn if that fails.
3674
3675 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
3676
3677         * win32-low.c (win32_wait): Don't read from the inferior when it
3678         has already exited.
3679
3680 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
3681
3682         * Makefile.in (win32_low_h): New variable.
3683         (win32-low.o): Add dependency on $(win32_low_h).
3684         (win32-arm-low.o, win32-i386-low.o): New rules.
3685
3686 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
3687
3688         * hostio.c: Correct copyright year.
3689
3690 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
3691
3692         * Makefile.in (OBS): Add hostio.o.
3693         (hostio.o): New rule.
3694         * server.h (handle_vFile): Declare.
3695         * hostio.c: New file.
3696         * server.c (handle_v_requests): Take packet_len and new_packet_len
3697         for binary packets.  Call handle_vFile.
3698         (main): Update call to handle_v_requests.
3699
3700 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
3701
3702         * linux-low.c: Include <sched.h>.
3703
3704 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
3705
3706         * linux-low.c (linux_tracefork_grandchild): New.
3707         (linux_tracefork_child): Use clone.
3708         (linux_test_for_tracefork): Use clone; allocate and free a stack.
3709
3710 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
3711
3712         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
3713
3714 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
3715
3716         * linux-low.c (handle_extended_wait): Handle unexpected signals.
3717
3718 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
3719
3720         * inferiors.c (change_inferior_id): Delete.
3721         (add_pid_to_list, pull_pid_from_list): New.
3722         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
3723         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
3724         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
3725         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
3726         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
3727         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
3728         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
3729         (using_threads): Always set to 1.
3730         (handle_extended_wait): New.
3731         (add_process): Do not set TID.
3732         (linux_create_inferior): Set must_set_ptrace_flags.
3733         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
3734         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
3735         (linux_thread_alive): Rename TID argument to LWPID.
3736         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
3737         (linux_wait_for_event): Do not use TID or check using_threads.  Update
3738         call to dead_thread_notify.  Call handle_extended_wait.
3739         (linux_create_inferior): Use PTRACE_SETOPTIONS.
3740         (send_sigstop): Delete sigstop_sent.
3741         (wait_for_sigstop): Avoid TID.
3742         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
3743         (linux_test_for_tracefork): New.
3744         (linux_lookup_signals): Use thread_db_active and
3745         linux_supports_tracefork_flag.
3746         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
3747         * linux-low.h (get_process_thread): Avoid TID.
3748         (struct process_ifo): Move thread_known and tid to the end.  Remove
3749         sigstop_sent.
3750         (linux_attach_lwp, thread_db_init): Update prototypes.
3751         * server.h (change_inferior_id): Delete prototype.
3752         (add_pid_to_list, pull_pid_from_list): New prototypes.
3753         * thread-db.c (thread_db_use_events): New.
3754         (find_first_thread): Rename to...
3755         (find_one_thread): ...this.  Update callers and messages.  Do not
3756         call fatal.  Check thread_db_use_events.  Do not call
3757         change_inferior_id or new_thread_notify.
3758         (maybe_attach_thread): Update.  Do not call new_thread_notify.
3759         (thread_db_init): Set thread_db_use_events.  Check use_events.
3760         * utils.c (fatal, warning): Correct message prefix.
3761
3762 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
3763
3764         * Makefile.in (clean): Remove new files.
3765         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
3766         (powerpc-64.o, powerpc-64.c): New rules.
3767         * configure.srv: Use alternate register sets for powerpc64-*-linux*
3768         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
3769         with SPE.
3770         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
3771         SPE targets.
3772         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
3773         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
3774         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
3775         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
3776         (target_regsets): Add AltiVec and SPE register sets.
3777         * configure.ac: Check for AltiVec and SPE.
3778         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
3779         (ppc_fill_vrregset, ppc_store_vrregset): New.
3780         (target_regsets): Add AltiVec register set.
3781         * configure: Regenerated.
3782
3783 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
3784
3785         * linux-low.c (O_LARGEFILE): Define.
3786         (linux_read_memory): Use /proc/PID/mem.
3787         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
3788         * configure, config.in: Regenerated.
3789
3790 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
3791
3792         * linux-low.c (linux_wait_for_event): Do not pass signals while
3793         single-stepping.
3794
3795 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
3796
3797         * win32-low.c (create_process): New.
3798         (win32_create_inferior): Use create_process instead of
3799         CreateProcess.  If create_process failed retry appending an ".exe"
3800         suffix.  Store the GetLastError result immediatelly after
3801         create_process calls and use it on the call to error.
3802
3803 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
3804
3805         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
3806
3807 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
3808
3809         * configure.ac: Switch license to GPLv3.
3810
3811 2007-08-01  Michael Snyder  <msnyder@access-company.com>
3812
3813         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
3814
3815 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
3816
3817         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
3818         typedef.
3819         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
3820         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
3821         CloseToolhelp32Snapshot.
3822         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
3823         CloseToolhelp32Snapshot.
3824
3825 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
3826
3827         * server.c (main): Check for inferior exit before main loop.
3828
3829 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
3830
3831         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
3832         instead of on tmp_desc.
3833
3834 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
3835             Daniel Jacobowitz  <dan@codesourcery.com>
3836
3837         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
3838         (add_thread): Minor cleanups.
3839         (clear_inferiors): Move lower in the file.  Clear the DLL
3840         list.
3841         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
3842         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
3843         (xml_escape_text): New.
3844         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
3845         for qSupported.
3846         (handle_v_cont): Report errors.
3847         (gdbserver_version): Update.
3848         (main): Correct size of own_buf.  Do not report initial DLL events.
3849         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
3850         (unloaded_dll, xml_escape_text): New.
3851         * win32-low.c (enum target_waitkind): Update comments.
3852         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
3853         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
3854         (win32_EnumProcessModules, win32_GetModuleInformation)
3855         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
3856         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
3857         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
3858         (win32_Module32First, win32_Module32Next, load_toolhelp)
3859         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
3860         (get_child_debug_event): Handle DLL events.
3861         (win32_wait): Likewise.
3862
3863 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
3864
3865         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
3866         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
3867
3868 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
3869
3870         * win32-low.c (handle_output_debug_string): Ignore event if not
3871         waiting.
3872
3873 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
3874
3875         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
3876
3877 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
3878
3879         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
3880
3881 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
3882
3883         * inferiors.c (change_inferior_id): Add comment.
3884         * linux-low.c (check_removed_breakpoint): Add an early
3885         prototype.  Improve debug output.
3886         (linux_attach): Doc update.
3887         (linux_detach_one_process, linux_detach): Clean up before releasing
3888         each process.
3889         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
3890         * linux-low.h (struct process_info): Doc improvement.
3891         * mem-break.c (delete_all_breakpoints): New.
3892         * mem-break.h (delete_all_breakpoints): New prototype.
3893         * thread-db.c (find_first_thread): New.
3894         (thread_db_create_event): Call it instead of
3895         thread_db_find_new_threads.  Clean up unused variables.
3896         (maybe_attach_thread): Remove first thread handling.
3897         (thread_db_find_new_threads): Use find_first_thread.
3898         (thread_db_get_tls_address): Likewise.
3899
3900 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
3901
3902         * thread-db.c (thread_db_find_new_threads): Add prototype.
3903         (thread_db_create_event): Check for the main thread before adding
3904         a new thread.
3905         (maybe_attach_thread): Only enable event reporting if TID == 0.
3906         (thread_db_get_tls_address): Check for new threads.
3907
3908 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
3909
3910         * linux-low.c (linux_create_inferior): Try execv before execvp.
3911         * spu-low.c (spu_create_inferior): Likewise.
3912
3913 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
3914
3915         * linux-low.c (linux_create_inferior): Change execv to execvp.
3916         * spu-low.c (spu_create_inferior): Likewies.
3917
3918 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
3919
3920         * Makefile.in (clean): Clean new files instead of deleted ones.
3921         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
3922         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
3923         rules.
3924         * configure.srv: Specify XML files and new regformats for MIPS and
3925         MIPS64 GNU/Linux.
3926         * linux-mips-low.c (mips_num_regs): Set to only used registers.
3927         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
3928         an entry for the restart register.
3929         (mips_cannot_fetch_register, mips_cannot_store_register)
3930         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
3931         register names to match the XML descriptions.
3932         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
3933         restart register instead of $0.
3934
3935 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
3936             Markus Deuling  <deuling@de.ibm.com>
3937
3938         * remote-utils.c (decode_xfer_write): New function.
3939         * server.h (decode_xfer_write): Add prototype.
3940         * server.c (handle_query): Add PACKET_LEN argument.  Support
3941         qXfer:spu:read and qXfer:spu:write packets.
3942         (main): Pass packet_len to handle_query.
3943         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
3944         * target.h (target_ops): Add qxfer_spu.
3945
3946 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
3947
3948         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
3949         accessing non-seekable spufs files.
3950
3951 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
3952
3953         * server.c (handle_query): Add reply for qC packet.
3954
3955 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
3956             Leo Zayas  <lerele@champenstudios@com>
3957
3958         * server.h (check_remote_input_interrupt_request): New function.
3959         * remote_utils.c (INVALID_DESCRIPTOR): New define.
3960         (remote_desc): Initialize with INVALID_DESCRIPTOR.
3961         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
3962         (check_remote_input_interrupt_request): New function.
3963         * server.h (check_remote_input_interrupt_request): Declare.
3964         * win32-low.c (winapi_DebugBreakProcess,
3965         winapi_GenerateConsoleCtrlEvent): New typedefs.
3966         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
3967         to 250 ms.
3968         (win32_wait): Check for remote interrupt request
3969         with check_remote_input_interrupt_request.
3970         (win32_request_interrupt): New function.
3971         (win32_target_op): Set request_interrupt to win32_request_interrupt.
3972
3973 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
3974
3975         * win32-low.c (debug_registers_changed,
3976         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
3977         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
3978         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
3979         (thread_rec): Get context using the low target.
3980         (child_add_thread): Call thread_added on the low target,
3981         which does the same thing.
3982         (regptr): Delete.
3983         (do_initial_child_stuff): Remove debug registers references.
3984         Set context using the low target.  Resume threads after
3985         setting the contexts.
3986         (child_continue): Remove dead variable.  Remove debug
3987         registers references.
3988         (child_fetch_inferior_registers): Go through the low target.
3989         (do_child_store_inferior_registers): Remove.
3990         (child_store_inferior_registers): Go through the low target.
3991         (win32_resume): Remove debug registers references.
3992         Set context using the low target.
3993         (handle_exception): Change return type to void.  Don't record
3994         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
3995         first chance exception.
3996         (get_child_debug_event): Change return type to void.  Remove
3997         goto loop.  Always return after waiting for debug event.
3998         (win32_wait): Convert to switch statement.  Handle spurious
3999         events.
4000
4001         * win32-i386-low.c (debug_registers_changed,
4002         debug_registers_used): New.
4003         (initial_stuff): Rename to ...
4004         (i386_initial_stuff): ... this.  Clear debug registers
4005         state variables.
4006         (store_debug_registers): Delete.
4007         (i386_get_thread_context): New.
4008         (load_debug_registers): Delete.
4009         (i386_set_thread_context): New.
4010         (i386_thread_added): New.
4011         (single_step): Rename to ...
4012         (i386_single_step): ... this.
4013         (do_fetch_inferior_registers): Rename to ...
4014         (i386_fetch_inferior_register): ... this.
4015         (i386_store_inferior_register): New.
4016         (the_low_target): Adapt to new interface.
4017
4018         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
4019         (arm_get_thread_context): New.
4020         (arm_set_thread_context): New.
4021         (regptr): New.
4022         (do_fetch_inferior_registers): Rename to ...
4023         (arm_fetch_inferior_register): ... this.
4024         (arm_store_inferior_register): New.
4025         (arm_wince_breakpoint): Reimplement as unsigned long.
4026         (arm_wince_breakpoint_len): Define.
4027         (the_low_target): Adapt to new interface.
4028
4029         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
4030         load_debug_registers.  Add get_thread_context, set_thread_context,
4031         thread_added and store_inferior_register.  Rename
4032         fetch_inferior_registers to fetch_inferior_register.
4033         (regptr): Remove declaration.
4034
4035 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
4036
4037         * linux-low.c (linux_detach): Change return type to int.  Return 0.
4038         * spu-low.c (spu_detach): Likewise.
4039
4040 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
4041
4042         * target.h (target_ops): Change return type of detach to int.
4043         Add join.
4044         (join_inferior): New.
4045         * server.c (main): Don't skip detach support on mingw32.
4046         If the inferior doesn't support detaching return error.
4047         Call join_inferior instead of using waitpid.
4048         * linux-low.c (linux_join): New.
4049         (linux_target_op): Add linux_join.
4050         * spu-low.c (spu_join): New.
4051         (spu_target_ops): Add spu_join.
4052         * win32-low.c (win32_detach): Adapt to new interface.
4053         Reopen current_process_handle before detaching.  Issue a child
4054         resume before detaching.
4055         (win32_join): New.
4056         (win32_target_op): Add win32_join.
4057
4058 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
4059
4060         * win32-low.c (win32-attach): Fix return value.
4061         * target.h (target_ops): Describe ATTACH return values.
4062
4063 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
4064
4065         * win32-low.c (GETPROCADDRESS): Define.
4066         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
4067         (winapi_DebugSetProcessKillOnExit): Likewise.
4068         (win32_create_inferior): Force usage of ansi CreateProcessA.
4069         (win32_attach): Use GETPROCADDRESS.
4070         (win32_detach): Likewise.
4071
4072 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
4073
4074         * win32-low.c (win32_wait): Don't use WSTOPSIG.
4075
4076 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
4077
4078         * win32-low.c: Commit leftover changes from 2007-03-29.
4079
4080 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
4081
4082         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
4083         fields short instead of int.  Add explicit padding.
4084         (i387_cache_to_fsave): Remove unnecessary casts.
4085         (i387_fsave_to_cache): Doc fix.
4086         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
4087
4088 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
4089
4090         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
4091         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
4092
4093 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
4094
4095         * configure.srv (arm*-*-mingw32ce*): Move near the other
4096         arm targets.
4097
4098 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
4099
4100         * configure.ac: Add errno checking.
4101         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
4102         sys/file.h and malloc.h.
4103         (AC_CHECK_DECLS): Add perror.
4104         (srv_mingwce): Handle.
4105         * configure.srv (i[34567]86-*-cygwin*): Add
4106         win32-i386-low.o to srv_tgtobj.
4107         (i[34567]86-*-mingw*): Likewise.
4108         (arm*-*-mingw32ce*): Add case.
4109         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
4110         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
4111         [__MINGW32CE__] (strerror): New function.
4112         [__MINGW32CE__] (errno): Define to GetLastError.
4113         [__MINGW32CE__] (COUNTOF): New macro.
4114         (remote_open): Remove extra close call.
4115         * mem-break.c (delete_breakpoint_at): New function.
4116         * mem-break.h (delete_breakpoint_at): Declare.
4117         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
4118         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
4119         [USE_WIN32API] (read, write): Add char* casts.
4120         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
4121         * server.h: Include wincecompat.h on Windows CE.
4122         [HAVE_ERRNO_H]: Check.
4123         (perror): Declare if not declared.
4124         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
4125         (perror_with_name): Remove errno declaration.
4126         * wincecompat.h: New.
4127         * wincecompat.c: New.
4128         * win32-low.h: New.
4129         * win32-arm-low.c: New.
4130         * win32-i386-low.c: New.
4131         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
4132         (OUTMSG2): Make it safe.
4133         (_T): New macro.
4134         (COUNTOF): New macro.
4135         (NUM_REGS): Get it from the low target.
4136         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
4137         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
4138         (thread_rec): Let low target handle debug registers.
4139         (child_add_thread): Likewise.
4140         (child_init_thread_list): Likewise.
4141         (continue_one_thread): Likewise.
4142         (regptr): New.
4143         (do_child_fetch_inferior_registers): Move to ...
4144         * win32-i386-low.c: ... here, and rename to ...
4145         (do_fetch_inferior_registers): ... this.
4146         * win32-low.c (child_fetch_inferior_registers):
4147         Go through the low target.
4148         (do_child_store_inferior_registers): Use regptr.
4149         (strwinerror): New function.
4150         (win32_create_inferior): Handle Windows CE.
4151         Use strwinerror instead of strerror on Windows error
4152         codes.  Add program to the error output.
4153         Don't close the main thread handle on Windows CE.
4154         (win32_attach): Use coredll.dll on Windows CE.
4155         (win32_kill): Close current process and current
4156         thread handles.
4157         (win32_detach): Use coredll.dll on Windows CE.
4158         (win32_resume): Let low target handle debug registers, and
4159         step request.
4160         (handle_exception): Add/Remove initial breakpoint.  Avoid
4161         non-existant WSTOPSIG on Windows CE.
4162         (win32_read_inferior_memory): Cast to remove warning.
4163         (win32_arch_string): Go through the low target.
4164         (initialize_low): Call set_breakpoint_data with the low
4165         target's breakpoint.
4166         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
4167         FOP_REGNUM, mappings): Move to ...
4168         * win32-i386-low.c: ... here.
4169         * win32-low.c (win32_thread_info): Move to ...
4170         * win32-low.h: ... here.
4171         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
4172         win32-arm-low.c and wincecompat.c.
4173         (all:): Add $EXEEXT.
4174         (install-only:): Likewise.
4175         (gdbserver:): Likewise.
4176         (gdbreplay:): Likewise.
4177         * config.in: Regenerate.
4178         * configure: Regenerate.
4179
4180 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
4181
4182         * win32-low.c: Rename typedef thread_info to
4183         win32_thread_info throughout.
4184
4185 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
4186
4187         * win32-i386-low.c: Rename to ...
4188         * win32-low.c: ... this.
4189         * configure.srv: Replace win32-i386-low.o with win32-low.o.
4190         * Makefile.in: Likewise.
4191
4192 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
4193
4194         * remote-utils.c (monitor_output): Constify msg parameter.
4195         * server.h (monitor_output): Likewise.
4196         * win32-i386-low.c (handle_output_debug_string): New.
4197         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
4198         handle_output_debug_string.
4199         (get_child_debug_event): Likewise.
4200
4201 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
4202
4203         * server.c (main): Correct strtoul check.
4204
4205 2007-03-27  Jon Ringle  <jon@ringle.org>
4206
4207         * linux-low.c: Check __ARCH_HAS_MMU__ also.
4208
4209 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
4210
4211         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
4212
4213 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
4214
4215         * terminal.h: Check HAVE_SGTTY_H.
4216
4217 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
4218
4219         * remote-utils.c (remote_open): Print out the assigned port number.
4220
4221 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
4222
4223         * remote-utils.c (monitor_output): New function.
4224         * server.c (debug_threads): Define here.
4225         (monitor_show_help): New function.
4226         (handle_query): Handle qRcmd.
4227         (main): Do not handle 'd' packet.
4228         * server.h (debug_threads, remote_debug, monitor_output): Declare.
4229         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
4230         of debug_threads.
4231
4232 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
4233
4234         * Makefile.in (EXEEXT): New.
4235         (clean): Use $(EXEEXT).
4236
4237 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
4238
4239         * target.h (target_ops): Rename send_signal to request_interrupt,
4240         and remove enum target_signal parameter.
4241         * linux-low.c (linux_request_interrupt): Rename from
4242         linux_send_signal, and always send SIGINT.
4243         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
4244         and always send SIGINT.
4245         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
4246         of send_signal.
4247         (input_interrupt): Likewise.
4248
4249 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
4250
4251         * server.c (get_features_xml): Check if target implemented
4252         arch_string.
4253         * win32-i386-low.c (win32_arch_string): New.
4254         (win32_target_ops): Add win32_arch_string as arch_string member.
4255
4256 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
4257
4258         * spu-low.c (spu_arch_string): New.
4259         (spu_target_ops): Add spu_arch_string.
4260
4261 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
4262
4263         * remote-utils.c: Remove HAVE_TERMINAL_H check.
4264         * configure.ac: Do not check for terminal.h.
4265         * configure, config.in: Regenerated.
4266
4267 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
4268
4269         * Makefile.in (OBS): Add $(XML_BUILTIN).
4270         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
4271         (clean): Update.
4272         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
4273         (arm-with-iwmmxt.c): New.
4274         * config.in, configure: Regenerate.
4275         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
4276         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
4277         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
4278         (arm*-*-linux*): Add iWMMXt and regset support.
4279         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
4280         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
4281         (arm_store_wmmxregset, target_regsets): New.
4282         * server.c (get_features_xml): Take annex argument.  Check builtin
4283         XML documents.
4284         (handle_query): Handle multiple annexes.
4285
4286 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
4287
4288         * remote-utils.c [USE_WIN32API] (read, write): Define.
4289         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
4290         write.
4291
4292 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
4293
4294         * linux-i386-low.c (the_low_target): Set arch_string.
4295         * linux-x86-64-low.c (the_low_target): Likewise.
4296         * linux-low.c (linux_arch_string): New.
4297         (linux_target_ops): Add it.
4298         * linux-low.h (struct linux_target_ops): Add arch_string.
4299         * server.c (write_qxfer_response): Use const void * for DATA.
4300         (get_features_xml): New.
4301         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
4302         * target.h (struct target_ops): Add arch_string method.
4303
4304 2007-01-03  Denis Pilat  <denis.pilat@st.com>
4305             Daniel Jacobowitz  <dan@codesourcery.com>
4306
4307         * linux-low.c (linux_kill): Handle being called with no threads.
4308         * win32-i386-low.c (win32_kill): Likewise.
4309         (get_child_debug_event): Clear current_process_handle.
4310
4311 2006-12-30  Denis PILAT  <denis.pilat@st.com>
4312             Daniel Jacobowitz  <dan@codesourcery.com>
4313
4314         * remote-utils.c (remote_open): Check the type of specified
4315         serial port devices before opening them.
4316         * server.c (main): Kill the inferior if an error occurs during
4317         the first remote_open.
4318
4319 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
4320
4321         * README: Update supported targets.
4322
4323 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
4324
4325         * Makefile.in (clean): Remove reg-mips64.c.
4326         (reg-mips64.c, reg-mips64.o): New rules.
4327         * configure.srv: Handle mips64.  Include regset support for mips.
4328         * linux-mips-low.c (union mips_register): New.
4329         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
4330         (mips_breakpoint, mips_breakpoint_at): Use int.
4331         (mips_collect_register, mips_supply_register)
4332         (mips_collect_register_32bit, mips_supply_register_32bit)
4333         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
4334         (mips_store_fpregset, target_regsets): New.
4335         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
4336
4337 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
4338
4339         * configure.srv: Add target "spu*-*-*".
4340         * Makefile.in (clean): Remove reg-spu.c.
4341         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
4342         * spu-low.c: New file.
4343
4344 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
4345
4346         * configure.ac: Correct td_thr_tls_get_addr test.
4347         * configure: Regenerated.
4348
4349 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
4350
4351         * linux-low.c (linux_wait_for_event): Reformat.  Use the
4352         pass_signals array.
4353         * remote-utils.c (decode_address_to_semicolon): New.
4354         * server.c (pass_signals, handle_general_set): New.
4355         (handle_query): Mention QPassSignals for qSupported.
4356         (main): Call handle_general_set.
4357         * server.h (pass_signals, decode_address_to_semicolon): New.
4358
4359 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
4360
4361         * server.c (handle_query): Correct error handling for read_auxv.
4362
4363 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
4364
4365         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
4366         and srv_linux_thread_db to yes.
4367         * linux-s390-low.c (s390_fill_gregset): New function.
4368         (target_regsets): Define data structure.
4369
4370 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
4371
4372         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
4373         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
4374         * config.in, configure: Regenerated.
4375         * inferiors.c (gdb_id_to_thread): New function.
4376         (gdb_id_to_thread_id): Use it.
4377         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
4378         * linux-low.h (struct process_info): Add th member.
4379         (thread_db_get_tls_address): New prototype.
4380         * remote-utils.c (decode_address): Make non-static.
4381         * server.c (handle_query): Handle qGetTLSAddr.
4382         * server.h (gdb_id_to_thread, decode_address): New prototypes.
4383         * target.h (struct target_ops): Add get_tls_address.
4384         * thread-db.c (maybe_attach_thread): Save the thread handle.
4385         (thread_db_get_tls_address): New.
4386
4387 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
4388
4389         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
4390         (linux_resume_one_process): Take a siginfo_t *.  Update all
4391         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
4392         (struct pending_signals): Add a siginfo_t.
4393         (linux_wait_for_process): Always set last_status.
4394         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
4395         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
4396         * linux-low.h (struct process_info): Add last_status.
4397
4398 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
4399
4400         * remote-utils.c (try_rle): New function.
4401         (putpkt_binary): Use it.
4402
4403 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
4404
4405         * Makefile.in (clean): Clean reg-x86-64-linux.c.
4406         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
4407         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
4408         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
4409         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
4410         point registers.
4411
4412 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
4413
4414         * server.c (terminal_fd): New variable.
4415         (old_foreground_pgrp): Likewise.
4416         (restore_old_foreground_pgrp): New function.
4417         (start_inferior): Record the terminal file descriptor in terminal_fd
4418         and its original foreground group in old_foreground_pgrp.  Register
4419         restore_old_foreground_pgrp with atexit().
4420
4421 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
4422
4423         * server.c (handle_query): Correct qPart to qXfer.
4424
4425 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
4426
4427         * configure.ac: Check for more headers which are missing on
4428         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
4429         * configure.srv: Add Cygwin and mingw32.
4430         * remote-utils.c: Don't include headers unconditionally which
4431         are missing on mingw32.  Include <winsock.h> for mingw32.
4432         (remote_open): Adjust for mingw32 support.  Flush
4433         standard error after writing to it.
4434         (remote_close, putpkt_binary, input_interrupt, block_async_io)
4435         (unblock_async_io, enable_async_io, disable_async_io)
4436         (readchar, getpkt): Update for Winsock support.
4437         (prepare_resume_reply): Expect a protocol signal number.
4438         * server.c: Disable <sys/wait.h> on mingw32.
4439         (start_inferior): Adjust for mingw32 support.  Flush
4440         standard error after writing to it.
4441         (attach_inferior): Likewise.  Use protocol signal
4442         numbers.
4443         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
4444         and names.
4445         * win32-i386-low.c: New file.
4446         * Makefile.in (XM_CLIBS): Set.
4447         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
4448         (win32-i386-low.o): New dependency rule.
4449         * linux-low.c (linux_wait): Use target signal numbers.
4450         * target.h (struct target_ops): Doc fix.
4451         * server.h (target_signal_to_name): New prototype.
4452         * gdbreplay.c: Don't include headers unconditionally which
4453         are missing on mingw32.  Include <winsock.h> for mingw32.
4454         (remote_close, remote_open): Adjust for Winsock support.
4455         * configure, config.in: Regenerated.
4456
4457 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
4458
4459         * server.c (decode_xfer_read, write_qxfer_response): New.
4460         (handle_query): Take a packet length argument.  Handle
4461         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
4462         the qSupported response.
4463         (main): Update call to handle_query.
4464
4465 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
4466
4467         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
4468         (putpkt_binary): Renamed from putpkt and adjusted for binary
4469         data.
4470         (putpkt): New wrapper for putpkt_binary.
4471         (readchar): Don't mask off the high bit.
4472         (decode_X_packet): New function.
4473         * server.c (main): Call putpkt_binary if a handler sets the packet
4474         length.  Save the length of the incoming packet.  Handle 'X'.
4475         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
4476
4477 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
4478
4479         * server.c (handle_query): Handle qSupported.
4480
4481 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
4482
4483         * remote-utils.c (all_symbols_looked_up): New variable.
4484         (look_up_one_symbol): Check it.
4485         * server.h (look_up_one_symbol): New declaration.
4486         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
4487
4488 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
4489
4490         * Makefile.in (linux-arm-low.o): Update dependencies.
4491         * linux-arm-low.c: Include "gdb_proc_service.h".
4492         (PTRACE_GET_THREAD_AREA): Define.
4493         (ps_get_thread_area): New function.
4494
4495 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
4496
4497         * configure.srv (m68k*-*-uclinux*): New target.
4498         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
4499         (linux_resume_one_process): Remove extraneous cast.
4500         (linux_read_offsets): New.
4501         (linux_target_op): Add linux_read_offsets on mmuless systems.
4502         * server.c (handle_query): Add qOffsets logic.
4503         * target.h (struct target_ops): Add read_offsets.
4504
4505 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
4506
4507         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
4508         (PTRACE_GET_THREAD_AREA): Define.
4509         (ps_get_thread_area): New function.
4510         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
4511         (linux-x86-64-low.o): Update.
4512
4513 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
4514
4515         * configure.ac: Remove checks for prfpregset_t.
4516         * gdb_proc_service.h: New file.
4517         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
4518         new "gdb_proc_service.h".
4519         * proc-service.c: Likewise.
4520         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
4521         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
4522         * Makefile.in (gdb_proc_service_h): Updated.
4523         * configure, config.in: Regenerated.
4524
4525 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
4526
4527         * remote-utils.c (prepare_resume_reply): Move declaration
4528         of gdb_id_from_wait to the top of the block.
4529
4530 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
4531
4532         * linux-low.c (regsets_store_inferior_registers): Read the regset
4533         from the target before filling it.
4534
4535 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
4536
4537         * server.c (attach_inferior): Return SIGTRAP for a successful
4538         attach.
4539
4540 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
4541
4542         * Makefile.in (OBS): Add version.o.
4543         (STAGESTUFF): Delete.
4544         (version.o): Add dependencies.
4545         (version.c): Replace rule.
4546         (clean): Remove version.c.
4547         * server.c (gdbserver_version): New.
4548         (gdbserver_usage): Use printf.
4549         (main): Handle --version and --help.
4550         * server.h (version, host_name): Add declarations.
4551
4552 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
4553
4554         * linux-arm-low.c:
4555         * linux-arm-low.c:
4556         * inferiors.c:
4557         * i387-fp.h:
4558         * i387-fp.c:
4559         * gdbreplay.c:
4560         * regcache.c:
4561         * proc-service.c:
4562         * mem-break.h:
4563         * mem-break.c:
4564         * linux-x86-64-low.c:
4565         * linux-sh-low.c:
4566         * linux-s390-low.c:
4567         * linux-ppc64-low.c:
4568         * linux-ppc-low.c:
4569         * linux-mips-low.c:
4570         * linux-m68k-low.c:
4571         * linux-m32r-low.c:
4572         * linux-low.h:
4573         * linux-low.c:
4574         * linux-ia64-low.c:
4575         * linux-i386-low.c:
4576         * linux-crisv32-low.c:
4577         * thread-db.c:
4578         * terminal.h:
4579         * target.h:
4580         * target.c:
4581         * server.h:
4582         * server.c:
4583         * remote-utils.c:
4584         * regcache.h:
4585         * utils.c:
4586         * Makefile.in:
4587         * configure.ac:
4588         * gdbserver.1: Add (C) after Copyright.  Update the FSF
4589         address.
4590
4591 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
4592
4593         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
4594         (arm_breakpoint_at): Recognize both breakpoints.
4595         (the_low_target): Use the correct breakpoint instruction.
4596
4597 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
4598
4599         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
4600         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
4601         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
4602         (the_low_target): Update.
4603
4604 2005-10-25  Andreas Schwab  <schwab@suse.de>
4605
4606         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
4607
4608         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
4609         (ia64_num_regs): Reduce to 462.
4610
4611 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
4612
4613         * acinclude.m4: Correct quoting.
4614         * aclocal.m4: Regenerated.
4615
4616         Suggested by SZOKOVACS Robert <szo@ies.hu>:
4617         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
4618         (thread_db_init): Call thread_db_err_str.
4619         * configure.ac: Check for TD_VERSION.
4620         * config.in, configure: Regenerated.
4621
4622 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
4623
4624         * server.h (error, fatal, warning): Add ATTR_FORMAT.
4625
4626 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
4627
4628         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
4629         is not available.  Define HAVE_PTRACE_GETREGS if it is.
4630         * config.in, configure: Regenerated.
4631         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
4632         * linux-i386-low.c, linux-m68k-low.c: Update to use
4633         HAVE_PTRACE_GETREGS.
4634         * linux-low.c (regsets_fetch_inferior_registers)
4635         (regsets_store_inferior_registers): Only return 0 if we processed
4636         GENERAL_REGS.
4637         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
4638         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
4639
4640 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
4641
4642         * inferiors.c (struct thread_info): Add gdb_id.
4643         (add_thread): Add gdb_id argument.
4644         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
4645         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
4646         calls to add_thread.
4647         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
4648         * server.c (handle_query): Use thread_to_gdb_id.
4649         (handle_v_cont, main): Use gdb_id_to_thread_id.
4650         * server.h (add_thread): Update prototype.
4651         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
4652         prototypes.
4653
4654 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
4655
4656         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
4657         left-padded registers.
4658         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
4659         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
4660
4661 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
4662
4663         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
4664         * configure: Regenerate.
4665         * config.in: Regenerate.
4666         * server.h (NEED_DECLARATION_STRERROR):
4667         Replace with !HAVE_DECL_STRERROR.
4668
4669 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
4670
4671         * linux-low.c (linux_wait, linux_send_signal): Don't test
4672         an unsigned long variable for > 0 if it could be MAX_ULONG.
4673         * server.c (myresume): Likewise.
4674         * target.c (set_desired_inferior): Likewise.
4675
4676 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
4677
4678         * configure.ac: Simplify and improve check for socklen_t.
4679         * configure, config.in: Regenerate.
4680
4681 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
4682
4683         * acconfig.h: Remove.
4684         * configure.ac: Add a test for socklen_t.  Use three-argument
4685         AC_DEFINE throughout.
4686         * config.in: Regenerated using autoheader 2.59.
4687         * configure: Regenerated.
4688
4689         * gdbreplay.c (socklen_t): Provide a default.
4690         (remote_open): Use socklen_t.
4691         * remote-utils.c (socklen_t): Provide a default.
4692         (remote_open): Use socklen_t.
4693         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
4694         unsigned char.
4695
4696         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
4697         char for buffers.
4698         * linux-low.c (linux_read_memory, linux_write_memory)
4699         (linux_read_auxv): Likewise.
4700         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
4701         (check_mem_write): Likewise.
4702         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
4703         Likewise.
4704         * regcache.c (struct inferior_rgcache_data, registers_to_string)
4705         (registers_from_string, register_data): Likewise.
4706         * server.c (handle_query, main): Likewise.
4707         * server.h (convert_ascii_to_int, convert_int_to_ascii)
4708         (decode_M_packet): Likewise.
4709         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
4710         * target.h (struct target_ops): Update read_memory, write_memory,
4711         and read_auxv.
4712         (read_inferior_memory, write_inferior_memory): Update.
4713         * linux-low.h (struct linux_target_ops): Change type of breakpoint
4714         to unsigned char *.
4715         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
4716         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
4717         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
4718         linux-s390-low.c, linux-sh-low.c: Update for changes in
4719         read_inferior_memory and the_low_target->breakpoint.
4720
4721 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
4722
4723         * Makefile.in (SFILES): Add linux-ppc64-low.c.
4724         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
4725         * configure.srv: Add powerpc64-*-linux*.
4726         * linux-ppc64-low.c: New file.
4727
4728 2005-05-23  Orjan Friberg  <orjanf@axis.com>
4729
4730         * linux-cris-low.c: New file with support for CRIS.
4731         * linux-crisv32-low.c: Ditto for CRISv32.
4732         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
4733         (clean): Add reg-cris.c and reg-crisv32.c.
4734         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
4735         reg-crisv32.o, and reg-crisv32.c to make rules.
4736         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
4737         recognized targets.
4738
4739 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
4740
4741         * linux-low.c (fetch_register): Ensure buffer size is a multiple
4742         of sizeof (PTRACE_XFER_TYPE).
4743         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
4744
4745 2005-05-12  Orjan Friberg  <orjanf@axis.com>
4746
4747         * target.h (struct target_ops): Add insert_watchpoint,
4748         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
4749         pointers for hardware watchpoint support.
4750         * linux-low.h (struct linux_target_ops): Ditto.
4751         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
4752         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
4753         to linux_target_ops.
4754         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
4755         reply packet.
4756         * server.c (main): Recognize 'Z' and 'z' packets.
4757
4758 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
4759
4760         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
4761         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
4762         (the_low_target): Add new members.
4763
4764 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
4765
4766         * proc-service.c (ps_lgetregs): Search all_processes instead of
4767         all_threads.
4768
4769 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
4770
4771         * server.c (start_inferior): Change return type to int.
4772         (attach_inferior): Change sigptr to int *.
4773         (handle_v_cont, handle_v_requests): Change signal to int *.
4774         (main): Change signal to int.
4775
4776 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
4777
4778         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
4779         * configure.srv: Add m32r*-*-linux*.
4780         * linux-m32r-low.c: New file.
4781
4782 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
4783
4784         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
4785
4786 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
4787
4788         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
4789         Take unsigned long arguments for PIDs.
4790         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
4791         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
4792         (wait_for_sigstop, linux_resume_one_process)
4793         (regsets_fetch_inferior_registers, linux_send_signal)
4794         (linux_read_auxv): Likewise.  Update the types of variables holding
4795         PIDs.  Update format string specifiers.
4796         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
4797         * remote-utils.c (prepare_resume_reply): Likewise.
4798         * server.c (cont_thread, general_thread, step_thread)
4799         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
4800         unsigned long.
4801         (handle_query): Update format specifiers.
4802         (handle_v_cont, main): Use strtoul for thread IDs.
4803         * server.h (struct inferior_list_entry): Use unsigned long for ID.
4804         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
4805         (general_thread, step_thread, thread_from_wait)
4806         (old_thread_from_wait): Update.
4807         * target.h (struct thread_resume): Use unsigned long for THREAD.
4808         (struct target_ops): Use unsigned long for arguments to attach and
4809         thread_alive.
4810
4811 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
4812
4813         * acinclude.m4: Include bfd/bfd.m4 directly.
4814         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
4815         <agriffis@toolchain.org>.
4816         * aclocal.m4, configure: Regenerated.
4817
4818 2005-01-07  Andrew Cagney  <cagney@gnu.org>
4819
4820         * configure.ac: Rename configure.in, require autoconf 2.59.
4821         * configure: Re-generate.
4822
4823 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
4824
4825         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
4826         LIBS when finished.
4827         * aclocal.m4: Regenerated.
4828         * configure: Regenerated.
4829
4830 2004-11-21  Andreas Schwab  <schwab@suse.de>
4831
4832         * linux-m68k-low.c (m68k_num_gregs): Define.
4833         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
4834         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
4835         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
4836         (m68k_breakpoint_at): New.  Add to the_low_target.
4837
4838         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
4839         srv_linux_thread_db to yes.
4840
4841 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
4842
4843         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
4844         (ARCH_SET_FS): Likewise.
4845         (ARCH_GET_FS): Likewise.
4846         (ARCH_GET_GS): Likewise.
4847
4848 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
4849
4850         * linux-i386-low.c (ps_get_thread_area): New.
4851         * linux-x86-64-low.c (ps_get_thread_area): New.
4852         * linux-low.c: Include <sys/syscall.h>.
4853         (linux_kill_one_process): Don't kill the first thread here.
4854         (linux_kill): Kill the first thread here.
4855         (kill_lwp): New function.
4856         (send_sigstop, linux_send_signal): Use it.
4857         * proc-service.c: Clean up #ifdefs.
4858         (fpregset_info): Delete.
4859         (ps_lgetregs): Update and enable implementation.
4860         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
4861         implementations.
4862         * remote-utils.c (struct sym_cache, symbol_cache): New.
4863         (input_interrupt): Print a clearer message.
4864         (async_io_enabled): New variable.
4865         (enable_async_io, disable_async_io): Use it.  Update comments.
4866         (look_up_one_symbol): Use the symbol cache.
4867         * thread-db.c (thread_db_look_up_symbols): New function.
4868         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
4869
4870 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
4871
4872         * configure.in: Test for -rdynamic.
4873         * configure: Regenerated.
4874         * Makefile (INTERNAL_LDFLAGS): New.
4875         (gdbserver, gdbreplay): Use it.
4876
4877 2004-09-02  Andrew Cagney  <cagney@gnu.org>
4878
4879         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
4880
4881 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
4882
4883         * linux-low.c (linux_wait): Clear all_processes list also.
4884
4885 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
4886
4887         * linux-low.c: Include <errno.h>.  Remove extern declaration of
4888         errno.
4889
4890 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
4891
4892         * gdbreplay.c, server.h, utils.c: Update copyright years.
4893
4894 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
4895
4896         * server.c (main): Print child status or termination signal from
4897         variable 'signal', not 'sig'.
4898
4899 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
4900
4901         * linux-low.c (linux_read_memory): Change return type to
4902         int.  Check for and return error from ptrace().
4903         * target.c (read_inferior_memory): Change return type to int.  Pass
4904         back return status from the_target->read_memory().
4905         * target.h (struct target_ops): Adapt *read_memory() prototype.
4906         Update comment.
4907         (read_inferior_memory): Adapt prototype.
4908         * server.c (main): Return an error packet if
4909         read_inferior_memory() returns an error.
4910
4911 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
4912
4913         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
4914         Unify with other clean targets.
4915
4916 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
4917
4918         * server.c (handle_v_cont): Call set_desired_inferior.
4919
4920 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
4921
4922         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
4923
4924 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
4925
4926         * linux-low.c (linux_wait): Unblock async I/O.
4927         (linux_resume): Block and enable async I/O.
4928         * remote-utils.c (block_async_io, unblock_async_io): New functions.
4929         * server.h (block_async_io, unblock_async_io): Add prototypes.
4930
4931 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
4932
4933         * remote-utils.c (remote_open): Print a status notice after
4934         opening a TCP port.
4935         * server.c (attach_inferior): Print a status notice after
4936         attaching.
4937
4938 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
4939
4940         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
4941
4942 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
4943
4944         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
4945         error packet.
4946         * server.c, target.h: Update copyright years.
4947
4948 2004-02-25  Roland McGrath  <roland@redhat.com>
4949
4950         * target.h (struct target_ops): New member `read_auxv'.
4951         * server.c (handle_query): Handle qPart:auxv:read: query using that.
4952         * linux-low.c (linux_read_auxv): New function.
4953         (linux_target_ops): Initialize `read_auxv' member to that.
4954
4955 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
4956
4957         Committed by Jim Blandy  <jimb@redhat.com>.
4958
4959         * linux-s390-low.c (s390_num_regs): Update.
4960         (s390_regmap): Remove control registers.  Use __s390x__ predefine
4961         instead of GPR_SIZE to distiguish s390 and s390x targets.
4962
4963 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
4964
4965         * linux-low.c: Update copyright year.
4966         (check_removed_breakpoint): Clear pending_is_breakpoint.
4967         (linux_set_resume_request, linux_queue_one_thread)
4968         (resume_status_pending_p): New functions.
4969         (linux_continue_one_thread): Use process->resume.
4970         (linux_resume): Only resume threads if there are no pending events.
4971         * linux-low.h (struct process_info): Add resume request
4972         pointer.
4973
4974 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
4975
4976         * regcache.c (new_register_cache): Clear the allocated register
4977         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
4978
4979 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
4980
4981         * linux-low.c (linux_resume): Take a struct thread_resume *
4982         argument.
4983         (linux_wait): Update call.
4984         (resume_ptr): New static variable.
4985         (linux_continue_one_thread): Renamed from
4986         linux_continue_one_process.  Use resume_ptr.
4987         (linux_resume): Use linux_continue_one_thread.
4988         * server.c (handle_v_cont, handle_v_requests): New functions.
4989         (myresume): New function.
4990         (main): Handle 'v' case.
4991         * target.h (struct thread_resume): New type.
4992         (struct target_ops): Change argument of "resume" to struct
4993         thread_resume *.
4994         (myresume): Delete macro.
4995
4996 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
4997
4998         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
4999         (uninstall): Support DESTDIR.
5000
5001 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
5002
5003         * configure.srv: Add xscale*linux copy of arm*linux entry.
5004
5005 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
5006
5007         * linux-arm-low.c (arm_reinsert_addr): New function.
5008         (the_low_target): Add arm_reinsert_addr.
5009
5010 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
5011
5012         * mem-break.c: Remove whitespace at end of file.
5013
5014 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
5015
5016         * configure.in: Check whether we need to prototype strerror.
5017         * server.h: Optionally prototype strerror.
5018         * gdbreplay.c (perror_with_name): Use strerror.
5019         * linux-low.c (linux_attach_lwp): Use strerror.
5020         * utils.c (perror_with_name): Use strerror.
5021         * config.in, configure: Regenerated.
5022
5023 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
5024
5025         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
5026         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
5027
5028 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
5029
5030         * Makefile.in (SFILES): Update.
5031         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
5032         low-sun3.c: Remove files.
5033
5034 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
5035
5036         * linux-low.c: Move comment to linux_thread_alive where it belonged.
5037         (linux_detach_one_process, linux_detach): New functions.
5038         (linux_target_ops): Add linux_detach.
5039         * server.c (main): Handle 'D' packet.
5040         * target.h (struct target_ops): Add "detach" member.
5041         (detach_inferior): Define.
5042
5043 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
5044
5045         From Kelley Cook  <kelleycook@wideopenwest.com>:
5046         * configure.srv: Accept i[34567]86 variants.
5047
5048 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
5049
5050         * linux-low.c (linux_wait_for_event): Correct comment typos.
5051         (linux_resume_one_process): Call check_removed_breakpoint.
5052         (linux_send_signal): New function.
5053         (linux_target_ops): Add linux_send_signal.
5054         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
5055         of kill.
5056         * target.h (struct target_ops): Add send_signal.
5057
5058 2003-05-29  Jim Blandy  <jimb@redhat.com>
5059
5060         * linux-low.c (usr_store_inferior_registers): Transfer buf in
5061         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
5062         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
5063         away part of the register's value.
5064
5065 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
5066
5067         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
5068         (linux_wait_for_event, linux_init_signals): Likewise.
5069
5070 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
5071
5072         * configure.in: Check for stdlib.h.
5073         * configure: Regenerated.
5074         * config.in: Regenerated.
5075
5076 2003-01-04  Andreas Schwab  <schwab@suse.de>
5077
5078         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
5079
5080 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
5081
5082         * Makefile.in: Remove obsolete code.
5083
5084 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
5085
5086         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
5087         defined(PT_FPR0_HI).
5088
5089 2002-11-17  Stuart Hughes  <seh@zee2.com>
5090
5091         * linux-arm-low.c (arm_num_regs): Increase.
5092         (arm_regmap): Include status register.
5093
5094 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
5095
5096         * linux-low.c (register_addr): Remove incorrect -1 check.
5097
5098 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
5099
5100         * linux-low.c (linux_create_inferior): Call setpgid.  Return
5101         the new PID.
5102         (unstopped_p, linux_signal_pid): Remove.
5103         (linux_target_ops): Remove linux_signal_pid.
5104         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
5105         global instead of target method.
5106         * target.h (struct target_ops): Remove signal_pid.  Update comment
5107         for create_inferior.
5108         * server.c (signal_pid): New variable.
5109         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
5110         gdbserver.  Set the child to be the foreground process group.
5111         (attach_inferior): Set signal_pid.
5112
5113 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
5114
5115         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
5116
5117 2002-08-20  Jim Blandy  <jimb@redhat.com>
5118
5119         * Makefile.in (LDFLAGS): Allow the configure script to establish a
5120         default for this.
5121
5122 2002-08-01  Andrew Cagney  <cagney@redhat.com>
5123
5124         * Makefile.in: Make chill references obsolete.
5125
5126 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
5127
5128         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
5129         * configure: Regenerate.
5130         * config.in: Regenerate.
5131
5132 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
5133
5134         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
5135         (perror_with_name, remote_close, remote_open, expect, play): Static.
5136
5137 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
5138
5139         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
5140         byte offsets instead of an array of indexes.
5141         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
5142
5143 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
5144
5145         * regcache.c: Add comment.
5146
5147 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
5148
5149         * thread-db.c: New file.
5150         * proc-service.c: New file.
5151         * acinclude.m4: New file.
5152         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
5153         proc-service.o, and thread-db.o.
5154         (linux-low.o): Add USE_THREAD_DB.
5155         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
5156         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
5157         * aclocal.m4: Regenerated.
5158         * config.in: Regenerated.
5159         * configure: Regenerated.
5160         * configure.in: Check for proc_service.h, sys/procfs.h,
5161         thread_db.h, and linux/elf.h headrs.
5162         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
5163         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
5164         Check for -lthread_db and thread support.
5165         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
5166         PowerPC, and SuperH.
5167         * i387-fp.c: Constify arguments.
5168         * i387-fp.h: Likewise.
5169         * inferiors.c: (struct thread_info): Renamed from
5170         `struct inferior_info'.  Remove PID member.  Use generic inferior
5171         list header.  All uses updated.
5172         (inferiors, signal_pid): Removed.
5173         (all_threads): New variable.
5174         (get_thread): Define.
5175         (add_inferior_to_list): New function.
5176         (for_each_inferior): New function.
5177         (change_inferior_id): New function.
5178         (add_inferior): Removed.
5179         (remove_inferior): New function.
5180         (add_thread): New function.
5181         (free_one_thread): New function.
5182         (remove_thread): New function.
5183         (clear_inferiors): Use for_each_inferior and free_one_thread.
5184         (find_inferior): New function.
5185         (find_inferior_id): New function.
5186         (inferior_target_data): Update argument type.
5187         (set_inferior_target_data): Likewise.
5188         (inferior_regcache_data): Likewise.
5189         (set_inferior_regcache_data): Likewise.
5190         * linux-low.c (linux_bp_reinsert): Remove.
5191         (all_processes, stopping_threads, using_thrads)
5192         (struct pending_signals, debug_threads, pid_of): New.
5193         (inferior_pid): Replace with macro.
5194         (struct inferior_linux_data): Remove.
5195         (get_stop_pc, add_process): New functions.
5196         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
5197         Use add_process and add_thread.
5198         (linux_attach_lwp): New function, based on old linux_attach.  Use
5199         add_process and add_thread.  Set stop_expected for new threads.
5200         (linux_attach): New function.
5201         (linux_kill_one_process): New function.
5202         (linux_kill): Kill all LWPs.
5203         (linux_thread_alive): Use find_inferior_id.
5204         (check_removed_breakpoints, status_pending_p): New functions.
5205         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
5206         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
5207         struct for the found process.
5208         (linux_wait_for_event): New function.
5209         (linux_wait): Use it.  Support LWPs.
5210         (send_sigstop, wait_for_sigstop, stop_all_processes)
5211         (linux_resume_one_process, linux_continue_one_process): New functions.
5212         (linux_resume): Support LWPs.
5213         (REGISTER_RAW_SIZE): Remove.
5214         (fetch_register): Use register_size instead.  Call supply_register.
5215         (usr_store_inferior_registers): Likewise.  Call collect_register.
5216         Fix recursive case.
5217         (regsets_fetch_inferior_registers): Improve error message.
5218         (regsets_store_inferior_registers): Add debugging.
5219         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
5220         (unstopped_p, linux_signal_pid): New functions.
5221         (linux_target_ops): Add linux_signal_pid.
5222         (linux_init_signals): New function.
5223         (initialize_low): Call it.  Initialize using_threads.
5224         * regcache.c (inferior_regcache_data): Add valid
5225         flag.
5226         (get_regcache): Fetch registers lazily.  Add fetch argument
5227         and update all callers.
5228         (regcache_invalidate_one, regcache_invalidate): New
5229         functions.
5230         (new_register_cache): Renamed from create_register_cache.
5231         Return the new regcache.
5232         (free_register_cache): Change argument to a void *.
5233         (registers_to_string, registers_from_string): Call get_regcache
5234         with fetch flag set.
5235         (register_data): Make static.  Pass fetch flag to get_regcache.
5236         (supply_register): Call get_regcache with fetch flag clear.
5237         (collect_register): Call get_regcache with fetch flag set.
5238         (collect_register_as_string): New function.
5239         * regcache.h: Update.
5240         * remote-utils.c (putpkt): Flush after debug output and use
5241         stderr.
5242         Handle input interrupts while waiting for an ACK.
5243         (input_interrupt): Use signal_pid method.
5244         (getpkt): Flush after debug output and use stderr.
5245         (outreg): Use collect_register_as_string.
5246         (new_thread_notify, dead_thread_notify): New functions.
5247         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
5248         and general_thread.
5249         (look_up_one_symbol): Flush after debug output.
5250         * server.c (step_thread, server_waiting): New variables.
5251         (start_inferior): Don't use signal_pid.  Update call to mywait.
5252         (attach_inferior): Update call to mywait.
5253         (handle_query): Handle qfThreadInfo and qsThreadInfo.
5254         (main): Don't fetch/store registers explicitly.  Use
5255         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
5256         calls to mywait.
5257         * server.h: Update.
5258         (struct inferior_list, struct_inferior_list_entry): New.
5259         * target.c (set_desired_inferior): New.
5260         (write_inferior_memory): Constify.
5261         (mywait): New function.
5262         * target.h: Update.
5263         (struct target_ops): New signal_pid method.
5264         (mywait): Removed macro, added prototype.
5265
5266         * linux-low.h (regset_func): Removed.
5267         (regset_fill_func, regset_store_func): New.
5268         (enum regset_type): New.
5269         (struct regset_info): Add type field.  Use new operation types.
5270         (struct linux_target_ops): stop_pc renamed to get_pc.
5271         Add decr_pc_after_break and breakpoint_at.
5272         (get_process, get_thread_proess, get_process_thread)
5273         (strut process_info, all_processes, linux_attach_lwp)
5274         (thread_db_init): New.
5275
5276         * linux-arm-low.c (arm_get_pc, arm_set_pc,
5277         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
5278         (the_low_target): Add new members.
5279         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
5280         (i386_store_fpxregset): Constify.
5281         (target_regsets): Add new kind identifier.
5282         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
5283         (i386_set_pc): Add debugging.
5284         (i386_breakpoint_at): New function.
5285         (the_low_target): Add new members.
5286         * linux-mips-low.c (mips_get_pc, mips_set_pc)
5287         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
5288         (mips_breakpoint_at): New.
5289         (the_low_target): Add new members.
5290         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
5291         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
5292         (the_low_target): Add new members.
5293         * linux-sh-low.c (sh_get_pc, sh_set_pc)
5294         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
5295         (the_low_target): Add new members.
5296         * linux-x86-64-low.c (target_regsets): Add new kind
5297         identifier.
5298
5299 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
5300
5301         From Martin Pool <mbp@samba.org>:
5302         * server.c (gdbserver_usage): New function.
5303         (main): Call it.
5304
5305 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
5306
5307         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
5308         stop_at -> stop_pc.
5309
5310 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
5311
5312         * Makefile.in: Remove obsolete code.
5313
5314 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
5315
5316         * linux-low.c (regsets_fetch_inferior_registers),
5317         (regsets_store_inferior_registers): Removed cast to int from
5318         ptrace() calls.
5319         * regcache.h: Added declaration of struct inferior_info.
5320
5321 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
5322
5323         * inferiors.c (struct inferior_info): Add regcache_data.
5324         (add_inferior): Call create_register_cache.
5325         (clear_inferiors): Call free_register_cache.
5326         (inferior_regcache_data, set_inferior_regcache_data): New functions.
5327         * regcache.c (struct inferior_regcache_data): New.
5328         (registers): Remove.
5329         (get_regcache): New function.
5330         (create_register_cache, free_register_cache): New functions.
5331         (set_register_cache): Don't initialize the register cache here.
5332         (registers_to_string, registers_from_string, register_data): Call
5333         get_regcache.
5334         * regcache.h: Add prototypes.
5335         * server.h: Likewise.
5336
5337 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
5338
5339         * mem-break.c: New file.
5340         * mem-break.h: New file.
5341         * Makefile.in: Add mem-break.o rule; update server.h
5342         dependencies.
5343         * inferiors.c (struct inferior_info): Add target_data
5344         member.
5345         (clear_inferiors): Free target_data member if set.
5346         (inferior_target_data, set_inferior_target_data): New functions.
5347         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
5348         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
5349         * linux-low.c (linux_bp_reinsert): New variable.
5350         (struct inferior_linux_data): New.
5351         (linux_create_inferior): Use set_inferior_target_data.
5352         (linux_attach): Likewise.  Call add_inferior.
5353         (linux_wait_for_one_inferior): New function.
5354         (linux_wait): Call it.
5355         (linux_write_memory): Add const.
5356         (initialize_low): Call set_breakpoint_data.
5357         * linux-low.h (struct linux_target_ops): Add breakpoint
5358         handling members.
5359         * server.c (attach_inferior): Remove extra add_inferior
5360         call.
5361         * server.h: Include mem-break.h.  Update inferior.c
5362         prototypes.
5363         * target.c (read_inferior_memory)
5364         (write_inferior_memory): New functions.
5365         * target.h (read_inferior_memory)
5366         (write_inferior_memory): Change macros to prototypes.
5367         (struct target_ops): Update comments.  Add const to write_memory
5368         definition.
5369
5370 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
5371
5372         * linux-low.c (usr_store_inferior_registers): Support
5373         registers which are allowed to fail to store.
5374         * linux-low.h (linux_target_ops): Likewise.
5375         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
5376         (ppc_cannot_store_register): FPSCR may not be storable.
5377
5378 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
5379
5380         * server.h: Include <string.h> if HAVE_STRING_H.
5381         * ChangeLog: Correct paths in last ChangeLog entry.
5382
5383 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
5384
5385         * linux-low.h: Remove obsolete prototypes.
5386         (struct linux_target_ops): New.
5387         (extern the_low_target): New.
5388         * linux-low.c (num_regs, regmap): Remove declarations.
5389         (register_addr): Use the_low_target explicitly.
5390         (fetch_register): Likewise.
5391         (usr_fetch_inferior_registers): Likewise.
5392         (usr_store_inferior_registers): Likewise.
5393         * linux-arm-low.c (num_regs): Remove.
5394         (arm_num_regs): Define.
5395         (arm_regmap): Renamed from regmap, made static.
5396         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
5397         made static.
5398         (arm_cannot_store_register): Renamed from cannot_store_register,
5399         made static.
5400         (the_low_target): New.
5401         * linux-i386-low.c (num_regs): Remove.
5402         (i386_num_regs): Define.
5403         (i386_regmap): Renamed from regmap, made static.
5404         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
5405         made static.
5406         (i386_cannot_store_register): Renamed from cannot_store_register,
5407         made static.
5408         (the_low_target): New.
5409         * linux-ia64-low.c (num_regs): Remove.
5410         (ia64_num_regs): Define.
5411         (ia64_regmap): Renamed from regmap, made static.
5412         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
5413         made static.
5414         (ia64_cannot_store_register): Renamed from cannot_store_register,
5415         made static.
5416         (the_low_target): New.
5417         * linux-m68k-low.c (num_regs): Remove.
5418         (m68k_num_regs): Define.
5419         (m68k_regmap): Renamed from regmap, made static.
5420         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
5421         made static.
5422         (m68k_cannot_store_register): Renamed from cannot_store_register,
5423         made static.
5424         (the_low_target): New.
5425         * linux-mips-low.c (num_regs): Remove.
5426         (mips_num_regs): Define.
5427         (mips_regmap): Renamed from regmap, made static.
5428         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
5429         made static.
5430         (mips_cannot_store_register): Renamed from cannot_store_register,
5431         made static.
5432         (the_low_target): New.
5433         * linux-ppc-low.c (num_regs): Remove.
5434         (ppc_num_regs): Define.
5435         (ppc_regmap): Renamed from regmap, made static.
5436         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
5437         made static.
5438         (ppc_cannot_store_register): Renamed from cannot_store_register,
5439         made static.
5440         (the_low_target): New.
5441         * linux-s390-low.c (num_regs): Remove.
5442         (s390_num_regs): Define.
5443         (s390_regmap): Renamed from regmap, made static.
5444         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
5445         made static.
5446         (s390_cannot_store_register): Renamed from cannot_store_register,
5447         made static.
5448         (the_low_target): New.
5449         * linux-sh-low.c (num_regs): Remove.
5450         (sh_num_regs): Define.
5451         (sh_regmap): Renamed from regmap, made static.
5452         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
5453         made static.
5454         (sh_cannot_store_register): Renamed from cannot_store_register,
5455         made static.
5456         (the_low_target): New.
5457         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
5458         (the_low_target): New.
5459
5460 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
5461
5462         * Makefile.in: Add stamp-h target.
5463         * configure.in: Create stamp-h.
5464         * configure: Regenerated.
5465
5466 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
5467
5468         * inferiors.c: New file.
5469         * target.c: New file.
5470         * target.h: New file.
5471         * Makefile.in:  Add target.o and inferiors.o.  Update
5472         dependencies.
5473         * linux-low.c (inferior_pid): New static variable,
5474         moved from server.c.
5475         (linux_create_inferior): Renamed from create_inferior.
5476         Call add_inferior.  Return 0 on success instead of a PID.
5477         (linux_attach): Renamed from myattach.
5478         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
5479         (linux_thread_alive): Renamed from mythread_alive.
5480         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
5481         child dies.
5482         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
5483         (regsets_store_inferior_registers): Correct error message.
5484         Add missing ``return 0''.
5485         (linux_fetch_registers): Renamed from fetch_inferior_registers.
5486         (linux_store_registers): Renamed from store_inferior_registers.
5487         (linux_read_memory): Renamed from read_inferior_memory.
5488         (linux_write_memory): Renamed from write_inferior_memory.
5489         (linux_target_ops): New structure.
5490         (initialize_low): Call set_target_ops ().
5491         * remote-utils.c (unhexify): New function.
5492         (hexify): New function.
5493         (input_interrupt): Send signals to ``signal_pid''.
5494         * server.c (inferior_pid): Remove.
5495         (start_inferior): Update create_inferior call.
5496         (attach_inferior): Call add_inferior.
5497         (handle_query): New function.
5498         (main): Call handle_query for `q' packets.
5499         * server.h: Include "target.h".  Remove obsolete prototypes.
5500         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
5501
5502 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
5503
5504         * Makefile.in: Add WARN_CFLAGS.  Update configury
5505         dependencies.
5506         * configure.in: Check for <string.h>
5507         * configure: Regenerate.
5508         * config.in: Regenerate.
5509         * gdbreplay.c: Include needed system headers.
5510         (remote_open): Remove strchr prototype.
5511         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
5512         * regcache.c (supply_register): Change buf argument to const void *.
5513         (supply_register_by_name): Likewise.
5514         (collect_register): Change buf argument to void *.
5515         (collect_register_by_name): Likewise.
5516         * regcache.h: Add missing prototypes.
5517         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
5518         * server.c (handle_query): New function.
5519         (attached): New static variable, moved out of main.
5520         (main): Quiet longjmp clobber warnings.
5521         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
5522         * utils.c (error): Remove NORETURN.
5523         (fatal): Likewise.