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