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