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