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