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