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