Fix instruction skipping when using software single step in GDBServer
[external/binutils.git] / gdb / gdbserver / ChangeLog
1 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2
3         * linux-low.c (linux_wait_1): Fix pc advance condition.
4         * mem-break.c (reinsert_breakpoint_inserted_here): New function.
5         * mem-break.h (reinsert_breakpoint_inserted_here): New declaration.
6
7 2015-11-30  Antoine Tremblay  <antoine.tremblay@ericsson.com>
8
9         * linux-arm-low.c (arm_is_thumb_mode): New function.
10         (arm_breakpoint_at): Use arm_is_thumb_mode.
11         (arm_breakpoint_kind_from_current_state): New function.
12         (struct linux_target_ops) <breakpoint_kind_from_current_state>:
13         Initialize.
14         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_current_state.
15         (linux_breakpoint_kind_from_current_state): New function.
16         (struct target_ops <breakpoint_kind_from_current_state>: Initialize.
17         * linux-low.h (struct linux_target_ops)
18         <breakpoint_kind_from_current_state>: New field.
19         * target.h (struct target_ops): Likewise.
20         (target_breakpoint_kind_from_current_state): New macro.
21
22 2015-11-30  Pedro Alves  <palves@redhat.com>
23
24         * linux-low.c (linux_resume): Wake up the event loop before
25         returning.
26
27 2015-11-30  Pedro Alves  <palves@redhat.com>
28
29         * mem-break.c (check_gdb_bp_preconditions): Remove current_thread
30         check.
31         (set_gdb_breakpoint): If prepare_to_access_memory fails, set *ERR
32         to -1.
33         * target.c (struct thread_search): New structure.
34         (thread_search_callback): New function.
35         (prev_general_thread): New global.
36         (prepare_to_access_memory, done_accessing_memory): New functions.
37         * target.h (prepare_to_access_memory, done_accessing_memory):
38         Replace macros with function declarations.
39
40 2015-11-30  Pedro Alves  <palves@redhat.com>
41
42         PR 14618
43         * linux-low.c (linux_wait_1): If the last resumed thread is gone,
44         report TARGET_WAITKIND_NO_RESUMED.
45         * remote-utils.c (prepare_resume_reply): Handle
46         TARGET_WAITKIND_NO_RESUMED.
47         * server.c (report_no_resumed): New global.
48         (handle_query) <qSupported>: Handle "no-resumed+".  Report
49         "no-resumed+" support.
50         (resume): When the target reports TARGET_WAITKIND_NO_RESUMED, only
51         return error if the client doesn't support no-resumed events.
52         (push_stop_notification): New function.
53         (handle_target_event): Use it.  Report TARGET_WAITKIND_NO_RESUMED
54         events if the client supports them.
55
56 2015-11-30  Pedro Alves  <palves@redhat.com>
57
58         * linux-low.c (thread_still_has_status_pending_p): Don't check
59         vCont;t here.
60         (lwp_resumed): New function.
61         (status_pending_p_callback): Return early if the LWP is not
62         supposed to be resumed.
63
64 2015-11-30  Pedro Alves  <palves@redhat.com>
65
66         * linux-low.c (handle_extended_wait): Assert that the LWP's
67         waitstatus is TARGET_WAITKIND_IGNORE.  If GDB wants to hear about
68         thread create events, leave the new child's status pending.
69         (linux_low_filter_event): If GDB wants to hear about thread exit
70         events, leave the LWP marked dead and don't delete it.
71         (linux_wait_for_event_filtered): Don't check for thread exit.
72         (filter_exit_event): New function.
73         (linux_wait_1): Use it, when returning an exit event.
74         (linux_resume_one_lwp_throw): Assert that the LWP's
75         waitstatus is TARGET_WAITKIND_IGNORE.
76         * remote-utils.c (prepare_resume_reply): Handle
77         TARGET_WAITKIND_THREAD_CREATED and TARGET_WAITKIND_THREAD_EXITED.
78         * server.c (report_thread_events): New global.
79         (handle_general_set): Handle QThreadEvents.
80         (handle_query) <qSupported>: Handle and report QThreadEvents+;
81         (handle_target_event): Handle TARGET_WAITKIND_THREAD_CREATED and
82         TARGET_WAITKIND_THREAD_EXITED.
83         * server.h (report_thread_events): Declare.
84
85 2015-11-30  Pedro Alves  <palves@redhat.com>
86
87         * linux-low.c (resume_stopped_resumed_lwps): Don't check whether
88         the thread's last_resume_kind was resume_stop.
89
90 2015-11-30  Pedro Alves  <palves@redhat.com>
91
92         * linux-low.c (linux_attach): In non-stop mode, wait for one stop
93         before returning.
94
95 2015-11-30  Pedro Alves  <palves@redhat.com>
96
97         * server.c (handle_v_requests): Handle vCtrlC.
98
99 2015-11-30  Pedro Alves  <palves@redhat.com>
100
101         * gdbthread.h (find_any_thread_of_pid): Declare.
102         * inferiors.c (thread_of_pid, find_any_thread_of_pid): New
103         functions.
104         * server.c (handle_query): If current_thread is NULL, look for
105         another thread of the selected process.
106
107 2015-11-26  Daniel Colascione  <dancol@dancol.org>
108             Simon Marchi  <simon.marchi@ericsson.com>
109
110         * linux-low.c (linux_target_ops): Use linux_proc_tid_get_name.
111         * server.c (handle_qxfer_threads_worker): Refactor to include thread
112         name in reply.
113         * target.h (struct target_ops) <thread_name>: New field.
114         (target_thread_name): New macro.
115
116 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
117
118         * regcache.h (regcache_invalidate_pid): Add declaration.
119         * regcache.c (regcache_invalidate_pid): New function, extracted
120         from regcache_invalidate.
121         (regcache_invalidate): Reimplement using regcache_invalidate_pid.
122         Add trivial documentation comment.
123         * lynx-low.c: Use regcache_invalidate_pid instead of
124         regcache_invalidate.
125
126 2015-11-23  Joel Brobecker  <brobecker@adacore.com>
127
128         * configure.ac: Do not call AC_CHECK_TYPES for Elf32_auxv_t
129         and Elf64_auxv_t if the target is Android.
130
131 2015-11-22  Doug Evans  <xdje42@gmail.com>
132
133         * target.h: #include <sys/types.h>.
134
135 2015-11-19  Pedro Alves  <palves@redhat.com>
136
137         * linux-low.c (linux_process_qsupported): Change prototype.
138         Adjust.
139         * linux-low.h (struct linux_target_ops) <process_qsupported>:
140         Change prototype.
141         * linux-x86-low.c (x86_linux_process_qsupported): Change prototype
142         and adjust to loop over all features.
143         * server.c (handle_query) <qSupported>: Adjust to call
144         target_process_qsupported once, passing it a vector of unprocessed
145         features.
146         * target.h (struct target_ops) <process_qsupported>: Change
147         prototype.
148         (target_process_qsupported): Adjust.
149
150 2015-11-19  Pedro Alves  <palves@redhat.com>
151
152         * configure.ac (ERROR_ON_WARNING): Don't check whether in C++
153         mode.
154         * configure: Regenerate.
155
156 2015-11-19  Pedro Alves  <palves@redhat.com>
157
158         * configure: Regenerate.
159
160 2015-11-19  Yao Qi  <yao.qi@linaro.org>
161
162         * linux-aarch64-low.c (emit_data_processing_reg): Change opcode
163         type to uint32_t.
164
165 2015-11-19  Yao Qi  <yao.qi@linaro.org>
166
167         * linux-aarch64-low.c (enum aarch64_operand_type): New.
168         (struct aarch64_operand): Move enum out.
169
170 2015-11-19  Yao Qi  <yao.qi@linaro.org>
171
172         * linux-aarch64-low.c (aarch64_fill_fpregset): Cast buf to
173         struct user_fpsimd_state *.
174         (aarch64_store_fpregset): Likewise.
175
176 2015-11-19  Yao Qi  <yao.qi@linaro.org>
177
178         * linux-aarch64-low.c (aarch64_fill_gregset): Cast buf to
179         struct user_pt_regs *.
180         (aarch64_store_gregset): Likewise.
181
182 2015-11-18  Pedro Alves  <palves@redhat.com>
183
184         * Makefile.in (all_object_files): Add $IPA_OBJS.
185
186 2015-11-17  Pedro Alves  <palves@redhat.com>
187
188         * win32-low.c (win32_resume): Use gdb_signal_from_host,
189         GDB_SIGNAL_0 and gdb_signal_to_string.
190
191 2015-11-17  Pedro Alves  <palves@redhat.com>
192
193         * win32-low.c (handle_output_debug_string): Remove parameter.
194         (win32_kill): Remove our_status local and adjust call to
195         handle_output_debug_string.
196         (get_child_debug_event): Adjust call to
197         handle_output_debug_string.
198
199 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
200
201         * linux-mips-low.c (mips_fill_gregset): Add cast.
202         (mips_store_gregset): Likewise.
203         (mips_fill_fpregset): Likewise.
204         (mips_store_fpregset): Likewise.
205
206 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
207
208         * linux-mips-low.c (mips_add_watchpoint): Rename private to
209         priv.
210
211 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
212
213         * linux-mips-low.c (mips_linux_new_thread): Change type of
214         watch_type to enum target_hw_bp_type.
215
216 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
217
218                 * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type):
219                 Change return type to arm_hwbp_type.
220
221 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
222
223         * linux-aarch32-low.c (arm_fill_gregset): Add cast.
224         (arm_store_gregset): Likewise.
225         * linux-arm-low.c (arm_get_hwcap): Likewise.
226         (arm_read_description): Likewise.
227
228 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
229
230         * linux-aarch32-low.c (aarch32_regsets): Use NULL_REGSET.
231
232 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
233
234         * linux-ppc-low.c (ppc_get_hwcap): Add cast.
235         (ppc_fill_vsxregset): Likewise.
236         (ppc_store_vsxregset): Likewise.
237         (ppc_fill_vrregset): Likewise.
238         (ppc_store_vrregset): Likewise.
239         (ppc_fill_evrregset): Likewise.
240         (ppc_store_evrregset): Likewise.
241
242 2015-11-03  Simon Marchi  <simon.marchi@polymtl.ca>
243
244         * linux-ppc-low.c (ppc_usrregs_info): Remove
245         forward-declaration.
246         (ppc_arch_setup): Move lower in file.
247
248 2015-10-30  Simon Marchi  <simon.marchi@ericsson.com>
249
250         * proc-service.c (ps_pdread): Change CORE_ADDR cast to uintptr_t.
251         (ps_pdwrite): Likewise.
252
253 2015-10-29 Henrik Wallin <henrik.wallin@windriver.com>
254
255         * linux-arm-low.c (arm_new_thread): Move pointer dereference
256         to after assert checks.
257
258 2015-10-29  Simon Marchi  <simon.marchi@ericsson.com>
259
260         * proc-service.c (ps_pdread): Add/adjust casts.
261         (ps_pdwrite): Add/adjust casts.
262
263 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
264
265         * server.c (handle_search_memory_1): Cast return value of
266         memmem.
267
268 2015-10-29  Simon Marchi  <simon.marchi@polymtl.ca>
269
270         * server.c (write_qxfer_response): Change type of data to
271         gdb_byte *.
272
273 2015-10-29  Pedro Alves  <palves@redhat.com>
274
275         * mem-break.c (Z_packet_to_bkpt_type): Add cast.
276
277 2015-10-29  Pedro Alves  <palves@redhat.com>
278
279         * tracepoint.c (clear_installed_tracepoints): Add casts.
280
281 2015-10-29  Pedro Alves  <palves@redhat.com>
282
283         * server.c (handle_v_cont, process_serial_event): Add enum
284         gdb_signal casts to signal parsing code.
285
286 2015-10-29  Pedro Alves  <palves@redhat.com>
287
288         * linux-low.h (NULL_REGSET): Define.
289         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
290         * linux-arm-low.c (arm_regsets): Likewise.
291         * linux-crisv32-low.c (cris_regsets): Likewise.
292         * linux-m68k-low.c (m68k_regsets): Likewise.
293         * linux-mips-low.c (mips_regsets): Likewise.
294         * linux-nios2-low.c (nios2_regsets): Likewise.
295         * linux-ppc-low.c (ppc_regsets): Likewise.
296         * linux-s390-low.c (s390_regsets): Likewise.
297         * linux-sh-low.c (sh_regsets): Likewise.
298         * linux-sparc-low.c (sparc_regsets): Likewise.
299         * linux-tic6x-low.c (tic6x_regsets): Likewise.
300         * linux-tile-low.c (tile_regsets): Likewise.
301         * linux-x86-low.c (x86_regsets): Likewise.
302         * linux-xtensa-low.c (xtensa_regsets): Likewise.
303
304 2015-10-29  Pedro Alves  <palves@redhat.com>
305
306         * linux-low.h (NULL_REGSET): Define.
307         * linux-aarch64-low.c (aarch64_regsets): Use NULL_REGSET.
308         * linux-arm-low.c (arm_regsets): Likewise.
309         * linux-crisv32-low.c (cris_regsets): Likewise.
310         * linux-m68k-low.c (m68k_regsets): Likewise.
311         * linux-mips-low.c (mips_regsets): Likewise.
312         * linux-nios2-low.c (nios2_regsets): Likewise.
313         * linux-ppc-low.c (ppc_regsets): Likewise.
314         * linux-s390-low.c (s390_regsets): Likewise.
315         * linux-sh-low.c (sh_regsets): Likewise.
316         * linux-sparc-low.c (sparc_regsets): Likewise.
317         * linux-tic6x-low.c (tic6x_regsets): Likewise.
318         * linux-tile-low.c (tile_regsets): Likewise.
319         * linux-x86-low.c (x86_regsets): Likewise.
320         * linux-xtensa-low.c (xtensa_regsets): Likewise.
321
322 2015-10-26  Doug Evans  <dje@google.com>
323
324         * linux-low.c (__SIGRTMIN): Move to nat/linux-nat.h.
325
326 2015-10-26  Doug Evans  <dje@google.com>
327
328         * linux-low.c (W_STOPCODE): Moved to common/gdb_wait.h.
329
330 2015-10-26  Doug Evans  <dje@google.com>
331
332         * thread-db.c (find_one_thread): Cast ti.ti_tid to unsigned long
333         for debug_printf.
334         (attach_thread, find_new_threads_callback): Ditto.
335
336 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
337
338         * mem-break.h (set_breakpoint_data): Remove.
339
340 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
341
342         * nto-low.c (nto_sw_breakpoint_from_kind): New function.
343         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
344         (initialize_low): Remove set_breakpoint_data call.
345         * spu-low.c (spu_sw_breakpoint_from_kind): New function.
346         (struct target_ops) <sw_breakpoint_from_kind>: Iniitalize.
347         (initialize_low): Remove set_breakpoint_data call.
348         * win32-low.c (win32_sw_breakpoint_from_kind): New function.
349         (struct target_ops) <sw_breakpoint_from_kind>: Initialize.
350         (initialize_low): Remove set_breakpoint_data call.
351
352 2015-10-23  Antoine Tremblay  <antoine.tremblay@ericsson.com>
353
354         * linux-low.c (default_breakpoint_kind_from_pc): Move to target.c.
355         * mem-break.c (set_breakpoint_at): Use target_breakpoint_kind_from_pc.
356         * target.c (default_breakpoint_kind_from_pc): Moved from linux-low.c
357         * target.h (target_breakpoint_kind_from_pc): New macro.
358
359 2015-10-22  Antoine Tremblay  <antoine.tremblay@ericsson.com>
360
361         * linux-low.c (default_breakpoint_kind_from_pc): New function.
362         (linux_breakpoint_kind_from_pc): Use default_breakpoint_kind_from_pc for
363         the default breakpoint kind.
364
365 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
366
367         * linux-arm-low.c (arm_supports_z_point_type): Add software
368         breakpoint support.
369
370 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
371
372         * linux-arm-low.c: Refactor breakpoint definitions.
373         (arm_breakpoint_at): Adjust for arm_abi_breakpoint.
374         (arm_sw_breakpoint_from_kind): Adjust for arm_breakpoint.
375
376 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
377
378         * Makefile.in: Add arm.c/o.
379         * configure.srv: Likewise.
380         * linux-arm-low.c (arm_breakpoint_kinds): New enum.
381         (arm_breakpoint_kind_from_pc): New function.
382         (arm_sw_breakpoint_from_kind): Return proper kind.
383         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize.
384
385 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
386
387         * linux-low.c (initialize_low): Ajdust for breakpoint global variables
388         removal.
389         * mem-break.c : Remove breakpoint_data/breakpoint_len global variables.
390         (struct raw_breakpoint) <size>: Remove.
391         (struct raw_breakpoint) <kind>: Add.
392         (bp_size): New function.
393         (bp_opcode): Likewise.
394         (find_raw_breakpoint_at): Adjust for kind.
395         (insert_memory_breakpoint): Adjust for kind call bp_size,bp_opcode.
396         (remove_memory_breakpoint): Adjust for kind call bp_size.
397         (set_raw_breakpoint_at): Adjust for kind.
398         (set_breakpoint): Likewise.
399         (set_breakpoint_at): Call breakpoint_kind_from_pc.
400         (delete_raw_breakpoint): Adjust for kind.
401         (delete_breakpoint): Likewise.
402         (find_gdb_breakpoint): Likewise.
403         (set_gdb_breakpoint_1): Likewise.
404         (set_gdb_breakpoint): Likewise.
405         (delete_gdb_breakpoint_1): Likewise.
406         (delete_gdb_breakpoint): Likewise.
407         (uninsert_raw_breakpoint): Likewise.
408         (reinsert_raw_breakpoint): Likewise.
409         (set_breakpoint_data): Remove.
410         (validate_inserted_breakpoint): Adjust for kind call bp_size,bp_opcode.
411         (check_mem_read): Adjust for kind call bp_size.
412         (check_mem_write): Adjust for kind call bp_size,bp_opcode.
413         (clone_one_breakpoint): Adjust for kind.
414         * mem-break.h (set_gdb_breakpoint): Likewise.
415         (delete_gdb_breakpoint): Likewise.
416         * server.c (process_serial_event): Likewise.
417
418 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
419
420         * linux-aarch64-low.c (aarch64_sw_breakpoint_from_kind): New function.
421         (struct linux_target_ops) <breakpoint>: Remove.
422         (struct linux_target_ops) <breakpoint_len>: Remove.
423         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
424         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
425         * linux-arm-low.c (arm_breakpoint_kind_from_pc): New function.
426         (arm_sw_breakpoint_from_kind): New function.
427         * linux-bfin-low.c (bfin_sw_breakpoint_from_kind): New function.
428         (struct linux_target_ops) <breakpoint>: Remove.
429         (struct linux_target_ops) <breakpoint_len>: Remove.
430         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
431         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
432         * linux-cris-low.c (cris_sw_breakpoint_from_kind): New function.
433         (struct linux_target_ops) <breakpoint>: Remove.
434         (struct linux_target_ops) <breakpoint_len>: Remove.
435         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
436         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
437         * linux-crisv32-low.c (cris_sw_breakpoint_from_kind): New function.
438         (struct linux_target_ops) <breakpoint>: Remove.
439         (struct linux_target_ops) <breakpoint_len>: Remove.
440         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
441         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
442         * linux-low.c (linux_wait_1): Call breakpoint_kind_from_pc
443         and sw_breakpoint_from_kind to increment the pc.
444         (linux_breakpoint_kind_from_pc): New function.
445         (linux_sw_breakpoint_from_kind): New function.
446         (struct target_ops) <sw_breakpoint_from_kind>: Initialize field.
447         (initialize_low): Call breakpoint_kind_from_pc and
448         sw_breakpoint_from_kind to replace breakpoint_data/len.
449         * linux-low.h (struct linux_target_ops) <breakpoint_kind_from_pc>:
450         New field.
451         (struct linux_target_ops) <sw_breakpoint_from_kind>: Likewise.
452         * linux-m32r-low.c (m32r_sw_breakpoint_from_kind): New function.
453         (struct linux_target_ops) <breakpoint>: Remove.
454         (struct linux_target_ops) <breakpoint_len>: Remove.
455         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
456         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
457         * linux-m68k-low.c (m68k_sw_breakpoint_from_kind): New function.
458         (struct linux_target_ops) <breakpoint>: Remove.
459         (struct linux_target_ops) <breakpoint_len>: Remove.
460         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
461         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
462         * linux-mips-low.c (mips_sw_breakpoint_from_kind): New function.
463         (struct linux_target_ops) <breakpoint>: Remove.
464         (struct linux_target_ops) <breakpoint_len>: Remove.
465         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
466         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
467         * linux-nios2-low.c (nios2_sw_breakpoint_from_kind): New function.
468         (struct linux_target_ops) <breakpoint>: Remove.
469         (struct linux_target_ops) <breakpoint_len>: Remove.
470         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
471         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
472         * linux-ppc-low.c (ppc_sw_breakpoint_from_kind): New function.
473         (struct linux_target_ops) <breakpoint>: Remove.
474         (struct linux_target_ops) <breakpoint_len>: Remove.
475         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
476         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
477         * linux-s390-low.c (s390_sw_breakpoint_from_kind): New function.
478         (struct linux_target_ops) <breakpoint>: Remove.
479         (struct linux_target_ops) <breakpoint_len>: Remove.
480         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
481         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
482         * linux-sh-low.c (sh_sw_breakpoint_from_kind): New function.
483         (struct linux_target_ops) <breakpoint>: Remove.
484         (struct linux_target_ops) <breakpoint_len>: Remove.
485         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
486         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
487         * linux-sparc-low.c (sparc_sw_breakpoint_from_kind): New function.
488         (struct linux_target_ops) <breakpoint>: Remove.
489         (struct linux_target_ops) <breakpoint_len>: Remove.
490         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
491         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
492         * linux-tic6x-low.c (tic6x_sw_breakpoint_from_kind): New function.
493         (struct linux_target_ops) <breakpoint>: Remove.
494         (struct linux_target_ops) <breakpoint_len>: Remove.
495         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
496         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
497         * linux-tile-low.c (tile_sw_breakpoint_from_kind): New function.
498         * linux-x86-low.c (x86_sw_breakpoint_from_kind): New function.
499         (struct linux_target_ops) <breakpoint>: Remove.
500         (struct linux_target_ops) <breakpoint_len>: Remove.
501         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
502         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
503         * linux-xtensa-low.c (xtensa_sw_breakpoint_from_kind) New function.
504         (struct linux_target_ops) <breakpoint>: Remove.
505         (struct linux_target_ops) <breakpoint_len>: Remove.
506         (struct linux_target_ops) <breakpoint_kind_from_pc>: Initialize field.
507         (struct linux_target_ops) <sw_breakpoint_from_kind>: Initialize field.
508
509 2015-10-21  Antoine Tremblay  <antoine.tremblay@ericsson.com>
510
511         * linux-cris-low.c (cris_get_pc): Remove void arg.
512
513 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
514
515         * gdbserver/nto-low.c (nto_insert_point, nto_remove_point): Fix
516         variable name.
517
518 2015-10-16  Aleksandar Ristovski  <aristovski@qnx.com>
519
520         * inferiors.c (thread_pid_matches_callback): New function.
521         (find_thread_process): New function.
522         (remove_thread): Reset current_thread.
523         (remove_process): Assert threads have been removed first.
524
525 2015-10-15  Yao Qi  <yao.qi@linaro.org>
526
527         * linux-aarch64-low.c (aarch64_insert_point): Set len to 2
528         if it is 3.
529         (aarch64_remove_point): Likewise.
530         * regcache.c (regcache_register_size): New function.
531
532 2015-10-12  Yao Qi  <yao.qi@linaro.org>
533
534         * linux-aarch64-low.c: Update all callers as emit_load_store
535         is renamed to aarch64_emit_load_store.
536
537 2015-10-12  Yao Qi  <yao.qi@linaro.org>
538
539         * linux-aarch64-low.c: Update all callers of function renaming
540         from emit_insn to aarch64_emit_insn.
541
542 2015-10-12  Yao Qi  <yao.qi@linaro.org>
543
544         * linux-aarch64-low.c (enum aarch64_opcodes): Move to
545         arch/aarch64-insn.h.
546         (struct aarch64_memory_operand): Likewise.
547         (ENCODE): Likewise.
548         (emit_insn): Move to arch/aarch64-insn.c.
549         (emit_b, emit_bcond, emit_cb, emit_tb): Remove.
550         (emit_load_store): Move to arch/aarch64-insn.c.
551         (emit_ldr, emit_ldrb, emit_ldrsw, emit_nop): Remove.
552         (can_encode_int32): Remove.
553
554 2015-10-12  Yao Qi  <yao.qi@linaro.org>
555
556         * linux-aarch64-low.c (extract_signed_bitfield): Remove.
557         (aarch64_decode_ldr_literal): Move to gdb/arch/aarch64-insn.c.
558         (aarch64_relocate_instruction): Likewise.
559         (struct aarch64_insn_data): Move to gdb/arch/aarch64-insn.h.
560         (struct aarch64_insn_visitor): Likewise.
561
562 2015-10-12  Yao Qi  <yao.qi@linaro.org>
563
564         * linux-aarch64-low.c (struct aarch64_insn_data): New.
565         (struct aarch64_insn_visitor): New.
566         (struct aarch64_insn_relocation_data): New.
567         (aarch64_ftrace_insn_reloc_b): New function.
568         (aarch64_ftrace_insn_reloc_b_cond): Likewise.
569         (aarch64_ftrace_insn_reloc_cb): Likewise.
570         (aarch64_ftrace_insn_reloc_tb): Likewise.
571         (aarch64_ftrace_insn_reloc_adr): Likewise.
572         (aarch64_ftrace_insn_reloc_ldr_literal): Likewise.
573         (aarch64_ftrace_insn_reloc_others): Likewise.
574         (visitor): New.
575         (aarch64_relocate_instruction): Use visitor.
576
577 2015-10-12  Yao Qi  <yao.qi@linaro.org>
578
579         * linux-aarch64-low.c (aarch64_relocate_instruction): Return
580         int.  Add argument buf.
581         (aarch64_install_fast_tracepoint_jump_pad): Pass buf to
582         aarch64_relocate_instruction.
583
584 2015-10-12  Yao Qi  <yao.qi@linaro.org>
585
586         * linux-aarch64-low.c (aarch64_relocate_instruction): Add
587         argument insn.  Remove local variable insn.  Don't call
588         target_read_uint32.
589         (aarch64_install_fast_tracepoint_jump_pad): Call
590         target_read_uint32.
591
592 2015-09-30  Yao Qi  <yao.qi@linaro.org>
593
594         * linux-aarch64-low.c (emit_movk): Shorten a long line.
595         (emit_load_store_pair): Likewise.
596
597 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
598
599         * dll.c (match_dll): Add cast(s).
600         (unloaded_dll): Likewise.
601         * linux-low.c (second_thread_of_pid_p): Likewise.
602         (delete_lwp_callback): Likewise.
603         (count_events_callback): Likewise.
604         (select_event_lwp_callback): Likewise.
605         (linux_set_resume_request): Likewise.
606         * server.c (accumulate_file_name_length): Likewise.
607         (emit_dll_description): Likewise.
608         (handle_qxfer_threads_worker): Likewise.
609         (visit_actioned_threads): Likewise.
610         * thread-db.c (any_thread_of): Likewise.
611         * tracepoint.c (same_process_p): Likewise.
612         (match_blocktype): Likewise.
613         (build_traceframe_info_xml): Likewise.
614
615 2015-09-25  Simon Marchi  <simon.marchi@ericsson.com>
616
617         * ax.c (gdb_parse_agent_expr): Add cast to allocation result
618         assignment.
619         (gdb_unparse_agent_expr): Likewise.
620         * hostio.c (require_data): Likewise.
621         (handle_pread): Likewise.
622         * linux-low.c (disable_regset): Likewise.
623         (fetch_register): Likewise.
624         (store_register): Likewise.
625         (get_dynamic): Likewise.
626         (linux_qxfer_libraries_svr4): Likewise.
627         * mem-break.c (delete_fast_tracepoint_jump): Likewise.
628         (set_fast_tracepoint_jump): Likewise.
629         (uninsert_fast_tracepoint_jumps_at): Likewise.
630         (reinsert_fast_tracepoint_jumps_at): Likewise.
631         (validate_inserted_breakpoint): Likewise.
632         (clone_agent_expr): Likewise.
633         * regcache.c (init_register_cache): Likewise.
634         * remote-utils.c (putpkt_binary_1): Likewise.
635         (decode_M_packet): Likewise.
636         (decode_X_packet): Likewise.
637         (look_up_one_symbol): Likewise.
638         (relocate_instruction): Likewise.
639         (monitor_output): Likewise.
640         * server.c (handle_search_memory): Likewise.
641         (handle_qxfer_exec_file): Likewise.
642         (handle_qxfer_libraries): Likewise.
643         (handle_qxfer): Likewise.
644         (handle_query): Likewise.
645         (handle_v_cont): Likewise.
646         (handle_v_run): Likewise.
647         (captured_main): Likewise.
648         * target.c (write_inferior_memory): Likewise.
649         * thread-db.c (try_thread_db_load_from_dir): Likewise.
650         * tracepoint.c (init_trace_buffer): Likewise.
651         (add_tracepoint_action): Likewise.
652         (add_traceframe): Likewise.
653         (add_traceframe_block): Likewise.
654         (cmd_qtdpsrc): Likewise.
655         (cmd_qtdv): Likewise.
656         (cmd_qtstatus): Likewise.
657         (response_source): Likewise.
658         (response_tsv): Likewise.
659         (cmd_qtnotes): Likewise.
660         (gdb_collect): Likewise.
661         (initialize_tracepoint): Likewise.
662
663 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
664
665         * linux-aarch64-low-.c: Include ax.h and tracepoint.h.
666         (enum aarch64_opcodes) <RET>, <SUBS>, <AND>, <ORR>, <ORN>,
667         <EOR>, <LSLV>, <LSRV>, <ASRV>, <SBFM>, <UBFM>, <CSINC>, <MUL>,
668         <NOP>: New.
669         (enum aarch64_condition_codes): New enum.
670         (w0): New static global.
671         (fp): Likewise.
672         (lr): Likewise.
673         (struct aarch64_memory_operand) <type>: New
674         MEMORY_OPERAND_POSTINDEX type.
675         (postindex_memory_operand): New helper function.
676         (emit_ret): New function.
677         (emit_load_store_pair): New function, factored out of emit_stp
678         with support for MEMORY_OPERAND_POSTINDEX.
679         (emit_stp): Rewrite using emit_load_store_pair.
680         (emit_ldp): New function.
681         (emit_load_store): Likewise.
682         (emit_ldr): Mention post-index instruction in comment.
683         (emit_ldrh): New function.
684         (emit_ldrb): New function.
685         (emit_ldrsw): Mention post-index instruction in comment.
686         (emit_str): Likewise.
687         (emit_subs): New function.
688         (emit_cmp): Likewise.
689         (emit_and): Likewise.
690         (emit_orr): Likewise.
691         (emit_orn): Likewise.
692         (emit_eor): Likewise.
693         (emit_mvn): Likewise.
694         (emit_lslv): Likewise.
695         (emit_lsrv): Likewise.
696         (emit_asrv): Likewise.
697         (emit_mul): Likewise.
698         (emit_sbfm): Likewise.
699         (emit_sbfx): Likewise.
700         (emit_ubfm): Likewise.
701         (emit_ubfx): Likewise.
702         (emit_csinc): Likewise.
703         (emit_cset): Likewise.
704         (emit_nop): Likewise.
705         (emit_ops_insns): New helper function.
706         (emit_pop): Likewise.
707         (emit_push): Likewise.
708         (aarch64_emit_prologue): New function.
709         (aarch64_emit_epilogue): Likewise.
710         (aarch64_emit_add): Likewise.
711         (aarch64_emit_sub): Likewise.
712         (aarch64_emit_mul): Likewise.
713         (aarch64_emit_lsh): Likewise.
714         (aarch64_emit_rsh_signed): Likewise.
715         (aarch64_emit_rsh_unsigned): Likewise.
716         (aarch64_emit_ext): Likewise.
717         (aarch64_emit_log_not): Likewise.
718         (aarch64_emit_bit_and): Likewise.
719         (aarch64_emit_bit_or): Likewise.
720         (aarch64_emit_bit_xor): Likewise.
721         (aarch64_emit_bit_not): Likewise.
722         (aarch64_emit_equal): Likewise.
723         (aarch64_emit_less_signed): Likewise.
724         (aarch64_emit_less_unsigned): Likewise.
725         (aarch64_emit_ref): Likewise.
726         (aarch64_emit_if_goto): Likewise.
727         (aarch64_emit_goto): Likewise.
728         (aarch64_write_goto_address): Likewise.
729         (aarch64_emit_const): Likewise.
730         (aarch64_emit_call): Likewise.
731         (aarch64_emit_reg): Likewise.
732         (aarch64_emit_pop): Likewise.
733         (aarch64_emit_stack_flush): Likewise.
734         (aarch64_emit_zero_ext): Likewise.
735         (aarch64_emit_swap): Likewise.
736         (aarch64_emit_stack_adjust): Likewise.
737         (aarch64_emit_int_call_1): Likewise.
738         (aarch64_emit_void_call_2): Likewise.
739         (aarch64_emit_eq_goto): Likewise.
740         (aarch64_emit_ne_goto): Likewise.
741         (aarch64_emit_lt_goto): Likewise.
742         (aarch64_emit_le_goto): Likewise.
743         (aarch64_emit_gt_goto): Likewise.
744         (aarch64_emit_ge_got): Likewise.
745         (aarch64_emit_ops_impl): New static global variable.
746         (aarch64_emit_ops): New target function, return
747         &aarch64_emit_ops_impl.
748         (struct linux_target_ops): Install it.
749
750 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
751
752         * Makefile.in (linux-aarch64-ipa.o, aarch64-ipa.o): New rules.
753         * configure.srv (aarch64*-*-linux*): Add linux-aarch64-ipa.o and
754         aarch64-ipa.o.
755         * linux-aarch64-ipa.c: New file.
756         * linux-aarch64-low.c: Include arch/aarch64-insn.h, inttypes.h
757         and endian.h.
758         (aarch64_get_thread_area): New target method.
759         (extract_signed_bitfield): New helper function.
760         (aarch64_decode_ldr_literal): New function.
761         (enum aarch64_opcodes): New enum.
762         (struct aarch64_register): New struct.
763         (struct aarch64_operand): New struct.
764         (x0): New static global.
765         (x1): Likewise.
766         (x2): Likewise.
767         (x3): Likewise.
768         (x4): Likewise.
769         (w2): Likewise.
770         (ip0): Likewise.
771         (sp): Likewise.
772         (xzr): Likewise.
773         (aarch64_register): New helper function.
774         (register_operand): Likewise.
775         (immediate_operand): Likewise.
776         (struct aarch64_memory_operand): New struct.
777         (offset_memory_operand): New helper function.
778         (preindex_memory_operand): Likewise.
779         (enum aarch64_system_control_registers): New enum.
780         (ENCODE): New macro.
781         (emit_insn): New helper function.
782         (emit_b): New function.
783         (emit_bcond): Likewise.
784         (emit_cb): Likewise.
785         (emit_tb): Likewise.
786         (emit_blr): Likewise.
787         (emit_stp): Likewise.
788         (emit_ldp_q_offset): Likewise.
789         (emit_stp_q_offset): Likewise.
790         (emit_load_store): Likewise.
791         (emit_ldr): Likewise.
792         (emit_ldrsw): Likewise.
793         (emit_str): Likewise.
794         (emit_ldaxr): Likewise.
795         (emit_stxr): Likewise.
796         (emit_stlr): Likewise.
797         (emit_data_processing_reg): Likewise.
798         (emit_data_processing): Likewise.
799         (emit_add): Likewise.
800         (emit_sub): Likewise.
801         (emit_mov): Likewise.
802         (emit_movk): Likewise.
803         (emit_mov_addr): Likewise.
804         (emit_mrs): Likewise.
805         (emit_msr): Likewise.
806         (emit_sevl): Likewise.
807         (emit_wfe): Likewise.
808         (append_insns): Likewise.
809         (can_encode_int32_in): New helper function.
810         (aarch64_relocate_instruction): New function.
811         (aarch64_install_fast_tracepoint_jump_pad): Likewise.
812         (aarch64_get_min_fast_tracepoint_insn_len): Likewise.
813         (struct linux_target_ops): Install aarch64_get_thread_area,
814         aarch64_install_fast_tracepoint_jump_pad and
815         aarch64_get_min_fast_tracepoint_insn_len.
816
817 2015-09-21  Pierre Langlois  <pierre.langlois@arm.com>
818
819         * Makefile.in (aarch64-insn.o): New rule.
820         * configure.srv (aarch64*-*-linux*): Add aarch64-insn.o.
821
822 2015-09-21  Yao Qi  <yao.qi@linaro.org>
823
824         * ax.c [!IN_PROCESS_AGENT] (gdb_agent_op_sizes): Define it.
825
826 2015-09-21  Yao Qi  <yao.qi@linaro.org>
827
828         * tracepoint.c (max_jump_pad_size): Remove.
829
830 2015-09-18  Yao Qi  <yao.qi@linaro.org>
831
832         * linux-aarch64-low.c: Don't include sys/uio.h.
833         (ps_get_thread_area): Call aarch64_ps_get_thread_area.
834
835 2015-09-16  Wei-cheng Wang  <cole945@gmail.com>
836
837         * tracepoint.c (eval_result_type): Change prototype.
838         (condition_true_at_tracepoint): Fix argument to compiled_cond.
839
840 2015-09-15  Pedro Alves  <palves@redhat.com>
841
842         * remote-utils.c (prepare_resume_reply) <TARGET_WAITKIND_EXECD>:
843         Check whether to report exec events instead of checking whether
844         multiprocess is enabled.
845
846 2015-09-15  Pedro Alves  <palves@redhat.com>
847
848         PR remote/18965
849         * remote-utils.c (prepare_resume_reply): Merge
850         TARGET_WAITKIND_VFORK_DONE switch case with the
851         TARGET_WAITKIND_FORKED case.
852
853 2015-09-15  Yao Qi  <yao.qi@linaro.org>
854
855         * server.c (handle_query): Check string comparison using
856         "else if" instead of "if".
857
858 2015-09-15  Yao Qi  <yao.qi@linaro.org>
859
860         * server.c (vCont_supported): New global variable.
861         (handle_query): Set vCont_supported to 1 if "vContSupported+"
862         matches.  Append ";vContSupported+" to own_buf.
863         (handle_v_requests): Append ";s;S" to own_buf if target supports
864         hardware single step or vCont_supported is false.
865         (capture_main): Set vCont_supported to zero.
866
867 2015-09-15  Yao Qi  <yao.qi@linaro.org>
868
869         * linux-low.c (linux_supports_conditional_breakpoints): Rename
870         it to ...
871         (linux_supports_hardware_single_step): ... New function.
872         (linux_target_ops): Update.
873         * lynx-low.c (lynx_target_ops): Set field
874         supports_hardware_single_step to target_can_do_hardware_single_step.
875         * nto-low.c (nto_target_ops): Likewise.
876         * spu-low.c (spu_target_ops): Likewise.
877         * win32-low.c (win32_target_ops): Likewise.
878         * target.c (target_can_do_hardware_single_step): New function.
879         * target.h (struct target_ops) <supports_conditional_breakpoints>:
880         Remove.  <supports_hardware_single_step>: New field.
881         (target_supports_conditional_breakpoints): Remove.
882         (target_supports_hardware_single_step): New macro.
883         (target_can_do_hardware_single_step): Declare.
884         * server.c (handle_query): Use target_supports_hardware_single_step
885         instead of target_supports_conditional_breakpoints.
886
887 2015-09-15  Yao Qi  <yao.qi@linaro.org>
888
889         * linux-aarch64-low.c (aarch64_linux_siginfo_fixup): New
890         function.
891         (struct linux_target_ops the_low_target): Install
892         aarch64_linux_siginfo_fixup.
893
894 2015-09-11  Don Breazeal  <donb@codesourcery.com>
895             Luis Machado  <lgustavo@codesourcery.com>
896
897         * linux-low.c (linux_mourn): Static declaration.
898         (linux_arch_setup): Move in front of
899         handle_extended_wait.
900         (linux_arch_setup_thread): New function.
901         (handle_extended_wait): Handle exec events.  Call
902         linux_arch_setup_thread.  Make event_lwp argument a
903         pointer-to-a-pointer.
904         (check_zombie_leaders): Do not check stopped threads.
905         (linux_low_ptrace_options): Add PTRACE_O_TRACEEXEC.
906         (linux_low_filter_event): Add lwp and thread for exec'ing
907         non-leader thread if leader thread has been deleted.
908         Refactor code into linux_arch_setup_thread and call it.
909         Pass child lwp pointer by reference to handle_extended_wait.
910         (linux_wait_for_event_filtered): Update comment.
911         (linux_wait_1): Prevent clobbering exec event status.
912         (linux_supports_exec_events): New function.
913         (linux_target_ops) <supports_exec_events>: Initialize new member.
914         * lynx-low.c (lynx_target_ops) <supports_exec_events>: Initialize
915         new member.
916         * remote-utils.c (prepare_resume_reply): New stop reason 'exec'.
917         * server.c (report_exec_events): New global variable.
918         (handle_query): Handle qSupported query for exec-events feature.
919         (captured_main): Initialize report_exec_events.
920         * server.h (report_exec_events): Declare new global variable.
921         * target.h (struct target_ops) <supports_exec_events>: New
922         member.
923         (target_supports_exec_events): New macro.
924         * win32-low.c (win32_target_ops) <supports_exec_events>:
925         Initialize new member.
926
927 2015-09-09  Markus Metzger  <markus.t.metzger@intel.com>
928
929         * linux-low.c (linux_low_enable_btrace): Remove.
930         (linux_target_ops): Replace linux_low_enable_btrace with
931         linux_enable_btrace.
932
933 2015-09-03  Yao Qi  <yao.qi@linaro.org>
934
935         * linux-aarch64-low.c (aarch64_insert_point): Call
936         aarch64_handle_watchpoint if aarch64_linux_region_ok_for_watchpoint
937         returns true.
938
939 2015-08-27  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
940
941         * linux-low.c (check_stopped_by_breakpoint): Use
942         GDB_ARCH_IS_TRAP_BRKPT instead of GDB_ARCH_TRAP_BRKPT.
943
944 2015-08-27  Pedro Alves  <palves@redhat.com>
945
946         * proc-service.c (ps_pdwrite): Return PS_ERR/PS_OK explicily.
947
948 2015-08-26  Simon Marchi  <simon.marchi@ericsson.com>
949
950         * ax.c (gdb_parse_agent_expr): Replace xmalloc-family function with
951         the XNEW-family equivalent.
952         (compile_bytecodes): Likewise.
953         * dll.c (loaded_dll): Likewise.
954         * event-loop.c (append_callback_event): Likewise.
955         (create_file_handler): Likewise.
956         (create_file_event): Likewise.
957         * hostio.c (handle_open): Likewise.
958         * inferiors.c (add_thread): Likewise.
959         (add_process): Likewise.
960         * linux-aarch64-low.c (aarch64_linux_new_process): Likewise.
961         * linux-arm-low.c (arm_new_process): Likewise.
962         (arm_new_thread): Likewise.
963         * linux-low.c (add_to_pid_list): Likewise.
964         (linux_add_process): Likewise.
965         (handle_extended_wait): Likewise.
966         (add_lwp): Likewise.
967         (enqueue_one_deferred_signal): Likewise.
968         (enqueue_pending_signal): Likewise.
969         (linux_resume_one_lwp_throw): Likewise.
970         (linux_resume_one_thread): Likewise.
971         (linux_read_memory): Likewise.
972         (linux_write_memory): Likewise.
973         * linux-mips-low.c (mips_linux_new_process): Likewise.
974         (mips_linux_new_thread): Likewise.
975         (mips_add_watchpoint): Likewise.
976         * linux-x86-low.c (initialize_low_arch): Likewise.
977         * lynx-low.c (lynx_add_process): Likewise.
978         * mem-break.c (set_raw_breakpoint_at): Likewise.
979         (set_breakpoint): Likewise.
980         (add_condition_to_breakpoint): Likewise.
981         (add_commands_to_breakpoint): Likewise.
982         (clone_agent_expr): Likewise.
983         (clone_one_breakpoint): Likewise.
984         * regcache.c (new_register_cache): Likewise.
985         * remote-utils.c (look_up_one_symbol): Likewise.
986         * server.c (queue_stop_reply): Likewise.
987         (start_inferior): Likewise.
988         (queue_stop_reply_callback): Likewise.
989         (handle_target_event): Likewise.
990         * spu-low.c (fetch_ppc_memory): Likewise.
991         (store_ppc_memory): Likewise.
992         * target.c (set_target_ops): Likewise.
993         * thread-db.c (thread_db_load_search): Likewise.
994         (try_thread_db_load_1): Likewise.
995         * tracepoint.c (add_tracepoint): Likewise.
996         (add_tracepoint_action): Likewise.
997         (create_trace_state_variable): Likewise.
998         (cmd_qtdpsrc): Likewise.
999         (cmd_qtro): Likewise.
1000         (add_while_stepping_state): Likewise.
1001         * win32-low.c (child_add_thread): Likewise.
1002         (get_image_name): Likewise.
1003
1004 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1005
1006         * linux-aarch64-low.c (aarch64_linux_new_thread): Remove.
1007
1008 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1009
1010         * Makefile.in (aarch64-linux.o): New rule.
1011         * configure.srv (aarch64*-*-linux*): Append aarch64-linux.o to
1012         srv_tgtobj.
1013         * linux-aarch64-low.c: Include nat/aarch64-linux.h.
1014         (aarch64_init_debug_reg_state): Make it extern.
1015         (aarch64_linux_prepare_to_resume): Remove.
1016
1017 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1018
1019         * linux-aarch64-low.c (aarch64_linux_prepare_to_resume): Use
1020         lwp_arch_private_info and ptid_of_lwp.
1021
1022 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1023
1024         * linux-aarch64-low.c (aarch64_get_debug_reg_state): Add argument pid.
1025         Find proc_info by find_process_pid.  All callers updated.
1026
1027 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1028
1029         * linux-aarch64-low.c (struct arch64_dr_update_callback_param):
1030         Remove.
1031         (debug_reg_change_callback): Remove.
1032         (aarch64_notify_debug_reg_change): Remove.
1033
1034 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1035
1036         * linux-aarch64-low.c (aarch64_notify_debug_reg_change):
1037         Call current_lwp_ptid.
1038
1039 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1040
1041         * linux-aarch64-low.c (debug_reg_change_callback): Use
1042         debug_printf.
1043
1044 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1045
1046         * linux-aarch64-low.c (debug_reg_change_callback): Use phex.
1047
1048 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1049
1050         * linux-aarch64-low.c (debug_reg_change_callback): Remove comments.
1051
1052 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1053
1054         * linux-aarch64-low.c (debug_reg_change_callback): Re-indent
1055         the code.
1056
1057 2015-08-25  Yao Qi  <yao.qi@linaro.org>
1058
1059         * linux-aarch64-low.c (aarch64_dr_update_callback_param) <pid>:
1060         Remove.
1061         (debug_reg_change_callback): Remove argument entry and add argument
1062         lwp.  Remove local variable thread.  Don't print thread id in the
1063         debugging output.  Don't check whether pid of thread equals to pid.
1064         (aarch64_notify_debug_reg_change): Don't set param.pid.  Call
1065         iterate_over_lwps instead find_inferior.
1066
1067 2015-08-24  Pedro Alves  <palves@redhat.com>
1068
1069         * inferiors.c (get_first_process): New function.
1070         * inferiors.h (get_first_process): New declaration.
1071         * remote-utils.c (read_ptid): Default to the first process in the
1072         list, instead of to the current thread's process.
1073
1074 2015-08-24  Pedro Alves  <palves@redhat.com>
1075
1076         * debug.c: Include gdb_sys_time.h instead of sys/time.h.
1077         * event-loop.c: Likewise.
1078         * remote-utils.c: Likewise.
1079         * tracepoint.c: Likewise.
1080
1081 2015-08-24  Pedro Alves  <palves@redhat.com>
1082
1083         * spu-low.c (spu_request_interrupt): Use lwpid_of instead of
1084         ptid_get_lwp.
1085
1086 2015-08-21  Pedro Alves  <palves@redhat.com>
1087
1088         * ax.c (gdb_eval_agent_expr): Return expr_eval_unhandled_opcode
1089         instead of literal 1.
1090
1091 2015-08-21  Pedro Alves  <palves@redhat.com>
1092
1093         * tdesc.c (default_description): Explicitly zero-initialize.
1094
1095 2015-08-21  Pedro Alves  <palves@redhat.com>
1096
1097         PR gdb/18749
1098         * inferiors.c (remove_thread): Discard any pending stop reply for
1099         this thread.
1100         * server.c (remove_all_on_match_pid): Rename to ...
1101         (remove_all_on_match_ptid): ... this.  Work with a filter ptid
1102         instead of a pid.
1103         (discard_queued_stop_replies): Change parameter to a ptid.  Now
1104         extern.
1105         (handle_v_kill, kill_inferior_callback, captured_main)
1106         (process_serial_event): Adjust.
1107         * server.h (discard_queued_stop_replies): Declare.
1108
1109 2015-08-21  Pedro Alves  <palves@redhat.com>
1110
1111         * linux-low.c (wait_for_sigstop): Always switch to no thread
1112         selected if the previously current thread dies.
1113         * lynx-low.c (lynx_request_interrupt): Use the first thread's
1114         process instead of the current thread's.
1115         * remote-utils.c (input_interrupt): Don't check if there's no
1116         current thread.
1117         * server.c (gdb_read_memory, gdb_write_memory): If setting the
1118         current thread to the general thread fails, error out.
1119         (handle_qxfer_auxv, handle_qxfer_libraries)
1120         (handle_qxfer_libraries_svr4, handle_qxfer_siginfo)
1121         (handle_qxfer_spu, handle_qxfer_statictrace, handle_qxfer_fdpic)
1122         (handle_query): Check if there's a thread selected instead of
1123         checking whether there's any thread in the thread list.
1124         (handle_qxfer_threads, handle_qxfer_btrace)
1125         (handle_qxfer_btrace_conf): Don't error out early if there's no
1126         thread in the thread list.
1127         (handle_v_cont, myresume): Don't set the current thread to the
1128         continue thread.
1129         (process_serial_event) <Hg handling>: Also set thread_id if the
1130         previous general thread is still alive.
1131         (process_serial_event) <g/G handling>: If setting the current
1132         thread to the general thread fails, error out.
1133         * spu-low.c (spu_resume, spu_request_interrupt): Use the first
1134         thread's lwp instead of the current thread's.
1135         * target.c (set_desired_thread): If the desired thread was not
1136         found, leave the current thread pointing to NULL.  Return an int
1137         (boolean) indicating success.
1138         * target.h (set_desired_thread): Change return type to int.
1139
1140 2015-08-20  Max Filippov  <jcmvbkbc@gmail.com>
1141
1142         * configure.srv (xtensa*-*-linux*): Add srv_linux_thread_db=yes.
1143         * linux-xtensa-low.c (arch/xtensa.h gdb_proc_service.h): New
1144         #includes.
1145         (ps_get_thread_area): New function.
1146
1147 2015-08-19  Gary Benson  <gbenson@redhat.com>
1148
1149         * hostio.c (handle_pread): Do not attempt to read more data
1150         than hostio_reply_with_data can fit in a packet.
1151
1152 2015-08-18  Joel Brobecker  <brobecker@adacore.com>
1153
1154         * linux-aarch32-low.c (NT_ARM_VFP): Define if not already defined.
1155
1156 2015-08-14  Matthew Fortune  <matthew.fortune@imgtec.com>
1157
1158         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP_REL.
1159
1160 2015-08-06  Pedro Alves  <palves@redhat.com>
1161
1162         * tracepoint.c (expr_eval_result): Now an int.
1163
1164 2015-08-06  Pedro Alves  <palves@redhat.com>
1165
1166         * gdbthread.h (struct regcache): Forward declare.
1167         (struct thread_info) <regcache_data>: Now a struct regcache
1168         pointer.
1169         * inferiors.c (inferior_regcache_data)
1170         (set_inferior_regcache_data): Now work with struct regcache
1171         pointers.
1172         * inferiors.h (struct regcache): Forward declare.
1173         (inferior_regcache_data, set_inferior_regcache_data): Now work
1174         with struct regcache pointers.
1175         * regcache.c (get_thread_regcache, regcache_invalidate_thread)
1176         (free_register_cache_thread): Remove struct regcache pointer
1177         casts.
1178
1179 2015-08-06  Pedro Alves  <palves@redhat.com>
1180
1181         * server.c (captured_main): On error, print the exception message
1182         to stderr, and if run_once is set, throw a quit.
1183
1184 2015-08-06  Pedro Alves  <palves@redhat.com>
1185
1186         * linux-low.c (move_out_of_jump_pad_callback): Temporarily switch
1187         the current thread.
1188
1189 2015-08-06  Pedro Alves  <palves@redhat.com>
1190
1191         * linux-low.c (linux_write_memory): Rewrite debug output to avoid
1192         reading beyond the passed in buffer length.
1193
1194 2015-08-06  Pierre Langlois  <pierre.langlois@arm.com>
1195
1196         * tracepoint.c (symbol_list) <required>: Remove.
1197
1198 2015-08-06  Pedro Alves  <palves@redhat.com>
1199
1200         * linux-low.c (handle_extended_wait): Set the fork child's suspend
1201         count if stopping and suspending threads.
1202         (check_stopped_by_breakpoint): If stopped by trace, set the LWP's
1203         stop reason to TARGET_STOPPED_BY_SINGLE_STEP.
1204         (linux_detach): Complete an ongoing step-over.
1205         (lwp_suspended_inc, lwp_suspended_decr): New functions.  Use
1206         throughout.
1207         (resume_stopped_resumed_lwps): Don't resume a suspended thread.
1208         (linux_wait_1): If passing a signal to the inferior after
1209         finishing a step-over, unsuspend and re-resume all lwps.  If we
1210         see a single-step event but the thread should be continuing, don't
1211         pass the trap to gdb.
1212         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback): Use
1213         internal_error instead of gdb_assert.
1214         (enqueue_pending_signal): New function.
1215         (check_ptrace_stopped_lwp_gone): Add debug output.
1216         (start_step_over): Use internal_error instead of gdb_assert.
1217         (complete_ongoing_step_over): New function.
1218         (linux_resume_one_thread): Don't resume a suspended thread.
1219         (proceed_one_lwp): If the LWP is stepping over a breakpoint, reset
1220         it stepping.
1221
1222 2015-08-06  Pedro Alves  <palves@redhat.com>
1223
1224         * linux-low.c (add_lwp): Set waitstatus to TARGET_WAITKIND_IGNORE.
1225         (linux_thread_alive): Use lwp_is_marked_dead.
1226         (extended_event_reported): Delete.
1227         (linux_wait_1): Check if waitstatus is TARGET_WAITKIND_IGNORE
1228         instead of extended_event_reported.
1229         (mark_lwp_dead): Don't set the 'dead' flag.  Store the waitstatus
1230         as well.
1231         (lwp_is_marked_dead): New function.
1232         (lwp_running): Use lwp_is_marked_dead.
1233         * linux-low.h: Delete 'dead' field, and update 'waitstatus's
1234         comment.
1235
1236 2015-08-06  Pedro Alves  <palves@redhat.com>
1237
1238         * linux-low.c (linux_wait_1): Move fork event output out of the
1239         !report_to_gdb check.  Pass event_child->waitstatus to
1240         target_waitstatus_to_string instead of ourstatus.
1241
1242 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1243
1244         * linux-aarch64-low.c (aarch64_supports_tracepoints): Return 0
1245         if current_thread is 32 bit.
1246
1247 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1248
1249         * linux-aarch64-low.c (aarch64_supports_z_point_type): Return
1250         0 for Z_PACKET_SW_BP if it may be used in multi-arch debugging.
1251         * server.c (extended_protocol): Remove "static".
1252         * server.h (extended_protocol): Declare it.
1253
1254 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1255
1256         * linux-aarch64-low.c (aarch64_get_pc): Get PC register on
1257         both aarch64 and aarch32.
1258         (aarch64_set_pc): Likewise.
1259
1260 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1261
1262         * configure.srv (case aarch64*-*-linux*): Append arm-with-neon.o
1263         to srv_regobj and append arm-core.xml arm-vfpv3.xml and
1264         arm-with-neon.xml to srv_xmlfiles.
1265         * linux-aarch64-low.c: Include linux-aarch32-low.h.
1266         (is_64bit_tdesc): New function.
1267         (aarch64_linux_read_description): New function.
1268         (aarch64_arch_setup): Call aarch64_linux_read_description.
1269         (regs_info): Rename to regs_info_aarch64.
1270         (aarch64_regs_info): Return right regs_info.
1271         (initialize_low_arch): Call initialize_low_arch_aarch32.
1272
1273 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1274
1275         * configure.srv (srv_tgtobj): Add linux-aarch32-low.o.
1276         * linux-aarch32-low.c: New file.
1277         * linux-aarch32-low.h: New file.
1278         * linux-arm-low.c (arm_fill_gregset): Move it to
1279         linux-aarch32-low.c.
1280         (arm_store_gregset): Likewise.
1281         (arm_fill_vfpregset): Call arm_fill_vfpregset_num
1282         (arm_store_vfpregset): Call arm_store_vfpregset_num.
1283         (arm_arch_setup): Check if PTRACE_GETREGSET works.
1284         (regs_info): Rename to regs_info_arm.
1285         (arm_regs_info): Return regs_info_aarch32 if
1286         have_ptrace_getregset is 1 and target description is
1287         arm_with_neon or arm_with_vfpv3.
1288         (initialize_low_arch): Don't call init_registers_arm_with_neon.
1289         Call initialize_low_arch_aarch32 instead.
1290
1291 2015-08-04  Yao Qi  <yao.qi@linaro.org>
1292
1293         * linux-x86-low.c (have_ptrace_getregset): Move it to ...
1294         * linux-low.c: ... here.
1295         * linux-low.h (have_ptrace_getregset): Declare it.
1296
1297 2015-08-04  Pedro Alves  <palves@redhat.com>
1298
1299         * thread-db.c (struct thread_db): Use new typedefs.
1300         (try_thread_db_load_1): Define local TDB_DLSYM macro and use it in
1301         CHK calls.
1302         (disable_thread_event_reporting): Cast result of dlsym to
1303         destination function pointer type.
1304         (thread_db_mourn): Use td_ta_delete_ftype.
1305
1306 2015-08-03  Sandra Loosemore  <sandra@codesourcery.com>
1307
1308         * linux-nios2-low.c (NIOS2_BREAKPOINT): Conditionalize for
1309         arch variant.
1310         (CDX_BREAKPOINT): Define for R2.
1311         (nios2_breakpoint_at): Check for CDX_BREAKPOINT when R2.
1312         (the_low_target): Add comments.
1313
1314 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1315
1316         * linux-arm-low.c (arm_hwcap): Remove it.
1317         (arm_read_description): New local variable arm_hwcap.  Don't
1318         set arm_hwcap to zero.
1319
1320 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1321
1322         * linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
1323         Use regcache->tdesc instead.
1324         (arm_store_wmmxregset): Likewise.
1325         (arm_fill_vfpregset): Likewise.
1326         (arm_store_vfpregset): Likewise.
1327
1328 2015-07-30  Yao Qi  <yao.qi@linaro.org>
1329
1330         * linux-arm-low.c: Include arch/arm.h.
1331         (arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
1332         (arm_store_gregset): Likewise.
1333
1334 2015-07-29  Simon Marchi  <simon.marchi@ericsson.com>
1335
1336         * linux-mips-low.c (mips_linux_prepare_to_resume): Add NULL as
1337         ptrace's 4th parameter.
1338
1339 2015-07-27  Yao Qi  <yao.qi@linaro.org>
1340
1341         * configure.srv (case aarch64*-*-linux*): Don't set
1342         srv_linux_usrregs.
1343
1344 2015-07-24  Pedro Alves  <palves@redhat.c: Likewise.om>
1345
1346         * linux-aarch64-low.c: Include nat/gdb_ptrace.h instead of
1347         sys/ptrace.h.
1348         * linux-arm-low.c: Likewise.
1349         * linux-cris-low.c: Likewise.
1350         * linux-crisv32-low.c: Likewise.
1351         * linux-low.c: Likewise.
1352         * linux-m68k-low.c: Likewise.
1353         * linux-mips-low.c: Likewise.
1354         * linux-nios2-low.c: Likewise.
1355         * linux-s390-low.c: Likewise.
1356         * linux-sparc-low.c: Likewise.
1357         * linux-tic6x-low.c: Likewise.
1358         * linux-tile-low.c: Likewise.
1359         * linux-x86-low.c: Likewise.
1360
1361 2015-07-24  Pedro Alves  <palves@redhat.com>
1362
1363         * config.in: Regenerate.
1364         * configure: Regenerate.
1365
1366 2015-07-24  Pedro Alves  <palves@redhat.com>
1367
1368         * acinclude.m4: Include ../ptrace.m4.
1369         * configure.ac: Call GDB_AC_PTRACE.
1370         * config.in, configure: Regenerate.
1371
1372 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1373
1374         * linux-low.c (linux_create_inferior): Remove setting to
1375         proc->priv->new_inferior.
1376         (linux_attach): Likewise.
1377         (linux_low_filter_event): Likewise.
1378         * linux-low.h (struct process_info_private) <new_inferior>: Remove.
1379
1380 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1381
1382         * linux-low.c (linux_arch_setup): New function.
1383         (linux_low_filter_event): If proc->tdesc is NULL and
1384         proc->attached is true, call the_low_target.arch_setup.
1385         Otherwise, keep status pending, and return.
1386         (linux_resume_one_lwp_throw): Don't call get_pc if
1387         thread->while_stepping isn't NULL.  Don't call
1388         get_thread_regcache if proc->tdesc is NULL.
1389         (need_step_over_p): Return 0 if proc->tdesc is NULL.
1390         (linux_target_ops): Install arch_setup.
1391         * server.c (start_inferior): Call the_target->arch_setup.
1392         * target.h (struct target_ops) <arch_setup>: New field.
1393         (target_arch_setup): New marco.
1394         * lynx-low.c (lynx_target_ops): Update.
1395         * nto-low.c (nto_target_ops): Update.
1396         * spu-low.c (spu_target_ops): Update.
1397         * win32-low.c (win32_target_ops): Update.
1398
1399 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1400
1401         * linux-low.c (linux_add_process): Don't set
1402         proc->priv->new_inferior.
1403         (linux_create_inferior): Set proc->priv->new_inferior to 1.
1404         (linux_attach): Likewise.
1405
1406 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1407
1408         * server.c (start_inferior): Code refactor.
1409
1410 2015-07-24  Yao Qi  <yao.qi@linaro.org>
1411
1412         * server.c (process_serial_event): Set general_thread.
1413
1414 2015-07-21  Yao Qi  <yao.qi@linaro.org>
1415
1416         * linux-aarch64-low.c (aarch64_arch_setup): Remove code and call
1417         aarch64_linux_get_debug_reg_capacity.
1418
1419 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1420
1421         * Makefile.in (aarch64-linux-hw-point.o): New rule.
1422         * configure.srv (srv_tgtobj): Append aarch64-linux-hw-point.o.
1423         * linux-aarch64-low.c: Include nat/aarch64-linux-hw-point.h.
1424         (AARCH64_HBP_MAX_NUM): Move to nat/aarch64-linux-hw-point.h.
1425         (AARCH64_HWP_MAX_NUM, AARCH64_HBP_ALIGNMENT): Likewise.
1426         (AARCH64_HWP_ALIGNMENT): Likewise.
1427         (AARCH64_HWP_MAX_LEN_PER_REG): Likewise.
1428         (AARCH64_DEBUG_NUM_SLOTS, AARCH64_DEBUG_ARCH): Likewise.
1429         (aarch64_num_bp_regs, aarch64_num_wp_regs): Likewise.
1430         (AARCH64_DEBUG_ARCH_V8, DR_MARK_ALL_CHANGED): Likewise.
1431         (DR_MARK_N_CHANGED, DR_CLEAR_CHANGED): Likewise.
1432         (DR_HAS_CHANGED, DR_N_HAS_CHANGE): Likewise.
1433         (struct aarch64_debug_reg_state): Likewise.
1434         (struct arch_lwp_info): Likewise.
1435         (aarch64_align_watchpoint): Likewise.
1436         (DR_CONTROL_ENABLED, DR_CONTROL_LENGTH): Likewise.
1437         (aarch64_watchpoint_length): Likewise.
1438         (aarch64_point_encode_ctrl_reg): Likewise
1439         (aarch64_point_is_aligned): Likewise.
1440         (aarch64_align_watchpoint): Likewise.
1441         (aarch64_linux_set_debug_regs):
1442         (aarch64_dr_state_insert_one_point): Likewise.
1443         (aarch64_dr_state_remove_one_point): Likewise.
1444         (aarch64_handle_breakpoint): Likewise.
1445         (aarch64_handle_aligned_watchpoint): Likewise.
1446         (aarch64_handle_unaligned_watchpoint): Likewise.
1447         (aarch64_handle_watchpoint): Likewise.
1448
1449 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1450
1451         * linux-aarch64-low.c (aarch64_handle_breakpoint): Add argument state
1452         and don't aarch64_get_debug_reg_state.  All callers update.
1453         (aarch64_handle_aligned_watchpoint): Likewise.
1454         (aarch64_handle_unaligned_watchpoint): Likewise.
1455         (aarch64_handle_watchpoint): Likewise.
1456         (aarch64_insert_point): Call aarch64_get_debug_reg_state earlier.
1457         (aarch64_remove_point): Likewise.
1458
1459 2015-07-17  Yao Qi  <yao.qi@linaro.org>
1460
1461         * linux-aarch64-low.c (aarch64_show_debug_reg_state): Use
1462         debug_printf.
1463         (aarch64_handle_unaligned_watchpoint): Likewise.
1464
1465 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1466
1467         Revert the previous 3 commits:
1468         Move gdb_regex* to common/
1469         Move linux_find_memory_regions_full & co.
1470         gdbserver build-id attribute generator
1471
1472 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1473             Jan Kratochvil  <jan.kratochvil@redhat.com>
1474
1475         gdbserver build-id attribute generator.
1476         * linux-low.c (nat/linux-maps.h, search.h, rsp-low.h): Include.
1477         (ElfXX_Ehdr, ElfXX_Phdr, ElfXX_Nhdr): New.
1478         (ELFXX_FLD, ELFXX_SIZEOF, ELFXX_ROUNDUP, BUILD_ID_INVALID): New.
1479         (find_phdr): New.
1480         (get_dynamic): Use find_pdhr to traverse program headers.
1481         (struct mapping_entry, mapping_entry_s, free_mapping_entry_vec)
1482         (compare_mapping_entry_range, struct find_memory_region_callback_data)
1483         (read_build_id, find_memory_region_callback, lrfind_mapping_entry)
1484         (get_hex_build_id): New.
1485         (linux_qxfer_libraries_svr4): Add optional build-id attribute
1486         to reply XML document.
1487
1488 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1489             Jan Kratochvil  <jan.kratochvil@redhat.com>
1490
1491         * target.c: Include target/target-utils.h and fcntl.h.
1492         (target_fileio_read_stralloc_1_pread, target_fileio_read_stralloc_1)
1493         (target_fileio_read_stralloc): New functions.
1494
1495 2015-07-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
1496
1497         * Makefile.in (OBS): Add gdb_regex.o.
1498         (gdb_regex.o): New.
1499         * config.in: Rebuilt.
1500         * configure: Rebuilt.
1501
1502 2015-07-15  Aleksandar Ristovski  <aristovski@qnx.com
1503             Jan Kratochvil  <jan.kratochvil@redhat.com>
1504
1505         Create empty nat/linux-maps.[ch] and common/target-utils.[ch].
1506         * Makefile.in (OBS): Add target-utils.o.
1507         (linux-maps.o, target-utils.o): New.
1508         * configure.srv (srv_linux_obj): Add linux-maps.o.
1509
1510 2015-07-15  Pierre Langlois  <pierre.langlois@arm.com>
1511
1512         * linux-aarch64-low.c (aarch64_supports_range_stepping): New
1513         function, return 1.
1514         (the_low_target): Install it.
1515
1516 2015-07-14  Pedro Alves  <palves@redhat.com>
1517
1518         * linux-low.c (kill_wait_lwp): Don't assert if waitpid fails.
1519         Instead, ignore ECHILD, and throw an error for other errnos.
1520
1521 2015-07-10  Pedro Alves  <palves@redhat.com>
1522
1523         * event-loop.c (struct callback_event) <data>: Change type to
1524         gdb_client_data instance instead of gdb_client_data pointer.
1525         (append_callback_event): Adjust.
1526
1527 2015-07-10  Pierre Langlois  <pierre.langlois@arm.com>
1528
1529         * linux-aarch64-low.c: Add comments for each linux_target_ops
1530         method.  Remove comments already covered in target_ops and
1531         linux_target_ops definitions.
1532         (the_low_target): Add comments for each unimplemented method.
1533
1534 2015-07-09  Yao Qi  <yao.qi@linaro.org>
1535
1536         * linux-aarch64-low.c (aarch64_regmap): Remove.
1537         (aarch64_usrregs_info): Remove.
1538         (regs_info): Set field usrregs to NULL.
1539
1540 2015-07-02  Markus Metzger  <markus.t.metzger@intel.com>
1541
1542         * linux-low.c: Include "rsp-low.h"
1543         (linux_low_encode_pt_config, linux_low_encode_raw): New.
1544         (linux_low_read_btrace): Support BTRACE_FORMAT_PT.
1545         (linux_low_btrace_conf): Support BTRACE_FORMAT_PT.
1546         (handle_btrace_enable_pt): New.
1547         (handle_btrace_general_set): Support "pt".
1548         (handle_btrace_conf_general_set): Support "pt:size".
1549
1550 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1551
1552         * linux-aarch64-low.c (aarch64_supports_z_point_type): Enable for
1553         Z_PACKET_SW_BP.
1554
1555 2015-06-29  Pierre Langlois  <pierre.langlois@arm.com>
1556
1557         * linux-aarch64-low.c: Remove comment about endianness.
1558         (aarch64_breakpoint): Change type to gdb_byte[].  Set to "brk #0".
1559         (aarch64_breakpoint_at): Change type of insn to gdb_byte[].  Use
1560         memcmp.
1561
1562 2015-06-24  Gary Benson  <gbenson@redhat.com>
1563
1564         * linux-i386-ipa.c (stdint.h): Do not include.
1565         * lynx-i386-low.c (stdint.h): Likewise.
1566         * lynx-ppc-low.c (stdint.h): Likewise.
1567         * mem-break.c (stdint.h): Likewise.
1568         * thread-db.c (stdint.h): Likewise.
1569         * tracepoint.c (stdint.h): Likewise.
1570         * win32-low.c (stdint.h): Likewise.
1571
1572 2015-06-18  Simon Marchi  <simon.marchi@ericsson.com>
1573
1574         * server.c (write_qxfer_response): Update call to
1575         remote_escape_output.
1576
1577 2015-06-15  Aleksandar Ristovski  <aristovski@qnx.com
1578             Jan Kratochvil  <jan.kratochvil@redhat.com>
1579
1580         Merge multiple hex conversions.
1581         * gdbreplay.c (tohex): Rename to 'fromhex'.
1582         (logchar): Use fromhex.
1583
1584 2015-06-10  Jan Kratochvil  <jan.kratochvil@redhat.com>
1585
1586         * server.c (handle_qxfer_libraries): Set `version' attribute for
1587         <library-list>.
1588
1589 2015-06-10  Gary Benson  <gbenson@redhat.com>
1590
1591         * target.h (struct target_ops) <multifs_open>: New field.
1592         <multifs_unlink>: Likewise.
1593         <multifs_readlink>: Likewise.
1594         * linux-low.c (nat/linux-namespaces.h): New include.
1595         (linux_target_ops): Initialize the_target->multifs_open,
1596         the_target->multifs_unlink and the_target->multifs_readlink.
1597         * hostio.h (hostio_handle_new_gdb_connection): New declaration.
1598         * hostio.c (hostio_fs_pid): New static variable.
1599         (hostio_handle_new_gdb_connection): New function.
1600         (handle_setfs): Likewise.
1601         (handle_open): Use the_target->multifs_open as appropriate.
1602         (handle_unlink): Use the_target->multifs_unlink as appropriate.
1603         (handle_readlink): Use the_target->multifs_readlink as
1604         appropriate.
1605         (handle_vFile): Handle vFile:setfs packets.
1606         * server.c (handle_query): Call hostio_handle_new_gdb_connection
1607         after target_handle_new_gdb_connection.
1608
1609 2015-06-10  Gary Benson  <gbenson@redhat.com>
1610
1611         * configure.ac (AC_CHECK_FUNCS): Add setns.
1612         * config.in: Regenerate.
1613         * configure: Likewise.
1614         * Makefile.in (SFILES): Add nat/linux-namespaces.c.
1615         (linux-namespaces.o): New rule.
1616         * configure.srv (srv_linux_obj): Add linux-namespaces.o.
1617
1618 2015-06-09  Gary Benson <gbenson@redhat.com>
1619
1620         * hostio.c (handle_open): Process mode argument with
1621         fileio_to_host_mode.
1622
1623 2015-06-01  Yao Qi  <yao.qi@linaro.org>
1624
1625         * linux-s390-low.c (PTRACE_GETREGSET, PTRACE_SETREGSET): Remove.
1626         * linux-x86-low.c: Likewise.
1627
1628 2015-05-28  Don Breazeal  <donb@codesourcery.com>
1629
1630         * linux-low.c (handle_extended_wait): Initialize
1631         thread_info.last_resume_kind for new fork children.
1632
1633 2015-05-15  Pedro Alves  <palves@redhat.com>
1634
1635         * target.h (target_handle_new_gdb_connection): Rewrite using if
1636         wrapped in do/while.
1637
1638 2015-05-14  Joel Brobecker  <brobecker@adacore.com>
1639
1640         * configure.ac: Add prfpregset_t BFD_HAVE_SYS_PROCFS_TYPE check.
1641         * configure, config.in: Regenerate.
1642         * gdb_proc_service.h [HAVE_PRFPREGSET_T] (prfpregset_t):
1643         Declare typedef.
1644
1645 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1646
1647         * linux-low.c (handle_extended_wait): Handle PTRACE_EVENT_FORK and
1648         PTRACE_EVENT_VFORK_DONE.
1649         (linux_low_ptrace_options, extended_event_reported): Add vfork
1650         events.
1651         * remote-utils.c (prepare_resume_reply): New stop reasons "vfork"
1652         and "vforkdone" for RSP 'T' Stop Reply Packet.
1653         * server.h (report_vfork_events): Declare
1654         global variable.
1655
1656 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1657
1658         * linux-aarch64-low.c (aarch64_linux_new_fork): New function.
1659         (the_low_target) <new_fork>: Initialize new member.
1660         * linux-arm-low.c (arm_new_fork): New function.
1661         (the_low_target) <new_fork>: Initialize new member.
1662         * linux-low.c (handle_extended_wait): Call new target function
1663         new_fork.
1664         * linux-low.h (struct linux_target_ops) <new_fork>: New member.
1665         * linux-mips-low.c (mips_add_watchpoint): New function
1666         extracted from mips_insert_point.
1667         (the_low_target) <new_fork>: Initialize new member.
1668         (mips_linux_new_fork): New function.
1669         (mips_insert_point): Call mips_add_watchpoint.
1670         * linux-x86-low.c (x86_linux_new_fork): New function.
1671         (the_low_target) <new_fork>: Initialize new member.
1672
1673 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1674
1675         * linux-low.c (handle_extended_wait): Implement return value,
1676         rename argument 'event_child' to 'event_lwp', handle
1677         PTRACE_EVENT_FORK, call internal_error for unrecognized event.
1678         (linux_low_ptrace_options): New function.
1679         (linux_low_filter_event): Call linux_low_ptrace_options,
1680         use different argument fo linux_enable_event_reporting,
1681         use return value from handle_extended_wait.
1682         (extended_event_reported): New function.
1683         (linux_wait_1): Call extended_event_reported and set
1684         status to report fork events.
1685         (linux_write_memory): Add pid to debug message.
1686         (reset_lwp_ptrace_options_callback): New function.
1687         (linux_handle_new_gdb_connection): New function.
1688         (linux_target_ops): Initialize new structure member.
1689         * linux-low.h (struct lwp_info) <waitstatus>: New member.
1690         * lynx-low.c: Initialize new structure member.
1691         * remote-utils.c (prepare_resume_reply): Implement stop reason
1692         "fork" for "T" stop message.
1693         * server.c (handle_query): Call handle_new_gdb_connection.
1694         * server.h (report_fork_events): Declare global flag.
1695         * target.h (struct target_ops) <handle_new_gdb_connection>:
1696         New member.
1697         (target_handle_new_gdb_connection): New macro.
1698         * win32-low.c: Initialize new structure member.
1699
1700 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1701
1702         * mem-break.c (APPEND_TO_LIST): Define macro.
1703         (clone_agent_expr): New function.
1704         (clone_one_breakpoint): New function.
1705         (clone_all_breakpoints): New function.
1706         * mem-break.h: Declare new functions.
1707
1708 2015-05-12  Don Breazeal  <donb@codesourcery.com>
1709
1710         * linux-low.c (linux_supports_fork_events): New function.
1711         (linux_supports_vfork_events): New function.
1712         (linux_target_ops): Initialize new structure members.
1713         (initialize_low): Call linux_check_ptrace_features.
1714         * lynx-low.c (lynx_target_ops): Initialize new structure
1715         members.
1716         * server.c (report_fork_events, report_vfork_events):
1717         New global flags.
1718         (handle_query): Add new features to qSupported packet and
1719         response.
1720         (captured_main): Initialize new global variables.
1721         * target.h (struct target_ops) <supports_fork_events>:
1722         New member.
1723         <supports_vfork_events>: New member.
1724         (target_supports_fork_events): New macro.
1725         (target_supports_vfork_events): New macro.
1726         * win32-low.c (win32_target_ops): Initialize new structure
1727         members.
1728
1729 2015-05-12  Gary Benson <gbenson@redhat.com>
1730
1731         * server.c (handle_qxfer_exec_file): Use current process
1732         if annex is empty.
1733
1734 2015-05-08  Sandra Loosemore  <sandra@codesourcery.com>
1735
1736         * linux-nios2-low.c: Include elf/common.h.  Adjust comments.
1737         Remove HAVE_PTRACE_GETREGS conditionals.
1738         (nios2_regsets): Use PTRACE_GETREGSET and PTRACE_SETREGSET
1739         instead of PTRACE_GETREGS and PTRACE_SETREGS.
1740
1741 2015-05-08  Yao Qi  <yao.qi@linaro.org>
1742
1743         * linux-low.c (linux_supports_conditional_breakpoints): New
1744         function.
1745         (linux_target_ops): Install new target method.
1746         * lynx-low.c (lynx_target_ops): Install NULL hook for
1747         supports_conditional_breakpoints.
1748         * nto-low.c (nto_target_ops): Likewise.
1749         * spu-low.c (spu_target_ops): Likewise.
1750         * win32-low.c (win32_target_ops): Likewise.
1751         * server.c (handle_query): Check
1752         target_supports_conditional_breakpoints.
1753         * target.h (struct target_ops) <supports_conditional_breakpoints>:
1754         New field.
1755         (target_supports_conditional_breakpoints): New macro.
1756
1757 2015-05-06  Pedro Alves  <palves@redhat.com>
1758
1759         PR server/18081
1760         * server.c (start_inferior): If the process exits, mourn it.
1761
1762 2015-04-21  Gary Benson <gbenson@redhat.com>
1763
1764         * hostio.c (fileio_open_flags_to_host): Factored out to
1765         fileio_to_host_openflags in common/fileio.c.  Single use
1766         updated.
1767
1768 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1769
1770         * linux-xtensa-low.c (xtensa_fill_gregset)
1771         (xtensa_store_gregset): Check XCHAL_HAVE_LOOPS instead of
1772         XCHAL_HAVE_LOOP.
1773
1774 2015-04-17  Max Filippov  <jcmvbkbc@gmail.com>
1775
1776         * linux-xtensa-low.c (xtensa_usrregs_info): Remove.
1777         (regs_info): Replace usrregs pointer with NULL.
1778
1779 2015-04-17  Gary Benson  <gbenson@redhat.com>
1780
1781         * target.h (struct target_ops) <pid_to_exec_file>: New field.
1782         * linux-low.c (linux_target_ops): Initialize pid_to_exec_file.
1783         * server.c (handle_qxfer_exec_file): New function.
1784         (qxfer_packets): Add exec-file entry.
1785         (handle_query): Report qXfer:exec-file:read as supported packet.
1786
1787 2015-04-14  Romain Naour <romain.naour@openwide.fr>  (tiny change)
1788
1789         * linux-low.c (linux_read_offsets): Remove get_thread_lwp.
1790
1791 2015-04-09  Gary Benson <gbenson@redhat.com>
1792
1793         * hostio-errno.c (errno_to_fileio_error): Remove function.
1794         Update caller to use remote_fileio_to_fio_error.
1795
1796 2015-04-09  Yao Qi  <yao.qi@linaro.org>
1797
1798         * linux-low.c (linux_insert_point): Call
1799         insert_memory_breakpoint if TYPE is raw_bkpt_type_sw.
1800         (linux_remove_point): Call remove_memory_breakpoint if type is
1801         raw_bkpt_type_sw.
1802         * linux-x86-low.c (x86_insert_point): Don't call
1803         insert_memory_breakpoint.
1804         (x86_remove_point): Don't call remove_memory_breakpoint.
1805
1806 2015-04-01  Pedro Alves  <palves@redhat.com>
1807             Cleber Rosa  <crosa@redhat.com>
1808
1809         * server.c (gdbserver_usage): Reorganize and extend the usage
1810         message.
1811
1812 2015-03-24  Pedro Alves  <palves@redhat.com>
1813
1814         * linux-low.c (check_stopped_by_breakpoint): Tweak debug log
1815         output.  Also dump TRAP_TRACE.
1816         (linux_low_filter_event): In debug output, distinguish a
1817         resume_stop SIGSTOP from a delayed SIGSTOP.
1818
1819 2015-03-24  Gary Benson  <gbenson@redhat.com>
1820
1821         * linux-x86-low.c (x86_linux_new_thread): Moved to
1822         nat/x86-linux.c.
1823         (x86_linux_prepare_to_resume): Likewise.
1824
1825 2015-03-24  Gary Benson  <gbenson@redhat.com>
1826
1827         * Makefile.in (x86-linux-dregs.o): New rule.
1828         * configure.srv: Add x86-linux-dregs.o to relevant targets.
1829         * linux-x86-low.c: Include nat/x86-linux-dregs.h.
1830         (u_debugreg_offset): Moved to nat/x86-linux-dregs.c.
1831         (x86_linux_dr_get): Likewise.
1832         (x86_linux_dr_set): Likewise.
1833         (update_debug_registers_callback): Likewise.
1834         (x86_linux_dr_set_addr): Likewise.
1835         (x86_linux_dr_get_addr): Likewise.
1836         (x86_linux_dr_set_control): Likewise.
1837         (x86_linux_dr_get_control): Likewise.
1838         (x86_linux_dr_get_status): Likewise.
1839         (x86_linux_update_debug_registers): Likewise.
1840
1841 2015-03-24  Gary Benson  <gbenson@redhat.com>
1842
1843         * linux-x86-low.c (x86_linux_update_debug_registers):
1844         New function, factored out from...
1845         (x86_linux_prepare_to_resume): ...this.
1846
1847 2015-03-24  Gary Benson  <gbenson@redhat.com>
1848
1849         * linux-x86-low.c (x86_linux_dr_get): Update comments.
1850         (x86_linux_dr_set): Likewise.
1851         (update_debug_registers_callback): Likewise.
1852         (x86_linux_dr_set_addr): Likewise.
1853         (x86_linux_dr_get_addr): Likewise.
1854         (x86_linux_dr_set_control): Likewise.
1855         (x86_linux_dr_get_control): Likewise.
1856         (x86_linux_dr_get_status): Likewise.
1857         (x86_linux_prepare_to_resume): Likewise.
1858
1859 2015-03-24  Gary Benson  <gbenson@redhat.com>
1860
1861         * linux-x86-low.c (x86_linux_dr_get): Add assertion.
1862         Use perror_with_name.  Pass string through gettext.
1863         (x86_linux_dr_set): Likewise.
1864
1865 2015-03-24  Gary Benson  <gbenson@redhat.com>
1866
1867         * linux-x86-low.c (x86_dr_low_set_addr): Rename to...
1868         (x86_linux_dr_set_addr): ...this.
1869         (x86_dr_low_get_addr): Rename to...
1870         (x86_linux_dr_get_addr): ...this.
1871         (x86_dr_low_set_control): Rename to...
1872         (x86_linux_dr_set_control): ...this.
1873         (x86_dr_low_get_control): Rename to...
1874         (x86_linux_dr_get_control): ...this.
1875         (x86_dr_low_get_status): Rename to...
1876         (x86_linux_dr_get_status): ...this.
1877         (x86_dr_low): Update with new function names.
1878
1879 2015-03-24  Gary Benson  <gbenson@redhat.com>
1880
1881         * Makefile.in (x86-linux.o): New rule.
1882         * configure.srv: Add x86-linux.o to relevant targets.
1883         * linux-low.c (lwp_set_arch_private_info): New function.
1884         (lwp_arch_private_info): Likewise.
1885         * linux-x86-low.c: Include nat/x86-linux.h.
1886         (arch_lwp_info): Removed structure.
1887         (update_debug_registers_callback):
1888         Use lwp_set_debug_registers_changed.
1889         (x86_linux_prepare_to_resume): Use lwp_debug_registers_changed
1890         and lwp_set_debug_registers_changed.
1891         (x86_linux_new_thread): Use lwp_set_debug_registers_changed.
1892
1893 2015-03-24  Gary Benson  <gbenson@redhat.com>
1894
1895         * linux-low.h (linux_target_ops) <new_thread>: Changed signature.
1896         * linux-arm-low.c (arm_new_thread): Likewise.
1897         * linux-aarch64-low.c (aarch64_linux_new_thread): Likewise.
1898         * linux-mips-low.c (mips_linux_new_thread): Likewise.
1899         * linux-x86-low.c (x86_linux_new_thread): Likewise.
1900         * linux-low.c (add_lwp): Update the_low_target.new_thread call.
1901
1902 2015-03-24  Gary Benson  <gbenson@redhat.com>
1903
1904         * linux-low.c (ptid_of_lwp): New function.
1905         (lwp_is_stopped): Likewise.
1906         (lwp_stop_reason): Likewise.
1907         * linux-x86-low.c (update_debug_registers_callback):
1908         Use lwp_is_stopped.
1909         (x86_linux_prepare_to_resume): Use ptid_of_lwp and
1910         lwp_stop_reason.
1911
1912 2015-03-24  Gary Benson  <gbenson@redhat.com>
1913
1914         * linux-low.h (linux_stop_lwp): Remove declaration.
1915
1916 2015-03-24  Gary Benson  <gbenson@redhat.com>
1917
1918         * linux-low.h: Include nat/linux-nat.h.
1919         * linux-low.c (iterate_over_lwps_args): New structure.
1920         (iterate_over_lwps_filter): New function.
1921         (iterate_over_lwps): Likewise.
1922         * linux-x86-low.c (update_debug_registers_callback):
1923         Update signature to what iterate_over_lwps expects.
1924         Remove PID check that iterate_over_lwps now performs.
1925         (x86_dr_low_set_addr): Use iterate_over_lwps.
1926         (x86_dr_low_set_control): Likewise.
1927
1928 2015-03-24  Gary Benson  <gbenson@redhat.com>
1929
1930         * linux-x86-low.c (x86_debug_reg_state): New function.
1931         (x86_linux_prepare_to_resume): Use the above.
1932
1933 2015-03-24  Gary Benson  <gbenson@redhat.com>
1934
1935         * linux-low.c (current_lwp_ptid): New function.
1936         * linux-x86-low.c: Include nat/linux-nat.h.
1937         (x86_dr_low_get_addr): Use current_lwp_ptid.
1938         (x86_dr_low_get_control): Likewise.
1939         (x86_dr_low_get_status): Likewise.
1940
1941 2015-03-20  Pedro Alves  <palves@redhat.com>
1942
1943         * tracepoint.c (cmd_qtstatus): Make "str" const.
1944
1945 2015-03-20  Pedro Alves  <palves@redhat.com>
1946
1947         * server.c (handle_general_set): Make "req_str" const.
1948
1949 2015-03-19  Pedro Alves  <palves@redhat.com>
1950
1951         * linux-low.c (linux_resume_one_lwp): Rename to ...
1952         (linux_resume_one_lwp_throw): ... this.  Don't handle ESRCH here,
1953         instead call perror_with_name.
1954         (check_ptrace_stopped_lwp_gone): New function.
1955         (linux_resume_one_lwp): Reimplement as wrapper around
1956         linux_resume_one_lwp_throw that swallows errors if the LWP is
1957         gone.
1958
1959 2015-03-19  Pedro Alves  <palves@redhat.com>
1960
1961         * linux-low.c (count_events_callback, select_event_lwp_callback):
1962         No longer check whether the thread has resume_stop as last resume
1963         kind.
1964
1965 2015-03-19 Pedro Alves  <palves@redhat.com>
1966
1967         * linux-low.c (count_events_callback, select_event_lwp_callback):
1968         Use the lwp's status_pending_p field, not the thread's.
1969
1970 2015-03-19  Pedro Alves  <palves@redhat.com>
1971
1972         * linux-low.c (select_event_lwp_callback): Update comments to
1973         no longer mention SIGTRAP.
1974
1975 2015-03-18  Gary Benson  <gbenson@redhat.com>
1976
1977         * server.c (handle_query): Do not report vFile:fstat as supported.
1978
1979 2015-03-11  Gary Benson  <gbenson@redhat.com>
1980
1981         * hostio.c (sys/types.h): New include.
1982         (sys/stat.h): Likewise.
1983         (common-remote-fileio.h): Likewise.
1984         (handle_fstat): New function.
1985         (handle_vFile): Handle vFile:fstat packets.
1986
1987 2015-03-11  Gary Benson  <gbenson@redhat.com>
1988
1989         * configure.ac (AC_CHECK_MEMBERS): Add checks for
1990         struct stat.st_blocks and struct stat.st_blksize.
1991         * configure: Regenerate.
1992         * config.in: Likewise.
1993         * Makefile.in (SFILES): Add common/common-remote-fileio.c.
1994         (OBS): Add common-remote-fileio.o.
1995         (common-remote-fileio.o): New rule.
1996
1997 2015-03-09  Pedro Alves  <palves@redhat.com>
1998
1999         * tracepoint.c (gdb_agent_helper_thread): Cast '&sockaddr' to
2000         'struct sockaddr' pointer in 'accept' call.
2001
2002 2015-03-09  Pedro Alves  <palves@redhat.com>
2003
2004         Revert:
2005         2015-03-07  Pedro Alves  <palves@redhat.com>
2006         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2007         or <winsock2.h> here.  Instead include "gdb_socket.h".
2008         (remote_open): Use union gdb_sockaddr_u.
2009         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2010         or <winsock2.h> here.  Instead include "gdb_socket.h".
2011         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2012         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2013         or <sys/un.h>.
2014         (init_named_socket, gdb_agent_helper_thread): Use union
2015         gdb_sockaddr_u.
2016
2017 2015-03-07  Pedro Alves  <palves@redhat.com>
2018
2019         * configure.ac (build_warnings): Move
2020         -Wdeclaration-after-statement to the C-specific set.
2021         * configure: Regenerate.
2022
2023 2015-03-07  Pedro Alves  <palves@redhat.com>
2024
2025         * gdbreplay.c: No longer include <netinet/in.h>, <sys/socket.h>,
2026         or <winsock2.h> here.  Instead include "gdb_socket.h".
2027         (remote_open): Use union gdb_sockaddr_u.
2028         * remote-utils.c: No longer include <netinet/in.h>, <sys/socket.h>
2029         or <winsock2.h> here.  Instead include "gdb_socket.h".
2030         (handle_accept_event, remote_prepare): Use union gdb_sockaddr_u.
2031         * tracepoint.c: Include "gdb_socket.h" instead of <sys/socket.h>
2032         or <sys/un.h>.
2033         (init_named_socket, gdb_agent_helper_thread): Use union
2034         gdb_sockaddr_u.
2035
2036 2015-03-07  Pedro Alves  <palves@redhat.com>
2037
2038         Adjust all callers of TRY_CATCH to use TRY/CATCH/END_CATCH
2039         instead.
2040
2041 2015-03-06  Yao Qi  <yao.qi@linaro.org>
2042
2043         * linux-aarch64-low.c (aarch64_insert_point): Use
2044         show_debug_regs as a boolean.
2045         (aarch64_remove_point): Likewise.
2046
2047 2015-03-05  Pedro Alves  <palves@redhat.com>
2048
2049         * lynx-low.c (lynx_target_ops): Install NULL hooks for
2050         stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
2051         stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint.
2052         * nto-low.c (nto_target_ops): Likewise.
2053         * spu-low.c (spu_target_ops): Likewise.
2054         * win32-low.c (win32_target_ops): Likewise.
2055
2056 2015-03-04  Pedro Alves  <palves@redhat.com>
2057
2058         * linux-low.c (check_stopped_by_breakpoint) [USE_SIGTRAP_SIGINFO]:
2059         Decide whether a breakpoint triggered based on the SIGTRAP's
2060         siginfo.si_code.
2061         (thread_still_has_status_pending_p) [USE_SIGTRAP_SIGINFO]: Don't check whether a
2062         breakpoint is inserted if relying on SIGTRAP's siginfo.si_code.
2063         (linux_low_filter_event): Check for breakpoints before checking
2064         watchpoints.
2065         (linux_wait_1): Don't re-increment the PC if relying on SIGTRAP's
2066         siginfo.si_code.
2067         (linux_stopped_by_sw_breakpoint)
2068         (linux_supports_stopped_by_sw_breakpoint)
2069         (linux_stopped_by_hw_breakpoint)
2070         (linux_supports_stopped_by_hw_breakpoint): New functions.
2071         (linux_target_ops): Install new target methods.
2072
2073 2015-03-04  Pedro Alves  <palves@redhat.com>
2074
2075         * remote-utils.c (prepare_resume_reply): Report swbreak/hbreak.
2076         * server.c (swbreak_feature, hwbreak_feature): New globals.
2077         (handle_query) <qSupported>: Handle "swbreak+" and "hwbreak+".
2078         (captured_main): Clear swbreak_feature and hwbreak_feature.
2079         * server.h (swbreak_feature, hwbreak_feature): Declare.
2080         * target.h (struct target_ops) <stopped_by_sw_breakpoint,
2081         supports_stopped_by_sw_breakpoint, stopped_by_hw_breakpoint,
2082         supports_stopped_by_hw_breakpoint>: New fields.
2083         (target_supports_stopped_by_sw_breakpoint)
2084         (target_stopped_by_sw_breakpoint)
2085         (target_supports_stopped_by_hw_breakpoint)
2086         (target_stopped_by_hw_breakpoint): Declare.
2087
2088 2015-03-04  Pedro Alves  <palves@redhat.com>
2089
2090         enum lwp_stop_reason -> enum target_stop_reason
2091         * linux-low.c (check_stopped_by_breakpoint): Adjust.
2092         (thread_still_has_status_pending_p, check_stopped_by_watchpoint)
2093         (linux_wait_1, stuck_in_jump_pad_callback)
2094         (move_out_of_jump_pad_callback, linux_resume_one_lwp)
2095         (linux_stopped_by_watchpoint):
2096         * linux-low.h (enum lwp_stop_reason): Delete.
2097         (struct lwp_info) <stop_reason>: Now an enum target_stop_reason.
2098         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2099
2100 2015-03-04  Yao Qi  <yao.qi@linaro.org>
2101
2102         * Makefile.in (SFILES): Add linux-aarch64-low.c.
2103
2104 2015-03-03  Gary Benson  <gbenson@redhat.com>
2105
2106         * hostio.c (handle_vFile): Fix prefix lengths.
2107
2108 2015-03-03  Markus Metzger  <markus.t.metzger@intel.com>
2109
2110         * linux-low.c (linux_low_enable_btrace): Do not overwrite non-zero
2111         ptr_bits.
2112
2113 2015-03-02  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2114
2115         * Makefile.in (s390-vx-linux64.c, s390-tevx-linux64.c)
2116         (s390x-vx-linux64.c, s390x-tevx-linux64.c): New rules.
2117         (clean): Add "rm -f" for above C files.
2118         * configure.srv (srv_regobj): Add s390-vx-linux64.o,
2119         s390-tevx-linux64.o, s390x-vx-linux64.o, and s390x-tevx-linux64.o.
2120         (srv_xmlfiles): Add s390-vx-linux64.xml, s390-tevx-linux64.xml,
2121         s390x-vx-linux64.xml, s390x-tevx-linux64.xml, and s390-vx.xml.
2122         * linux-s390-low.c (HWCAP_S390_VX): New macro.
2123         (init_registers_s390_vx_linux64, init_registers_s390_tevx_linux64)
2124         (init_registers_s390x_vx_linux64)
2125         (init_registers_s390x_tevx_linux64)
2126         (tdesc_s390_vx_linux64, tdesc_s390_tevx_linux64)
2127         (tdesc_s390x_vx_linux64, tdesc_s390x_tevx_linux64): New extern
2128         declarations.
2129         (s390_fill_vxrs_low, s390_store_vxrs_low, s390_fill_vxrs_high)
2130         (s390_store_vxrs_high): New functions.
2131         (s390_regsets): Add entries for NT_S390_VXRS_LOW and
2132         NT_S390_VXRS_HIGH.
2133         (s390_arch_setup): Add logic for selecting one of the new target
2134         descriptions.  Activate the new vector regsets if applicable.
2135         (initialize_low_arch): Also invoke init_registers_s390_vx_linux64,
2136         init_registers_s390_tevx_linux64, init_registers_s390x_vx_linux64,
2137         and init_registers_s390x_tevx_linux64.
2138
2139 2015-03-01  Pedro Alves  <palves@redhat.com>
2140
2141         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Constify 'raw_regs'
2142         parameter.
2143
2144 2015-02-27  Pedro Alves  <palves@redhat.com>
2145
2146         * linux-x86-low.c (u_debugreg_offset): New function.
2147         (x86_linux_dr_get, x86_linux_dr_set): Use it.
2148
2149 2015-02-27  Pedro Alves  <palves@redhat.com>
2150
2151         * gdb_proc_service.h: Wrap with EXTERN_C_PUSH/EXTERN_C_POP.
2152         [!HAVE_PROC_SERVICE_H] (struct ps_prochandle): Forward declare.
2153         [!HAVE_PROC_SERVICE_H] (ps_pdread, ps_pdwrite, ps_ptread)
2154         ps_ptwrite, ps_lgetregs, ps_lsetregs, ps_lgetfpregs)
2155         (ps_lsetfpregs, ps_getpid)
2156         (ps_get_thread_area, ps_pglobal_lookup, ps_pstop, ps_pcontinue)
2157         (ps_lstop, ps_lcontinue, ps_lgetxregsize, ps_lgetxregs)
2158         (ps_lsetxregs, ps_plog): Declare.
2159
2160 2015-02-27  Pedro Alves  <palves@redhat.com>
2161
2162         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Use
2163         IP_AGENT_EXPORT_FUNC.
2164         * linux-i386-ipa.c (gdb_agent_get_raw_reg): Use
2165         IP_AGENT_EXPORT_FUNC.
2166         * tracepoint.c (ATTR_USED, ATTR_NOINLINE, ATTR_CONSTRUCTOR)
2167         (IP_AGENT_EXPORT): Delete.
2168         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2169         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2170         (gdb_trampoline_buffer_error, collecting, gdb_collect)
2171         (stop_tracing, flush_trace_buffer, about_to_request_buffer_space)
2172         (trace_buffer_is_full, stopping_tracepoint, expr_eval_result)
2173         (error_tracepoint, tracepoints, tracing, trace_buffer_ctrl)
2174         (trace_buffer_ctrl_curr, trace_buffer_lo, trace_buffer_hi)
2175         (traceframe_read_count, traceframe_write_count)
2176         (traceframes_created, trace_state_variables, get_raw_reg)
2177         (get_trace_state_variable_value, set_trace_state_variable_value)
2178         (ust_loaded, helper_thread_id, cmd_buf): Use
2179         IPA_SYM_EXPORTED_NAME.
2180         (stop_tracing, flush_trace_buffer): Use IP_AGENT_EXPORT_FUNC.
2181         (tracepoints) Use IP_AGENT_EXPORT_VAR.
2182         (stopping_tracepoint, trace_buffer_is_full, expr_eval_result): Use
2183         IP_AGENT_EXPORT_VAR and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2184         (last_tracepoint): Move into !IN_PROCESS_AGENT block.
2185         (error_tracepoint): Use IP_AGENT_EXPORT_VAR and wrap in
2186         EXTERN_C_PUSH/EXTERN_C_POP.
2187         (trace_state_variables): Use IP_AGENT_EXPORT_VAR.
2188         (trace_buffer_lo, trace_buffer_hi): Use IP_AGENT_EXPORT_VAR and
2189         wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2190         (trace_buffer_ctrl, trace_buffer_ctrl_curr)
2191         (traceframe_write_count, traceframe_read_count)
2192         (traceframes_created, tracing): Use IP_AGENT_EXPORT_VAR.
2193         (about_to_request_buffer_space, get_trace_state_variable_value)
2194         (set_trace_state_variable_value): Use IP_AGENT_EXPORT_FUNC.
2195         (collecting): Use IP_AGENT_EXPORT_VAR and wrap in
2196         EXTERN_C_PUSH/EXTERN_C_POP.
2197         (gdb_collect): Use IP_AGENT_EXPORT_FUNC.
2198         (ust_loaded, cmd_buf): Use IP_AGENT_EXPORT_VAR.
2199         (helper_thread_id, gdb_agent_capability): Use IP_AGENT_EXPORT_VAR
2200         and wrap in EXTERN_C_PUSH/EXTERN_C_POP.
2201         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
2202         (gdb_trampoline_buffer, gdb_trampoline_buffer_end)
2203         (gdb_trampoline_buffer_error): Use IP_AGENT_EXPORT_VAR.
2204         * tracepoint.h (ATTR_USED, ATTR_NOINLINE, EXPORTED_SYMBOL):
2205         Define.
2206         (IP_AGENT_EXPORT_FUNC, IP_AGENT_EXPORT_VAR)
2207         (IP_AGENT_EXPORT_VAR_DECL): Define.
2208         (tracing): Declare.
2209         (gdb_agent_get_raw_reg): Declare.
2210
2211 2015-02-27  Tom Tromey  <tromey@redhat.com>
2212             Pedro Alves  <palves@redhat.com>
2213
2214         Rename symbols whose names are reserved C++ keywords throughout.
2215
2216 2015-02-27  Pedro Alves  <palves@redhat.com>
2217
2218         * Makefile.in (COMPILER): New, get it from autoconf.
2219         (CXX): Get from autoconf instead.
2220         (COMPILE.pre): Use COMPILER.
2221         (CC-LD): Rename to ...
2222         (CC_LD): ... this.  Use COMPILER.
2223         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT), $(IPA_LIB)): Adjust.
2224         (CXX_FOR_TARGET): Default to g++ instead of gcc.
2225         * acinclude.m4: Include build-with-cxx.m4.
2226         * configure.ac: Call AC_PROG_CXX and GDB_AC_BUILD_WITH_CXX.
2227         Disable -Werror by default if building in C++ mode.
2228         (build_warnings): Add -Wno-sign-compare, -Wno-write-strings and
2229         -Wno-narrowing in C++ mode. Run supported-warning-flags tests with
2230         the C++ compiler.  Save/restore CXXFLAGS too.
2231         * configure: Regenerate.
2232
2233 2015-02-27  Pedro Alves  <palves@redhat.com>
2234
2235         * acinclude.m4: Include libiberty.m4.
2236         * configure.ac: Call libiberty_INIT.
2237         * config.in, configure: Regenerate.
2238
2239 2015-02-26  Pedro Alves  <palves@redhat.com>
2240
2241         * linux-low.c (linux_wait_1): When incrementing the PC past a
2242         program breakpoint always use the_low_target.breakpoint_len as
2243         increment, rather than the maximum between that and
2244         the_low_target.decr_pc_after_break.
2245
2246 2015-02-23  Pedro Alves  <palves@redhat.com>
2247
2248         * linux-low.c (check_stopped_by_breakpoint): Don't check if the
2249         thread was doing a step-over; always adjust the PC if
2250         we stepped over a permanent breakpoint.
2251         (linux_wait_1): If we stepped over breakpoint that was on top of a
2252         permanent breakpoint, manually advance the PC past it.
2253
2254 2015-02-23  Pedro Alves  <palves@redhat.com>
2255
2256         * linux-x86-low.c (REGSIZE): Define in both 32-bit and 64-bit
2257         modes.
2258         (x86_fill_gregset, x86_store_gregset): Use it when handling
2259         $orig_eax.
2260
2261 2015-02-20  Pedro Alves  <palves@redhat.com>
2262
2263         * thread-db.c: Include "nat/linux-procfs.h".
2264         (thread_db_init): Skip listing new threads if the kernel supports
2265         PTRACE_EVENT_CLONE and /proc/PID/task/ is accessible.
2266
2267 2015-02-20  Pedro Alves  <palves@redhat.com>
2268
2269         * linux-low.c (status_pending_p_callback): Use ptid_match.
2270
2271 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
2272
2273         PR breakpoints/16812
2274         * linux-low.c (wstatus_maybe_breakpoint): Remove.
2275         (linux_low_filter_event): Update wstatus_maybe_breakpoint name.
2276         (linux_wait_1): Report SIGTRAP,SIGILL,SIGSEGV.
2277
2278 2015-02-10  Antoine Tremblay <antoine.tremblay@ericsson.com>
2279
2280         PR breakpoints/15956
2281         * tracepoint.c (cmd_qtinit): Add check for current_thread.
2282
2283 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2284
2285         * linux-low.c (linux_low_btrace_conf): Print size.
2286         * server.c (handle_btrace_conf_general_set): New.
2287         (hanle_general_set): Call handle_btrace_conf_general_set.
2288         (handle_query): Report Qbtrace-conf:bts:size as supported.
2289
2290 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2291
2292         * linux-low.c (linux_low_enable_btrace): Update parameters.
2293         (linux_low_btrace_conf): New.
2294         (linux_target_ops)<to_btrace_conf>: Initialize.
2295         * server.c (current_btrace_conf): New.
2296         (handle_btrace_enable): Rename to ...
2297         (handle_btrace_enable_bts): ... this.  Pass &current_btrace_conf
2298         to target_enable_btrace.  Update comment.  Update users.
2299         (handle_qxfer_btrace_conf): New.
2300         (qxfer_packets): Add btrace-conf entry.
2301         (handle_query): Report qXfer:btrace-conf:read as supported packet.
2302         * target.h (target_ops)<enable_btrace>: Update parameters and comment.
2303         (target_ops)<read_btrace_conf>: New.
2304         (target_enable_btrace): Update parameters.
2305         (target_read_btrace_conf): New.
2306
2307 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2308
2309         * server.c (handle_btrace_general_set): Remove call to
2310         target_supports_btrace.
2311         (supported_btrace_packets): New.
2312         (handle_query): Call supported_btrace_packets.
2313         * target.h: include btrace-common.h.
2314         (btrace_target_info): Removed.
2315         (supports_btrace, target_supports_btrace): Update parameters.
2316
2317 2015-02-09  Markus Metzger  <markus.t.metzger@intel.com>
2318
2319         * Makefile.in (SFILES): Add common/btrace-common.c.
2320         (OBS): Add common/btrace-common.o.
2321         (btrace-common.o): Add build rules.
2322         * linux-low: Include btrace-common.h.
2323         (linux_low_read_btrace): Use struct btrace_data.  Call
2324         btrace_data_init and btrace_data_fini.
2325
2326 2015-02-06  Pedro Alves  <palves@redhat.com>
2327
2328         * thread-db.c (find_new_threads_callback): Add debug output.
2329
2330 2015-02-04  Pedro Alves  <palves@redhat.com>
2331
2332         * linux-low.c (handle_extended_wait): Don't resume LWPs here.
2333         (resume_stopped_resumed_lwps): New function.
2334         (linux_wait_for_event_filtered): Use it.
2335
2336 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2337
2338         * Makefile.in (SFILES): Add linux-personality.c.
2339         (linux-personality.o): New rule.
2340         * configure.srv (srv_linux_obj): Add linux-personality.o to the
2341         list of objects to be built.
2342         * linux-low.c: Include nat/linux-personality.h.
2343         (linux_create_inferior): Remove code to disable address space
2344         randomization (moved to ../nat/linux-personality.c).  Create
2345         cleanup to disable address space randomization.
2346
2347 2015-01-15  Sergio Durigan Junior  <sergiodj@redhat.com>
2348
2349         * Makefile.in (posix-strerror.o): New rule.
2350         (mingw-strerror.o): Likewise.
2351         * configure: Regenerated.
2352         * configure.ac: Source file ../common/common.host.  Initialize new
2353         variable srv_host_obs.  Add srv_host_obs to GDBSERVER_DEPFILES.
2354
2355 2015-01-14  Yao Qi  <yao@codesourcery.com>
2356
2357         * Makefile.in (SFILES): Add nat/ppc-linux.c.
2358         (ppc-linux.o): New rule.
2359         * configure.srv (powerpc*-*-linux*): Add ppc-linux.o.
2360         * configure.ac: AC_CHECK_FUNCS(getauxval).
2361         * config.in: Re-generated.
2362         * configure: Re-generated.
2363         * linux-ppc-low.c (ppc_arch_setup) [__powerpc64__]: Call
2364         ppc64_64bit_inferior_p
2365
2366 2015-01-14  Yao Qi  <yao@codesourcery.com>
2367
2368         * linux-ppc-low.c: Include "nat/ppc-linux.h".
2369          (PPC_FEATURE_HAS_VSX): Move to nat/ppc-linux.h.
2370         (PPC_FEATURE_HAS_ALTIVEC,  PPC_FEATURE_HAS_SPE): Likewise.
2371         (PT_ORIG_R3, PT_TRAP): Likewise.
2372         (PTRACE_GETVSXREGS, PTRACE_SETVSXREGS): Likewise.
2373         (PTRACE_GETVRREGS, PTRACE_SETVRREGS): Likewise.
2374         (PTRACE_GETEVRREGS, PTRACE_SETEVRREGS): Likewise.
2375
2376 2015-01-10  Joel Brobecker  <brobecker@adacore.com>
2377
2378         * i387-fp.c (i387_cache_to_xsave): In look over
2379         num_avx512_zmmh_high_registers, replace use of struct i387_xsave
2380         zmmh_low_space field by use of zmmh_high_space.
2381
2382 2015-01-09  Pedro Alves  <palves@redhat.com>
2383
2384         * linux-low.c (step_over_bkpt): Move higher up in the file.
2385         (handle_extended_wait): Don't store the stop_pc here.
2386         (get_stop_pc): Adjust comments and rename to ...
2387         (check_stopped_by_breakpoint): ... this.  Record whether the LWP
2388         stopped for a software breakpoint or hardware breakpoint.
2389         (thread_still_has_status_pending_p): New function.
2390         (status_pending_p_callback): Use
2391         thread_still_has_status_pending_p.  If the event is no longer
2392         interesting, resume the LWP.
2393         (handle_tracepoints): Add assert.
2394         (maybe_move_out_of_jump_pad): Remove cancel_breakpoints call.
2395         (wstatus_maybe_breakpoint): New function.
2396         (cancel_breakpoint): Delete function.
2397         (check_stopped_by_watchpoint): New function, factored out from
2398         linux_low_filter_event.
2399         (lp_status_maybe_breakpoint): Delete function.
2400         (linux_low_filter_event): Remove filter_ptid argument.
2401         Leave thread group exits pending here.  Store the LWP's stop PC.
2402         Always leave events pending.
2403         (linux_wait_for_event_filtered): Pull all events out of the
2404         kernel, and leave them all pending.
2405         (count_events_callback, select_event_lwp_callback): Consider all
2406         events.
2407         (cancel_breakpoints_callback, linux_cancel_breakpoints): Delete.
2408         (select_event_lwp): Only give preference to the stepping LWP in
2409         all-stop mode.  Adjust comments.
2410         (ignore_event): New function.
2411         (linux_wait_1): Delete 'retry' label.  Use ignore_event.  Remove
2412         references to cancel_breakpoints.  Adjust to renames.  Also give
2413         equal priority to all LWPs that have had events in non-stop mode.
2414         If reporting a software breakpoint event, unadjust the LWP's PC.
2415         (linux_wait): If linux_wait_1 returned an ignored event, retry.
2416         (stuck_in_jump_pad_callback, move_out_of_jump_pad_callback):
2417         Adjust.
2418         (linux_resume_one_lwp): Store the LWP's PC.  Adjust.
2419         (resume_status_pending_p): Use thread_still_has_status_pending_p.
2420         (linux_stopped_by_watchpoint): Adjust.
2421         (linux_target_ops): Remove reference to linux_cancel_breakpoints.
2422         * linux-low.h (enum lwp_stop_reason): New.
2423         (struct lwp_info) <stop_pc>: Adjust comment.
2424         <stopped_by_watchpoint>: Delete field.
2425         <stop_reason>: New field.
2426         * linux-x86-low.c (x86_linux_prepare_to_resume): Adjust.
2427         * mem-break.c (software_breakpoint_inserted_here)
2428         (hardware_breakpoint_inserted_here): New function.
2429         * mem-break.h (software_breakpoint_inserted_here)
2430         (hardware_breakpoint_inserted_here): Declare.
2431         * target.h (struct target_ops) <cancel_breakpoints>: Remove field.
2432         (cancel_breakpoints): Delete.
2433         * tracepoint.c (clear_installed_tracepoints, stop_tracing)
2434         (upload_fast_traceframes): Remove references to
2435         cancel_breakpoints.
2436
2437 2015-01-09  Pedro Alves  <palves@redhat.com>
2438
2439         * thread-db.c (find_new_threads_callback): Ignore thread if the
2440         kernel thread ID is -1.
2441
2442 2015-01-09  Pedro Alves  <palves@redhat.com>
2443
2444         * linux-low.c (linux_attach_fail_reason_string): Move to
2445         nat/linux-ptrace.c, and rename.
2446         (linux_attach_lwp): Update comment.
2447         (attach_proc_task_lwp_callback): New function.
2448         (linux_attach): Adjust to rename and use
2449         linux_proc_attach_tgid_threads.
2450         (linux_attach_fail_reason_string): Delete declaration.
2451
2452 2015-01-01  Joel Brobecker  <brobecker@adacore.com>
2453
2454         * gdbreplay.c (gdbreplay_version): Update copyright year to 2015.
2455         * server.c (gdbserver_version): Likewise.
2456
2457 2014-12-29  Sergio Durigan Junior  <sergiodj@redhat.com>
2458
2459         * remote-utils.c: Include ctype.h.
2460         (input_interrupt): Explicitly handle the case when the char
2461         received is the NUL byte.  Improve the printing of non-ASCII
2462         characters.
2463
2464 2014-12-16  Joel Brobecker  <brobecker@adacore.com>
2465
2466         * linux-low.c (linux_low_filter_event): Update call to
2467         linux_enable_event_reporting following the addition of
2468         a new parameter to that function.
2469
2470 2014-12-16  Catalin Udma  <catalin.udma@freescale.com>
2471
2472         PR server/17457
2473         * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define.
2474         (AARCH64_FPCR_REGNO): Likewise.
2475         (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers.
2476         (aarch64_fill_fpregset): Add missing fpsr/fpcr registers.
2477         (aarch64_store_fpregset): Likewise.
2478
2479 2014-12-15  Joel Brobecker  <brobecker@adacore.com>
2480
2481         * lynx-low.c (lynx_resume): Use PTRACE_SINGLESTEP_ONE if N == 1.
2482         Remove FIXME comment about assumption about N.
2483
2484 2014-12-13  Joel Brobecker  <brobecker@adacore.com>
2485
2486         * configure.ac: If large-file support is disabled in GDBserver,
2487         pass --disable-largefile to ACX_CONFIGURE_DIR call for "gnulib".
2488         * configure: Regenerate.
2489
2490 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2491
2492         * linux-low.c (regsets_fetch_inferior_registers): Suppress the
2493         warning upon ENODATA from ptrace.
2494         * linux-s390-low.c (s390_store_tdb): New.
2495         (s390_regsets): Add regset for NT_S390_TDB.
2496
2497 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2498
2499         * linux-low.c (regsets_store_inferior_registers): Skip regsets
2500         without a fill_function.
2501         * linux-s390-low.c (s390_fill_last_break): Remove.
2502         (s390_regsets): Set fill_function to NULL for NT_S390_LAST_BREAK.
2503         (s390_arch_setup): Use regset's size instead of fill_function for
2504         loop end condition.
2505
2506 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2507
2508         * linux-low.c (regsets_fetch_inferior_registers): Do not invoke
2509         the regset's store function when ptrace returned an error.
2510         * regcache.c (get_thread_regcache): Invalidate register cache
2511         before fetching inferior's registers.
2512
2513 2014-12-12  Andreas Arnez  <arnez@linux.vnet.ibm.com>
2514
2515         * linux-low.c (regsets_fetch_inferior_registers): Rephrase
2516         while-loop as for-loop.
2517         (regsets_store_inferior_registers): Likewise.
2518
2519 2014-11-28  Yao Qi  <yao@codesourcery.com>
2520
2521         * configure.ac(AC_CHECK_FUNCS): Remove readlink.
2522         * config.in, configure: Re-generate.
2523         * hostio.c (handle_unlink): Remove code checking HAVE_READLINK
2524         is defined.
2525
2526 2014-11-21  Yao Qi  <yao@codesourcery.com>
2527
2528         * configure.ac: Don't invoke AC_FUNC_ALLOCA.
2529         (AC_CHECK_HEADERS): Remove malloc.h.
2530         * configure: Re-generated.
2531         * config.in: Re-generated.
2532         * server.h: Don't include alloca.h and malloc.h.
2533         * gdbreplay.c: Don't check HAVE_ALLOCA_H is defined.
2534         Don't include malloc.h.
2535
2536 2014-11-17  Joel Brobecker  <brobecker@adacore.com>
2537
2538         * lynx-low.c (lynx_write_memory): Put lynx_read_memory and
2539         corresponding ERRNO check in same block.
2540
2541 2014-11-12  Pedro Alves  <palves@redhat.com>
2542
2543         * server.c (cont_thread): Update comment.
2544         (start_inferior, attach_inferior): No longer clear cont_thread.
2545         (handle_v_cont): No longer set cont_thread.
2546         (captured_main): Clear cont_thread each time a GDB connects.
2547
2548 2014-11-12  Pedro Alves  <palves@redhat.com>
2549
2550         * linux-low.c (linux_wait_1): Don't force a wait for the Hc
2551         thread, and don't resume all threads if the Hc thread has exited.
2552
2553 2014-11-12  Pedro Alves  <palves@redhat.com>
2554
2555         * linux-low.c (linux_request_interrupt): Always send a SIGINT to
2556         the process group instead of to a specific LWP.
2557
2558 2014-10-15  Pedro Alves  <palves@redhat.com>
2559
2560         PR server/17487
2561         * win32-arm-low.c (arm_set_thread_context): Remove current_event
2562         parameter.
2563         (arm_set_thread_context): Delete.
2564         (the_low_target): Adjust.
2565         * win32-i386-low.c (debug_registers_changed)
2566         (debug_registers_used): Delete.
2567         (update_debug_registers_callback): New function.
2568         (x86_dr_low_set_addr, x86_dr_low_set_control): Mark all threads as
2569         needing to update their debug registers.
2570         (win32_get_current_dr): New function.
2571         (x86_dr_low_get_addr, x86_dr_low_get_control)
2572         (x86_dr_low_get_status): Fetch the debug register from the thread
2573         record's context.
2574         (i386_initial_stuff): Adjust.
2575         (i386_get_thread_context): Remove current_event parameter.  Don't
2576         clear debug_registers_changed nor copy DR values to
2577         debug_reg_state.
2578         (i386_set_thread_context): Delete.
2579         (i386_prepare_to_resume): New function.
2580         (i386_thread_added): Mark the thread as needing to update irs
2581         debug registers.
2582         (the_low_target): Remove i386_set_thread_context and install
2583         i386_prepare_to_resume.
2584         * win32-low.c (win32_get_thread_context): Adjust.
2585         (win32_set_thread_context): Use SetThreadContext
2586         directly.
2587         (win32_prepare_to_resume): New function.
2588         (win32_require_context): New function, factored out from ...
2589         (thread_rec): ... this.
2590         (continue_one_thread): Call win32_prepare_to_resume on each thread
2591         we're about to continue.
2592         (win32_resume): Call win32_prepare_to_resume on the event thread.
2593         * win32-low.h (struct win32_thread_info)
2594         <debug_registers_changed>: New field.
2595         (struct win32_target_ops): Change prototype of set_thread_context,
2596         delete set_thread_context and add prepare_to_resume.
2597         (win32_require_context): New declaration.
2598
2599 2014-10-08  Gary Benson  <gbenson@redhat.com>
2600
2601         * server.h: Do not include common-exceptions.h.
2602
2603 2014-10-08  Gary Benson  <gbenson@redhat.com>
2604
2605         * server.h: Do not include cleanups.h.
2606
2607 2014-09-30  James Hogan  <james.hogan@imgtec.com>
2608
2609         * Makefile.in (clean): Add rm -f commands for mips-dsp-linux.c and
2610         mips64-dsp-linux.c.
2611
2612 2014-09-23  Yao Qi  <yao@codesourcery.com>
2613
2614         * linux-low.c (lp_status_maybe_breakpoint): New function.
2615         (linux_low_filter_event): Call lp_status_maybe_breakpoint.
2616         (count_events_callback): Likewise.
2617         (select_event_lwp_callback): Likewise.
2618         (cancel_breakpoints_callback): Likewise.
2619
2620 2014-09-19  Don Breazeal  <donb@codesourcery.com>
2621
2622         * linux-low.c (handle_extended_wait): Call
2623         linux_ptrace_get_extended_event.
2624         (get_stop_pc, get_detach_signal, linux_low_filter_event): Call
2625         linux_is_extended_waitstatus.
2626
2627 2014-09-16  Joel Brobecker  <brobecker@adacore.com>
2628
2629         * Makefile.in (CPPFLAGS): Define.
2630         (INTERNAL_CFLAGS_BASE): Add ${CPPFLAGS}.
2631         (IPAGENT_CFLAGS): Remove ${CPPFLAGS}.
2632
2633 2014-09-16  Gary Benson  <gbenson@redhat.com>
2634
2635         * inferiors.h (current_inferior): Renamed as...
2636         (current_thread): New variable.  All uses updated.
2637         * linux-low.c (get_pc): Renamed saved_inferior as saved_thread.
2638         (maybe_move_out_of_jump_pad): Likewise.
2639         (cancel_breakpoint): Likewise.
2640         (linux_low_filter_event): Likewise.
2641         (wait_for_sigstop): Likewise.
2642         (linux_resume_one_lwp): Likewise.
2643         (need_step_over_p): Likewise.
2644         (start_step_over): Likewise.
2645         (linux_stabilize_threads): Renamed save_inferior as saved_thread.
2646         * linux-x86-low.c (x86_linux_update_xmltarget): Likewise.
2647         * proc-service.c (ps_lgetregs): Renamed reg_inferior as reg_thread
2648         and save_inferior as saved_thread.
2649         * regcache.c (get_thread_regcache): Renamed saved_inferior as
2650         saved_thread.
2651         (regcache_invalidate_thread): Likewise.
2652         * remote-utils.c (prepare_resume_reply): Likewise.
2653         * thread-db.c (thread_db_get_tls_address): Likewise.
2654         (disable_thread_event_reporting): Likewise.
2655         (remove_thread_event_breakpoints): Likewise.
2656         * tracepoint.c (gdb_agent_about_to_close): Renamed save_inferior
2657         as saved_thread.
2658         * target.h (set_desired_inferior): Renamed as...
2659         (set_desired_thread): New declaration.  All uses updated.
2660         * server.c (myresume): Updated comment to reference thread instead
2661         of inferior.
2662         (handle_serial_event): Likewise.
2663         (handle_target_event): Likewise.
2664
2665 2014-09-12  Tom Tromey  <tromey@redhat.com>
2666             Gary Benson  <gbenson@redhat.com>
2667
2668         * regcache.h: Include common-regcache.h.
2669         (regcache_read_pc): Don't declare.
2670         * regcache.c (get_thread_regcache_for_ptid): New function.
2671
2672 2014-09-11  Tom Tromey  <tromey@redhat.com>
2673             Gary Benson  <gbenson@redhat.com>
2674
2675         * symbol.c: New file.
2676         * Makefile.in (SFILES): Add symbol.c.
2677         (OBS): Add symbol.o.
2678
2679 2014-09-11  Gary Benson  <gbenson@redhat.com>
2680
2681         * target.c (target_stop_ptid, target_continue_ptid): New
2682         functions.
2683
2684 2014-09-11  Tom Tromey  <tromey@redhat.com>
2685             Gary Benson  <gbenson@redhat.com>
2686
2687         * target.h: Include target/target.h.
2688         * target.c (target_read_memory, target_read_uint32)
2689         (target_write_memory): New functions.
2690
2691 2014-09-11  Gary Benson  <gbenson@redhat.com>
2692
2693         * server.h (debug_hw_points): Don't declare.
2694         * server.c (debug_hw_points): Don't define.  Replace all uses
2695         with show_debug_regs.
2696         * linux-aarch64-low.c (debug_hw_points): Don't define.  Replace
2697         all uses with show_debug_regs.
2698
2699 2014-09-08  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
2700
2701         * linux-ppc-low.c (ppc_collect_ptrace_register): Adjust routine to take
2702         endianness into account.
2703         (ppc_supply_ptrace_register): Likewise.
2704
2705 2014-09-03  James Hogan  <james.hogan@imgtec.com>
2706
2707         * linux-mips-low.c (mips_read_description): Reset errno to 0 prior
2708         to reading DSP_CONTROL with PTRACE_PEEKUSER ptrace call.
2709
2710 2014-09-03  Gary Benson  <gbenson@redhat.com>
2711
2712         * linux-x86-low.c (x86_linux_prepare_to_resume): Use
2713         ALL_DEBUG_ADDRESS_REGISTERS.
2714
2715 2014-09-02  Gary Benson  <gbenson@redhat.com>
2716
2717         * i386-low.h: Renamed as...
2718         * x86-low.h: New file.  All type, function and variable name
2719         prefixes changed from "i386_" to "x86_".  All references updated.
2720         * i386-low.c: Renamed as...
2721         * x86-low.c: New file.  All type, function and variable name
2722         prefixes changed from "i386_" to "x86_".  All references updated.
2723
2724 2014-09-02  Gary Benson  <gbenson@redhat.com>
2725
2726         * linux-x86-low.c (x86_linux_new_process): Use XCNEW.
2727         (x86_linux_new_thread): Likewise.
2728
2729 2014-08-29  Gary Benson  <gbenson@redhat.com>
2730
2731         * server.h (setjmp.h): Do not include.
2732         (toplevel): Do not declare.
2733         (common-exceptions.h): Include.
2734         (cleanups.h): Likewise.
2735         * server.c (toplevel): Do not define.
2736         (exit_code): New static global.
2737         (detach_or_kill_for_exit_cleanup): New function.
2738         (main): New function.  Original main renamed to...
2739         (captured_main): New function.
2740         * utils.c (verror) [!IN_PROCESS_AGENT]: Use throw_verror.
2741
2742 2014-08-29  Gary Benson  <gbenson@redhat.com>
2743
2744         * Makefile.in (SFILES): Add common/common-exceptions.c.
2745         (OBS): Add common-exceptions.o.
2746         (common-exceptions.o): New rule.
2747         * utils.c (prepare_to_throw_exception): New function.
2748
2749 2014-08-29  Gary Benson  <gbenson@redhat.com>
2750
2751         * config.in: Regenerate.
2752         * configure: Likewise.
2753
2754 2014-08-29  Gary Benson  <gbenson@redhat.com>
2755
2756         * Makefile.in (SFILES): Add common/cleanups.c.
2757         (OBS): cleanups.o.
2758         (cleanups.o): New rule.
2759
2760 2014-08-29  Gary Benson  <gbenson@redhat.com>
2761
2762         * utils.c (internal_vwarning): New function.
2763
2764 2014-08-28  Gary Benson  <gbenson@redhat.com>
2765
2766         * utils.h (fatal): Remove declaration.
2767         * utils.c (fatal): Remove function.
2768
2769 2014-08-28  Gary Benson  <gbenson@redhat.com>
2770
2771         * tracepoint.c (gdb_agent_init): Replace fatal with
2772         perror_with_name.
2773         (initialize_tracepoint): Likewise.
2774
2775 2014-08-28  Gary Benson  <gbenson@redhat.com>
2776
2777         * remote-utils.c (remote_prepare): Replace fatal with error.
2778
2779 2014-08-28  Gary Benson  <gbenson@redhat.com>
2780
2781         * linux-low.c (linux_async): Replace fatal with warning.
2782         Tidy up and return.
2783         (linux_start_non_stop): Return -1 if linux_async failed.
2784
2785 2014-08-28  Gary Benson  <gbenson@redhat.com>
2786
2787         * linux-x86-low.c (i386_dr_low_set_addr): Replace check with
2788         gdb_assert.
2789         (i386_dr_low_get_addr): Remove vague comment.
2790         * win32-i386-low.c (i386_dr_low_set_addr): Replace check with
2791         gdb_assert.
2792
2793 2014-08-28  Gary Benson  <gbenson@redhat.com>
2794
2795         * inferiors.c (get_thread_process): Replace check with gdb_assert.
2796         * linux-low.c (linux_wait_for_event_filtered): Replace fatal with
2797         internal_error.
2798         (linux_resume_one_lwp): Likewise.
2799         * linux-x86-low.c (x86_siginfo_fixup): Replace checks with
2800         gdb_assert.
2801         * mem-break.c (raw_bkpt_type_to_target_hw_bp_type): Replace fatal
2802         with internal_error.
2803         * regcache.c (get_thread_regcache): Replace check with gdb_assert.
2804         (init_register_cache): Replace fatal with gdb_assert_not_reached.
2805         (find_register_by_name): Replace fatal with internal_error.
2806         (find_regno): Likewise.
2807         * tdesc.c (init_target_desc): Replace check with gdb_assert.
2808         * thread-db.c (thread_db_create_event): Likewise.
2809         (thread_db_load_search): Likewise.
2810         (try_thread_db_load_1): Likewise.
2811         * tracepoint.c (get_jump_space_head): Replace fatal with
2812         internal_error.
2813         (claim_trampoline_space): Likewise.
2814         (have_fast_tracepoint_trampoline_buffer): Likewise.
2815         (cmd_qtstart): Likewise.
2816         (stop_tracing): Likewise.
2817         (fast_tracepoint_collecting): Likewise.
2818         (target_malloc): Likewise.
2819         (download_tracepoint): Likewise.
2820         (download_trace_state_variables): Replace check with gdb_assert.
2821         (upload_fast_traceframes): Replace fatal with internal_error.
2822
2823 2014-08-19  Tom Tromey  <tromey@redhat.com>
2824             Gary Benson  <gbenson@redhat.com>
2825
2826         * Makefile.in (SFILES): Add common/common-debug.c.
2827         (OBS): Add common-debug.o.
2828         (common-debug.o): New rule.
2829         * debug.h (debug_printf): Don't declare.
2830         * debug.c (debug_printf): Renamed and rewritten as...
2831         (debug_vprintf): New function.
2832
2833 2014-08-19  Gary Benson  <gbenson@redhat.com>
2834
2835         * utils.h: Do not include print-utils.h.
2836
2837 2014-08-19  Tom Tromey  <tromey@redhat.com>
2838             Gary Benson  <gbenson@redhat.com>
2839
2840         * server.h: Add static assertion.
2841         (gdb_byte, CORE_ADDR, LONGEST, ULONGEST): Remove.
2842
2843 2014-08-19  Tom Tromey  <tromey@redhat.com>
2844             Gary Benson  <gbenson@redhat.com>
2845
2846         * Makefile.in (SFILES): Add common/errors.c.
2847         (OBS): Add errors.o.
2848         (IPA_OBS): Add errors-ipa.o.
2849         (errors.o): New rule.
2850         (errors-ipa.o): Likewise.
2851         * utils.h (perror_with_name, error, warning): Don't declare.
2852         * utils.c (warning): Renamed and rewritten as...
2853         (vwarning): New function.
2854         (error): Renamed and rewritten as...
2855         (verror): New function.
2856         (internal_error): Renamed and rewritten as...
2857         (internal_verror): New function.
2858
2859 2014-08-07  Gary Benson  <gbenson@redhat.com>
2860
2861         * configure.ac (AC_CHECK_HEADERS): Remove errno.h.
2862         * configure: Regenerate.
2863         * config.in: Likewise.
2864         * server.h: Do not include errno.h.
2865         * event-loop.c: Likewise.
2866         * hostio-errno.c: Likewise.
2867         * linux-low.c: Likewise.
2868         * remote-utils.c: Likewise.
2869         * spu-low.c: Likewise.
2870         * utils.c: Likewise.
2871         * gdbreplay.c: Unconditionally include errno.h.
2872
2873 2014-08-07  Gary Benson  <gbenson@redhat.com>
2874
2875         * server.h: Do not include string.h.
2876         * event-loop.c: Likewise.
2877         * linux-low.c: Likewise.
2878         * regcache.c: Likewise.
2879         * remote-utils.c: Likewise.
2880         * spu-low.c: Likewise.
2881         * utils.c: Likewise.
2882
2883 2014-08-07  Gary Benson  <gbenson@redhat.com>
2884
2885         * server.h: Do not include gdb_assert.h.
2886
2887 2014-08-07  Gary Benson  <gbenson@redhat.com>
2888
2889         * server.h: Do not include common-utils.h.
2890
2891 2014-08-07  Gary Benson  <gbenson@redhat.com>
2892
2893         * server.h: Do not include ptid.h.
2894         * notif.h: Likewise.
2895
2896 2014-08-07  Gary Benson  <gbenson@redhat.com>
2897
2898         * server.h: Do not include gdb_locale.h.
2899
2900 2014-08-07  Gary Benson  <gbenson@redhat.com>
2901
2902         * server.h: Do not include gdb/signals.h.
2903         * win32-low.c: Likewise.
2904
2905 2014-08-07  Gary Benson  <gbenson@redhat.com>
2906
2907         * server.h: Do not include pathmax.h.
2908
2909 2014-08-07  Gary Benson  <gbenson@redhat.com>
2910
2911         * server.h: Do not include libiberty.h.
2912         * linux-bfin-low.c: Likewise.
2913
2914 2014-08-07  Gary Benson  <gbenson@redhat.com>
2915
2916         * server.h: Do not include ansidecl.h.
2917
2918 2014-08-07  Gary Benson  <gbenson@redhat.com>
2919
2920         * linux-x86-low.c: Do not include stddef.h.
2921         * lynx-ppc-low.c: Likewise.
2922         * tracepoint.c: Likewise.
2923
2924 2014-08-07  Gary Benson  <gbenson@redhat.com>
2925
2926         * server.h: Do not include stdarg.h.
2927         * nto-low.c: Likewise.
2928
2929 2014-08-07  Gary Benson  <gbenson@redhat.com>
2930
2931         * server.h: Do not include stdlib.h.
2932         * inferiors.c: Likewise.
2933         * linux-low.c: Likewise.
2934         * regcache.c: Likewise.
2935         * spu-low.c: Likewise.
2936         * tracepoint.c: Likewise.
2937         * utils.c: Likewise.
2938
2939 2014-08-07  Gary Benson  <gbenson@redhat.com>
2940
2941         * server.h: Do not include stdio.h.
2942         * linux-low.c: Likewise.
2943         * remote-utils.c: Likewise.
2944         * spu-low.c: Likewise.
2945         * utils.c: Likewise.
2946         * wincecompat.c: Likewise.
2947
2948 2014-08-06  Gary Benson  <gbenson@redhat.com>
2949
2950         * regcache.c (init_register_cache): Move conditionals inside if.
2951
2952 2014-08-06  Gary Benson  <gbenson@redhat.com>
2953
2954         * linux-low.c (linux_supports_non_stop): Use target_is_async_p.
2955
2956 2014-07-31  Gary Benson  <gbenson@redhat.com>
2957
2958         * ax.h: Do not include server.h.
2959         * gdbthread.h: Likewise.
2960         * lynx-low.h: Likewise.
2961         * notif.h: Likewise.
2962
2963 2014-07-30  Gary Benson  <gbenson@redhat.com>
2964
2965         * server.h: Include common-defs.h.
2966         Do not include config.h or build-gnulib-gdbserver/config.h.
2967
2968 2014-07-30  Gary Benson  <gbenson@redhat.com>
2969
2970         * hostio-errno.c: Move server.h to top of includes list.
2971         * inferiors.c: Likewise.
2972         * linux-x86-low.c: Likewise.
2973         * notif.c: Include server.h.
2974
2975 2014-07-24  Tom Tromey  <tromey@redhat.com>
2976             Gary Benson  <gbenson@redhat.com>
2977
2978         * server.h (CORE_ADDR): Now unsigned.
2979
2980 2014-07-16  Pedro Alves  <palves@redhat.com>
2981
2982         * linux-low.c (linux_kill_one_lwp): Use kill_lwp, not kill.
2983
2984 2014-07-15  Pedro Alves  <palves@redhat.com>
2985
2986         * linux-low.c (linux_kill_one_lwp): Save errno and work with saved
2987         copy.
2988
2989 2014-07-11  Pedro Alves  <palves@redhat.com>
2990
2991         * linux-low.c (kill_wait_lwp): New function, based on
2992         kill_one_lwp_callback, but use my_waitpid directly.
2993         (kill_one_lwp_callback, linux_kill): Use it.
2994
2995 2014-06-23  Pedro Alves  <palves@redhat.com>
2996
2997         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR_CONTROL
2998         before setting DR0..DR3.
2999
3000 2014-06-20  Gary Benson  <gbenson@redhat.com>
3001
3002         * configure.ac (AC_REPLACE_FUNCS) <vasprintf, vsnprintf>: Removed.
3003         * configure: Regenerated.
3004         * config.in: Likewise.
3005
3006 2014-06-20  Gary Benson  <gbenson@redhat.com>
3007
3008         * Makefile.in (SFILES): Update locations for files moved
3009         from common to nat.
3010         (object file files): Reordered.
3011
3012 2014-06-20  Gary Benson  <gbenson@redhat.com>
3013
3014         * i386-low.h (i386_dr_low_can_set_addr): Removed.
3015         (i386_dr_low_set_addr): Likewise.
3016         (i386_dr_low_get_addr): Likewise.
3017         (i386_dr_low_can_set_control): Likewise.
3018         (i386_dr_low_set_control): Likewise.
3019         (i386_dr_low_get_control): Likewise.
3020         (i386_dr_low_get_status): Likewise.
3021         (i386_get_debug_register_length): Likewise.
3022         * linux-x86-low.c (i386_dr_low_set_addr):
3023         Changed signature.  Made static.
3024         (i386_dr_low_get_addr): Likewise.
3025         (i386_dr_low_set_control): Likewise.
3026         (i386_dr_low_get_control): Likewise.
3027         (i386_dr_low_get_status): Likewise.
3028         (i386_dr_low): New global variable.
3029         * win32-i386-low.c (i386_dr_low_set_addr):
3030         Changed signature.  Made static.
3031         (i386_dr_low_get_addr): Likewise.
3032         (i386_dr_low_set_control): Likewise.
3033         (i386_dr_low_get_control): Likewise.
3034         (i386_dr_low_get_status): Likewise.
3035         (i386_dr_low): New global variable.
3036
3037 2014-06-20  Marcus Shawcroft  <marcus.shawcroft@arm.com>
3038
3039         * configure.ac: Invoke. AC_CHECK_TOOL(AR, ar).
3040         * Makefile.in (AR, AR_FLAGS): Define.
3041         * configure: Regenerate.
3042
3043 2014-06-19  Gary Benson  <gbenson@redhat.com>
3044
3045         * Makefile.in (i386-dregs.o): New rule.
3046         * configure.srv: Add i386-dregs.o to all targets using i386-low.o.
3047         * i386-low.c (target.h): Remove include.
3048         (TARGET_HAS_DR_LEN_8): Now in i386-dregs.c.
3049         (DR_CONTROL_SHIFT): Likewise.
3050         (DR_CONTROL_SIZE): Likewise.
3051         (DR_RW_EXECUTE): Likewise.
3052         (DR_RW_WRITE): Likewise.
3053         (DR_RW_READ): Likewise.
3054         (DR_RW_IORW): Likewise.
3055         (DR_LEN_1): Likewise.
3056         (DR_LEN_2): Likewise.
3057         (DR_LEN_4): Likewise.
3058         (DR_LEN_8): Likewise.
3059         (DR_LOCAL_ENABLE_SHIFT): Likewise.
3060         (DR_GLOBAL_ENABLE_SHIFT): Likewise.
3061         (DR_ENABLE_SIZE): Likewise.
3062         (DR_LOCAL_SLOWDOWN): Likewise.
3063         (DR_GLOBAL_SLOWDOWN): Likewise.
3064         (DR_CONTROL_RESERVED): Likewise.
3065         (I386_DR_CONTROL_MASK): Likewise.
3066         (I386_DR_VACANT): Likewise.
3067         (I386_DR_LOCAL_ENABLE): Likewise.
3068         (I386_DR_GLOBAL_ENABLE): Likewise.
3069         (I386_DR_DISABLE): Likewise.
3070         (I386_DR_SET_RW_LEN): Likewise.
3071         (I386_DR_GET_RW_LEN): Likewise.
3072         (I386_DR_WATCH_HIT): Likewise.
3073         (i386_wp_op_t): Likewise.
3074         (i386_show_dr): Likewise.
3075         (i386_length_and_rw_bits): Likewise.
3076         (i386_insert_aligned_watchpoint): Likewise.
3077         (i386_remove_aligned_watchpoint): Likewise.
3078         (i386_handle_nonaligned_watchpoint): Likewise.
3079         i386_update_inferior_debug_regs(): Likewise.
3080         (i386_dr_insert_watchpoint): Likewise.
3081         (i386_dr_remove_watchpoint): Likewise.
3082         (i386_dr_region_ok_for_watchpoint): Likewise.
3083         (i386_dr_stopped_data_address): Likewise.
3084         (i386_dr_stopped_by_watchpoint): Likewise.
3085
3086 2014-06-19  Gary Benson  <gbenson@redhat.com>
3087
3088         * i386-low.c (i386_dr_show): Renamed to
3089         i386_show_dr and made static.  All uses updated.
3090         (i386_dr_length_and_rw_bits): Renamed to
3091         i386_length_and_rw_bits and made static.
3092         All uses updated.
3093         (i386_dr_insert_aligned_watchpoint): Renamed to
3094         i386_insert_aligned_watchpoint and made static.
3095         All uses updated.
3096         (i386_dr_remove_aligned_watchpoint): Renamed to
3097         i386_remove_aligned_watchpoint and made static.
3098         All uses updated.
3099         (i386_dr_update_inferior_debug_regs): Renamed to
3100         i386_update_inferior_debug_regs and made static.
3101         All uses updated.
3102
3103 2014-06-18  Gary Benson  <gbenson@redhat.com>
3104
3105         * i386-low.h (i386_dr_low_can_set_addr): New macro.
3106         (i386_dr_low_can_set_control): Likewise.
3107         (i386_get_debug_register_length): Likewise.
3108         * i386-low.c (i386_dr_low_can_set_addr): Now in i386-low.h.
3109         (i386_dr_low_can_set_control): Likewise.
3110         (i386_get_debug_register_length): Likewise.
3111
3112 2014-06-17  Gary Benson  <gbenson@redhat.com>
3113
3114         * i386-low.h (i386-dregs.h): New include.
3115         (DR_FIRSTADDR): Now in i386-dregs.h.
3116         (DR_LASTADDR): Likewise.
3117         (DR_NADDR): Likewise.
3118         (DR_STATUS): Likewise.
3119         (DR_CONTROL): Likewise.
3120         (i386_debug_reg_state): Likewise.
3121         (i386_dr_insert_watchpoint): Likewise.
3122         (i386_dr_remove_watchpoint): Likewise.
3123         (i386_dr_region_ok_for_watchpoint): Likewise.
3124         (i386_dr_stopped_data_address): Likewise.
3125         (i386_dr_stopped_by_watchpoint): Likewise.
3126         * i386-low.c (ALL_DEBUG_REGISTERS): Likewise.
3127
3128 2014-06-18  Gary Benson  <gbenson@redhat.com>
3129
3130         * i386-low.h (i386_low_insert_watchpoint): Renamed to
3131         i386_dr_insert_watchpoint.
3132         (i386_low_remove_watchpoint): Renamed to
3133         i386_dr_remove_watchpoint.
3134         (i386_low_region_ok_for_watchpoint): Renamed to
3135         i386_dr_region_ok_for_watchpoint.
3136         (i386_low_stopped_data_address): Renamed to
3137         i386_dr_stopped_data_address.
3138         (i386_low_stopped_by_watchpoint): Renamed to
3139         i386_dr_stopped_by_watchpoint.
3140         * i386-low.c (i386_show_dr): Renamed to
3141         i386_dr_show and made nonstatic.  All uses updated.
3142         (i386_length_and_rw_bits): Renamed to
3143         i386_dr_length_and_rw_bits and made nonstatic.
3144         All uses updated.
3145         (i386_insert_aligned_watchpoint): Renamed to
3146         i386_dr_insert_aligned_watchpoint and made nonstatic.
3147         All uses updated.
3148         (i386_remove_aligned_watchpoint): Renamed to
3149         i386_dr_remove_aligned_watchpoint and made nonstatic.
3150         All uses updated.
3151         (i386_update_inferior_debug_regs): Renamed to
3152         i386_dr_update_inferior_debug_regs and made nonstatic.
3153         All uses updated.
3154         (i386_low_insert_watchpoint): Renamed to
3155         i386_dr_insert_watchpoint.  All uses updated.
3156         (i386_low_remove_watchpoint): Renamed to
3157         i386_dr_remove_watchpoint.  All uses updated.
3158         (i386_low_region_ok_for_watchpoint): Renamed to
3159         i386_dr_region_ok_for_watchpoint.  All uses updated.
3160         (i386_low_stopped_data_address): Renamed to
3161         i386_dr_stopped_data_address.  All uses updated.
3162         (i386_low_stopped_by_watchpoint): Renamed to
3163         i386_dr_stopped_by_watchpoint.  All uses updated.
3164
3165 2014-06-18  Gary Benson  <gbenson@redhat.com>
3166
3167         * i386-low.c (i386_dr_low_can_set_addr): New macro.
3168         (i386_dr_low_can_set_control): Likewise.
3169         (i386_insert_aligned_watchpoint): New check.
3170
3171 2014-06-18  Gary Benson  <gbenson@redhat.com>
3172
3173         * i386-low.c (i386_update_inferior_debug_regs) <inf_state>:
3174         Renamed to state.
3175
3176 2014-06-18  Gary Benson  <gbenson@redhat.com>
3177
3178         * i386-low.c (i386_length_and_rw_bits): Use internal_error
3179         instead of fatal and error.
3180         (i386_handle_nonaligned_watchpoint): Likewise.
3181
3182 2014-06-18  Gary Benson  <gbenson@redhat.com>
3183
3184         * i386-low.c (i386_get_debug_register_length): New macro.
3185         (TARGET_HAS_DR_LEN_8): Remove conditional.  Use above macro.
3186         (i386_show_dr): Use debug_printf instead of fprintf.  Use
3187         phex to format values.
3188
3189 2014-06-18  Gary Benson  <gbenson@redhat.com>
3190
3191         * i386-low.h: Comment changes.
3192         * i386-low.c: Likewise.
3193
3194 2014-06-18  Gary Benson  <gbenson@redhat.com>
3195
3196         * i386-low.c: Whitespace changes.
3197
3198 2014-06-12  Tom Tromey  <tromey@redhat.com>
3199
3200         * utils.c (freeargv): Remove.
3201
3202 2014-06-12  Tom Tromey  <tromey@redhat.com>
3203
3204         * debug.c (debug_printf): Remove HAVE_GETTIMEOFDAY checks.
3205         * server.c (monitor_show_help): Remove HAVE_GETTIMEOFDAY check.
3206         (parse_debug_format_options): Likewise.
3207         (gdbserver_usage): Likewise.
3208         * Makefile.in (LIBIBERTY_BUILDDIR, LIBIBERTY): New variables.
3209         (SUBDIRS, REQUIRED_SUBDIRS): Add libiberty.
3210         (gdbserver$(EXEEXT), gdbreplay$(EXEEXT)): Depend on and link
3211         against libiberty.
3212         ($(LIBGNU)): Depend on libiberty.
3213         (all-lib): Recurse into all subdirs.
3214         (install-only): Invoke "install" target in subdirs.
3215         (vasprintf.o, vsnprintf.o, safe-ctype.o, lbasename.o): Remove
3216         targets.
3217         * configure: Rebuild.
3218         * configure.ac: Add ACX_CONFIGURE_DIR for libiberty.  Don't check
3219         for vasprintf, vsnprintf, or gettimeofday.
3220         * configure.srv: Don't add safe-ctype.o or lbasename.o to
3221         srv_tgtobj.
3222
3223 2014-06-05  Joel Brobecker  <brobecker@adacore.com>
3224
3225         * development.sh: Delete.
3226         * Makefile.in (config.status): Adjust dependency on development.sh.
3227         * configure.ac: Adjust development.sh source call.
3228         * configure: Regenerate.
3229
3230 2014-06-02  Pedro Alves  <palves@redhat.com>
3231
3232         * ax.c (gdb_free_agent_expr): New function.
3233         * ax.h (gdb_free_agent_expr): New declaration.
3234         * mem-break.c (delete_gdb_breakpoint_1): Also clear the commands
3235         list.
3236         (clear_breakpoint_conditions, clear_breakpoint_commands): Make
3237         static.
3238         (clear_breakpoint_conditions_and_commands): New function.
3239         * mem-break.h (clear_breakpoint_conditions): Delete declaration.
3240         (clear_breakpoint_conditions_and_commands): New declaration.
3241
3242 2014-05-23  Ramana Radhakrishnan  <ramana.radhakrishnan@arm.com>
3243
3244         * linux-aarch64-low.c (asm/ptrace.h): Include.
3245
3246 2014-05-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
3247
3248         Fix TLS access for -static -pthread.
3249         * gdbserver/thread-db.c (struct thread_db): Add td_thr_tlsbase_p.
3250         (thread_db_get_tls_address): Call it if LOAD_MODULE is zero.
3251         (thread_db_load_search, try_thread_db_load_1): Initialize it.
3252
3253 2014-05-20  Pedro Alves  <palves@redhat.com>
3254
3255         * linux-aarch64-low.c (aarch64_insert_point)
3256         (aarch64_remove_point): No longer check whether the type is
3257         supported here.  Adjust to new interface.
3258         (the_low_target): Install aarch64_supports_z_point_type as
3259         supports_z_point_type method.
3260         * linux-arm-low.c (raw_bkpt_type_to_arm_hwbp_type): New function.
3261         (arm_linux_hw_point_initialize): Take an enum raw_bkpt_type
3262         instead of a Z packet char.  Adjust.
3263         (arm_supports_z_point_type): New function.
3264         (arm_insert_point, arm_remove_point): Adjust to new interface.
3265         (the_low_target): Install arm_supports_z_point_type.
3266         * linux-crisv32-low.c (cris_supports_z_point_type): New function.
3267         (cris_insert_point, cris_remove_point): Adjust to new interface.
3268         Don't check whether the type is supported here.
3269         (the_low_target): Install cris_supports_z_point_type.
3270         * linux-low.c (linux_supports_z_point_type): New function.
3271         (linux_insert_point, linux_remove_point): Adjust to new interface.
3272         * linux-low.h (struct linux_target_ops) <insert_point,
3273         remove_point>: Take an enum raw_bkpt_type instead of a char.  Add
3274         raw_breakpoint pointer parameter.
3275         <supports_z_point_type>: New method.
3276         * linux-mips-low.c (mips_supports_z_point_type): New function.
3277         (mips_insert_point, mips_remove_point): Adjust to new interface.
3278         Use mips_supports_z_point_type.
3279         (the_low_target): Install mips_supports_z_point_type.
3280         * linux-ppc-low.c (the_low_target): Install NULL as
3281         supports_z_point_type method.
3282         * linux-s390-low.c (the_low_target): Install NULL as
3283         supports_z_point_type method.
3284         * linux-sparc-low.c (the_low_target): Install NULL as
3285         supports_z_point_type method.
3286         * linux-x86-low.c (x86_supports_z_point_type): New function.
3287         (x86_insert_point): Adjust to new insert_point interface.  Use
3288         insert_memory_breakpoint.  Adjust to new
3289         i386_low_insert_watchpoint interface.
3290         (x86_remove_point): Adjust to remove_point interface.  Use
3291         remove_memory_breakpoint.  Adjust to new
3292         i386_low_remove_watchpoint interface.
3293         (the_low_target): Install x86_supports_z_point_type.
3294         * lynx-low.c (lynx_target_ops): Install NULL as
3295         supports_z_point_type callback.
3296         * nto-low.c (nto_supports_z_point_type): New.
3297         (nto_insert_point, nto_remove_point): Adjust to new interface.
3298         (nto_target_ops): Install nto_supports_z_point_type.
3299         * mem-break.c: Adjust intro comment.
3300         (struct raw_breakpoint) <raw_type, size>: New fields.
3301         <inserted>: Update comment.
3302         <shlib_disabled>: Delete field.
3303         (enum bkpt_type) <gdb_breakpoint>: Delete value.
3304         <gdb_breakpoint_Z0, gdb_breakpoint_Z1, gdb_breakpoint_Z2,
3305         gdb_breakpoint_Z3, gdb_breakpoint_Z4>: New values.
3306         (raw_bkpt_type_to_target_hw_bp_type): New function.
3307         (find_enabled_raw_code_breakpoint_at): New function.
3308         (find_raw_breakpoint_at): New type and size parameters.  Use them.
3309         (insert_memory_breakpoint): New function, based off
3310         set_raw_breakpoint_at.
3311         (remove_memory_breakpoint): New function.
3312         (set_raw_breakpoint_at): Reimplement.
3313         (set_breakpoint): New, based on set_breakpoint_at.
3314         (set_breakpoint_at): Reimplement.
3315         (delete_raw_breakpoint): Go through the_target->remove_point
3316         instead of assuming memory breakpoints.
3317         (find_gdb_breakpoint_at): Delete.
3318         (Z_packet_to_bkpt_type, Z_packet_to_raw_bkpt_type): New functions.
3319         (find_gdb_breakpoint): New function.
3320         (set_gdb_breakpoint_at): Delete.
3321         (z_type_supported): New function.
3322         (set_gdb_breakpoint_1): New function, loosely based off
3323         set_gdb_breakpoint_at.
3324         (check_gdb_bp_preconditions, set_gdb_breakpoint): New functions.
3325         (delete_gdb_breakpoint_at): Delete.
3326         (delete_gdb_breakpoint_1): New function, loosely based off
3327         delete_gdb_breakpoint_at.
3328         (delete_gdb_breakpoint): New function.
3329         (clear_gdb_breakpoint_conditions): Rename to ...
3330         (clear_breakpoint_conditions): ... this.  Don't handle a NULL
3331         breakpoint.
3332         (add_condition_to_breakpoint): Make static.
3333         (add_breakpoint_condition): Take a struct breakpoint pointer
3334         instead of an address.  Adjust.
3335         (gdb_condition_true_at_breakpoint): Rename to ...
3336         (gdb_condition_true_at_breakpoint_z_type): ... this, and add
3337         z_type parameter.
3338         (gdb_condition_true_at_breakpoint): Reimplement.
3339         (add_breakpoint_commands): Take a struct breakpoint pointer
3340         instead of an address.  Adjust.
3341         (gdb_no_commands_at_breakpoint): Rename to ...
3342         (gdb_no_commands_at_breakpoint_z_type): ... this.  Add z_type
3343         parameter.  Return true if no breakpoint was found.  Change debug
3344         output.
3345         (gdb_no_commands_at_breakpoint): Reimplement.
3346         (run_breakpoint_commands): Rename to ...
3347         (run_breakpoint_commands_z_type): ... this.  Add z_type parameter,
3348         and change return type to boolean.
3349         (run_breakpoint_commands): New function.
3350         (gdb_breakpoint_here): Also check for Z1 breakpoints.
3351         (uninsert_raw_breakpoint): Don't try to reinsert a disabled
3352         breakpoint.  Go through the_target->remove_point instead of
3353         assuming memory breakpoint.
3354         (uninsert_breakpoints_at, uninsert_all_breakpoints): Uninsert
3355         software and hardware breakpoints.
3356         (reinsert_raw_breakpoint): Go through the_target->insert_point
3357         instead of assuming memory breakpoint.
3358         (reinsert_breakpoints_at, reinsert_all_breakpoints): Reinsert
3359         software and hardware breakpoints.
3360         (check_breakpoints, breakpoint_here, breakpoint_inserted_here):
3361         Check both software and hardware breakpoints.
3362         (validate_inserted_breakpoint): Assert the breakpoint is a
3363         software breakpoint.  Set the inserted flag to -1 instead of
3364         setting shlib_disabled.
3365         (delete_disabled_breakpoints): Adjust.
3366         (validate_breakpoints): Only validate software breakpoints.
3367         Adjust to inserted flag change.
3368         (check_mem_read, check_mem_write): Skip breakpoint types other
3369         than software breakpoints.  Adjust to inserted flag change.
3370         * mem-break.h (enum raw_bkpt_type): New enum.
3371         (raw_breakpoint, struct process_info): Forward declare.
3372         (Z_packet_to_target_hw_bp_type): Delete declaration.
3373         (raw_bkpt_type_to_target_hw_bp_type, Z_packet_to_raw_bkpt_type)
3374         (set_gdb_breakpoint, delete_gdb_breakpoint)
3375         (clear_breakpoint_conditions): New declarations.
3376         (set_gdb_breakpoint_at, clear_gdb_breakpoint_conditions): Delete.
3377         (breakpoint_inserted_here): Update comment.
3378         (add_breakpoint_condition, add_breakpoint_commands): Replace
3379         address parameter with a breakpoint pointer parameter.
3380         (gdb_breakpoint_here): Update comment.
3381         (delete_gdb_breakpoint_at): Delete.
3382         (insert_memory_breakpoint, remove_memory_breakpoint): Declare.
3383         * server.c (process_point_options): Take a struct breakpoint
3384         pointer instead of an address.  Adjust.
3385         (process_serial_event) <Z/z packets>: Use set_gdb_breakpoint and
3386         delete_gdb_breakpoint.
3387         * spu-low.c (spu_target_ops): Install NULL as
3388         supports_z_point_type method.
3389         * target.h: Include mem-break.h.
3390         (struct target_ops) <prepare_to_access_memory>: Update comment.
3391         <supports_z_point_type>: New field.
3392         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3393         instead of a char.  Also take a raw breakpoint pointer.
3394         * win32-arm-low.c (the_low_target): Install NULL as
3395         supports_z_point_type.
3396         * win32-i386-low.c (i386_supports_z_point_type): New function.
3397         (i386_insert_point, i386_remove_point): Adjust to new interface.
3398         (the_low_target): Install i386_supports_z_point_type.
3399         * win32-low.c (win32_supports_z_point_type): New function.
3400         (win32_insert_point, win32_remove_point): Adjust to new interface.
3401         (win32_target_ops): Install win32_supports_z_point_type.
3402         * win32-low.h (struct win32_target_ops):
3403         <supports_z_point_type>: New method.
3404         <insert_point, remove_point>: Take an enum raw_bkpt_type argument
3405         instead of a char.  Also take a raw breakpoint pointer.
3406
3407 2014-05-20  Pedro Alves  <palves@redhat.com>
3408
3409         * mem-break.h: Include break-common.h.
3410         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3411         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): New defines.
3412         (Z_packet_to_target_hw_bp_type): New declaration.
3413         * mem-break.c (Z_packet_to_target_hw_bp_type): New function.
3414         * i386-low.c (Z_PACKET_HW_BP, Z_PACKET_WRITE_WP, Z_PACKET_READ_WP)
3415         (Z_PACKET_ACCESS_WP): Delete macros.
3416         (Z_packet_to_hw_type): Delete function.
3417         * i386-low.h: Don't include break-common.h here.
3418         (Z_packet_to_hw_type): Delete declaration.
3419         * linux-x86-low.c (x86_insert_point, x86_insert_point): Call
3420         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3421         * win32-i386-low.c (i386_insert_point, i386_remove_point): Call
3422         Z_packet_to_target_hw_bp_type instead of Z_packet_to_hw_type.
3423         * linux-aarch64-low.c: Don't include break-common.h here.
3424         (Z_PACKET_SW_BP, Z_PACKET_HW_BP, Z_PACKET_WRITE_WP)
3425         (Z_PACKET_READ_WP, Z_PACKET_ACCESS_WP): Delete macros.
3426         (Z_packet_to_target_hw_bp_type): Delete function.
3427         * linux-mips-low.c (rsp_bp_type_to_target_hw_bp_type): Delete
3428         function.
3429         (mips_insert_point, mips_remove_point): Use
3430         Z_packet_to_target_hw_bp_type.
3431
3432 2014-05-20  Pedro Alves  <palves@redhat.com>
3433
3434         * linux-aarch64-low.c: Include break-common.h.
3435         (enum target_point_type): Delete.
3436         (Z_packet_to_point_type): Rename to ...
3437         (Z_packet_to_target_hw_bp_type): ... this, and return a
3438         target_hw_bp_type instead.
3439         (aarch64_show_debug_reg_state): Take an enum target_hw_bp_type
3440         instead of an enum target_point_type.
3441         (aarch64_point_encode_ctrl_reg): Likewise.  Compute type mask from
3442         breakpoint type.
3443         (aarch64_dr_state_insert_one_point)
3444         (aarch64_dr_state_remove_one_point, aarch64_handle_breakpoint)
3445         (aarch64_handle_aligned_watchpoint)
3446         (aarch64_handle_unaligned_watchpoint, aarch64_handle_watchpoint):
3447         Take an enum target_hw_bp_type instead of an enum
3448         target_point_type.
3449         (aarch64_supports_z_point_type): New function.
3450         (aarch64_insert_point, aarch64_remove_point): Use it.  Adjust to
3451         use Z_packet_to_target_hw_bp_type.
3452
3453 2014-05-20  Joel Brobecker  <brobecker@adacore.com>
3454
3455         * configure.ac: Only use -Werror by default when DEVELOPMENT
3456         is true.
3457         * configure: Regenerate.
3458
3459 2014-05-19  Jan Kratochvil  <jan.kratochvil@redhat.com>
3460
3461         Fix gdbserver qGetTLSAddr for x86_64 -m32.
3462         * linux-x86-low.c (X86_64_USER_REGS): New.
3463         (x86_fill_gregset): Call memset for BUF first in x86_64 -m32 case.
3464
3465 2014-04-28  Yao Qi  <yao@codesourcery.com>
3466
3467         * Makefile.in (i386-avx512.c): Fix the typo of generated file
3468         name.
3469
3470 2014-04-25  Pedro Alves  <palves@redhat.com>
3471
3472         PR server/16255
3473         * linux-low.c (linux_attach_fail_reason_string): New function.
3474         (linux_attach_lwp): Delete.
3475         (linux_attach_lwp_1): Rename to ...
3476         (linux_attach_lwp): ... this.  Take a ptid instead of a pid as
3477         argument.  Remove "initial" parameter.  Return int instead of
3478         void.  Don't error or warn here.
3479         (linux_attach): Adjust to call linux_attach_lwp.  Call error on
3480         failure to attach to the tgid.  Call warning when failing to
3481         attach to an lwp.
3482         * linux-low.h (linux_attach_lwp): Take a ptid instead of a pid as
3483         argument.  Remove "initial" parameter.  Return int instead of
3484         void.  Don't error or warn here.
3485         (linux_attach_fail_reason_string): New declaration.
3486         * thread-db.c (attach_thread): Adjust to linux_attach_lwp's
3487         interface change.  Use linux_attach_fail_reason_string.
3488
3489 2014-04-24  Michael Sturm  <michael.sturm@mintel.com>
3490             Walfred Tedeschi  <walfred.tedeschi@intel.com>
3491
3492         * Makefile.in: Added rules to handle new files
3493         i386-avx512.c i386-avx512-linux.c amd64-avx512.c
3494         amd64-avx512-linux.c x32-avx512.c x32-avx512-linux.c.
3495         * configure.srv (srv_i386_regobj): Add i386-avx512.o.
3496         (srv_i386_linux_regobj): Add i386-avx512-linux.o.
3497         (srv_amd64_regobj): Add amd64-avx512.o and x32-avx512.o.
3498         (srv_amd64_linux_regobj): Add amd64-avx512-linux.o and
3499         x32-avx512-linux.o.
3500         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx512.xml.
3501         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx512.xml.
3502         (srv_amd64_xmlfiles): Add i386/amd64-avx512.xml and
3503         i386/x32-avx512.xml.
3504         (srv_i386_linux_xmlfiles): Add i386/i386-avx512-linux.xml.
3505         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx512-linux.xml and
3506         i386/x32-avx512-linux.xml.
3507         * i387-fp.c (num_avx512_k_registers): New constant for number
3508         of K registers.
3509         (num_avx512_zmmh_low_registers): New constant for number of
3510         lower ZMM registers (0-15).
3511         (num_avx512_zmmh_high_registers): New constant for number of
3512         higher ZMM registers (16-31).
3513         (num_avx512_ymmh_registers): New contant for number of higher
3514         YMM registers (ymm16-31 added by avx521 on x86_64).
3515         (num_avx512_xmm_registers): New constant for number of higher
3516         XMM registers (xmm16-31 added by AVX512 on x86_64).
3517         (struct i387_xsave): Add space for AVX512 registers.
3518         (i387_cache_to_xsave): Change raw buffer size to 64 characters.
3519         Add code to handle AVX512 registers.
3520         (i387_xsave_to_cache): Add code to handle AVX512 registers.
3521         * linux-x86-low.c (init_registers_amd64_avx512_linux): New
3522         prototypei from generated file.
3523         (tdesc_amd64_avx512_linux): Likewise.
3524         (init_registers_x32_avx512_linux): Likewise.
3525         (tdesc_x32_avx512_linux): Likewise.
3526         (init_registers_i386_avx512_linux): Likewise.
3527         (tdesc_i386_avx512_linux): Likewise.
3528         (x86_64_regmap): Add AVX512 registers.
3529         (x86_linux_read_description): Add code to handle AVX512 XSTATE
3530         mask.
3531         (initialize_low_arch): Add code to initialize AVX512 registers.
3532
3533 2014-04-23  Pedro Alves  <palves@redhat.com>
3534
3535         * mem-break.c (find_gdb_breakpoint_at): Make static.
3536         * mem-break.h (find_gdb_breakpoint_at): Delete declaration.
3537
3538 2014-04-23  Pedro Alves  <palves@redhat.com>
3539
3540         * i386-low.c: Don't include break-common.h here.
3541         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3542         prototype to take target_hw_bp_type as argument instead of a Z
3543         packet char.
3544         * i386-low.h: Include break-common.h here.
3545         (Z_packet_to_hw_type): Declare.
3546         (i386_low_insert_watchpoint, i386_low_remove_watchpoint): Change
3547         prototypes.
3548         * linux-x86-low.c (x86_insert_point): Convert the packet number to
3549         a target_hw_bp_type before calling i386_low_insert_watchpoint.
3550         (x86_remove_point): Convert the packet number to a
3551         target_hw_bp_type before calling i386_low_remove_watchpoint.
3552         * win32-i386-low.c (i386_insert_point): Convert the packet number
3553         to a target_hw_bp_type before calling i386_low_insert_watchpoint.
3554         (i386_remove_point): Convert the packet number to a
3555         target_hw_bp_type before calling i386_low_remove_watchpoint.
3556
3557 2014-04-23  Pedro Alves  <palves@redhat.com>
3558
3559         * utils.h (perror_with_name): Add ATTRIBUTE_NORETURN.
3560
3561 2014-04-10  Pedro Alves  <palves@redhat.com>
3562
3563         * mem-break.c (add_breakpoint_condition, add_breakpoint_commands):
3564         Check if the condition or command is NULL before checking if the
3565         breakpoint is known.  On success, return true.
3566         * mem-break.h (add_breakpoint_condition): Document return.
3567         (add_breakpoint_commands): Add describing comment.
3568         * server.c (skip_to_semicolon): New function.
3569         (process_point_options): Use it.
3570
3571 2014-04-09  Pedro Alves  <palves@redhat.com>
3572
3573         * linux-low.c (linux_read_loadmap): Pass current_inferior directly
3574         to lwpid_of.
3575
3576 2014-02-27  Pedro Alves  <palves@redhat.com>
3577
3578         PR 12702
3579         * inferiors.h (A_I_NEXT, ALL_INFERIORS_TYPE, ALL_PROCESSES): New
3580         macros.
3581         * linux-low.c (delete_lwp, handle_extended_wait): Add debug
3582         output.
3583         (last_thread_of_process_p): Take a PID argument instead of a
3584         thread pointer.
3585         (linux_wait_for_lwp): Delete.
3586         (num_lwps, check_zombie_leaders, not_stopped_callback): New
3587         functions.
3588         (linux_low_filter_event): New function, party factored out from
3589         linux_wait_for_event.
3590         (linux_wait_for_event): Rename to ...
3591         (linux_wait_for_event_filtered): ... this.  Add new filter ptid
3592         argument.  Partly rewrite.  Always use waitpid(-1, WNOHANG) and
3593         sigsuspend.  Check for zombie leaders.
3594         (linux_wait_for_event): Reimplement as wrapper around
3595         linux_wait_for_event_filtered.
3596         (linux_wait_1): Handle TARGET_WAITKIND_NO_RESUMED.  Assume that if
3597         a normal or signal exit is seen, it's the whole process exiting.
3598         (wait_for_sigstop): No longer a for_each_inferior callback.
3599         Rewrite on top of linux_wait_for_event_filtered.
3600         (stop_all_lwps): Call wait_for_sigstop directly.
3601         * server.c (resume, handle_target_event): Handle
3602         TARGET_WAITKIND_NO_RESUMED.
3603
3604 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3605
3606         * win32-low.c (psapi_get_dll_name,
3607         * win32_CreateToolhelp32Snapshot): Delete.
3608         (win32_CreateToolhelp32Snapshot, win32_Module32First)
3609         (win32_Module32Next, load_toolhelp, toolhelp_get_dll_name):
3610         Delete.
3611         (handle_load_dll): Add function description.
3612         Remove code using psapi_get_dll_name and toolhelp_get_dll_name.
3613
3614 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3615
3616         * win32-low.c (win32_add_one_solib): Add 0x1000 to load_addr.
3617         Add comment.
3618         (win32_add_all_dlls): Remove 0x1000 offset applied to DLL
3619         base address when calling win32_add_one_solib.
3620         (handle_load_dll): Delete local variable load_addr.
3621         Remove 0x1000 offset applied to DLL base address when calling
3622         win32_add_one_solib.
3623         (handle_unload_dll): Add comment.
3624
3625 2014-02-26  Joel Brobecker  <brobecker@adacore.com>
3626
3627         * win32-low.c (win32_add_all_dlls): Renames
3628         win32_ensure_ntdll_loaded.  Rewrite function documentation.
3629         Adjust implementation to always load all DLLs.
3630         Add 0x1000 offset to DLL base address when calling
3631         win32_add_one_solib.
3632         (child_initialization_done): New static global.
3633         (do_initial_child_stuff): Set child_initialization_done to
3634         zero during child initialization, and 1 after.  Replace call
3635         to win32_ensure_ntdll_loaded by call to win32_add_all_dlls.
3636         Add comment.
3637         (match_dll_by_basename, dll_is_loaded_by_basename): Delete.
3638         (handle_unload_dll): Add function documentation.
3639         (get_child_debug_event): Ignore load and unload DLL events
3640         during child initialization.
3641
3642 2014-02-20  Doug Evans  <dje@google.com>
3643
3644         Remove global all_lwps.
3645         * inferiors.h (ptid_of): Move here from linux-low.h.
3646         (pid_of, lwpid_of): Ditto.
3647         * linux-aarch64-low.c (debug_reg_change_callback): Update, "entry"
3648         parameter is a struct thread_info * now.
3649         (aarch64_notify_debug_reg_change): Fetch pid from current_inferior
3650         directly.  Pass &all_threads to find_inferior instead of &all_lwps.
3651         (aarch64_stopped_data_address): Fetch lwpid from current_inferior
3652         directly.
3653         (aarch64_linux_prepare_to_resume): Fetch ptid from thread.
3654         (aarch64_arch_setup): Fetch lwpid from current_inferior directly.
3655         * linux-arm-low.c (update_registers_callback): Update, "entry"
3656         parameter is a struct thread_info * now.
3657         Fetch lwpid from current_inferior directly.
3658         (arm_insert_point): Pass &all_threads to find_inferior instead of
3659         &all_lwps.
3660         (arm_remove_point): Ditto.
3661         (arm_stopped_by_watchpoint): Fetch lwp from current_inferior.
3662         (arm_prepare_to_resume): Fetch pid from thread.
3663         (arm_read_description): Fetch lwpid from current_inferior directly.
3664         * linux-low.c (all_lwps): Delete.
3665         (delete_lwp): Delete call to remove_inferior.
3666         (handle_extended_wait): Fetch lwpid from thread.
3667         (add_lwp): Don't set lwp->entry.id.  Remove call to
3668         add_inferior_to_list.
3669         (linux_attach_lwp_1): Fetch pid from current_inferior directly.
3670         (linux_kill_one_lwp): Fetch ptid,lwpid from thread.
3671         (kill_one_lwp_callback): Ditto.
3672         (linux_kill): Don't dereference NULL pointer.
3673         Fetch ptid,lwpid from thread.
3674         (get_detach_signal): Fetch ptid from thread.
3675         (linux_detach_one_lwp): Fetch ptid,lwpid from thread.
3676         Simplify call to regcache_invalidate_thread.
3677         (delete_lwp_callback): Update, "entry" parameter is a
3678         struct thread_info * now.  Fetch pid from thread.
3679         (linux_mourn): Pass &all_threads to find_inferior instead of &all_lwps.
3680         (status_pending_p_callback): Update, "entry" parameter is a
3681         struct thread_info * now.  Fetch ptid from thread.
3682         (find_lwp_pid): Update, "entry" parameter is a
3683         struct thread_info * now.
3684         (linux_wait_for_lwp): Fetch pid from thread.
3685         (linux_fast_tracepoint_collecting): Fetch lwpid from thread.
3686         (maybe_move_out_of_jump_pad): Fetch lwpid from current_inferior.
3687         (enqueue_one_deferred_signal): Fetch lwpid from thread.
3688         (dequeue_one_deferred_signal): Ditto.
3689         (cancel_breakpoint): Fetch ptid from current_inferior.
3690         (linux_wait_for_event): Pass &all_threads to find_inferior,
3691         not &all_lwps.  Fetch ptid, lwpid from thread.
3692         (count_events_callback): Update, "entry" parameter is a
3693         struct thread_info * now.
3694         (select_singlestep_lwp_callback): Ditto.
3695         (select_event_lwp_callback): Ditto.
3696         (cancel_breakpoints_callback): Ditto.
3697         (linux_cancel_breakpoints): Pass &all_threads to find_inferior,
3698         not &all_lwps.
3699         (select_event_lwp): Ditto.  Fetch ptid from event_thread.
3700         (unsuspend_one_lwp): Update, "entry" parameter is a
3701         struct thread_info * now.
3702         (unsuspend_all_lwps): Pass &all_threads to find_inferior,
3703         not &all_lwps.
3704         (linux_stabilize_threads): Ditto.  And for for_each_inferior.
3705         Fetch lwpid from thread, not lwp.
3706         (linux_wait_1): Fetch ptid, lwpid from current_inferior.
3707         Pass &all_threads to find_inferior, not &all_lwps.
3708         (send_sigstop): Fetch lwpid from thread, not lwp.
3709         (send_sigstop_callback): Update, "entry" parameter is a
3710         struct thread_info * now.
3711         (suspend_and_send_sigstop_callback): Ditto.
3712         (wait_for_sigstop): Ditto.  Fetch ptid, lwpid from thread, lwp.
3713         (stuck_in_jump_pad_callback): Update, "entry" parameter is a
3714         struct thread_info * now.
3715         (move_out_of_jump_pad_callback): Ditto.  Fetch ptid, lwpid
3716         from thread, lwp.
3717         (lwp_running): Update, "entry" parameter is a
3718         struct thread_info * now.
3719         (stop_all_lwps): Fetch ptid from thread.
3720         Pass &all_threads to find_inferior, for_each_inferior, not &all_lwps.
3721         (linux_resume_one_lwp): Fetch lwpid from thread.
3722         (linux_set_resume_request): Update, "entry" parameter is a
3723         struct thread_info * now.  Fetch pid, lwpid from thread.
3724         (resume_status_pending_p): Update, "entry" parameter is a
3725         struct thread_info * now.
3726         (need_step_over_p): Ditto.  Fetch lwpid from thread.
3727         (start_step_over): Fetch lwpid from thread.
3728         (linux_resume_one_thread): Update, "entry" parameter is a
3729         struct thread_info * now.  Fetch lwpid from thread.
3730         (linux_resume): Pass &all_threads to find_inferior, not &all_lwps.
3731         (proceed_one_lwp): Update, "entry" parameter is a
3732         struct thread_info * now.  Fetch lwpid from thread.
3733         (unsuspend_and_proceed_one_lwp): Update, "entry" parameter is a
3734         struct thread_info * now.
3735         (proceed_all_lwps): Pass &all_threads to find_inferior, not &all_lwps.
3736         (unstop_all_lwps): Ditto.  Fetch lwpid from thread.
3737         (regsets_fetch_inferior_registers): Fetch lwpid from current_inferior
3738         directly.
3739         (regsets_store_inferior_registers): Ditto.
3740         (fetch_register, store_register): Ditto.
3741         (linux_read_memory, linux_write_memory): Ditto.
3742         (linux_request_interrupt): Ditto.
3743         (linux_read_auxv): Ditto.
3744         (linux_xfer_siginfo): Ditto.
3745         (linux_qxfer_spu): Ditto.
3746         (linux_qxfer_libraries_svr4): Ditto.
3747         * linux-low.h (ptid_of, pid_of, lwpid_of): Delete,
3748         moved to inferiors.h.
3749         (get_lwp): Delete.
3750         (get_thread_lwp): Update.
3751         (struct lwp_info): Delete member "entry".  Simplify comment for
3752         member "thread".
3753         (all_lwps): Delete.
3754         * linux-mips-low.c (mips_read_description): Fetch lwpid from
3755         current_inferior directly.
3756         (update_watch_registers_callback): Update, "entry" parameter is a
3757         struct thread_info * now.  Fetch pid from thread.
3758         (mips_linux_prepare_to_resume): Fetch ptid from thread.
3759         (mips_insert_point): Fetch lwpid from current_inferior.
3760         Pass &all_threads to find_inferior, not &all_lwps.
3761         (mips_remove_point): Pass &all_threads to find_inferior, not &all_lwps.
3762         (mips_stopped_by_watchpoint): Fetch lwpid from current_inferior
3763         directly.
3764         (mips_stopped_data_address): Ditto.
3765         * linux-s390-low.c (s390_arch_setup): Fetch pid from current_inferior
3766         directly.
3767         * linux-tile-low.c (tile_arch_setup): Ditto.
3768         * linux-x86-low.c (x86_get_thread_area): Fetch lwpid from thread.
3769         (update_debug_registers_callback): Update, "entry" parameter is a
3770         struct thread_info * now.  Fetch pid from thread.
3771         (i386_dr_low_set_addr): Fetch pid from current_inferior directly.
3772         Pass &all_threads to find_inferior, not &all_lwps.
3773         (i386_dr_low_get_addr): Fetch ptid from current_inferior directly.
3774         (i386_dr_low_set_control): Fetch pid from current_inferior directly.
3775         Pass &all_threads to find_inferior, not &all_lwps.
3776         (i386_dr_low_get_control): Fetch ptid from current_inferior directly.
3777         (i386_dr_low_get_status): Ditto.
3778         (x86_linux_prepare_to_resume): Fetch ptid from thread.
3779         (x86_siginfo_fixup): Fetch lwpid from current_inferior directly.
3780         (x86_linux_read_description): Ditto.
3781         * proc-service.c (ps_getpid): Fetch pid from current_inferior directly.
3782
3783 2014-02-20  Doug Evans  <dje@google.com>
3784
3785         * inferiors.c (get_first_inferior): Fix buglet.
3786
3787 2014-02-19  Doug Evans  <dje@google.com>
3788
3789         * gdbthread.h (add_thread): Change result type to struct thread_info *.
3790         * inferiors.c (add_thread): Change result type to struct thread_info *.
3791         All callers updated.
3792         (add_lwp): Call add_thread here instead of in callers.
3793         All callers updated.
3794         * linux-low.h (get_lwp_thread): Rewrite.
3795         (struct lwp_info): New member "thread".
3796
3797 2014-02-19  Doug Evans  <dje@google.com>
3798
3799         * linux-low.c (add_lwp): Change result to struct lwp_info *.
3800         All callers updated.
3801
3802 2014-02-19  Doug Evans  <dje@google.com>
3803
3804         * inferiors.c (add_thread): Fix whitespace.
3805
3806 2014-02-19  Doug Evans  <dje@google.com>
3807
3808         * dll.c (clear_dlls): Replace accessing list implemention details
3809         with API function.
3810         * gdbthread.h (get_first_thread): Declare.
3811         * inferiors.c (for_each_inferior_with_data): New function.
3812         (get_first_thread): New function.
3813         (find_thread_ptid): Simplify.
3814         (get_first_inferior): New function.
3815         (clear_list): Delete.
3816         (one_inferior_p): New function.
3817         (clear_inferior_list): New function.
3818         (clear_inferiors): Update.
3819         * inferiors.h (for_each_inferior_with_data): Declare.
3820         (clear_inferior_list): Declare.
3821         (one_inferior_p): Declare.
3822         (get_first_inferior): Declare.
3823         * linux-low.c (linux_wait_for_event): Replace accessing list
3824         implemention details with API function.
3825         * server.c (target_running): Ditto.
3826         (accumulate_file_name_length): New function.
3827         (emit_dll_description): New function.
3828         (handle_qxfer_libraries): Replace accessing list implemention
3829         details with API function.
3830         (handle_qxfer_threads_worker): New function.
3831         (handle_qxfer_threads_proper): Replace accessing list implemention
3832         details with API function.
3833         (handle_query): Ditto.
3834         (visit_actioned_threads_callback_ftype): New typedef.
3835         (visit_actioned_threads_data): New struct.
3836         (visit_actioned_threads): Rewrite to be find_inferior callback.
3837         (resume): Call find_inferior.
3838         (handle_status): Replace accessing list implemention
3839         details with API function.
3840         (process_serial_event): Replace accessing list implemention details
3841         with API function.
3842         * target.c (set_desired_inferior): Replace accessing list implemention
3843         details with API function.
3844         * tracepoint.c (same_process_p): New function.
3845         (gdb_agent_about_to_close): Replace accessing list implemention
3846         details with API function.
3847         * win32-low.c (child_delete_thread): Replace accessing list
3848         implemention details with API function.
3849         (match_dll_by_basename): New function.
3850         (dll_is_loaded_by_basename): New function.
3851         (win32_ensure_ntdll_loaded): Replace accessing list implemention
3852         details call to dll_is_loaded_by_basename.
3853
3854 2014-02-19  Doug Evans  <dje@google.com>
3855
3856         * dll.h (struct dll_info): Add comment.
3857         * gdbthread.h (struct thread_info): Add comment.
3858         (current_ptid): Simplify.
3859         * inferiors.c (add_process): Update.
3860         (remove_process): Update.
3861         * inferiors.h (struct process_info): Rename member "head" to "entry".
3862         * linux-low.c (delete_lwp): Update.
3863         (add_lwp): Update.
3864         (last_thread_of_process_p): Update.
3865         (kill_one_lwp_callback, linux_kill): Update.
3866         (status_pending_p_callback): Update.
3867         (wait_for_sigstop): Update.  Simplify read of ptid.
3868         (start_step_over): Update.
3869         * linux-low.h (ptid_of, pid_of, lwpid_of): Update.
3870         (get_lwp_thread): Update.
3871         (struct lwp_info): Rename member "head" to "entry".
3872         * regcache.h (inferior_list_entry): Delete.
3873         * server.c (kill_inferior_callback): Update.
3874         (detach_or_kill_inferior_callback): Update.
3875         (print_started_pid): Update.
3876         (print_attached_pid): Update.
3877         (process_serial_event): Simplify read of ptid.
3878         * thread-db.c (thread_db_create_event): Update.
3879         (thread_db_get_tls_address): Update.
3880         * win32-low.c (current_inferior_ptid): Simplify.
3881
3882 2014-02-19  Tom Tromey  <tromey@redhat.com>
3883
3884         * target.h (struct target_ops) <supports_btrace>: Add target_ops
3885         argument.
3886         (target_supports_btrace): Update.
3887
3888 2014-02-14  Yao Qi  <yao@codesourcery.com>
3889
3890         * Makefile.in (IPA_OBJS): Append rsp-low-ipa.o.
3891         (rsp-low-ipa.o): New target.
3892
3893 2014-02-12  Tom Tromey  <tromey@redhat.com>
3894
3895         * ax.c (gdb_parse_agent_expr): Use hex2bin, not
3896         convert_ascii_to_int.
3897         * regcache.c (registers_to_string): Likewise.
3898         * remote-utils.c (decode_M_packet): Likewise.
3899         * server.c (process_serial_event): Likewise.
3900
3901 2014-02-12  Tom Tromey  <tromey@redhat.com>
3902
3903         * server.c (handle_query, handle_v_run): Use hex2bin, not
3904         unhexify.
3905         * tracepoint.c (cmd_qtdpsrc, cmd_qtdv, cmd_qtnotes): Likewise.
3906
3907 2014-02-12  Tom Tromey  <tromey@redhat.com>
3908
3909         * ax.c (gdb_unparse_agent_expr): Use bin2hex, not
3910         convert_int_to_ascii.
3911         * regcache.c (registers_to_string, collect_register_as_string):
3912         Likewise.
3913         * remote-utils.c (look_up_one_symbol, relocate_instruction):
3914         Likewise.
3915         * server.c (process_serial_event): Likewise.
3916         * tracepoint.c (cmd_qtstatus, response_source, response_tsv)
3917         (cmd_qtbuffer, cstr_to_hexstr): Likewise.
3918
3919 2014-02-12  Tom Tromey  <tromey@redhat.com>
3920
3921         * remote-utils.c (look_up_one_symbol, monitor_output): Use
3922         bin2hex, not hexify.
3923         * tracepoint.c (cmd_qtstatus): Likewise.
3924
3925 2014-02-12  Tom Tromey  <tromey@redhat.com>
3926
3927         * remote-utils.c (monitor_output): Pass explicit length to
3928         hexify.
3929
3930 2014-02-12  Tom Tromey  <tromey@redhat.com>
3931
3932         * tracepoint.c: Include rsp-low.h.
3933         * server.c: Include rsp-low.h.
3934         * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii)
3935         (unhexify, hexify, remote_escape_output, unpack_varlen_hex): Don't
3936         declare.
3937         * remote-utils.c: Include rsp-low.h.
3938         (fromhex, hexchars, ishex, unhexify, tohex, hexify)
3939         (remote_escape_output, remote_unescape_input, unpack_varlen_hex)
3940         (convert_int_to_ascii, convert_ascii_to_int): Move to
3941         common/rsp-low.c.
3942         * regcache.c: Include rsp-low.h.
3943         * ax.c: Include rsp-low.h.
3944         * Makefile.in (SFILES): Add common/rsp-low.c.
3945         (OBS): Add rsp-low.o.
3946         (rsp-low.o): New target.
3947
3948 2014-02-12  Tom Tromey  <tromey@redhat.com>
3949
3950         * utils.h (pulongest, plongest, phex_nz): Don't declare.
3951         Include print-utils.h.
3952         * utils.c (NUMCELLS, CELLSIZE, get_cell, decimal2str, pulongest)
3953         (plongest, thirty_two, phex_nz): Remove.
3954         * Makefile.in (SFILES): Add common/print-utils.c.
3955         (OBS): Add print-utils.o.
3956         (print-utils-ipa.o): New target.
3957         (print-utils.o): New target.
3958         (IPA_OBJS): Add print-utils-ipa.o.
3959
3960 2014-02-06  Tom Tromey  <tromey@redhat.com>
3961
3962         * Makefile.in (SFILES): Fix indentation.
3963
3964 2014-02-05  Doug Evans  <dje@google.com>
3965
3966         * linux-low.c (linux_wait_for_event): Improve comment.
3967         (linux_wait_1): Keep current_inferior in sync with event_child.
3968
3969 2014-01-22  Doug Evans  <dje@google.com>
3970
3971         * gdbthread.h (gdb_id_to_thread): Delete, unused.
3972
3973 2014-01-22  Doug Evans  <dje@google.com>
3974
3975         * configure.ac (AC_CHECK_FUNCS): Add test for gettimeofday.
3976         * configure: Regenerate.
3977         * config.in: Regenerate.
3978         * Makefile.in (SFILES): Add debug.c.
3979         (OBS): Add debug.o.
3980         * debug.c: New file.
3981         * debug.h: New file.
3982         * linux-aarch64-low.c (*): Update all debugging printfs to use
3983         debug_printf instead of fprintf.
3984         * linux-arm-low.c (*): Ditto.
3985         * linux-cris-low.c (*): Ditto.
3986         * linux-crisv32-low.c (*): Ditto.
3987         * linux-m32r-low.c (*): Ditto.
3988         * linux-sparc-low.c (*): Ditto.
3989         * linux-x86.c (*): Ditto.
3990         * linux-low.c (*): Ditto.
3991         (linux_wait_1): Add calls to debug_enter, debug_exit.
3992         (linux_wait): Remove redundant debugging printf.
3993         (stop_all_lwps): Add calls to debug_enter, debug_exit.
3994         (linux_resume, unstop_all_lwps): Ditto.
3995         * mem-break.c (*): Update all debugging printfs to use
3996         debug_printf instead of fprintf.
3997         * remote-utils.c (*): Ditto.
3998         * thread-db.c (*): Ditto.
3999         * server.c #include <ctype.h>, "gdb_vecs.h".
4000         (debug_threads): Moved to debug.c.
4001         (*): Update all debugging printfs to use debug_printf instead of
4002         fprintf.
4003         (start_inferior): Replace call to fflush with call to debug_flush.
4004         (monitor_show_help): Mention set debug-format.
4005         (parse_debug_format_options): New function.
4006         (handle_monitor_command): Handle "monitor set debug-format".
4007         (gdbserver_usage): Mention --debug-format.
4008         (main): Parse --debug-format.
4009         * server.h (debug_threads): Declaration moved to debug.h.
4010         #include "debug.h".
4011         * tracepoint.c (trace_debug_1) [!IN_PROCESS_AGENT]: Add version of
4012         trace_debug_1 that uses debug_printf.
4013         (tracepoint_look_up_symbols): Update all debugging printfs to use
4014         debug_printf instead of fprintf.
4015
4016 2014-01-20  Baruch Siach  <baruch@tkos.co.il>
4017
4018         * linux-xtensa-low.c: Include asm/ptrace.h instead of
4019         sys/ptrace.h.
4020
4021 2014-01-17  Pedro Alves  <palves@redhat.com>
4022
4023         PR build/16445
4024         * linux-x86-low.c: Don't include elf/common.h if ELFMAG0 is
4025         defined after including gdb_proc_service.h.
4026
4027 2014-01-16  Doug Evans  <dje@google.com>
4028
4029         * dll.c (UNSPECIFIED_CORE_ADDR): New macro.
4030         (match_dll): Use it.
4031
4032 2014-01-16  Markus Metzger  <markus.t.metzger@intel.com>
4033
4034         * target.h (target_ops) <read_btrace>: Change parameters and
4035         return type to allow error reporting.
4036         * server.c (handle_qxfer_btrace): Support delta reads.  Pass
4037         trace reading errors on.
4038         * linux-low.c (linux_low_read_btrace): Pass trace reading
4039         errors on.
4040         (linux_low_disable_btrace): New.
4041
4042 2014-01-15  Doug Evans  <dje@google.com>
4043
4044         * inferiors.c (thread_id_to_gdb_id): Delete.
4045         * inferiors.h (thread_id_to_gdb_id): Delete.
4046
4047 2014-01-13  Eli Zaretskii  <eliz@gnu.org>
4048
4049         * Makefile.in (INCLUDE_CFLAGS): Remove trailing slash from
4050         "-I$(srcdir)/../".  Fixes MinGW compilation errors with old GCC
4051         versions.
4052
4053 2014-01-08  Pedro Alves  <palves@redhat.com>
4054
4055         * server.c (handle_status): Don't discard previous queued stop
4056         replies or thread's pending status here.
4057         (main) <disconnection>: Do it here instead.
4058
4059 2014-01-08  Pedro Alves  <palves@redhat.com>
4060
4061         * gdbthread.h (struct thread_info) <status_pending_p>: New field.
4062         * server.c (visit_actioned_threads, handle_pending_status): New
4063         function.
4064         (handle_v_cont): Factor out parts to ...
4065         (resume): ... this new function.  If in all-stop, and a thread
4066         being resumed has a pending status, report it without actually
4067         resuming.
4068         (myresume): Adjust to use the new 'resume' function.
4069         (clear_pending_status_callback, set_pending_status_callback)
4070         (find_status_pending_thread_callback): New functions.
4071         (handle_status): Handle the case of multiple threads having
4072         interesting statuses to report.  Report threads' real last signal
4073         instead of always reporting GDB_SIGNAL_TRAP.  Look for a thread
4074         with an interesting thread to report the status for, instead of
4075         always reporting the status of the first thread.
4076
4077 2014-01-01  Joel Brobecker  <brobecker@adacore.com>
4078
4079         * gdbserver.c (gdbserver_version): Set copyright year to 2014.
4080         * gdbreplay.c (gdbreplay_version): Likewise.
4081
4082 2013-12-18  Yufeng Zhang  <yufeng.zhang@arm.com>
4083
4084         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Set
4085         iov.iov_len with the real length in use.
4086
4087 2013-12-13  Joel Brobecker  <brobecker@adacore.com>
4088
4089         * Makefile.in (safe-ctype.o, lbasename.o): New rules.
4090         * configure.srv: Add safe-ctype.o and lbasename.o to srv_tgtobj
4091         for all targets that use win32-low.c.
4092         * win32-low.c (win32_ensure_ntdll_loaded): New function.
4093         (do_initial_child_stuff): Add call to win32_ensure_ntdll_loaded.
4094
4095 2013-12-13  Pedro Alves  <palves@redhat.com>
4096
4097         * target.c (mywait): Set OURSTATUS->KIND to TARGET_WAITKIND_STOPPED
4098         if equal to TARGET_WAITKIND_LOADED.
4099         * win32-low.c (cached_status): New static global.
4100         (win32_wait): Add declaration.
4101         (do_initial_child_stuff): Flush all initial pending debug events
4102         up to the initial breakpoint.
4103         (win32_wait): If CACHED_STATUS was set, return that instead
4104         of doing a real wait.  Remove the code resuming the execution
4105         of the inferior after receiving a TARGET_WAITKIND_LOADED event
4106         during the initial phase.  Also remove the code changing
4107         OURSTATUS->KIND from TARGET_WAITKIND_LOADED to
4108         TARGET_WAITKIND_STOPPED.
4109
4110 2013-12-11  Yao Qi  <yao@codesourcery.com>
4111
4112         * notif.c (handle_notif_ack): Return 0 if no notification
4113         matches.
4114
4115 2013-11-20  Doug Evans  <dje@google.com>
4116
4117         * linux-low.c (linux_set_resume_request): Fix comment.
4118
4119 2013-11-20  Doug Evans  <dje@google.com>
4120
4121         * linux-low.c (resume_status_pending_p): Tweak comment.
4122
4123 2013-11-20  Walfred Tedeschi  <walfred.tedeschi@intel.com>
4124
4125         * Makefile.in: Add i386-mpx.c, i386-mpx-linux.c, amd64-mpx.c,
4126         amd64-mpx-linux.c, x32-mpx.c and x32-mpx-linux.c generation.
4127         * configure.srv (srv_i386_regobj): Add i386-mpx.o.
4128         (srv_i386_linux_regobj): Add i386-mpx-linux.o.
4129         (srv_amd64_regobj): Add amd64-mpx.o.
4130         (srv_amd64_linux_regobj): Add amd64-mpx-linux.o.
4131         (srv_i386_32bit_xmlfiles): Add i386/32bit-mpx.xml.
4132         (srv_i386_64bit_xmlfiles): Add i386/64bit-mpx.xml.
4133         * i387-fp.c (num_pl_bnd_register) Added constant.
4134         (num_pl_bnd_cfg_registers) Added constant.
4135         (struct i387_xsave) Added reserved area and MPX fields.
4136         (i387_cache_to_xsave, i387_xsave_to_cache) Add MPX.
4137         * linux-x86-low.c (init_registers_i386_mpx_linux): Declare new
4138         function.
4139         (tdesc_i386_mpx_linux): Add MPX amd64 target.
4140         (init_registers_amd64_mpx_linux): Declare new function.
4141         (tdesc_amd64_mpx_linux): Add MPX amd64 target.
4142         (x86_64_regmap): Add MPX registers.
4143         (x86_linux_read_description): Add MPX case.
4144         (initialize_low_arch): Initialize MPX targets.
4145
4146 2013-11-18  Tom Tromey  <tromey@redhat.com>
4147
4148         * configure: Rebuild.
4149         * configure.ac: Don't check for stdlib.h.
4150         * gdbreplay.c: Unconditionally include stdlib.h.
4151
4152 2013-11-18  Tom Tromey  <tromey@redhat.com>
4153
4154         * config.in: Rebuild.
4155         * configure: Rebuild.
4156         * configure.ac: Don't use AC_HEADER_DIRENT.
4157
4158 2013-11-18  Tom Tromey  <tromey@redhat.com>
4159
4160         * server.h: Don't check HAVE_STRING_H.
4161         * gdbreplay.c: Don't check HAVE_STRING_H.
4162         * configure: Rebuild.
4163
4164 2013-11-18  Tom Tromey  <tromey@redhat.com>
4165
4166         * Makefile.in (gdbreplay$(EXEEXT)): Depend on and link against
4167         LIBGNU.
4168
4169 2013-11-08  Tom Tromey  <tromey@redhat.com>
4170
4171         * configure, config.in: Rebuild.
4172         * configure.ac: Remove unused configury.
4173
4174 2013-11-08  Tom Tromey  <tromey@redhat.com>
4175
4176         * acinclude.m4: Include common.m4, codeset.m4.
4177         * configure, config.in: Rebuild.
4178         * configure.ac: Use GDB_AC_COMMON.
4179
4180 2013-11-06  Andreas Arnez  <arnez@linux.vnet.ibm.com>
4181
4182         * linux-s390-low.c (HWCAP_S390_TE): New define.
4183         (s390_arch_setup): Consider the TE field in the HWCAP for
4184         determining 'have_regset_tdb'.
4185
4186 2013-10-16  Sergio Durigan Junior  <sergiodj@redhat.com>
4187
4188         PR gdb/16014
4189         * tracepoint.c (download_tracepoint_1): Remove unnecessary double
4190         call to sizeof.
4191
4192 2013-10-02  Pedro Alves  <palves@redhat.com>
4193
4194         * server.c (process_serial_event): Don't output "GDBserver
4195         exiting" if GDB is connected through stdio.
4196         * target.c (mywait): Likewise, be silent if GDB is connected
4197         through stdio.
4198
4199 2013-10-01  Joel Brobecker  <brobecker@adacore.com>
4200
4201         * lynx-low.c (lynx_add_threads_after_attach): New function.
4202         (lynx_attach): Remove call to add_thread.  Add call to
4203         lynx_add_threads_after_attach instead.
4204
4205 2013-09-28  Mike Frysinger  <vapier@gentoo.org>
4206
4207         * configure.ac (AC_CHECK_HEADERS): Add sys/syscall.h
4208         * config.in, configure: Regenerated.
4209
4210 2013-09-18  Yao Qi  <yao@codesourcery.com>
4211
4212         PR server/15959
4213         * server.c (start_inferior): Clear 'resume_info'.
4214
4215 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4216
4217         * linux-tile-low.c (tile_regsets): Modify the size field to 64-bit
4218         for each register.
4219
4220 2013-09-16  Jiong Wang  <jiwang@tilera.com>
4221
4222         * configure.srv <tilegx*-*-linux*>: Remove linux-osdata.o from and add
4223         linux-tile-low.o to srv_tgtobj.
4224
4225 2013-09-16  Will Newton  <will.newton@linaro.org>
4226
4227         * linux-aarch64-low.c (aarch64_linux_set_debug_regs): Zero
4228         out regs.
4229
4230 2013-09-06  Pedro Alves  <palves@redhat.com>
4231
4232         * Makefile.in (gdb_proc_service_h, regdef_h, regcache_h)
4233         (signals_def, signals_h, ptid_h, ax_h, agent_h, linux_btrace_h)
4234         (linux_osdata_h, vec_h, gdb_vecs_h, host_defs_h, libiberty_h)
4235         (server_h, gdbthread_h, linux_low_h, linux_ptrace_h)
4236         (gdb_thread_db_h, linux_procfs_h, lynx_low_h, nto_low_h)
4237         (mips_linux_watch_h, i386_low_h, win32_low_h): Delete.
4238
4239 2013-09-06  Pedro Alves  <palves@redhat.com>
4240
4241         * Makefile.in (linux-btrace.o, mips-linux-watch.o): Remove
4242         explicit header dependencies and use $COMPILE/$POSTCOMPILE.
4243
4244 2013-09-06  Pedro Alves  <palves@redhat.com>
4245
4246         * linux-amd64-ipa.c: Include tracepoint.h.
4247         * linux-i386-ipa.c: Include tracepoint.h.
4248
4249 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4250
4251         * linux-crisv32-low.c (PTRACE_GET_THREAD_AREA): New macro.
4252         (ps_get_thread_area): New function.
4253
4254 2013-09-06  Ricard Wanderlof  <ricardw@axis.com>
4255
4256         * linux-crisv32-low.c (elf_gregset_t): Delete typedef.
4257         (initialize_low_arch): Call init_registers_crisv32 rather than
4258         init_register_crisv32.
4259
4260 2013-09-05  Pedro Alves  <palves@redhat.com>
4261
4262         * server.h (handle_vFile, hostio_last_error_from_errno): Move
4263         to ...
4264         * hostio.h: ... this new file.
4265         * hostio.c, server.c, linux-low.c, nto-low.c, spu-low,
4266         win32-low.c: Include hostio.h.
4267
4268 2013-09-05  Pedro Alves  <palves@redhat.com>
4269
4270         * server.h (gdb_client_data, handler_func, callback_handler_func)
4271         (delete_file_handler, add_file_handler, append_callback_event)
4272         (delete_callback_event, start_event_loop, initialize_event_loop):
4273         Move to event-loop.h and include it.
4274         * event-loop.h: New file.
4275
4276 2013-09-05  Pedro Alves  <palves@redhat.com>
4277
4278         * dll.c, inferiors.c, remote-utils.c, server.c: Include "dll.h".
4279         * server.h (struct dll_info, all_dlls, dlls_changed, clear_dlls)
4280         (loaded_dll, unloaded_dll): Move to ...
4281         * dll.h: ... this new file.
4282         * inferiors.c, remote-utils.c, win32-low.c: Include "dll.h".
4283
4284 2013-09-05  Pedro Alves  <palves@redhat.com>
4285
4286         * server.h (current_process, get_thread_process, all_processes)
4287         (add_inferior_to_list, for_each_inferior, current_inferior)
4288         (remove_inferior, add_process, remove_process, find_process_pid)
4289         (have_started_inferiors_p, have_attached_inferiors_p)
4290         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id)
4291         (clear_inferiors, find_inferior, find_inferior_id)
4292         (inferior_target_data, set_inferior_target_data)
4293         (inferior_regcache_data, set_inferior_regcache_data): Move to
4294         inferiors.h, and include it.
4295         * inferiors.h: New file.
4296
4297 2013-09-05  Pedro Alves  <palves@redhat.com>
4298
4299         * server.h (struct emit_ops, current_insn_ptr, emit_error):
4300         Move ...
4301         * ax.h: ... here.
4302
4303 2013-09-05  Pedro Alves  <palves@redhat.com>
4304
4305         * ax.c, linux-low.c, linux-x86-low.c, server.c: Include
4306         tracepoint.h.
4307         * server.h (IPA_BUFSIZ, initialize_tracepoint, tracing)
4308         (disconnected_tracing, tracepoint_look_up_symbols, stop_tracing
4309         (handle_tracepoint_general_set, handle_tracepoint_query)
4310         (tracepoint_finished_step, tracepoint_was_hit)
4311         (release_while_stepping_state_list, current_traceframe)
4312         (in_readonly_region, traceframe_read_mem)
4313         (fetch_traceframe_registers, traceframe_read_sdata)
4314         (traceframe_read_info, struct fast_tpoint_collect_status)
4315         (fast_tracepoint_collecting, force_unlock_trace_buffer)
4316         (handle_tracepoit_bkpts, initialize_low_tracepoint)
4317         (supply_fast_tracepoint_registers)
4318         (supply_static_tracepoint_registers, set_trampoline_buffer_space)
4319         (ipa_tdesc, claim_trampoline_space)
4320         (have_fast_tracepoint_trampoline_buffer, gdb_agent_about_to_close)
4321         (agent_mem_read, agent_get_trace_state_variable_value)
4322         (agent_set_trace_state_variable_value, agent_tsv_read)
4323         (agent_mem_read_string, get_raw_reg_func_addr)
4324         (get_get_tsv_func_addr, get_set_tsv_func_addr): Move to ...
4325         * tracepoint.h: ... this new file.
4326
4327 2013-09-05  Pedro Alves  <palves@redhat.com>
4328
4329         * server.h (perror_with_name, error, fatal, warning, paddress)
4330         (pulongest, plongest, phex_nz, pfildes): Move to utils.h, and
4331         include it.
4332         * utils.h: New file.
4333
4334 2013-09-05  Pedro Alves  <palves@redhat.com>
4335
4336         * server.h (remote_debug, noack_mode, transport_is_reliable)
4337         (gdb_connected, STDIO_CONNECTION_NAME, remote_connection_is_stdio)
4338         (read_ptid, write_ptid, putpkt, putpkt_binary, putpkt_notif)
4339         (getpkt, remote_prepare, remote_open, remote_close, write_ok)
4340         (write_enn, initialize_async_io, enable_async_io)
4341         (disable_async_io, check_remote_input_interrupt_request)
4342         (convert_ascii_to_int, convert_int_to_ascii, new_thread_notify)
4343         (dead_thread_notify, prepare_resume_reply)
4344         (decode_address_to_semicolon, decode_address, decode_m_packet)
4345         (decode_M_packet, decode_X_packet, decode_xfer_write)
4346         (decode_search_memory_packet, unhexify, hexify)
4347         (remote_escape_output, unpack_varlen_hex, clear_symbol_cache)
4348         (look_up_one_symbol, relocate_instruction)
4349         (monitor_output): Move to remote-utils.h, and include it.
4350         * remote-utils.h: New file.
4351
4352 2013-09-05  Pedro Alves  <palves@redhat.com>
4353
4354         * server.h (_): Delete.
4355
4356 2013-09-02  Pedro Alves  <palves@redhat.com>
4357
4358         * tracepoint.c (TRACEFRAME_EOB_MARKER_SIZE): New macro.
4359         (init_trace_buffer): Ensure at least TRACEFRAME_EOB_MARKER_SIZE is
4360         allocated.
4361         (trace_buffer_alloc): Use TRACEFRAME_EOB_MARKER_SIZE.
4362
4363 2013-09-02  Pierre Muller  <muller@sourceware.org>
4364
4365         * win32-low.c (child_xfer_memory): Check if ReadProcessMemory
4366         or WriteProcessMemory complete successfully and handle
4367         ERROR_PARTIAL_COPY error.
4368
4369 2013-09-02  Pedro Alves  <palves@redhat.com>
4370
4371         * server.c (gdb_read_memory): Return -1 on traceframe memory read
4372         error instead of EIO.
4373
4374 2013-08-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
4375
4376         PR server/15604
4377         * linux-low.c: Include filestuff.h.
4378         (linux_create_inferior) <pid == 0>: Call close_most_fds.
4379         * lynx-low.c: Include filestuff.h.
4380         (lynx_create_inferior) <pid == 0>: Call close_most_fds.
4381         * server.c: Include filestuff.h.
4382         (main): Call notice_open_fds.
4383         * spu-low.c: Include filestuff.h.
4384         (spu_create_inferior) <pid == 0>: Call close_most_fds.
4385
4386 2013-08-22  Luis Machado  <lgustavo@codesourcery.com>
4387
4388         * Makefile.in: Explain why ../target and ../nat are not
4389         listed as include file search paths.
4390         (linux-waitpid.o): New object file rule.
4391         * configure.srv (srv_native_linux_obj): New variable.
4392         Replace all occurrences of linux native object files with
4393         $srv_native_linux_obj.
4394         * linux-low.c: Include nat/linux-nat.h and nat/linux-waitpid.h.
4395         (HAS_NOMMU): Move defining logic to common/linux-ptrace.c.
4396         (linux_enable_event_reporting): Remove declaration.
4397         (my_waitpid): Moved to common/linux-waitpid.c.
4398         (linux_wait_for_event): Pass ptid when calling
4399         linux_enable_event_reporting.
4400         (linux_supports_tracefork_flag): Remove.
4401         (linux_enable_event_reporting): Likewise.
4402         (linux_tracefork_grandchild): Remove.
4403         (STACK_SIZE): Moved to common/linux-ptrace.c.
4404         (linux_tracefork_child): Remove.
4405         (linux_test_for_tracefork): Remove.
4406         (linux_look_up_symbols): Call linux_supports_traceclone.
4407         (initialize_low): Remove call to linux_test_for_tracefork.
4408         * linux-low.h (PTRACE_TYPE_ARG3): Move to
4409         common/linux-ptrace.h.
4410         (PTRACE_TYPE_ARG4): Likewise.
4411         Include linux-ptrace.h.
4412
4413 2013-08-21  Pedro Alves  <palves@redhat.com>
4414
4415         * config.in: Renegerate.
4416
4417 2013-08-19  Luis Machado  <lgustavo@codesourcery.com>
4418
4419         * Makefile.in (INCLUDE_CFLAGS): Include -I$(srcdir)/../.
4420         (SFILES): Remove $(srcdir)/common/target-common.c and
4421         add $(srcdir)/target/waitstatus.c.
4422         (OBS): Remove target-common.o and add waitstatus.o.
4423         (server_h): Remove $(srcdir)/../common/target-common.h and
4424         add $(srcdir)/../target/resume.h, $(srcdir)/../target/wait.h
4425         and $(srcdir)/../target/waitstatus.h.
4426         (target-common.o): Remove.
4427         (waitstatus.o): New target object file.
4428         * target.h: Do not include target-common.h and
4429         include target/resume.h, target/wait.h and
4430         target/waitstatus.h.
4431
4432 2013-08-13  Luis Machado  <lgustavo@codesourcery.com>
4433
4434         * linux-arm-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4435         to PTRACE_TYPE_ARG3.
4436         * linux-low.c: Rename all occurrences of PTRACE_ARG3_TYPE
4437         to PTRACE_TYPE_ARG3 and PTRACE_ARG4_TYPE to
4438         PTRACE_TYPE_ARG4.
4439         * linux-low.h (PTRACE_ARG3_TYPE): Rename to PTRACE_TYPE_ARG3.
4440         (PTRACE_ARG4_TYPE): Rename to PTRACE_TYPE_ARG4.
4441
4442 2013-07-27  Jie Zhang  <jie@codesourcery.com>
4443             Daniel Jacobowitz  <dan@codesourcery.com>
4444             Yao Qi  <yao@codesourcery.com>
4445
4446         * Makefile.in (SFILES): Add common/mips-linux-watch.c.
4447         (mips-linux-watch.o): New rule.
4448         (mips_linux_watch_h): New variable.
4449         * configure.srv <mips*-*-linux*>: Add mips-linux-watch.o to
4450         srv_tgtobj.
4451         * linux-mips-low.c: Include mips-linux-watch.h.
4452         (struct arch_process_info, struct arch_lwp_info): New.
4453         (update_watch_registers_callback): New function.
4454         (mips_linux_new_process, mips_linux_new_thread) New functions.
4455         (mips_linux_prepare_to_resume, mips_insert_point): New
4456         functions.
4457         (mips_remove_point, mips_stopped_by_watchpoint): New
4458         functions.
4459         (rsp_bp_type_to_target_hw_bp_type): New function.
4460         (mips_stopped_data_address): New function.
4461         (the_low_target): Add watchpoint support functions.
4462
4463 2013-07-27  Yao Qi  <yao@codesourcery.com>
4464
4465         * i386-low.c: Include break-common.h.
4466         (enum target_hw_bp_type): Remove.
4467
4468 2013-07-24  Luis Machado  <lgustavo@codesourcery.com>
4469
4470         * Makefile.in (SFILES): /common/target-common.c.
4471         (OBS): Add target-common.o.
4472         (server_h): Add $(srcdir)/../common/target-common.h.
4473         (target-common.o): New target.
4474         * server.c (queue_stop_reply_callback): Free
4475         status string after use.
4476         * target.c (target_waitstatus_to_string): Remove.
4477         * target.h: Include target-common.h.
4478         (resume_kind): Likewise.
4479         (target_waitkind): Likewise.
4480         (target_waitstatus): Likewise.
4481         (TARGET_WNOHANG): Likewise.
4482
4483 2013-07-04  Yao Qi  <yao@codesourcery.com>
4484
4485         * Makefile.in (host_alias): Use @host_noncanonical@.
4486         (target_alias): Use @target_noncanonical@.
4487         * configure.ac: Use ACX_NONCANONICAL_TARGET and
4488         ACX_NONCANONICAL_HOST.
4489         * configure: Regenerated.
4490
4491         Revert:
4492         2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4493
4494         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4495         * configure: Rebuild.
4496         * Makefile.in (version_host, version_target): Get from configure.
4497         (version.c): Use $(version_host) and $(version_target).
4498
4499 2013-07-03  Pedro Alves  <palves@redhat.com>
4500
4501         * Makefile.in (config.status): Depend on development.sh.
4502         * acinclude.m4: Include libmcheck.m4.
4503         * configure: Regenerate.
4504
4505 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4506
4507         * win32-low.c (winapi_DebugActiveProcessStop): Move the WINAPI
4508         attribute inside the parentheses.
4509         (winapi_DebugSetProcessKillOnExit): Ditto.
4510         (winapi_DebugBreakProcess): Ditto.
4511         (winapi_GenerateConsoleCtrlEvent): Ditto.
4512
4513 2013-07-02  Mircea Gherzan  <mircea.gherzan@intel.com>
4514
4515         * notif.h (notif_event): Add a dummy member to avoid compiler
4516         errors.
4517
4518 2013-07-01  Pedro Alves  <palves@redhat.com>
4519
4520         * hostio.c (HOSTIO_PATH_MAX): Define.
4521         (require_filename, handle_open, handle_unlink, handle_readlink):
4522         Use it.
4523
4524 2013-07-01  Pedro Alves  <palves@redhat.com>
4525
4526         * server.h: Include "pathmax.h".
4527         * linux-low.c: Don't include sys/param.h.
4528         (linux_pid_exe_is_elf_64_file): Use PATH_MAX instead of
4529         MAXPATHLEN.
4530         * win32-low.c: Don't include sys/param.h.
4531         (win32_create_inferior): Use PATH_MAX instead of MAXPATHLEN.
4532
4533 2013-07-01  Pedro Alves  <palves@redhat.com>
4534
4535         * event-loop.c: Don't check HAVE_UNISTD_H before including
4536         <unistd.h>.
4537         * gdbreplay.c: Likewise.
4538         * remote-utils.c: Likewise.
4539         * server.c: Likewise.
4540         * configure.ac: Don't check for unistd.h.
4541         * configure: Regenerate.
4542
4543 2013-06-28  Tom Tromey  <tromey@redhat.com>
4544
4545         * Makefile.in (version.c): Use version.in, not
4546         common/version.in.
4547
4548 2013-06-28  Mircea Gherzan  <mircea.gherzan@intel.com>
4549
4550         * configure.ac (version_host, version_target): Set and AC_SUBST them.
4551         * configure: Rebuild.
4552         * Makefile.in (version_host, version_target): Get from configure.
4553         (version.c): Use $(version_host) and $(version_target).
4554
4555 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4556
4557         Fix trace-status to output user name without trailing colon.
4558         * tracepoint.c (cmd_qtstatus): Remove unnecessary colon from user name.
4559
4560 2013-06-10  Dmitry Kozlov <ddk@codesourcery.com>
4561
4562         Fix trace-status to output proper start-time and stop-time.
4563         * tracepoint.c (cmd_qtstatus): Modify trace-status output to
4564         output start time and stop time in hex as gdb expects.
4565
4566 2013-06-26  Pedro Alves  <pedro@codesourcery.com>
4567
4568         * tracepoint.c (build_traceframe_info_xml): Output trace state
4569         variables present in the trace buffer.
4570
4571 2013-06-24  Tom Tromey  <tromey@redhat.com>
4572
4573         * Makefile.in (version.c): Use bfd/version.h, common/version.in,
4574         create-version.sh.
4575         (version.o): Remove.
4576         * gdbreplay.c: Include version.h.
4577         (version, host_name): Don't declare.
4578         * server.h: Include version.h.
4579         (version, host_name): Don't declare.
4580
4581 2013-06-12  Pedro Alves  <palves@redhat.com>
4582
4583         * linux-x86-low.c (linux_is_elf64): Delete global.
4584         (x86_siginfo_fixup): Replace reference to `linux_is_elf64' global
4585         with local linux_pid_exe_is_elf_64_file use.
4586
4587 2013-06-11  Pedro Alves  <palves@redhat.com>
4588
4589         * linux-low.c (regset_disabled, disable_regset): New functions.
4590         (regsets_fetch_inferior_registers)
4591         (regsets_store_inferior_registers): Use them.
4592         (initialize_regsets_info); Don't allocate the disabled_regsets
4593         array here.
4594         * linux-low.h (struct regsets_info) <disabled_regsets>: Extend
4595         comment.
4596
4597 2013-06-11  Pedro Alves  <palves@redhat.com>
4598
4599         * linux-low.c (initialize_regsets_info): Use xcalloc instead of
4600         xmalloc.
4601
4602 2013-06-11  Pedro Alves  <palves@redhat.com>
4603
4604         * linux-x86-low.c (initialize_low_arch): Call
4605         init_registers_x32_avx_linux.
4606
4607 2013-06-09  Jan Kratochvil  <jan.kratochvil@redhat.com>
4608
4609         Fix compatibility with Android Bionic.
4610         * linux-low.c (linux_qxfer_libraries_svr4): Ignore first entry even if
4611         it is not empty.
4612
4613 2013-06-07  Pedro Alves  <palves@redhat.com>
4614
4615         PR server/14823
4616         * Makefile.in (OBS): Add tdesc.o.
4617         (IPA_OBJS): Add tdesc-ipa.o.
4618         (tdesc-ipa.o): New rule.
4619         * ax.c (gdb_eval_agent_expr): Adjust register_size call to new
4620         interface.
4621         * linux-low.c (new_inferior): Delete.
4622         (disabled_regsets, num_regsets): Delete.
4623         (linux_add_process): Adjust to set the new per-process
4624         new_inferior flag.
4625         (linux_detach_one_lwp): Adjust to call regcache_invalidate_thread.
4626         (linux_wait_for_lwp): Adjust.  Only call arch_setup if the event
4627         was a stop.  When calling arch_setup, switch the current inferior
4628         to the thread that got an event.
4629         (linux_resume_one_lwp): Adjust to call regcache_invalidate_thread.
4630         (regsets_fetch_inferior_registers)
4631         (regsets_store_inferior_registers): New regsets_info parameter.
4632         Adjust to use it.
4633         (linux_register_in_regsets): New regs_info parameter.  Adjust to
4634         use it.
4635         (register_addr, fetch_register, store_register): New usrregs_info
4636         parameter.  Adjust to use it.
4637         (usr_fetch_inferior_registers, usr_store_inferior_registers): New
4638         parameter regs_info.  Adjust to use it.
4639         (linux_fetch_registers): Get the current inferior's regs_info, and
4640         adjust to use it.
4641         (linux_store_registers): Ditto.
4642         [HAVE_LINUX_REGSETS] (initialize_regsets_info): New.
4643         (initialize_low): Don't initialize the target_regsets here.  Call
4644         initialize_low_arch.
4645         * linux-low.h (target_regsets): Delete declaration.
4646         (struct regsets_info): New.
4647         (struct usrregs_info): New.
4648         (struct regs_info): New.
4649         (struct process_info_private) <new_inferior>: New field.
4650         (struct linux_target_ops): Delete the num_regs, regmap, and
4651         regset_bitmap fields.  New field regs_info.
4652         [HAVE_LINUX_REGSETS] (initialize_regsets_info): Declare.
4653         * i387-fp.c (num_xmm_registers): Delete.
4654         (i387_cache_to_fsave, i387_fsave_to_cache): Adjust find_regno
4655         calls to new interface.
4656         (i387_cache_to_fxsave, i387_cache_to_xsave, i387_fxsave_to_cache)
4657         (i387_xsave_to_cache): Adjust find_regno calls to new interface.
4658         Infer the number of xmm registers from the regcache's target
4659         description.
4660         * i387-fp.h (num_xmm_registers): Delete.
4661         * inferiors.c (add_thread): Don't install the thread's regcache
4662         here.
4663         * proc-service.c (gregset_info): Fetch the current inferior's
4664         regs_info.  Adjust to use it.
4665         * regcache.c: Include tdesc.h.
4666         (register_bytes, reg_defs, num_registers)
4667         (gdbserver_expedite_regs): Delete.
4668         (get_thread_regcache): If the thread doesn't have a regcache yet,
4669         create one, instead of aborting gdbserver.
4670         (regcache_invalidate_one): Rename to ...
4671         (regcache_invalidate_thread): ... this.
4672         (regcache_invalidate_one): New.
4673         (regcache_invalidate): Only invalidate registers of the current
4674         process.
4675         (init_register_cache): Add target_desc parameter, and use it.
4676         (new_register_cache): Ditto.  Assert the target description has a
4677         non zero registers_size.
4678         (regcache_cpy): Add assertions.  Adjust.
4679         (realloc_register_cache, set_register_cache): Delete.
4680         (registers_to_string, registers_from_string): Adjust.
4681         (find_register_by_name, find_regno, find_register_by_number)
4682         (register_cache_size): Add target_desc parameter, and use it.
4683         (free_register_cache_thread, free_register_cache_thread_one)
4684         (regcache_release, register_cache_size): New.
4685         (register_size): Add target_desc parameter, and use it.
4686         (register_data, supply_register, supply_register_zeroed)
4687         (supply_regblock, supply_register_by_name, collect_register)
4688         (collect_register_as_string, collect_register_by_name): Adjust.
4689         * regcache.h (struct target_desc): Forward declare.
4690         (struct regcache) <tdesc>: New field.
4691         (init_register_cache, new_register_cache): Add target_desc
4692         parameter.
4693         (regcache_invalidate_thread): Declare.
4694         (regcache_invalidate_one): Delete declaration.
4695         (regcache_release): Declare.
4696         (find_register_by_number, register_cache_size, register_size)
4697         (find_regno): Add target_desc parameter.
4698         (gdbserver_expedite_regs, gdbserver_xmltarget): Delete
4699         declarations.
4700         * remote-utils.c: Include tdesc.h.
4701         (outreg, prepare_resume_reply): Adjust.
4702         * server.c: Include tdesc.h.
4703         (gdbserver_xmltarget): Delete declaration.
4704         (get_features_xml, process_serial_event): Adjust.
4705         * server.h [IN_PROCESS_AGENT] (struct target_desc): Forward
4706         declare.
4707         (struct process_info) <tdesc>: New field.
4708         (ipa_tdesc): Declare.
4709         * tdesc.c: New file.
4710         * tdesc.h: New file.
4711         * tracepoint.c: Include tdesc.h.
4712         [IN_PROCESS_AGENT] (ipa_tdesc): Define.
4713         (get_context_regcache): Adjust to pass ipa_tdesc down.
4714         (do_action_at_tracepoint): Adjust to get the register cache size
4715         from the context regcache's description.
4716         (traceframe_walk_blocks): Adjust to get the register cache size
4717         from the current trace frame's description.
4718         (traceframe_get_pc): Adjust to get current trace frame's
4719         description and pass it down.
4720         (gdb_collect): Adjust to get the register cache size from the
4721         IPA's description.
4722         * linux-amd64-ipa.c (tdesc_amd64_linux): Declare.
4723         (gdbserver_xmltarget): Delete.
4724         (initialize_low_tracepoint): Set the ipa's target description.
4725         * linux-i386-ipa.c (tdesc_i386_linux): Declare.
4726         (initialize_low_tracepoint): Set the ipa's target description.
4727         * linux-x86-low.c: Include tdesc.h.
4728         [__x86_64__] (is_64bit_tdesc): New.
4729         (ps_get_thread_area, x86_get_thread_area): Use it.
4730         (i386_cannot_store_register): Rename to ...
4731         (x86_cannot_store_register): ... this.  Use is_64bit_tdesc.
4732         (i386_cannot_fetch_register): Rename to ...
4733         (x86_cannot_fetch_register): ... this.  Use is_64bit_tdesc.
4734         (x86_fill_gregset, x86_store_gregset): Adjust register_size calls
4735         to new interface.
4736         (target_regsets): Rename to ...
4737         (x86_regsets): ... this.
4738         (x86_get_pc, x86_set_pc): Adjust register_size calls to new
4739         interface.
4740         (x86_siginfo_fixup): Use is_64bit_tdesc.
4741         [__x86_64__] (tdesc_amd64_linux, tdesc_amd64_avx_linux)
4742         (tdesc_x32_avx_linux, tdesc_x32_linux)
4743         (tdesc_i386_linux, tdesc_i386_mmx_linux, tdesc_i386_avx_linux):
4744         Declare.
4745         (x86_linux_update_xmltarget): Delete.
4746         (I386_LINUX_XSAVE_XCR0_OFFSET): Define.
4747         (have_ptrace_getfpxregs, have_ptrace_getregset): New.
4748         (AMD64_LINUX_USER64_CS): New.
4749         (x86_linux_read_description): New, based on
4750         x86_linux_update_xmltarget.
4751         (same_process_callback): New.
4752         (x86_arch_setup_process_callback): New.
4753         (x86_linux_update_xmltarget): New.
4754         (x86_regsets_info): New.
4755         (amd64_linux_regs_info): New.
4756         (i386_linux_usrregs_info): New.
4757         (i386_linux_regs_info): New.
4758         (x86_linux_regs_info): New.
4759         (x86_arch_setup): Reimplement.
4760         (x86_install_fast_tracepoint_jump_pad): Use is_64bit_tdesc.
4761         (x86_emit_ops): Ditto.
4762         (the_low_target): Adjust.  Install x86_linux_regs_info,
4763         x86_cannot_fetch_register, and x86_cannot_store_register.
4764         (initialize_low_arch): New.
4765         * linux-ia64-low.c (tdesc_ia64): Declare.
4766         (ia64_fetch_register): Adjust.
4767         (ia64_usrregs_info, regs_info): New globals.
4768         (ia64_regs_info): New function.
4769         (the_low_target): Adjust.
4770         (initialize_low_arch): New function.
4771         * linux-sparc-low.c (tdesc_sparc64): Declare.
4772         (sparc_fill_gregset_to_stack, sparc_store_gregset_from_stack):
4773         Adjust.
4774         (sparc_arch_setup): New function.
4775         (sparc_regsets_info, sparc_usrregs_info, regs_info): New globals.
4776         (the_low_target): Adjust.
4777         (initialize_low_arch): New function.
4778         * linux-ppc-low.c (tdesc_powerpc_32l, tdesc_powerpc_altivec32l)
4779         (tdesc_powerpc_cell32l, tdesc_powerpc_vsx32l)
4780         (tdesc_powerpc_isa205_32l, tdesc_powerpc_isa205_altivec32l)
4781         (tdesc_powerpc_isa205_vsx32l, tdesc_powerpc_e500l)
4782         (tdesc_powerpc_64l, tdesc_powerpc_altivec64l)
4783         (tdesc_powerpc_cell64l, tdesc_powerpc_vsx64l)
4784         (tdesc_powerpc_isa205_64l, tdesc_powerpc_isa205_altivec64l)
4785         (tdesc_powerpc_isa205_vsx64l): Declare.
4786         (ppc_cannot_store_register, ppc_collect_ptrace_register)
4787         (ppc_supply_ptrace_register, parse_spufs_run, ppc_get_pc)
4788         (ppc_set_pc, ppc_get_hwcap): Adjust.
4789         (ppc_usrregs_info): Forward declare.
4790         (!__powerpc64__) ppc_regmap_adjusted: New global.
4791         (ppc_arch_setup): Adjust to the current process'es target
4792         description.
4793         (ppc_fill_vsxregset, ppc_store_vsxregset, ppc_fill_vrregset)
4794         (ppc_store_vrregset, ppc_fill_evrregset, ppc_store_evrregse)
4795         (ppc_store_evrregset): Adjust.
4796         (target_regsets): Rename to ...
4797         (ppc_regsets): ... this, and make static.
4798         (ppc_usrregs_info, ppc_regsets_info, regs_info): New globals.
4799         (ppc_regs_info): New function.
4800         (the_low_target): Adjust.
4801         (initialize_low_arch): New function.
4802         * linux-s390-low.c (tdesc_s390_linux32, tdesc_s390_linux32v1)
4803         (tdesc_s390_linux32v2, tdesc_s390_linux64, tdesc_s390_linux64v1)
4804         (tdesc_s390_linux64v2, tdesc_s390x_linux64, tdesc_s390x_linux64v1)
4805         (tdesc_s390x_linux64v2): Declare.
4806         (s390_collect_ptrace_register, s390_supply_ptrace_register)
4807         (s390_fill_gregset, s390_store_last_break): Adjust.
4808         (target_regsets): Rename to ...
4809         (s390_regsets): ... this, and make static.
4810         (s390_get_pc, s390_set_pc): Adjust.
4811         (s390_get_hwcap): New target_desc parameter, and use it.
4812         [__s390x__] (have_hwcap_s390_high_gprs): New global.
4813         (s390_arch_setup): Adjust to set the current process'es target
4814         description.  Don't adjust the regmap.
4815         (s390_usrregs_info, s390_regsets_info, regs_info): New globals.
4816         [__s390x__] (s390_usrregs_info_3264, s390_regsets_info_3264)
4817         (regs_info_3264): New globals.
4818         (s390_regs_info): New function.
4819         (the_low_target): Adjust.
4820         (initialize_low_arch): New function.
4821         * linux-mips-low.c (tdesc_mips_linux, tdesc_mips_dsp_linux)
4822         (tdesc_mips64_linux, tdesc_mips64_dsp_linux): Declare.
4823         [__mips64] (init_registers_mips_linux)
4824         (init_registers_mips_dsp_linux): Delete defines.
4825         [__mips64] (tdesc_mips_linux, tdesc_mips_dsp_linux): New defines.
4826         (have_dsp): New global.
4827         (mips_read_description): New, based on mips_arch_setup.
4828         (mips_arch_setup): Reimplement.
4829         (get_usrregs_info): New function.
4830         (mips_cannot_fetch_register, mips_cannot_store_register)
4831         (mips_get_pc, mips_set_pc, mips_fill_gregset, mips_store_gregset)
4832         (mips_fill_fpregset, mips_store_fpregset): Adjust.
4833         (target_regsets): Rename to ...
4834         (mips_regsets): ... this, and make static.
4835         (mips_regsets_info, mips_dsp_usrregs_info, mips_usrregs_info)
4836         (dsp_regs_info, regs_info): New globals.
4837         (mips_regs_info): New function.
4838         (the_low_target): Adjust.
4839         (initialize_low_arch): New function.
4840         * linux-arm-low.c (tdesc_arm, tdesc_arm_with_iwmmxt)
4841         (tdesc_arm_with_vfpv2, tdesc_arm_with_vfpv3, tdesc_arm_with_neon):
4842         Declare.
4843         (arm_fill_vfpregset, arm_store_vfpregset): Adjust.
4844         (arm_read_description): New, with bits factored from
4845         arm_arch_setup.
4846         (arm_arch_setup): Reimplement.
4847         (target_regsets): Rename to ...
4848         (arm_regsets): ... this, and make static.
4849         (arm_regsets_info, arm_usrregs_info, regs_info): New globals.
4850         (arm_regs_info): New function.
4851         (the_low_target): Adjust.
4852         (initialize_low_arch): New function.
4853         * linux-m68k-low.c (tdesc_m68k): Declare.
4854         (target_regsets): Rename to ...
4855         (m68k_regsets): ... this, and make static.
4856         (m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
4857         (m68k_regs_info): New function.
4858         (m68k_arch_setup): New function.
4859         (the_low_target): Adjust.
4860         (initialize_low_arch): New function.
4861         * linux-sh-low.c (tdesc_sharch): Declare.
4862         (target_regsets): Rename to ...
4863         (sh_regsets): ... this, and make static.
4864         (sh_regsets_info, sh_usrregs_info, regs_info): New globals.
4865         (sh_regs_info, sh_arch_setup): New functions.
4866         (the_low_target): Adjust.
4867         (initialize_low_arch): New function.
4868         * linux-bfin-low.c (tdesc_bfin): Declare.
4869         (bfin_arch_setup): New function.
4870         (bfin_usrregs_info, regs_info): New globals.
4871         (bfin_regs_info): New function.
4872         (the_low_target): Adjust.
4873         (initialize_low_arch): New function.
4874         * linux-cris-low.c (tdesc_cris): Declare.
4875         (cris_arch_setup): New function.
4876         (cris_usrregs_info, regs_info): New globals.
4877         (cris_regs_info): New function.
4878         (the_low_target): Adjust.
4879         (initialize_low_arch): New function.
4880         * linux-cris-low.c (tdesc_crisv32): Declare.
4881         (cris_arch_setup): New function.
4882         (cris_regsets_info, cris_usrregs_info, regs_info): New globals.
4883         (cris_regs_info): New function.
4884         (the_low_target): Adjust.
4885         (initialize_low_arch): New function.
4886         * linux-m32r-low.c (tdesc_m32r): Declare.
4887         (m32r_arch_setup): New function.
4888         (m32r_usrregs_info, regs_info): New globals.
4889         (m32r_regs_info): Adjust.
4890         (initialize_low_arch): New function.
4891         * linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
4892         (tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
4893         (tic6x_usrregs_info): Forward declare.
4894         (tic6x_read_description): New function, based on ...
4895         (tic6x_arch_setup): ... this.  Reimplement.
4896         (target_regsets): Rename to ...
4897         (tic6x_regsets): ... this, and make static.
4898         (tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
4899         (tic6x_regs_info): New function.
4900         (the_low_target): Adjust.
4901         (initialize_low_arch): New function.
4902         * linux-xtensa-low.c (tdesc_xtensa): Declare.
4903         (xtensa_fill_gregset, xtensa_store_gregset): Adjust.
4904         (target_regsets): Rename to ...
4905         (xtensa_regsets): ... this, and make static.
4906         (xtensa_regsets_info, xtensa_usrregs_info, regs_info): New
4907         globals.
4908         (xtensa_arch_setup, xtensa_regs_info): New functions.
4909         (the_low_target): Adjust.
4910         (initialize_low_arch): New function.
4911         * linux-nios2-low.c (tdesc_nios2_linux): Declare.
4912         (nios2_arch_setup): Set the current process'es tdesc.
4913         (target_regsets): Rename to ...
4914         (nios2_regsets): ... this.
4915         (nios2_regsets_info, nios2_usrregs_info, regs_info): New globals.
4916         (nios2_regs_info): New function.
4917         (the_low_target): Adjust.
4918         (initialize_low_arch): New function.
4919         * linux-aarch64-low.c (tdesc_aarch64): Declare.
4920         (aarch64_arch_setup): Set the current process'es tdesc.
4921         (target_regsets): Rename to ...
4922         (aarch64_regsets): ... this.
4923         (aarch64_regsets_info, aarch64_usrregs_info, regs_info): New globals.
4924         (aarch64_regs_info): New function.
4925         (the_low_target): Adjust.
4926         (initialize_low_arch): New function.
4927         * linux-tile-low.c (tdesc_tilegx, tdesc_tilegx32): Declare
4928         globals.
4929         (target_regsets): Rename to ...
4930         (tile_regsets): ... this.
4931         (tile_regsets_info, tile_usrregs_info, regs_info): New globals.
4932         (tile_regs_info): New function.
4933         (tile_arch_setup): Set the current process'es tdesc.
4934         (the_low_target): Adjust.
4935         (initialize_low_arch): New function.
4936         * spu-low.c (tdesc_spu): Declare.
4937         (spu_create_inferior, spu_attach): Set the new process'es tdesc.
4938         * win32-arm-low.c (tdesc_arm): Declare.
4939         (arm_arch_setup): New function.
4940         (the_low_target): Install arm_arch_setup instead of
4941         init_registers_arm.
4942         * win32-i386-low.c (tdesc_i386, tdesc_amd64): Declare.
4943         (init_windows_x86): Rename to ...
4944         (i386_arch_setup): ... this.  Set `win32_tdesc'.
4945         (the_low_target): Adjust.
4946         * win32-low.c (win32_tdesc): New global.
4947         (child_add_thread): Don't create the thread cache here.
4948         (do_initial_child_stuff): Set the new process'es tdesc.
4949         * win32-low.h (struct target_desc): Forward declare.
4950         (win32_tdesc): Declare.
4951         * lynx-i386-low.c (tdesc_i386): Declare global.
4952         (lynx_i386_arch_setup): Set `lynx_tdesc'.
4953         * lynx-low.c (lynx_tdesc): New global.
4954         (lynx_add_process): Set the new process'es tdesc.
4955         * lynx-low.h (struct target_desc): Forward declare.
4956         (lynx_tdesc): Declare global.
4957         * lynx-ppc-low.c (tdesc_powerpc_32): Declare global.
4958         (lynx_ppc_arch_setup): Set `lynx_tdesc'.
4959         * nto-low.c (nto_tdesc): New global.
4960         (do_attach): Set the new process'es tdesc.
4961         * nto-low.h (struct target_desc): Forward declare.
4962         (nto_tdesc): Declare.
4963         * nto-x86-low.c (tdesc_i386): Declare.
4964         (nto_x86_arch_setup): Set `nto_tdesc'.
4965
4966 2013-06-04  Gary Benson  <gbenson@redhat.com>
4967
4968         * server.c (handle_query): Add "augmented-libraries-svr4-read+"
4969         to qSupported response when appropriate.
4970         (handle_qxfer_libraries_svr4): Allow qXfer:libraries-svr4:read
4971         with nonzero-length annex.
4972         * linux-low.c (linux_qxfer_libraries_svr4): Parse and handle
4973         arguments supplied in annex.
4974
4975 2013-05-31  Doug Evans  <dje@google.com>
4976
4977         PR server/15594
4978         * linux-x86-low.c (ps_get_thread_area): Properly extend address to
4979         64 bits in 64-cross-32 environment.
4980
4981 2013-05-28  Pedro Alves  <palves@redhat.com>
4982
4983         * Makefile.in (clean): Remove reference to aarch64-without-fpu.c.
4984         (aarch64-without-fpu.c): Delete rule.
4985         * configure.srv (aarch64*-*-linux*): Remove references to
4986         aarch64-without-fpu.o and aarch64-without-fpu.xml.
4987         * linux-aarch64-low.c (init_registers_aarch64_without_fpu): Remove
4988         declaration.
4989
4990 2013-05-24  Pedro Alves  <palves@redhat.com>
4991
4992         * server.c (handle_v_cont) <vCont;r>: Use unpack_varlen_hex
4993         instead of strchr/decode_address.  Error if the range isn't split
4994         with a ','.  Don't assume there's be a ':' in the action.
4995
4996 2013-05-23  Yao Qi  <yao@codesourcery.com>
4997             Pedro Alves  <palves@redhat.com>
4998
4999         * linux-low.c (lwp_in_step_range): New function.
5000         (linux_wait_1): If the thread was range stepping and stopped
5001         outside the stepping range, report the stop to GDB.  Otherwise,
5002         continue stepping.  Add range stepping debug output.
5003         (linux_set_resume_request): Copy the step range from the resume
5004         request to the lwp.
5005         (linux_supports_range_stepping): New.
5006         (linux_target_ops) <supports_range_stepping>: Set to
5007         linux_supports_range_stepping.
5008         * linux-low.h (struct linux_target_ops)
5009         <supports_range_stepping>: New field.
5010         (struct lwp_info) <step_range_start, step_range_end>: New fields.
5011         * linux-x86-low.c (x86_supports_range_stepping): New.
5012         (the_low_target) <supports_range_stepping>: Set to
5013         x86_supports_range_stepping.
5014         * server.c (handle_v_cont): Handle 'r' action.
5015         (handle_v_requests): Append ";r" if the target supports range
5016         stepping.
5017         * target.h (struct thread_resume) <step_range_start,
5018         step_range_end>: New fields.
5019         (struct target_ops) <supports_range_stepping>:
5020         New field.
5021         (target_supports_range_stepping): New macro.
5022
5023 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5024
5025         * lynx-low.c (lynx_resume): Fix null_ptid/minus_one_ptid
5026         confusion in comment.
5027
5028 2013-05-17  Joel Brobecker  <brobecker@adacore.com>
5029
5030         * lynx-low.c (struct process_info_private): New type.
5031         (lynx_add_process): New function.
5032         (lynx_create_inferior, lynx_attach): Replace calls to
5033         add_process by calls to lynx_add_process.
5034         (lynx_resume): If PTID is null, then try using
5035         current_process()->private->last_wait_event_ptid.
5036         Add comments.
5037         (lynx_clear_inferiors): Delete.  The contents of that function
5038         has been inlined in lynx_mourn;
5039         (lynx_wait_1): Save the ptid in the process's private data.
5040         (lynx_mourn): Free the process' private data.  Replace call
5041         to lynx_clear_inferiors by call to clear_inferiors.
5042
5043 2013-05-17  Yao Qi  <yao@codesourcery.com>
5044
5045         * i386-low.c (i386_length_and_rw_bits): Move the comment to
5046         the right place.
5047
5048 2013-05-16  Luis Machado  <lgustavo@codesourcery.com>
5049
5050         * linux-low.c: Move definition checks upwards for PT_TEXT_ADDR,
5051         PT_DATA_ADDR and PT_TEXT_END_ADDR.  Update comments.
5052         (linux_read_offsets): Remove PT_TEXT_ADDR, PT_DATA_ADDR and
5053         PT_TEXT_END_ADDR guards.  Update comments.
5054         (linux_target_op) <read_offsets>: Conditionally define to
5055         linux_read_offsets if the target is UCLIBC and if it defines
5056         PT_TEXT_ADDR, PT_DATA_ADDR and PT_TEXT_END_ADDR.
5057
5058 2013-05-06  Sandra Loosemore  <sandra@codesourcery.com>
5059             Andrew Jenner  <andrew@codesourcery.com>
5060
5061         * Makefile.in (SFILES): Add linux-nios2-low.c.
5062         (clean): Add action to delete nios2-linux.c.
5063         (nios2-linux.c): New rule.
5064         * configure.srv: Add nios2*-*-linux*.
5065         * linux-nios2-low.c: New.
5066
5067 2013-05-03  Hafiz Abid Qadeer  <abidh@codesourcery.com>
5068
5069         * tracepoint.c (cmd_qtinit): Call 'stop_tracing'.
5070
5071 2013-04-25  Hui Zhu  <hui@codesourcery.com>
5072
5073         PR gdb/15186
5074         * ax.c (ax_printf): Add fflush.
5075
5076 2013-04-22  Tom Tromey  <tromey@redhat.com>
5077
5078         * Makefile.in (SFILES): Add filestuff.c.
5079         (OBS): Add filestuff.o.
5080         (filestuff.o): New target.
5081         * config.in, configure: Rebuild.
5082         * configure.ac: Check for fdwalk, pipe2.
5083
5084 2013-04-17  Pedro Alves  <palves@redhat.com>
5085
5086         * configure.ac (USE_THREAD_DB): Delete variable.
5087         (if test "$srv_linux_thread_db" = "yes"): AC_DEFINE USE_THREAD_DB.
5088         Don't AC_SUBST USE_THREAD_DB.
5089         * Makefile.in (INTERNAL_CFLAGS): Remove @USE_THREAD_DB@.
5090         * config.in, configure: Regenerate.
5091
5092 2013-04-16  Pedro Alves  <palves@redhat.com>
5093
5094         * linux-low.h (struct lwp_info) <thread_known>: Move under
5095         the USE_THREAD_DB #ifdef.
5096
5097 2013-04-16  Pedro Alves  <palves@redhat.com>
5098
5099         * Makefile.in (INTERNAL_CFLAGS): Add @USE_THREAD_DB@.
5100         (linux-low.o): Delete rule.
5101         * linux-low.h: Always include "gdb_thread_db.h" instead of
5102         conditionally including thread_db.h.
5103         (struct lwp_info) <th>: Guard with #ifdef USE_THREAD_DB instead of
5104         HAVE_THREAD_DB_H.
5105
5106 2013-04-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5107
5108         * Makefile.in (install-only): Fix make install regression.
5109
5110 2013-04-05  Jan Kratochvil  <jan.kratochvil@redhat.com>
5111
5112         Convert man pages to texinfo, new gdbinit.5 texinfo page.
5113         * Makefile.in (install-only): Remove $(man1dir) and gdbserver.1
5114         installation.
5115         * gdbserver.1: Remove.
5116
5117 2013-03-22  Pedro Alves  <palves@redhat.com>
5118
5119         * linux-low.c (handle_extended_wait): Don't call
5120         linux_enable_event_reporting.
5121
5122 2013-03-15  Tony Theodore  <tonyt@logyst.com>
5123
5124         PR build/9098:
5125         * Makefile.in (SHELL): Use @SHELL@.
5126
5127 2013-03-14  Sergio Durigan Junior  <sergiodj@redhat.com>
5128
5129         * tracepoint.c (cmd_qtv): Initialize `val' with zero, silencing
5130         compiler warning.
5131
5132 2013-03-13  Joel Brobecker  <brobecker@adacore.com>
5133
5134         * linux-low.c (linux_target_ops) [!HAVE_LINUX_BTRACE]:
5135         Remove extraneous NULL element.
5136
5137 2013-03-13  Yao Qi  <yao@codesourcery.com>
5138
5139         * tracepoint.c (traceframe_read_tsv): Look for the last matched
5140         'V' block in trace frame.
5141
5142 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5143
5144         * target.h (struct target_ops): Add btrace ops.
5145         (target_supports_btrace): New macro.
5146         (target_enable_btrace): New macro.
5147         (target_disable_btrace): New macro.
5148         (target_read_btrace): New macro.
5149         * gdbthread.h (struct thread_info): Add btrace field.
5150         * server.c: Include btrace-common.h.
5151         (handle_btrace_general_set): New function.
5152         (handle_btrace_enable): New function.
5153         (handle_btrace_disable): New function.
5154         (handle_general_set): Call handle_btrace_general_set.
5155         (handle_qxfer_btrace): New function.
5156         (struct qxfer qxfer_packets[]): Add btrace entry.
5157         * inferiors.c (remove_thread): Disable btrace.
5158         * linux-low: Include linux-btrace.h.
5159         (linux_low_enable_btrace): New function.
5160         (linux_low_read_btrace): New function.
5161         (linux_target_ops): Add btrace ops.
5162         * configure.srv (i[34567]86-*-linux*): Add linux-btrace.o.
5163         Add srv_linux_btrace=yes.
5164         (x86_64-*-linux*): Add linux-btrace.o.
5165         Add srv_linux_btrace=yes.
5166         * configure.ac: Define HAVE_LINUX_BTRACE.
5167         * config.in: Regenerated.
5168         * configure: Regenerated.
5169
5170 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5171
5172         * server.c (handle_qxfer): Preserve error message if -3 is
5173         returned.
5174         (qxfer): Document the -3 return value.
5175
5176 2013-03-11  Markus Metzger  <markus.t.metzger@intel.com>
5177
5178         * Makefile.in (SFILES): Add $(srcdir)/common/linux-btrace.c.
5179         (linux_btrace_h): New variable.
5180         (linux-btrace.o): New rule.
5181
5182 2013-03-08  Stan Shebs  <stan@codesourcery.com>
5183             Hafiz Abid Qadeer  <abidh@codesourcery.com>
5184
5185         * tracepoint.c (trace_buffer_size): New global.
5186         (DEFAULT_TRACE_BUFFER_SIZE): New define.
5187         (init_trace_buffer): Change to one-argument function. Allocate
5188         trace buffer memory.
5189         (handle_tracepoint_general_set): Call cmd_bigqtbuffer_size to
5190         handle QTBuffer:size packet.
5191         (cmd_bigqtbuffer_size): New function.
5192         (initialize_tracepoint): Call init_trace_buffer with
5193         DEFAULT_TRACE_BUFFER_SIZE.
5194         * server.c (handle_query): Add QTBuffer:size in the
5195         supported packets.
5196
5197 2013-03-07  Yao Qi  <yao@codesourcery.com>
5198
5199         * tracepoint.c (cur_action, cur_step_action): Make them unsigned.
5200         (cmd_qtfp): Initialize cur_action and cur_step_action 0 instead
5201         of -1.
5202         (cmd_qtsp): Adjust condition.  Do post increment.
5203         Set cur_action and cur_step_action back to 0.
5204
5205 2013-03-07  Jeremy Bennett  <jeremy.bennett@embecosm.com>
5206
5207         PR server/15236
5208         * linux-low.c (linux_write_memory): Return early success if LEN is
5209         zero.
5210
5211 2013-03-05  Corinna Vinschen  <vinschen@redhat.de>
5212
5213         * configure.srv: Add x86_64-*-cygwin* as target.
5214
5215 2013-02-28  Tom Tromey  <tromey@redhat.com>
5216
5217         * configure.ac: Invoke AC_SYS_LARGEFILE.
5218         * configure, config.in: Rebuild.
5219
5220 2013-02-28  Corinna Vinschen  <vinschen@redhat.com>
5221
5222         * win32-low.c: Throughout, fix format strings and casts of
5223         printf-like functions to avoid type related warnings on all
5224         platforms.
5225         (get_child_debug_event): Print dwDebugEventCode as hex since
5226         that's how it's usually documented.
5227
5228 2013-02-28  Yao Qi  <yao@codesourcery.com>
5229
5230         * tracepoint.c (cmd_qtbuffer): Call phex_nz instead of
5231         pulongest.
5232
5233 2013-02-27  Jiong Wang  <jiwang@tilera.com>
5234
5235         * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c.
5236         (reg-tilegx32.c): New rule.
5237         * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj.
5238         * linux-tile-low.c (tile_arch_setup): New function.  Invoke
5239         different register info initializer according to elf class.
5240         (init_registers_tilgx32): New function.  The tilegx32 register info
5241         initializer.
5242         (tile_fill_gregset): Use "uint_reg_t" to represent register size.
5243         (tile_store_gregset): Likewise.
5244
5245 2013-02-27  Yao Qi  <yao@codesourcery.com>
5246
5247         * server.c (process_point_options): Print debug message when
5248         debug_threads is true.
5249
5250 2013-02-26  Yao Qi  <yao@codesourcery.com>
5251
5252         * tracepoint.c (cmd_qtbuffer): Don't set '\0' in OWN_BUF.
5253
5254 2013-02-19  Pedro Alves  <palves@redhat.com>
5255             Kai Tietz <ktietz@redhat.com>
5256
5257         PR gdb/15161
5258
5259         * server.c (handle_query) <CRC check>: Use unpack_varlen_hex
5260         instead of strtoul to extract address from packet.
5261         (process_serial_event) <'z'>: Likewise.
5262
5263 2013-02-18  Yao Qi  <yao@codesourcery.com>
5264
5265         * linux-bfin-low.c (the_low_target): Use NULL instead of 0.
5266
5267 2013-02-14  Pedro Alves  <palves@redhat.com>
5268
5269         Plug memory leak.
5270
5271         * tracepoint.c (cmd_qtnotes): Free TRACING_USER_NAME,
5272         TRACING_NOTES and TRACING_STOP_NOTE before clobbering.
5273
5274 2013-02-14  Pedro Alves  <palves@redhat.com>
5275
5276         * tracepoint.c (cmd_qtdpsrc): Use savestring.
5277
5278 2013-02-14  Pedro Alves  <palves@redhat.com>
5279
5280         * tracepoint.c (save_string): Delete.
5281         (add_tracepoint_action): Use savestring instead of save_string.
5282
5283 2013-02-12  Pedro Alves  <palves@redhat.com>
5284
5285         * linux-xtensa-low.c: Ditto.
5286         * xtensa-xtregs.c: Ditto.
5287
5288 2013-02-12  Sanimir Agovic  <sanimir.agovic@intel.com>
5289
5290         * thread-db.c (thread_db_get_tls_address): NULL pointer check
5291         thread_db.
5292
5293 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5294
5295         * linux-aarch64-low.c (aarch64_arch_setup): Clamp
5296         aarch64_num_wp_regs and aarch64_num_bp_regs to
5297         AARCH64_HWP_MAX_NUM and AARCH64_HBP_MAX_NUM respectively.
5298
5299 2013-02-07  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5300
5301         * linux-aarch64-low.c (ps_get_thread_area): Replace
5302         PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
5303
5304 2013-02-04  Jim MacArthur  <jim.macarthur@arm.com>
5305             Marcus Shawcroft  <marcus.shawcroft@arm.com>
5306             Nigel Stephens  <nigel.stephens@arm.com>
5307             Yufeng Zhang  <yufeng.zhang@arm.com>
5308
5309         * Makefile.in (clean): Remove aarch64.c and aarch64-without-fpu.c.
5310         (aarch64.c, aarch64-without-fpu.c): New targets.
5311         * configure.srv (aarch64*-*-linux*): New.
5312         * linux-aarch64-low.c: New file.
5313
5314 2013-02-04  Marcus Shawcroft  <marcus.shawcroft@arm.com>
5315
5316         * linux-low.c (handle_extended_wait, linux_create_inferior)
5317         (linux_attach_lwp_1, linux_kill_one_lwp, linux_attach_one_lwp)
5318         (dequeue_one_deferred_signal, linux_resume_one_thread)
5319         (fetch_register, linux_write_memory, linux_enable_event_reporting)
5320         (linux_tracefork_grandchild, linux_test_for_tracefork)
5321         (linux_read_offsets, linux_xfer_siginfo, linux_xfer_siginfo): Add
5322         PTRACE_ARG3_TYPE and PTRACE_ARG4_TYPE cast to ptrace arguments
5323         where the argument is 0.
5324
5325 2013-01-25  Yao Qi  <yao@codesourcery.com>
5326
5327         * event-loop.c: Include "queue.h".
5328         (gdb_event_p): New typedef.
5329         (struct gdb_event) <next_event>: Remove.
5330         (event_queue): Change to QUEUE(gdb_event_p).
5331         (async_queue_event): Remove.
5332         (gdb_event_xfree): New.
5333         (initialize_event_loop): New.
5334         (process_event): Use API from QUEUE.
5335         (wait_for_event): Likewise.
5336         * server.c (main): Call initialize_event_loop.
5337         * server.h (initialize_event_loop): Declare.
5338
5339 2013-01-18  Yao Qi  <yao@codesourcery.com>
5340
5341         * ax.h (struct eval_agent_expr_context): New.
5342         (gdb_eval_agent_expr): Update declaration.
5343         * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and
5344         TFRAME.  Add new argument CTX.
5345         * server.h (struct eval_agent_expr_context): Declare.
5346         (agent_mem_read, agent_tsv_read): Update declaration.
5347         (agent_mem_read_string): Likewise.
5348         * tracepoint.c (eval_tracepoint_agent_expr): Remove.
5349         (add_traceframe_block): Add new argument TPOINT.
5350         Increase TPOINT->traceframe_usage.
5351         (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of
5352         eval_tracepoint_agent_expr.
5353         (condition_true_at_tracepoint): Likewise.
5354         (agent_mem_read): Remove argument TFRAME.  Add argument CTX.
5355         (agent_mem_read_string, agent_tsv_read): Likewise.
5356
5357 2013-01-16  Yao Qi  <yao@codesourcery.com>
5358
5359         * linux-low.c (linux_resume_one_lwp): Don't check
5360         'lwp->bp_reinsert != 0'.
5361
5362 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5363             Pedro Alves  <palves@redhat.com>
5364
5365         * lynx-low.c (ptrace_request_to_str): Define a temporary
5366         macro and use it to simplify this function's implementation.
5367
5368 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5369
5370         * lynx-low.c (lynx_resume): Call perror_with_name if lynx_ptrace
5371         sets errno.
5372
5373 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5374
5375         * configure.srv (i[34567]86-*-lynxos*): Set srv_xmlfiles.
5376
5377 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5378
5379         * configure.srv (powerpc-*-lynxos*): Set srv_xmlfiles.
5380
5381 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5382
5383         * lynx-low.c (lynx_resume): Use the resume_info parameter
5384         to determine the ptid for the lynx_ptrace call, unless
5385         it is equal to minus_one_ptid, in which case we use the
5386         ptid of the current_inferior.
5387         (lynx_wait_1): After having received a thread create/exit
5388         event, resume the inferior's execution using the signaling
5389         thread's ptid, rather than the old ptid.
5390
5391 2013-01-07  Joel Brobecker  <brobecker@adacore.com>
5392
5393         * lynx-low.c (lynx_resume): Delete variable ret.
5394
5395 2013-01-01  Joel Brobecker  <brobecker@adacore.com>
5396
5397         * gdbreplay.c (gdbreplay_version): Update copyright year.
5398         * server.c (gdbserver_version): Likewise.
5399
5400 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5401
5402         * lynx-low.c (lynx_wait_1): Add debug trace before adding
5403         new thread.
5404
5405 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5406
5407         * lynx-low.c (ptrace_request_to_str): Add handling for
5408         PTRACE_GETTRACESIG.
5409
5410 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5411
5412         * lynx-low.c (lynx_attach): Delete variable new_process.
5413
5414 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5415
5416         * lynx-low.c (lynx_create_inferior): Delete variable
5417         new_process.
5418
5419 2012-12-17  Joel Brobecker  <brobecker@adacore.com>
5420
5421         * lynx-low.c (ptrace_request_to_str): Do not handle
5422         PTRACE_GETTHREADLIST if this macro does not exist.
5423
5424 2012-12-15  Yao Qi  <yao@codesourcery.com>
5425
5426         * Makefile.in (OBS): Add notif.o.
5427         * notif.c, notif.h: New.
5428         * server.c: Include "notif.h".
5429         (struct vstop_notif) <next>: Remove.
5430         <base>: New field.
5431         (queue_stop_reply): Update.
5432         (push_event, send_next_stop_reply): Remove.
5433         (discard_queued_stop_replies): Update.
5434         (notif_stop): New variable.
5435         (handle_v_stopped): Remove.
5436         (handle_v_requests): Don't call handle_v_stopped.  Call
5437         handle_ack_notif instead.
5438         (queue_stop_reply_callback): Call notif_event_enque instead
5439         of queue_stop_reply.
5440         (handle_status): Don't call send_next_stop_reply, call
5441         notif_write_event instead.
5442         (kill_inferior_callback): Likewise.
5443         (detach_or_kill_inferior_callback): Likewise.
5444         (main): Call initialize_notif.
5445         (process_serial_event): Call QUEUE_is_empty.
5446         (handle_target_event): Call notif_push instead of push event.
5447         * server.h (push_event): Remove declaration.
5448
5449 2012-12-10  Tom Tromey  <tromey@redhat.com>
5450
5451         * Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
5452         (COMPILE.post, COMPILE, POSTCOMPILE, IPAGENT_COMPILE): New
5453         macros.
5454         (.c.o): Rewrite.
5455         (ax-ipa.o, tracepoint-ipa.o, utils-ipa.o, format-ipa.o)
5456         (common-utils-ipa.o, remote-utils-ipa.o, regcache-ipa.o)
5457         (i386-linux-ipa.o, linux-i386-ipa.o, linux-amd64-ipa.o)
5458         (amd64-linux-ipa.o, ax.o): Rewrite.
5459         (event-loop.o, hostio.o, hostio-errno.o, inferiors.o, mem-break.o)
5460         (proc-service.o, regcache.o, remote-utils.o, server.o, target.o)
5461         (thread-db.o, tracepoint.o, utils.o, gdbreplay.o, dll.o): Remove.
5462         (signals.o, linux-procfs.o, linux-ptrace.o, common-utils.o, vec.o)
5463         (gdb_vecs.o, xml-utils.o, linux-osdata.o, ptid.o, buffer.o)
5464         (format.o, agent.o, vasprintf.o, vsnprintf.o): Rewrite.
5465         (i386-low.o, i387-fp.o, linux-low.o, linux-arm-low.o)
5466         (linux-bfin-low.o, linux-cris-low.o, linux-crisv32-low.o)
5467         (linux-ia64-low.o, linux-m32r-low.o, linux-mips-low.o)
5468         (linux-ppc-low.o, linux-s390-low.o, linux-sh-low.o)
5469         (linux-tic6x-low.o, linux-x86-low.o, linux-xtensa-low.o)
5470         (linux-tile-low.o, lynx-low.o, lynx-ppc-low.o, nto-low.o)
5471         (nto-x86-low.o, linux-low.o, win32-low.o, win32-arm-low.o)
5472         (win32-i386-low.o, spu-low.o, reg-arm.o, arm-with-iwmmxt.o)
5473         (arm-with-vfpv2.o, arm-with-vfpv3.o, arm-with-neon.o, reg-bfin.o)
5474         (reg-cris.o, reg-crisv32.o, i386.o, i386-linux.o, i386-avx.o)
5475         (i386-avx-linux.o, i386-mmx.o, i386-mmx-linux.o, reg-ia64.o)
5476         (reg-m32r.o, reg-m68k.o, reg-cf.o, mips-linux.o, mips-dsp-linux.o)
5477         (mips64-linux.o, mips64-dsp-linux.o, powerpc-32.o, powerpc-32l.o)
5478         (powerpc-altivec32l.o, powerpc-cell32l.o, powerpc-vsx32l.o)
5479         (powerpc-isa205-32l.o, powerpc-isa205-altivec32l.o)
5480         (powerpc-isa205-vsx32l.o, powerpc-e500l.o, powerpc-64l.o)
5481         (powerpc-altivec64l.o, powerpc-cell64l.o, powerpc-vsx64l.o)
5482         (powerpc-isa205-64l.o, powerpc-isa205-altivec64l.o)
5483         (powerpc-isa205-vsx64l.o, s390-linux32.o, s390-linux32v1.o)
5484         (s390-linux32v2.o, s390-linux64.o, s390-linux64v1.o)
5485         (s390-linux64v2.o, s390x-linux64.o, s390x-linux64v1.o)
5486         (s390x-linux64v2.o, tic6x-c64xp-linux.o, tic6x-c64x-linux.o)
5487         (tic6x-c62x-linux.o, reg-sh.o, reg-sparc64.o, reg-spu.o, amd64.o)
5488         (amd64-linux.o, amd64-avx.o, amd64-avx-linux.o, x32.o)
5489         (x32-linux.o, x32-avx.o, x32-avx-linux.o, reg-xtensa.o)
5490         (reg-tilegx.o): Remove.
5491         (all_object_files): New macro.
5492         Include .deps files.
5493         * aclocal.m4, configure: Rebuild.
5494         * acinclude.m4: Include depstand.m4, lead-dot.m4.
5495         * configure.ac: Invoke ZW_CREATE_DEPDIR,
5496         ZW_PROG_COMPILER_DEPENDENCIES.  Compute GMAKE condition.
5497
5498 2012-12-05  Tom Tromey  <tromey@redhat.com>
5499
5500         PR gdb/14917:
5501         * server.h (current_insn_ptr, emit_error): Declare 'extern'.
5502
5503 2012-11-28  Markus Metzger  <markus.t.metzger@intel.com>
5504
5505         * configure.ac: Check for linux/perf_event.h.
5506         * config.in: Regenerated.
5507         * configure: Regenerated.
5508
5509 2012-11-26  Maxime Villard  <rustyBSD@gmx.fr>
5510
5511         * hostio.c (handle_readlink): Decrease buffer size
5512         parameter passed to readlink by one byte.
5513
5514 2012-11-26  Yao Qi  <yao@codesourcery.com>
5515
5516         * configure.ac (build_warnings): Append '-Wempty-body'.
5517         * configure: Regenerated.
5518         * linux-low.c (linux_create_inferior): Use braces for empty 'if'
5519         body.
5520
5521 2012-11-15  Pierre Muller  <muller@sourceware.org>
5522
5523         * configure.ac (AC_CHECK_HEADERS): Add wait.h header.
5524         * config.in: Regenerate.
5525         * configure: Regenerate.
5526         * linux-low.c: Use "gdb_stat.h" header instead of <sys/stat.h> header.
5527         Use "gdb_wait.h" header instead of <sys/wait.h> header.
5528         * lynx-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5529         * remote-utils.c: Use "gdb_stat.h" header instead of <sys/stat.h>
5530         header.
5531         * server.c: Remove HAVE_WAIT_H conditional.  Use "gdb_wait.h" header
5532         instead of <sys/wait.h> header.
5533         * spu-low.c: Use "gdb_wait.h" header instead of <sys/wait.h> header.
5534
5535 2012-11-13 Markus Metzger  <markus.t.metzger@intel.com>
5536
5537         * Makefile.in: (INTERNAL_CFLAGS): Add -DGDBSERVER
5538         (various make rules): Remove -DGDBSERVER
5539
5540 2012-11-09  Yao Qi  <yao@codesourcery.com>
5541
5542         * spu-low.c (current_ptid): Move it to ..
5543         * gdbthread.h: ... here.  New.
5544         * remote-utils.c (read_ptid): Use macro 'current_ptid'.
5545         * server.c (myresume, process_serial_event): Likewise.
5546         * thread-db.c (thread_db_find_new_threads): Likewise.
5547         * tracepoint.c (run_inferior_command): Likewise.
5548
5549 2012-10-01  Andrew Burgess  <aburgess@broadcom.com>
5550
5551         * server.c (handle_search_memory_1): Include access length in
5552         warning message.
5553
5554 2012-09-05  Michael Brandt  <michael.brandt@axis.com>
5555
5556         * linux-crisv32-low.c: Fix compile errors.
5557
5558 2012-09-04  Yao Qi  <yao@codesourcery.com>
5559
5560         * tracepoint.c (cmd_qtsv): Adjust debug message.
5561         Don't check CUR_TPOINT.
5562
5563 2012-08-28  Yao Qi  <yao@codesourcery.com>
5564
5565         * ax.c, tracepoint.c: Replace ATTR_FORMAT with ATTRIBUTE_PRINTF.
5566         * server.h: Include 'libiberty.h' and 'ansidecl.h'.
5567         (ATTR_NORETURN, ATTR_FORMAT, ATTR_MALLOC): Remove.
5568         Remove declarations of xmalloc, xreallloc, xstrdup and
5569         freeargv.
5570         * Makefile.in (libiberty_h): New.
5571         (server_h): Append dependencies 'libiberty.h' and 'ansidecl.h'.
5572         (linux-bfin-low.o): Append dependency 'libiberty.h'.
5573
5574 2012-08-23  Yao Qi  <yao@codesourcery.com>
5575
5576         * server.h: Remove declaration of 'xsnprintf'.
5577
5578 2012-08-22  Keith Seitz  <keiths@redhat.com>
5579
5580         * server.h: Include build-gnulib-gbserver/config.h.
5581         * gdbreplay.c: Likewise.
5582
5583 2012-08-08  Doug Evans  <dje@google.com>
5584
5585         * Makefile.in (SFILES): Add gdb_vecs.c.
5586         (OBS): Add gdb_vecs.o.
5587         (gdb_vecs_h, host_defs_h): New variables.
5588         (thread-db.o): Add $(gdb_vecs_h) dependency.
5589         (gdb_vecs.o): New rule.
5590         * thread-db.c: #include "gdb_vecs.h".
5591         (thread_db_load_search): Use a vector to iterate over path elements.
5592         Handle text appearing after "$pdir".
5593
5594         * configure.ac: Add check for strstr.
5595         * config.in: Regenerate.
5596         * configure: Regenerate.
5597
5598 2012-08-02  Ulrich Weigand  <ulrich.weigand@linaro.org>
5599
5600         * hostio.c (handle_pread): If pread fails, fall back to attempting
5601         lseek/read.
5602         (handle_pwrite): Likewise for pwrite.
5603
5604 2012-08-01  Ulrich Weigand  <ulrich.weigand@linaro.org>
5605
5606         * linux-arm-low.c (arm_linux_hw_point_initialize): Distinguish
5607         between unsupported TYPE and unimplementable ADDR/LEN combination.
5608         (arm_insert_point): Act on new return value.
5609
5610 2012-07-31  Pedro Alves  <palves@redhat.com>
5611
5612         * server.c (process_point_options): Only skip tokens if we find
5613         one that is unrecognized.  Don't treat 'X' specially while
5614         skipping unrecognized tokens.
5615
5616 2012-07-30  Ulrich Weigand  <ulrich.weigand@linaro.org>
5617
5618         * linux-arm-low.c (arm_linux_hw_point_initialize): Do not attempt
5619         to 4-byte-align HW breakpoint addresses for Thumb.
5620
5621 2012-07-27  Yao Qi  <yao@codesourcery.com>
5622
5623         PR remote/14161.
5624
5625         * server.h: Declare gdb_agent_about_to_close.
5626         * target.c (kill_inferior): Include "agent.h".
5627         New.  Send command 'kill'.
5628         * target.h (kill_inferior): Removed macro.
5629         * tracepoint.c (gdb_agent_about_to_close): New.
5630         (gdb_agent_helper_thread): Handle command 'close'.
5631         Wait endlessly until the inferior stops.
5632         Install gdb_agent_remove_socket to atexit hook.
5633         (agent_socket_name): New static variable.
5634         (gdb_agent_socket_init): Replace local variable 'name' with
5635         'agent_socket_name'.
5636         (gdb_agent_remove_socket): New.
5637
5638 2012-07-27  Yao Qi  <yao@codesourcery.com>
5639
5640         * server.c (process_point_options): Stop at 'X' when parsing.
5641
5642 2012-07-19  Michael Eager  <eager@eagercon.com>
5643
5644         * i386-low.c (Z_packet_to_hw_type): Add Z_PACKET_HW_BP, translate
5645         to hw_execute.
5646         * linux-x86-low.c (x86_insert_point, x86_remove_point):
5647         Call i386_low_insert_watchpoint, i386_low_remove_watchpoint to add/del
5648         hardware breakpoint.
5649
5650 2012-07-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
5651
5652         * gdbserver/linux-low.c (initialize_low): Call
5653         linux_ptrace_init_warnings.
5654
5655 2012-07-02  Doug Evans  <dje@google.com>
5656
5657         * mem-break.c (gdb_no_commands_at_breakpoint): Fix cast from
5658         pointer to int.
5659
5660 2012-07-02  Stan Shebs  <stan@codesourcery.com>
5661
5662         * Makefile.in (WARN_CFLAGS_NO_FORMAT): Define.
5663         (ax.o): Add it to build rule.
5664         (ax-ipa.o): Ditto.
5665         (OBS): Add format.o.
5666         (IPA_OBS): Add format.o.
5667         * server.c (handle_query): Claim support for breakpoint commands.
5668         (process_point_options): Add command case.
5669         (process_serial_event): Leave running if there are printfs in
5670         effect.
5671         * mem-break.h (any_persistent_commands): Declare.
5672         (add_breakpoint_commands): Declare.
5673         (gdb_no_commands_at_breakpoint): Declare.
5674         (run_breakpoint_commands): Declare.
5675         * mem-break.c (struct point_command_list): New struct.
5676         (struct breakpoint): New field command_list.
5677         (any_persistent_commands): New function.
5678         (add_commands_to_breakpoint): New function.
5679         (add_breakpoint_commands): New function.
5680         (gdb_no_commands_at_breakpoint): New function.
5681         (run_breakpoint_commands): New function.
5682         * linux-low.c (linux_wait_1): Test for and run breakpoint commands
5683         locally.
5684         * ax.c: Include format.h.
5685         (ax_printf): New function.
5686         (gdb_eval_agent_expr): Add printf opcode.
5687
5688 2012-06-13  Yao Qi  <yao@codesourcery.com>
5689
5690         * server.c (start_inferior): Remove duplicated writes to fields
5691         'last_resume_kind' and 'last_status' of 'current_inferior'.
5692
5693 2012-06-12  Yao Qi  <yao@codesourcery.com>
5694             Pedro Alves  <palves@redhat.com>
5695
5696         * linux-low.c (linux_set_resume_request): Simplify predicate.  Add
5697         comment.
5698         * server.c (handle_v_cont): Extend comment.
5699
5700 2012-06-11  Yao Qi  <yao@codesourcery.com>
5701
5702         * linux-low.c (linux_attach): Add 'static'.
5703
5704 2012-06-06  Yao Qi  <yao@codesourcery.com>
5705
5706         * ax.c (gdb_eval_agent_expr): Print `top' in hex.
5707
5708 2012-06-01  Jan Kratochvil  <jan.kratochvil@redhat.com>
5709
5710         Fix gcc -flto compilation warning.
5711         * server.c (main): Make variable multi_mode and attach volatile.
5712
5713 2012-05-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5714
5715         * linux-low.c (get_r_debug): Disable code using DT_MIPS_RLD_MAP
5716         if the platform doesn't know about it.
5717
5718 2012-05-30  Jeff Kenton  <jkenton@tilera.com>
5719
5720         * Makefile.in (SFILES): Add linux-tile-low.c.
5721         (linux-tile-low.o, reg-tilegx.o, reg-tilegx.c): New rules.
5722         * configure.srv: Handle tilegx-*-linux*.
5723         * linux-tile-low.c: New file.
5724
5725 2012-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
5726
5727         * linux-low.c (linux_qxfer_libraries_svr4): Return -1 if R_DEBUG is -1.
5728
5729 2012-05-24  Pedro Alves  <palves@redhat.com>
5730
5731         PR gdb/7205
5732
5733         Replace TARGET_SIGNAL_ with GDB_SIGNAL_ throughout.
5734
5735 2012-05-24  Pedro Alves  <palves@redhat.com>
5736
5737         PR gdb/7205
5738
5739         Replace target_signal with gdb_signal throughout.
5740
5741 2012-05-22  Maciej W. Rozycki  <macro@codesourcery.com>
5742
5743         * linux-low.c (linux_store_registers): Avoid the copying sequence
5744         when no data has been retrieved by ptrace.
5745
5746 2012-05-22  Will Deacon  <will.deacon@arm.com>
5747
5748         * linux-low (__UCLIBC__ && !(__UCLIBC_HAS_MMU__ || __ARCH_HAS_MMU__)):
5749         Include asm/ptrace.h.
5750         (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define only if not
5751         already defined.
5752
5753 2012-05-21  Maciej W. Rozycki  <macro@codesourcery.com>
5754
5755         * linux-low.c (linux_store_registers): Don't re-retrieve data
5756         with ptrace that has already been obtained from /proc.  Always
5757         copy any data retrieved with ptrace to the buffer supplied.
5758
5759 2012-05-11  Yao Qi  <yao@codesourcery.com>
5760             Pedro Alves  <palves@redhat.com>
5761
5762         * linux-low.c (enum stopping_threads_kind): New.
5763         (stopping_threads): Change type to `enum stopping_threads_kind'.
5764         (handle_extended_wait): If stopping and suspending threads, leave
5765         the new_lwp suspended too.
5766         (linux_wait_for_event): Adjust.
5767         (stop_all_lwps): Set `stopping_threads' to
5768         STOPPING_AND_SUSPENDING_THREADS or STOPPING_THREADS depending on
5769         whether we're suspending threads or just stopping them.  Assert no
5770         recursion happens.
5771
5772 2012-04-29  Yao Qi  <yao@codesourcery.com>
5773
5774         * server.h: Move some code to ...
5775         * gdbthread.h: ... here.  New.
5776         * Makefile.in (inferiors.o, regcache.o): Depends on gdbthread.h
5777         (remote-utils.o, server.o, target.o tracepoint.o): Likewise.
5778         (nto-low.o, win32-low.o): Likewise.
5779         * inferiors.c, linux-low.h, nto-low.c: Include gdbthread.h.
5780         * regcache.c, remote-utils.c, server.c: Likewise.
5781         * target.c, tracepoint.c, win32-low.c: Likewise.
5782
5783 2012-04-24  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5784
5785         * linux-low.h (PTRACE_ARG3_TYPE): Move macro from linux-low.c.
5786         (PTRACE_ARG4_TYPE): Likewise.
5787         (PTRACE_XFER_TYPE): Likewise.
5788         * linux-arm-low.c (arm_prepare_to_resume): Cast third argument of
5789         ptrace to PTRACE_ARG3_TYPE.
5790         * linux-low.c (PTRACE_ARG3_TYPE): Move macro to linux-low.h.
5791         (PTRACE_ARG4_TYPE): Likewise.
5792         (PTRACE_XFER_TYPE): Likewise.
5793         (linux_detach_one_lwp): Cast fourth argument of
5794         ptrace to long then PTRACE_ARG4_TYPE.
5795         (regsets_fetch_inferior_registers): Cast third argument of
5796         ptrace to long then PTRACE_ARG3_TYPE.
5797         (regsets_store_inferior_registers): Likewise.
5798
5799 2012-04-20  Pedro Alves  <palves@redhat.com>
5800
5801         * configure: Regenerate.
5802
5803 2012-04-19  Pedro Alves  <palves@redhat.com>
5804
5805         * Makefile.in (GNULIB_BUILDDIR): New.
5806         (LIBGNU, INCGNU, GNULIB_H): Adjust.
5807         (SUBDIRS, CLEANDIRS, REQUIRED_SUBDIRS): New.
5808         (all, install-only, uninstall, clean-info, all-lib, clean): No
5809         longer pass GNULIB_FLAGS_TO_PASS.  Use subdir_do.
5810         (maintainer-clean realclean distclean): Use subdir_do.
5811         (subdir_do): New.
5812         (gnulib/import/Makefile): Adjust.  Replace gnulib/import with
5813         $(GNULIB_BUILDDIR).  Don't pass argument to config.status.
5814         * acinclude.m4: Include acx_configure_dir.m4.
5815         * configure.ac: Remove gl_EARLY, gl_INIT, and AM_INIT_AUTOMAKE
5816         calls.  Call AC_PROG_RANLIB.  Configure gnulib using
5817         ACX_CONFIGURE_DIR.
5818         (GNULIB): New.
5819         (GNULIB_STDINT_H): Adjust.
5820         (AC_OUTPUT): Don't output gnulib/Makefile anymore.
5821         * gdbreplay.c: Include build-gnulib/config.h.
5822         * server.h: Likewise.
5823         * aclocal.m4: Regenerate.
5824         * config.in: Regenerate.
5825         * configure: Regenerate.
5826
5827 2012-04-19  Pedro Alves  <palves@redhat.com>
5828
5829         * Makefile.in (LIBGNU, INCGNU): Adjust.
5830         (GNULIB_FLAGS_TO_PASS, GNULIB_H): Adjust.
5831         (all, install-only, uninstall, clean-info, all-lib, clean)
5832         (maintainer-clean, Makefile, gnulib/Makefile): Adjust.
5833         * configure.ac: Adjust AC_OUTPUT output.
5834         * aclocal.m4: Regenerate.
5835         * configure: Regenerate.
5836
5837 2012-04-19  Pedro Alves  <palves@redhat.com>
5838
5839         * Makefile.in (generated_files): New.
5840         (server_h): Remove the explicit dependency on config.h, and depend
5841         on $generated_files.
5842
5843 2012-04-19  Pedro Alves  <palves@redhat.com>
5844
5845         * Makefile.in (INCGNU): Add -Ignulib.
5846
5847 2012-04-19  Pedro Alves  <palves@redhat.com>
5848
5849         * Makefile.in (GNULIB_INCLUDE_DIR): Rename to ...
5850         (INCGNU): ... this, and spell out -I here.
5851         (GNULIB_LIB): Rename to ...
5852         (LIBGNU): ... this.
5853         (INCLUDE_CFLAGS, gdbserver$(EXEEXT), $(GNULIB_LIB) rule): Adjust.
5854
5855 2012-04-19  Pedro Alves  <palves@redhat.com>
5856
5857         * config.in: Regenerate.
5858
5859 2012-04-19  Pedro Alves  <palves@redhat.com>
5860
5861         * configure.ac: Remove AC_CHECK_DECLS check for memmem.
5862         * server.h (memmem): Remove declaration.
5863         * config.in: Regenerate.
5864         * configure: Regenerate.
5865
5866 2012-04-19  Yao Qi  <yao@codesourcery.com>
5867
5868         * Makefile.in (SFILES): Add common/vec.c.
5869         (OBS): Add vec.o.
5870         (vec.o): New rule.
5871
5872 2012-04-19  Yao Qi  <yao@codesourcery.com>
5873
5874         * remote-utils.c (prepare_resume_reply): Replace with macro
5875         target_core_of_thread.
5876         * server.c (handle_qxfer_threads_proper): Likewise.
5877         * target.h (traget_core_of_thread): New macro.
5878
5879 2012-04-18  Pedro Alves  <palves@redhat.com>
5880
5881         * aclocal.m4: Regenerate.
5882         * configure: Regenerate.
5883
5884 2012-04-16  Yao Qi  <yao@codesourcery.com>
5885
5886         * tracepoint.c (cmd_qtstart): Download tracepoints even when they are
5887         duplicated on address.
5888
5889 2012-04-16  Yao Qi  <yao@codesourcery.com>
5890
5891         * tracepoint.c (COPY_FIELD_TO_BUF): New macro.
5892         (struct tracepoint_action_ops) <send>: New field.
5893         (m_tracepoint_action_send, r_tracepoint_action_send): New.
5894         (agent_expr_send, x_tracepoint_action_send): New.
5895         (l_tracepoint_action_send): New.
5896         (cmd_qtdp): Download and install tracepoint
5897         according to `use_agent'.
5898         (run_inferior_command): Add one more parameter `len'.
5899         Update callers.
5900         (tracepoint_send_agent): New.
5901         (cmd_qtdp, cmd_qtstart): Call tracepoint_send_agent.
5902
5903 2012-04-16  Yao Qi  <yao@codesourcery.com>
5904
5905         * tracepoint.c (download_tracepoints): Moved to ...
5906         (cmd_qtstart): ... here.
5907
5908 2012-04-14  Yao Qi  <yao@codesourcery.com>
5909
5910         * tracepoint.c: Include inttypes.h.
5911         (struct collect_memory_action): Use sized types.
5912         (struct tracepoint): Likewise.
5913         (cmd_qtdp, stop_tracing): Update print specifiers.
5914         (cmd_qtp, response_tracepoint): Likewise.
5915         (collect_data_at_tracepoint): Likewise.
5916         (collect_data_at_step): Likewise.
5917
5918 2012-04-14  Yao Qi  <yao@codesourcery.com>
5919
5920         Import gnulib module inttypes.
5921         * aclocal.m4, config.in, configure: Regenerated.
5922
5923 2012-04-14  Yao Qi  <yao@codesourcery.com>
5924
5925         * Makefile.in (maintainer-clean, realclean, distclean): Remove
5926         Makefile and config.status at last.
5927
5928 2012-04-13  Yao Qi  <yao@codesourcery.com>
5929
5930         * tracepoint.c: Include stdint.h unconditionally.
5931
5932 2012-04-13  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
5933
5934         * acinclude.m4 (GDBSERVER_HAVE_THREAD_DB_TYPE): New macro based
5935         on BFD_HAVE_SYS_PROCFS_TYPE.
5936         * configure.ac: Look for lwpid_t and psaddr_t in libthread_db.h.
5937         * configure: Regenerate.
5938         * config.in: Likewise.
5939
5940 2012-04-13  H.J. Lu  <hongjiu.lu@intel.com>
5941
5942         * Makefile.in (clean): Also remove x32.c x32-linux.c
5943         x32-avx.c x32-avx-linux.c.
5944         (x32.o): New target.
5945         (x32.c): Likewise.
5946         (x32-linux.o): Likewise.
5947         (x32-linux.c): Likewise.
5948         (x32-avx.o): Likewise.
5949         (x32-avx.c): Likewise.
5950         (x32-avx-linux.o): Likewise.
5951         (x32-avx-linux.c): Likewise.
5952
5953         * configure.srv (srv_amd64_regobj): Add x32.o x32-avx.o.
5954         (srv_amd64_linux_regobj): Add x32-linux.o x32-avx-linux.o.
5955         (srv_i386_64bit_xmlfiles): Add i386/x32-core.xml.
5956         (srv_amd64_xmlfiles): Add i386/x32.xml i386/x32-avx.xml.
5957         (srv_amd64_linux_xmlfiles): Add i386/x32-linux.xml
5958         i386/x32-avx-linux.xml.
5959
5960         * linux-x86-low.c (init_registers_x32_linux): New prototype.
5961         (init_registers_x32_avx_linux): Likwise.
5962         (x86_linux_update_xmltarget): Call init_registers_x32_linux
5963         or init_registers_x32_avx_linux if linux_is_elf64 is false.
5964
5965 2012-04-13  Pedro Alves  <palves@redhat.com>
5966
5967         * Makefile.in (GNULIB_FLAGS_TO_PASS): New.
5968         (FLAGS_TO_PASS): Don't change or set $top_srcdir, $srcdir and VPATH.
5969         (all, uninstall, clean-info, all-lib, clean, maintainer-clean)
5970         (realclean, distclean): Explicitly pass $GNULIB_FLAGS_TO_PASS to
5971         the sub-make.
5972
5973 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
5974
5975         * linux-x86-low.c (compat_x32_clock_t): New.
5976         (compat_x32_siginfo_t): Likewise.
5977         (compat_x32_siginfo_from_siginfo): Likewise.
5978         (siginfo_from_compat_x32_siginfo): Likewise.
5979         (linux_is_elf64): Likewise.
5980         (x86_siginfo_fixup): Call compat_x32_siginfo_from_siginfo
5981         and siginfo_from_compat_x32_siginfo for x32.
5982         (x86_arch_setup): Set linux_is_elf64.
5983
5984 2012-04-12  H.J. Lu  <hongjiu.lu@intel.com>
5985
5986         PR gdb/13969
5987         * linux-low.c (linux_pid_exe_is_elf_64_file): Also return the
5988         e_machine field.
5989         (linux_qxfer_libraries_svr4): Update call to elf_64_file_p.
5990         * linux-low.h (linux_pid_exe_is_elf_64_file): Updated.
5991         * linux-x86-low.c (x86_arch_setup): Check if GDBserver is
5992         compatible with process.
5993
5994 2012-04-12  Yao Qi  <yao@codesourcery.com>
5995
5996         * Makefile.in: Define abs_top_srcdir and abs_srcdir.
5997         (INCLUDE_CFLAGS): Append GNULIB_INCLUDE_DIR.
5998         (install-only, install-info, clean): Handle sub dir gnulib.
5999         (all-lib, am--refresh): New targets.
6000         (memmem.o): Remove target.
6001         * configure.ac: Remove AC_CONFIG_LIBOBJ_DIR.
6002         Invoke gl_EARLY.  Invoke AC_CHECK_PROGS for make.
6003         (AC_REPLACE_FUNCS): Remove memmem.
6004         Invoke gl_INIT and AM_INIT_AUTOMAKE.
6005         (AC_OUTPUT): Generate Makefile in gnulib/.
6006         * aclocal.m4, config.in, configure: Regenerated.
6007
6008 2012-04-10  Maciej W. Rozycki  <macro@codesourcery.com>
6009
6010         * linux-low.c (get_r_debug): Handle DT_MIPS_RLD_MAP.
6011
6012 2012-04-05  Pedro Alves  <palves@redhat.com>
6013
6014         -Werror=strict-aliasing
6015
6016         * spu-low.c (parse_spufs_run): Avoid dereferencing type-punned
6017         pointer.
6018
6019 2012-04-04  Pedro Alves  <palves@redhat.com>
6020
6021         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
6022         (sparc_store_gregset_from_stack, sparc_store_gregset)
6023         (sparc_breakpoint_at): Fix formatting.
6024
6025 2012-03-30  Thiago Jung Bauermann  <thiago.bauermann@linaro.org>
6026
6027         * configure.ac: Check whether Elf32_auxv_t and Elf64_auxv_t
6028         are available.
6029         * linux-low.c [HAVE_ELF32_AUXV_T] (Elf32_auxv_t): Add typedef.
6030         [HAVE_ELF64_AUXV_T] (Elf64_auxv_t): Likewise.
6031         * config.in: Regenerate.
6032         * configure: Likewise.
6033
6034 2012-03-29  Pedro Alves  <palves@redhat.com>
6035
6036         * linux-low.c (regsets_store_inferior_registers) [__sparc__]:
6037         Correct ptrace arguments.
6038
6039 2012-03-28  Pedro Alves  <palves@redhat.com>
6040
6041         * linux-ia64-low.c (ia64_regmap): Map IA64_EC_REGNUM to PT_AR_EC.
6042         (IA64_GR0_REGNUM, IA64_FR0_REGNUM)
6043         (IA64_FR1_REGNUM): New defines.
6044         (ia64_fetch_register): New.
6045         (the_low_target): Install it.
6046         * linux-low.h (struct linux_target_ops) <fetch_register>: New
6047         field.
6048         * linux-low.c (linux_fetch_registers): Try the
6049         the_low_target.fetch_register hook first.
6050
6051         * linux-arm-low.c (the_low_target): Adjust.
6052         * linux-bfin-low.c (the_low_target): Adjust.
6053         * linux-cris-low.c (the_low_target): Adjust.
6054         * linux-crisv32-low.c (the_low_target): Adjust.
6055         * linux-m32r-low.c (the_low_target): Adjust.
6056         * linux-m68k-low.c (the_low_target): Adjust.
6057         * linux-mips-low.c (the_low_target): Adjust.
6058         * linux-ppc-low.c (the_low_target): Adjust.
6059         * linux-s390-low.c (the_low_target): Adjust.
6060         * linux-sh-low.c (the_low_target): Adjust.
6061         * linux-sparc-low.c (the_low_target): Adjust.
6062         * linux-tic6x-low.c (the_low_target): Adjust.
6063         * linux-x86-low.c (the_low_target): Adjust.
6064         * linux-xtensa-low.c (the_low_target): Adjust.
6065
6066 2012-03-26  Pedro Alves  <palves@redhat.com>
6067
6068         * server.c (handle_qxfer_libraries): Don't bail early if
6069         the_target->qxfer_libraries_svr4 is not NULL.
6070
6071 2012-03-26  Pedro Alves  <palves@redhat.com>
6072
6073         * linux-low.c (linux_qxfer_libraries_svr4): Fix pasto in comment.
6074
6075 2012-03-23  Pedro Alves  <palves@redhat.com>
6076
6077         * linux-low.c (linux_qxfer_libraries_svr4): Terminate the
6078         "library-list-svr4" element's start tag when the the DSO list is
6079         empty.
6080
6081 2012-03-23  Pedro Alves  <palves@redhat.com>
6082
6083         * linux-low.c (read_one_ptr): Read the inferior's pointer through
6084         a variable whose type size is the same as the inferior's pointer
6085         size.
6086
6087 2012-03-21  Thomas Schwinge  <thomas@codesourcery.com>
6088
6089         * linux-arm-low.c (arm_stopped_by_watchpoint): Use siginfo_t instead of
6090         struct siginfo.
6091         * linux-low.c (siginfo_fixup, linux_xfer_siginfo): Likewise.
6092         * linux-x86-low.c (x86_siginfo_fixup): Likewise.
6093         * linux-low.h: Include <signal.h>.
6094         (struct siginfo): Remove forward declaration.
6095         (struct linux_target_ops) <siginfo_fixup>: Use siginfo_t instead of
6096         struct siginfo.
6097
6098 2012-03-21  Mike Frysinger  <vapier@gentoo.org>
6099
6100         * .gitignore: Ignore more files.
6101
6102 2012-03-19  Pedro Alves  <palves@redhat.com>
6103             Jan Kratochvil  <jan.kratochvil@redhat.com>
6104
6105         * server.c (cont_thread, general_thread): Add describing comments.
6106         (start_inferior): Clear `cont_thread'.
6107         (handle_v_cont): Don't set `cont_thread' if resuming all threads
6108         of a process.
6109
6110 2012-03-15  Yao Qi  <yao@codesourcery.com>
6111
6112         * tracepoint.c (install_tracepoint): Move duplicated tracepoint
6113         handling to ...
6114         (cmd_qtdp): ... here.
6115
6116 2012-03-15  Yao Qi  <yao@codesourcery.com>
6117
6118         * tracepoint.c (struct tracepoint_action_ops): New.
6119         (struct tracepoint_action) [!IN_PROCESS_AGENT] <ops>: New field.
6120         (m_tracepoint_action_download): New.
6121         (r_tracepoint_action_download): New.
6122         (x_tracepoint_action_download): New.
6123         (l_tracepoint_action_download): New.
6124         (add_tracepoint_action): Install `action->ops' according type.
6125         (download_tracepoint_1): Move code `download' function pointer
6126         of various tracepoint_action_ops.
6127
6128 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6129
6130         * linux-low.c (linux_attach_lwp_1): New variable buffer.  Call
6131         linux_ptrace_attach_warnings.
6132
6133 2012-03-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
6134
6135         * Makefile.in (linux-ptrace.o): New.
6136         * configure.srv (arm*-*-linux*, bfin-*-*linux*, crisv32-*-linux*)
6137         (cris-*-linux*, i[34567]86-*-linux*, ia64-*-linux*, m32r*-*-linux*)
6138         (m68*-*-linux*, m68*-*-uclinux*, mips*-*-linux*, powerpc*-*-linux*)
6139         (s390*-*-linux*, sh*-*-linux*, sparc*-*-linux*, tic6x-*-uclinux)
6140         (x86_64-*-linux*, xtensa*-*-linux*): Add linux-ptrace.o to SRV_TGTOBJ
6141         of these targets.
6142         * linux-low.c (linux_attach_lwp_1): Remove redundent else clause.
6143
6144 2012-03-08  Yao Qi  <yao@codesourcery.com>
6145             Pedro Alves  <palves@redhat.com>
6146
6147         Fix PR server/13392.
6148         * linux-x86-low.c (amd64_install_fast_tracepoint_jump_pad): Check
6149         offset of JMP insn.
6150         * tracepoint.c (remove_tracepoint): New.
6151         (cmd_qtdp): Call remove_tracepoint when failed to install.
6152
6153 2012-03-07  Pedro Alves  <palves@redhat.com>
6154
6155         * linux-low.c (get_detach_signal): New.
6156         (linux_detach_one_lwp): Get rid of a pending SIGSTOP with SIGCONT.
6157         Pass on pending signals to PTRACE_DETACH.  Check the result of the
6158         ptrace call.
6159         * server.c (program_signals, program_signals_p): New.
6160         (handle_general_set): Handle QProgramSignals.
6161         * server.h (program_signals, program_signals_p): Declare.
6162
6163 2012-03-05  Pedro Alves  <palves@redhat.com>
6164             Jan Kratochvil  <jan.kratochvil@redhat.com>
6165
6166         * linux-low.c (get_dynamic): Don't warn when PT_PHDR isn't found.
6167         New comment why.
6168
6169 2012-03-03  Yao Qi  <yao@codesourcery.com>
6170
6171         * tracepoint.c (tracepoint_look_up_symbols): Update call to
6172         agent_look_up_symbols.
6173
6174 2012-03-03  Yao Qi  <yao@codesourcery.com>
6175
6176         * Makefile.in (linux-low.o): Keep dependence on agent.h.
6177         (linux-x86-low.o): Likewise.
6178         * server.h: Remove in_process_agent_loaded.
6179         * tracepoint.c (in_process_agent_loaded): Removed.  Moved it
6180         common/agent.c.
6181         Update callers.
6182
6183 2012-03-03  Yao Qi  <yao@codesourcery.com>
6184
6185         * tracepoint.c (gdb_agent_capability): New global.
6186         (in_process_agent_loaded_ust): Renamed to
6187         `in_process_agent_supports_ust'.
6188         Update callers.
6189         (in_process_agent_supports_ust): Call agent_capability_check.
6190         (clear_installed_tracepoints): Assert that agent supports
6191         agent.
6192
6193 2012-03-03  Yao Qi  <yao@codesourcery.com>
6194
6195         * linux-low.c (linux_supports_agent): New.
6196         (linux_target_ops): Initialize field `supports_agent' with
6197         linux_supports_agent.
6198         * target.h (struct target_ops) <supports_agent>: New.
6199         (target_supports_agent): New macro.
6200         * server.c (handle_general_set): Handle packet 'QAgent'.
6201         (handle_query): Send `QAgent+'.
6202         * Makefile.in (server.o): Depends on agent.h.
6203
6204 2012-03-03  Yao Qi  <yao@codesourcery.com>
6205
6206         * Makefile.in (OBS): Add agent.o.
6207         Add new rule for agent.o.
6208         Track dependence of tracepoint.c on agent.h.
6209         * tracepoint.c (run_inferior_command_1):
6210         (run_inferior_command): Call agent_run_command.
6211         (gdb_ust_connect_sync_socket): Deleted.  Move it to
6212         common/agent.c.
6213         (resume_thread, stop_thread): Likewise.
6214         (gdb_ust_socket_init): Renamed to ...
6215         (gdb_agent_socket_init): ... New.
6216         (gdb_ust_thread): Renamed to ...
6217         (gdb_agent_helper_thread): ... New.
6218         (gdb_ust_init): Move some code to ...
6219         (gdb_agent_init): ... here.  New.
6220         [HAVE_UST]: Call gdb_ust_init.
6221         (initialize_tracepoint_ftlib):  Call gdb_agent_init.
6222         * configure.ac: Add `sys/un.h' to AC_CHECK_HEADERS.
6223         * config.in, configure: Regenerated.
6224
6225 2012-03-02  Pedro Alves  <palves@redhat.com>
6226
6227         * inferiors.c (add_pid_to_list, pull_pid_from_list): Delete.
6228         * linux-low.c (struct simple_pid_list): New.
6229         (stopped_pids): New a struct simple_pid_list pointer.
6230         (add_to_pid_list, pull_pid_from_list): New.
6231         (handle_extended_wait): Don't assume the first signal new children
6232         report is SIGSTOP.  Adjust call to pull_pid_from_list.
6233         (linux_wait_for_lwp): Adjust.
6234
6235 2012-03-02  Yao Qi  <yao@codesourcery.com>
6236
6237         * tracepoint.c (do_action_at_tracepoint): Write `stop_pc' in
6238         debug log.
6239
6240 2012-03-02  Yao Qi  <yao@codesourcery.com>
6241
6242         * tracepoint.c (collect_ust_data_at_tracepoint): Remove parameters
6243         `stop_pc' and `tpoint'.  Update caller.
6244
6245 2012-03-01  Maciej W. Rozycki  <macro@codesourcery.com>
6246
6247         * linux-low.h (linux_target_ops): Add regset_bitmap member.
6248         * linux-low.c (use_linux_regsets): New macro.
6249         [!HAVE_LINUX_REGSETS] (regsets_fetch_inferior_registers): Likewise.
6250         [!HAVE_LINUX_REGSETS] (regsets_store_inferior_registers): Likewise.
6251         (linux_register_in_regsets): New function.
6252         (usr_fetch_inferior_registers): Skip registers covered by
6253         regsets.
6254         (usr_store_inferior_registers): Likewise.
6255         (usr_fetch_inferior_registers): New macro.
6256         (usr_store_inferior_registers): Likewise.
6257         (linux_fetch_registers): Handle mixed regset/non-regset targets.
6258         (linux_store_registers): Likewise.
6259         * linux-mips-low.c (init_registers_mips_dsp_linux): New
6260         prototype.
6261         (init_registers_mips64_dsp_linux): Likewise.
6262         (init_registers_mips_linux): New macro.
6263         (init_registers_mips_dsp_linux): Likewise.
6264         (mips_dsp_num_regs): Likewise.
6265         (DSP_BASE, DSP_CONTROL): New fallback macros.
6266         (mips_base_regs): New macro.
6267         (mips_regmap): Use it.  Fix the size.
6268         (mips_dsp_regmap): New variable.
6269         (mips_dsp_regset_bitmap): Likewise.
6270         (mips_arch_setup): New function.
6271         (mips_cannot_fetch_register): Use the_low_target.regmap rather
6272         than mips_regmap.
6273         (mips_cannot_store_register): Likewise.
6274         (the_low_target): Update .arch_setup, .num_regs and .regmap
6275         initializers.  Add .regset_bitmap initializer.
6276         * linux-arm-low.c (the_low_target): Add .regset_bitmap
6277         initializer.
6278         * linux-bfin-low.c (the_low_target): Likewise.
6279         * linux-cris-low.c (the_low_target): Likewise.
6280         * linux-crisv32-low.c (the_low_target): Likewise.
6281         * linux-ia64-low.c (the_low_target): Likewise.
6282         * linux-m32r-low.c (the_low_target): Likewise.
6283         * linux-m68k-low.c (the_low_target): Likewise.
6284         * linux-ppc-low.c (the_low_target): Likewise.
6285         * linux-s390-low.c (the_low_target): Likewise.
6286         * linux-sh-low.c (the_low_target): Likewise.
6287         * linux-sparc-low.c (the_low_target): Likewise.
6288         * linux-tic6x-low.c (the_low_target): Likewise.
6289         * linux-x86-low.c (the_low_target): Likewise.
6290         * linux-xtensa-low.c (the_low_target): Likewise.
6291         * configure.srv <mips*-*-linux*>: Add mips-dsp-linux.o and
6292         mips64-dsp-linux.o to srv_regobj.  Add mips-dsp-linux.xml,
6293         mips64-dsp-linux.xml, mips-dsp.xml and mips64-dsp.xml to
6294         srv_xmlfiles.
6295         * Makefile.in (mips-dsp-linux.o, mips-dsp-linux.c): New targets.
6296         (mips64-dsp-linux.o, mips64-dsp-linux.c): Likewise.
6297
6298 2012-02-29  Yao Qi  <yao@codesourcery.com>
6299             Pedro Alves  <palves@redhat.com>
6300
6301         * linux-low.c: (linux_wait_1): Call unsuspend_all_lwps when
6302         `step_over_finished' is true.
6303
6304 2012-02-27  Pedro Alves  <palves@redhat.com>
6305
6306         * linux-low.c (pid_is_stopped): Delete, moved to common/.
6307         (linux_attach_lwp_1): Adjust to use linux_proc_pid_is_stopped.
6308
6309 2012-02-27  Pedro Alves  <palves@redhat.com>
6310
6311         PR server/9684
6312         * linux-low.c (pid_is_stopped): New.
6313         (linux_attach_lwp_1): Handle attaching to 'T (stopped)' processes.
6314
6315 2012-02-25  Luis Machado  <lgustavo@codesourcery.com>
6316
6317         * mem-break.c (clear_gdb_breakpoint_conditions): Fix de-allocation
6318         of conditions.
6319
6320 2012-02-24  Maciej W. Rozycki  <macro@codesourcery.com>
6321
6322         * linux-mips-low.c (mips_regmap): Correct the index of $f9.
6323
6324 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6325
6326         * server.c (handle_query): Advertise support for target-side
6327         breakpoint condition evaluation.
6328         (process_point_options): New function.
6329         (process_serial_event): When inserting a breakpoint, check for
6330         a target-side condition that should be evaluated.
6331
6332         * mem-break.c: Include regcache.h and ax.h.
6333         (point_cond_list_t): New data structure.
6334         (breakpoint) <cond_list>: New field.
6335         (find_gdb_breakpoint_at): Make non-static.
6336         (delete_gdb_breakpoint_at): Clear any target-side
6337         conditions.
6338         (clear_gdb_breakpoint_conditions): New function.
6339         (add_condition_to_breakpoint): Likewise.
6340         (add_breakpoint_condition): Likewise.
6341         (gdb_condition_true_at_breakpoint): Likewise.
6342         (gdb_breakpoint_here): Return result directly instead
6343         of going through a local variable.
6344
6345         * mem-break.h (find_gdb_breakpoint_at): New prototype.
6346         (clear_gdb_breakpoint_conditions): Likewise.
6347         (add_breakpoint_condition): Likewise.
6348         (gdb_condition_true_at_breakpoint): Likewise.
6349
6350         * linux-low.c (linux_wait_1): Evaluate target-side breakpoint condition.
6351         (need_step_over_p): Take target-side breakpoint condition into
6352         consideration.
6353
6354 2012-02-24  Luis Machado  <lgustavo@codesourcery>
6355
6356         * server.h: Include tracepoint.h.
6357         (agent_mem_read, agent_get_trace_state_variable_value,
6358         agent_set_trace_state_variable_value,
6359         agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
6360         get_set_tsv_func_addr): New prototypes.
6361
6362         * ax.h: New include file.
6363         * ax.c: New source file.
6364
6365         * tracepoint.c: Include ax.h.
6366         (gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
6367         agent_expr, eval_result_type): Move to ax.h.
6368         (parse_agent_expr): Rename to ...
6369         (gdb_parse_agent_expr): ... this, make it non-static and move
6370         to ax.h.
6371         (unparse_agent_expr) Rename to ...
6372         (gdb_unparse_agent_expr): ... this, make it non-static and move
6373         to ax.h.
6374         (eval_agent_expr): Rename to ...
6375         (eval_tracepoint_agent_expr): ... this.
6376         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
6377         forward declarations.
6378         (add_tracepoint_action): Call gdb_parse_agent_expr (...).
6379         (agent_get_trace_state_variable_value): New function.
6380         (agent_set_trace_state_variable_value): New function.
6381         (cmd_qtdp): Call gdb_parse_agent_expr (...).
6382         (response_tracepoint): Call gdb_unparse_agent_expr (...).
6383         (do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
6384         (condition_true_at_tracepoint): Likewise.
6385         (parse_agent_expr): Rename to ...
6386         (gdb_parse_agent_expr): ... this and move to ax.c.
6387         (unparse_agent_expr): Rename to ...
6388         (gdb_unparse_agent_expr): ... this and move to ax.c.
6389         (gdb_agent_op_name): Move to ax.c.
6390         (eval_agent_expr): Rename to ...
6391         (gdb_eval_agent_expr): ... this, use regcache passed as parameter
6392         and move to ax.c.
6393         (eval_tracepoint_agent_expr): New function.
6394         (agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
6395         non-static.
6396         (current_insn_ptr, emit_error, struct bytecode_address): Move to
6397         ax.c.
6398         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
6399         emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
6400         emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
6401         emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
6402         emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
6403         emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
6404         emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
6405         emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
6406         (get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
6407         (compile_bytecodes): Remove forward declaration.
6408         (is_goto_target): Move to ax.c.
6409         (compile_bytecodes): Move to ax.c and call
6410         agent_get_trace_state_variable_value (...) and
6411         agent_set_trace_state_variable_value (...).
6412
6413         * Makefile.in: Update ax.c and IPA dependencies.
6414
6415 2012-02-24  Pedro Alves  <palves@redhat.com>
6416
6417         * tracepoint.c (cmd_bigqtbuffer): Rename as ...
6418         (cmd_bigqtbuffer_circular): ... this.  Only handle
6419         'QTBuffer:circular:'.
6420         (handle_tracepoint_general_set): Adjust.
6421
6422 2012-02-16  Yao Qi  <yao@codesourcery.com>
6423
6424         * inferiors.c: Move code to ...
6425         * dll.c: .... here.  New.
6426         * server.h: Declare clear_dlls.
6427         * Makefile.in (SFILES): Add dll.c.
6428         (OBS): Add dll.o
6429         (dll.o): New rule.
6430
6431 2012-02-11  Yao Qi  <yao@codesourcery.com>
6432
6433         * server.c: (handle_monitor_command): Add a new parameter
6434         `own_buf'.
6435         (handle_query): Update caller.
6436
6437 2012-02-09  Joel Brobecker  <brobecker@adacore.com>
6438
6439         * configure.ac: Add readlink to AC_CHECK_FUNCS list.
6440         * configure, config.in: Regenerate.
6441         * hostio.c: Provide an alternate implementation if HAVE_READLINK
6442         is not defined.
6443
6444 2012-02-02  Pedro Alves  <palves@redhat.com>
6445
6446         Try SIGKILL first, then PTRACE_KILL.
6447         * linux-low.c (linux_kill_one_lwp): New.
6448         (linux_kill_one_lwp): Rename to ...
6449         (kill_one_lwp_callback): ... this.  Use the new
6450         linux_kill_one_lwp.
6451
6452 2012-02-02  Pedro Alves  <palves@redhat.com>
6453
6454         * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
6455         inferior.
6456
6457 2012-01-27  Pedro Alves  <palves@redhat.com>
6458
6459         * linux-low.c (linux_child_pid_to_exec_file): Delete.
6460         (elf_64_file_p): Make static.
6461         (linux_pid_exe_is_elf_64_file): New.
6462         * linux-low.h (linux_child_pid_to_exec_file, elf_64_file_p):
6463         Delete declarations.
6464         (linux_pid_exe_is_elf_64_file): Declare.
6465         * linux-x86-low.c (x86_arch_setup): Use
6466         linux_pid_exe_is_elf_64_file.
6467
6468 2012-01-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
6469
6470         * linux-low.c (linux_wait_for_event_1): Rename to ...
6471         (linux_wait_for_event): ... here and merge it with former
6472         linux_wait_for_event - new variable wait_ptid, use it.
6473         (linux_wait_for_event): Remove - merge it to linux_wait_for_event_1.
6474
6475 2012-01-23  Pedro Alves  <palves@redhat.com>
6476
6477         * server.c (main): Avoid yet another case of infinite loop while
6478         detaching/killing after a longjmp.
6479
6480 2012-01-20  Jan Kratochvil  <jan.kratochvil@redhat.com>
6481
6482         Code cleanup.
6483         * linux-low.c (linux_wait_for_event_1): Use ptid_is_pid.
6484
6485 2012-01-20  Ulrich Weigand  <ulrich.weigand@linaro.org>
6486
6487         * hostio.c (handle_readlink): New function.
6488         (handle_vFile): Call it to handle "vFile:readlink" packets.
6489
6490 2012-01-20  Pedro Alves  <palves@redhat.com>
6491             Ulrich Weigand  <ulrich.weigand@linaro.org>
6492
6493         * server.c (handle_v_requests): Only support vAttach and vRun to
6494         start multiple processes when in extended protocol mode.
6495
6496 2012-01-17  Pedro Alves  <palves@redhat.com>
6497
6498         * tracepoint.c (initialize_tracepoint): Use mmap instead of
6499         memalign plus mprotect to allocate the scratch buffer.
6500
6501 2012-01-13  Pedro Alves  <palves@redhat.com>
6502
6503         * server.c (attach_inferior): Clear `cont_thread'.
6504
6505 2012-01-13  Pedro Alves  <palves@redhat.com>
6506
6507         * server.c (main): Avoid infinite loop while detaching/killing
6508         after a longjmp.
6509
6510 2012-01-09  Doug Evans  <dje@google.com>
6511
6512         * server.c (start_inferior): Set last_ptid in --wrapper case.
6513
6514 2012-01-06  Yao Qi  <yao@codesourcery.com>
6515
6516         * tracepoint.c [IN_PROCESS_AGENT] (debug_threads): Macro
6517         defined.
6518         [IN_PROCESS_AGENT] (debug_agent): New global variable.
6519
6520 2012-01-04  Yao Qi  <yao@codesourcery.com>
6521
6522         * tracepoint.c (cmd_qtdp): Print debug message
6523         for static tracepoint.
6524
6525 2012-01-04  Yao Qi  <yao@codesourcery.com>
6526
6527         * tracepoint.c (trace_vdebug): Differentiate debug message
6528         between gdbserver and IPA.
6529
6530 2012-01-03  Yao Qi  <yao@codesourcery.com>
6531
6532         * tracepoint.c (tracepoint_was_hit): Don't collect for
6533         static tracepoint.
6534
6535 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6536
6537         * terminal.h: Reformat copyright header.
6538
6539 2012-01-02  Joel Brobecker  <brobecker@adacore.com>
6540
6541         * server.c (gdbserver_version): Update copyright year.
6542         * gdbreplay.c (gdbreplay_version): Likewise.
6543
6544 2011-12-18  Jan Kratochvil  <jan.kratochvil@redhat.com>
6545
6546         * linux-low.c (linux_create_inferior): Put empty if clause for write.
6547
6548         Revert:
6549         2011-12-18  Hui Zhu  <teawater@gmail.com>
6550         * linux-low.c (linux_create_inferior): Save return value to ret.
6551
6552 2011-12-18  Hui Zhu  <teawater@gmail.com>
6553
6554         * linux-low.c (linux_create_inferior): Save return value to ret.
6555
6556 2011-12-16  Doug Evans  <dje@google.com>
6557
6558         * linux-low.c (linux_create_inferior): If stdio connection,
6559         redirect stdin from /dev/null, stdout to stderr.
6560         * remote-utils.c (remote_is_stdio): New static global.
6561         (remote_connection_is_stdio): New function.
6562         (remote_prepare): Handle stdio connection.
6563         (remote_open): Ditto.
6564         (remote_close): Don't close stdin for stdio connections.
6565         (read_prim,write_prim): New functions.  Replace all calls to
6566         read/write to these.
6567         * server.c (main): Watch for "-" argument.  Move call to
6568         remote_prepare before start_inferior.
6569         * server.h (STDIO_CONNECTION_NAME): New macro.
6570         (remote_connection_is_stdio): Declare.
6571
6572         * remote-utils.c (prepare_resume_reply): Remove extraneous \n
6573         in debugging output.
6574
6575 2011-12-15  Yao Qi  <yao@codesourcery.com>
6576
6577         * tracepoint.c: Include sys/syscall.h.
6578         (gdb_ust_thread): Remove preprocessor conditional.
6579
6580 2011-12-14  Pedro Alves  <pedro@codesourcery.com>
6581
6582         * linux-low.c (linux_detach_one_lwp): Call
6583         the_low_target.prepare_to_resume before detaching.
6584
6585 2011-12-14  Yao Qi  <yao@codesourcery.com>
6586
6587         * tracepoint.c (gdb_ust_thread): Don't ignore return value
6588         of write.
6589
6590 2011-12-14  Yao Qi  <yao@codesourcery.com>
6591
6592         * i386-low.c (i386_low_stopped_data_address): Initialize local
6593         variable `control'.
6594
6595 2011-12-13  Pedro Alves  <pedro@codesourcery.com>
6596
6597         PR remote/13492
6598
6599         * i386-low.c (i386_low_stopped_data_address): Avoid fetching
6600         DR_CONTROL unless necessary.  Extend comments.
6601         * linux-x86-low.c (x86_linux_prepare_to_resume): Don't write to
6602         DR0-3 if not used.  If any watchpoint was set, clear DR_STATUS.
6603
6604 2011-12-13  Yao Qi  <yao@codesourcery.com>
6605
6606         * tracepoint.c (trace_buffer_alloc): Replace magic numbers with
6607         macros.
6608         (upload_fast_traceframes, upload_fast_traceframes): Likewise.
6609
6610 2011-12-08  Jan Kratochvil  <jan.kratochvil@redhat.com>
6611
6612         * linux-low.c (linux_kill): Skip PTRACE_KILL if LWP does not exist.
6613         Print new debug message for such case.
6614
6615 2011-12-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
6616
6617         Fix overlapping memcpy.
6618         * mem-break.c (set_raw_breakpoint_at): New variable buf.  Use it for
6619         the read_inferior_memory transfer.
6620         (delete_fast_tracepoint_jump): New variable buf.  Use it for the
6621         write_inferior_memory transfer.
6622         (set_fast_tracepoint_jump): New variable buf.  Use it for the
6623         read_inferior_memory and write_inferior_memory transfers.
6624         (uninsert_fast_tracepoint_jumps_at, reinsert_fast_tracepoint_jumps_at)
6625         (delete_raw_breakpoint, uninsert_raw_breakpoint): New variable buf.
6626         Use it for the write_inferior_memory transfer.
6627         (check_mem_read, check_mem_write): New gdb_asserts for overlapping
6628         buffers.
6629
6630 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6631
6632         * linux-low.c (fetch_register, store_register): Make code
6633         consistent, fix formatting.
6634
6635 2011-12-06  Maciej W. Rozycki  <macro@codesourcery.com>
6636
6637         * linux-low.c (usr_store_inferior_registers): Factor out code
6638         to handle individual registers into...
6639         (store_register): ... this new function.
6640
6641 2011-12-06  Ulrich Weigand  <uweigand@de.ibm.com>
6642
6643         * Makefile.in (s390-linux32v1.o, s390-linux32v1.c): New rules.
6644         (s390-linux32v2.o, s390-linux32v2.c): Likewise.
6645         (s390-linux64v1.o, s390-linux64v1.c): Likewise.
6646         (s390-linux64v2.o, s390-linux64v2.c): Likewise.
6647         (s390x-linux64v1.o, s390x-linux64v1.c): Likewise.
6648         (s390x-linux64v2.o, s390x-linux64v2.c): Likewise.
6649         * configure.srv [s390*-*-linux*] (srv_regobj): Add new objects.
6650         (srv_xmlfiles): Add new XML files.
6651
6652         * linux-s390-low.c: Include "elf/common.h", <sys/ptrace.h>,
6653         and <sys/uio.h>.
6654         (PTRACE_GETREGSET, PTRACE_SETREGSET): Define if undefined.
6655         (init_registers_s390_linux32v1): Add prototype.
6656         (init_registers_s390_linux32v2): Likewise.
6657         (init_registers_s390_linux64v1): Likewise.
6658         (init_registers_s390_linux64v2): Likewise.
6659         (init_registers_s390x_linux64v1): Likewise.
6660         (init_registers_s390x_linux64v2): Likewise.
6661         (s390_num_regs): Increment to 52.
6662         (s390_regmap): Add orig_r2 register.
6663         (s390_num_regs_3264): Increment to 68.
6664         (s390_regmap_3264): Add orig_r2 register.
6665         (s390_collect_ptrace_register): Handle orig_r2 register.
6666         (s390_supply_ptrace_register): Likewise.
6667         (s390_fill_last_break): New function.
6668         (s390_store_last_break): Likewise.
6669         (s390_fill_system_call): New function.
6670         (s390_store_system_call): Likewise.
6671         (target_regsets): Handle NT_S390_LAST_BREAK and NT_S390_SYSTEM_CALL
6672         register sets.
6673         (s390_check_regset): New function.
6674         (s390_arch_setup): Check for presence of NT_S390_LAST_BREAK and
6675         NT_S390_SYSTEM_CALL regsets and use appropriate description.
6676         Update target_regsets for available register sets.
6677
6678 2011-12-02  Paul Pluzhnikov  <ppluzhnikov@google.com>
6679             Jan Kratochvil  <jan.kratochvil@redhat.com>
6680
6681         * linux-low.c (get_phdr_phnum_from_proc_auxv, get_dynamic, get_r_debug)
6682         (read_one_ptr, struct link_map_offsets, linux_qxfer_libraries_svr4):
6683         New.
6684         (struct linux_target_ops): Install linux_qxfer_libraries_svr4.
6685         * linux-low.h (struct process_info_private): New member r_debug.
6686         * server.c (handle_qxfer_libraries): Call
6687         the_target->qxfer_libraries_svr4.
6688         (handle_qxfer_libraries_svr4): New function.
6689         (qxfer_packets): New entry "libraries-svr4".
6690         (handle_query): Check QXFER_LIBRARIES_SVR4 and report libraries-svr4.
6691         * target.h (struct target_ops): New member qxfer_libraries_svr4.
6692         * remote.c (remote_xfer_partial): Call add_packet_config_cmd for
6693         PACKET_qXfer_libraries_svr4.
6694
6695 2011-11-30  Ulrich Weigand  <uweigand@de.ibm.com>
6696
6697         * linux-s390-low.c (s390_collect_ptrace_register): Fully convert
6698         PSW address/mask between 8-byte and 16-byte formats.
6699         (s390_supply_ptrace_register): Likewise.
6700         (s390_get_pc, s390_set_pc): 4-byte PSW address always includes
6701         basic addressing mode bit.
6702
6703 2011-11-24  Stan Shebs  <stan@codesourcery.com>
6704
6705         * tracepoint.c (cmd_qtstatus): Use plongest instead of %llx.
6706
6707 2011-11-17  Stan Shebs  <stan@codesourcery.com>
6708
6709         * tracepoint.c (struct tracepoint): New field traceframe_usage.
6710         (tracing_start_time): New global.
6711         (tracing_stop_time): New global.
6712         (tracing_user_name): New global.
6713         (tracing_notes): New global.
6714         (tracing_stop_note): New global.
6715         (cmd_qtstart): Set traceframe_usage, start_time.
6716         (stop_tracing): Set stop_time.
6717         (cmd_qtstatus): Report additional status.
6718         (cmd_qtp): New function.
6719         (handle_tracepoint_query): Call it.
6720         (cmd_qtnotes): New function.
6721         (handle_tracepoint_general_set): Call it.
6722         (get_timestamp): Rename from tsv_get_timestamp.
6723
6724 2011-11-14  Stan Shebs  <stan@codesourcery.com>
6725             Kwok Cheung Yeung  <kcy@codesourcery.com>
6726
6727         * linux-x86-low.c (small_jump_insn): New.
6728         (i386_install_fast_tracepoint_jump_pad): Add arguments for
6729         trampoline and error message, build a trampoline and issue a small
6730         jump instruction to it.
6731         (x86_install_fast_tracepoint_jump_pad): Add arguments for
6732         trampoline and error message.
6733         (x86_get_min_fast_tracepoint_insn_len): New.
6734         (the_low_target): Add call to x86_get_min_fast_tracepoint_insn_len.
6735         * linux-low.h (struct linux_target_ops): Add arguments to
6736         install_fast_tracepoint_jump_pad operation, add new operation.
6737         * linux-low.c (linux_install_fast_tracepoint_jump_pad): Add
6738         arguments.
6739         (linux_get_min_fast_tracepoint_insn_len): New function.
6740         (linux_target_op): Add new operation.
6741         * tracepoint.c (gdb_trampoline_buffer): New IPA variable.
6742         (gdb_trampoline_buffer_end): Ditto.
6743         (gdb_trampoline_buffer_error): Ditto.
6744         (struct ipa_sym_addresses): Add fields for new IPA variables.
6745         (symbol_list): Add entries for new IPA variables.
6746         (struct tracepoint): Add fields to hold the address range of the
6747         trampoline used by the tracepoint.
6748         (trampoline_buffer_head): New static variable.
6749         (trampoline_buffer_tail): Ditto.
6750         (claim_trampoline_space): New function.
6751         (have_fast_tracepoint_trampoline_buffer): New function.
6752         (clone_fast_tracepoint): Fill in trampoline fields of tracepoint
6753         structure.
6754         (install_fast_tracepoint): Ditto, also add error buffer argument.
6755         (cmd_qtminftpilen): New function.
6756         (handle_tracepoint_query): Add response to qTMinFTPILen packet.
6757         (fast_tracepoint_from_trampoline_address): New function.
6758         (fast_tracepoint_collecting): Handle trampoline as part of jump
6759         pad space.
6760         (set_trampoline_buffer_space): New function.
6761         (initialize_tracepoint): Initialize new IPA variables.
6762         * target.h (struct target_ops): Add arguments to
6763         install_fast_tracepoint_jump_pad operation, add new
6764         get_min_fast_tracepoint_insn_len operation.
6765         (target_get_min_fast_tracepoint_insn_len): New.
6766         (install_fast_tracepoint_jump_pad): Add arguments.
6767         * server.h (IPA_BUFSIZ): Define.
6768         * linux-i386-ipa.c: Include extra header files.
6769         (initialize_fast_tracepoint_trampoline_buffer): New function.
6770         (initialize_low_tracepoint): Call it.
6771         * server.h (set_trampoline_buffer_space): Declare.
6772         (claim_trampoline_space): Ditto.
6773         (have_fast_tracepoint_trampoline_buffer): Ditto.
6774
6775 2011-11-14  Yao Qi  <yao@codesourcery.com>
6776
6777         * server.c (handle_query): Handle InstallInTrace for qSupported.
6778         * tracepoint.c (add_tracepoint): Sort list.
6779         (install_tracepoint, download_tracepoint): New.
6780         (cmd_qtdp): Call them to install and download tracepoints.
6781         (sort_tracepoints): Removed.
6782         (cmd_qtstart): Update.
6783
6784 2011-11-14  Yao Qi  <yao@codesourcery.com>
6785
6786         * mem-break.c (inc_ref_fast_tracepoint_jump): New.
6787         * mem-break.h: Declare.
6788         * tracepoint.c (cmd_qtstart): Move some code to ...
6789         (clone_fast_tracepoint, install_fast_tracepoint): ... here.
6790         New.
6791         (download_tracepoints): Move some code to ...
6792         (download_tracepoint_1): ... here.  New.
6793
6794 2011-11-08  Yao Qi  <yao@codesourcery.com>
6795
6796         * remote-utils.c (relocate_instruction): A comment fix.
6797
6798 2011-11-07  Joel Brobecker  <brobecker@adacore.com>
6799
6800         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): Delete.
6801         (i386_dr_low_get_control, i386_dr_low_get_status): Use
6802         dr_status_mirror and dr_control_mirror from debug_reg_state.
6803         (i386_dr_low_get_status): Use debug_reg_state.dr_status_mirror
6804         (i386_initial_stuff): Remove use of deleted globals.
6805         (i386_get_thread_context, i386_set_thread_context,
6806         i386_thread_added): Use dr_status_mirror and dr_control_mirror
6807         from debug_reg_state.
6808
6809 2011-11-05  Yao Qi  <yao@codesourcery.com>
6810
6811         * tracepoint.c (gdb_collect): Loop over tracepoints of same
6812         address as TPOINT's.
6813
6814 2011-11-02  Stan Shebs  <stan@codesourcery.com>
6815
6816         * tracepoint.c (agent_mem_read_string): New function.
6817         (eval_agent_expr): Call it for tracenz.
6818         * server.c (handle_query): Report support for tracenz.
6819
6820 2011-11-02  Yao Qi  <yao@codesourcery.com>
6821
6822         * tracepoint.c (cmd_qtstart): Remove unused local variables.
6823
6824 2011-11-02  Yao Qi  <yao@codesourcery.com>
6825
6826         * target.h: Fix a typo in comment.
6827
6828 2011-10-31  Pedro Alves  <pedro@codesourcery.com>
6829
6830         * mem-break.c (check_mem_write): Add `myaddr' parameter.  Don't
6831         clobber the breakpoints' shadows with fast tracepoint jumps.
6832         * mem-break.h (check_mem_write): Add `myaddr' parameter.
6833         * target.c (write_inferior_memory): Also pass MYADDR down to
6834         check_mem_write.
6835
6836 2011-10-07  Ulrich Weigand  <ulrich.weigand@linaro.org>
6837
6838         * configure.ac: Check support for personality routine.
6839         * configure: Regenerate.
6840         * config.in: Likewise.
6841         * linux-low.c: Include <sys/personality.h>.
6842         Define ADDR_NO_RANDOMIZE if necessary.
6843         (linux_create_inferior): Disable address space randomization when
6844         forking inferior, if requested.
6845         (linux_supports_disable_randomization): New function.
6846         (linux_target_ops): Install it.
6847         * server.h (disable_randomization): Declare.
6848         * server.c (disable_randomization): New global variable.
6849         (handle_general_set): Handle QDisableRandomization.
6850         (handle_query): Likewise for qSupported.
6851         (main): Support --disable-randomization and --no-disable-randomization
6852         command line arguments.
6853         * target.h (struct target_ops): Add supports_disable_randomization.
6854         (target_supports_disable_randomization): New macro.
6855
6856 2011-09-29  Mike Frysinger  <vapier@gentoo.org>
6857
6858         * linux-low.c (target_loadseg): Add defined PTRACE_GETFDPIC to the
6859         ifdef check.
6860         [PT_GETDSBT] (target_loadmap): Wrap in a defined PT_GETDSBT check.
6861         [!PT_GETDSBT] (target_loadmap): New definition.
6862         (LINUX_LOADMAP, LINUX_LOADMAP_EXEC, LINUX_LOADMAP_INTERP): Define.
6863         (linux_read_loadmap): Change PTRACE_GETDSBT_EXEC to
6864         LINUX_LOADMAP_EXEC, PTRACE_GETDSBT_INTERP to LINUX_LOADMAP_INTERP,
6865         and PT_GETDSBT to LINUX_LOADMAP.
6866         [!PT_GETDSBT] (linux_read_loadmap): Define to NULL.
6867         (linux_target_ops): Delete unnecessary ifdef PT_GETDSBT check.
6868
6869 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
6870
6871         * linux-arm-low.c (struct arm_linux_hwbp_cap): Remove.
6872         (arm_linux_hwbp_cap): New static variable.
6873         (arm_linux_get_hwbp_cap): Replace by ...
6874         (arm_linux_init_hwbp_cap): ... this new function.
6875         (arm_linux_get_hw_breakpoint_count): Use arm_linux_hwbp_cap.
6876         (arm_linux_get_hw_watchpoint_count): Likewise.
6877         (arm_linux_get_hw_watchpoint_max_length): Likewise.
6878         (arm_arch_setup): Call arm_linux_init_hwbp_cap.
6879         (arm_prepare_to_resume): Use perror_with_name instead of error.
6880
6881 2011-09-21  Ulrich Weigand  <ulrich.weigand@linaro.org>
6882
6883         * linux-arm-low.c: Include <signal.h>.
6884         (PTRACE_GETHBPREGS, PTRACE_SETHBPREGS): Define if necessary.
6885         (struct arm_linux_hwbp_cap): New data type.
6886         (arm_hwbp_type, arm_hwbp_control_t): New typedefs.
6887         (struct arm_linux_hw_breakpoint): New data type.
6888         (MAX_BPTS, MAX_WPTS): Define.
6889         (struct arch_process_info, struct arch_lwp_info): New data types.
6890         (arm_linux_get_hwbp_cap): New function.
6891         (arm_linux_get_hw_breakpoint_count): Likewise.
6892         (arm_linux_get_hw_watchpoint_count): Likewise.
6893         (arm_linux_get_hw_watchpoint_max_length): Likewise.
6894         (arm_hwbp_control_initialize): Likewise.
6895         (arm_hwbp_control_is_enabled): Likewise.
6896         (arm_hwbp_control_is_initialized): Likewise.
6897         (arm_hwbp_control_disable): Likewise.
6898         (arm_linux_hw_breakpoint_equal): Likewise.
6899         (arm_linux_hw_point_initialize): Likewise.
6900         (struct update_registers_data): New data structure.
6901         (update_registers_callback: New function.
6902         (arm_insert_point): Likewise.
6903         (arm_remove_point): Likewise.
6904         (arm_stopped_by_watchpoint): Likewise.
6905         (arm_stopped_data_address): Likewise.
6906         (arm_new_process): Likewise.
6907         (arm_new_thread): Likewise.
6908         (arm_prepare_to_resume): Likewise.
6909         (the_low_target): Register arm_insert_point, arm_remove_point,
6910         arm_stopped_by_watchpoint, arm_stopped_data_address, arm_new_process,
6911         arm_new_thread, and arm_prepare_to_resume.
6912
6913 2011-09-15  Stan Shebs  <stan@codesourcery.com>
6914
6915         * server.h (struct emit_ops): Add compare-goto fields.
6916         * tracepoint.c (gdb_agent_op_sizes): New table.
6917         (emit_eq_goto): New function.
6918         (emit_ne_goto): New function.
6919         (emit_lt_goto): New function.
6920         (emit_le_goto): New function.
6921         (emit_gt_goto): New function.
6922         (emit_ge_goto): New function.
6923         (is_goto_target): New function.
6924         (compile_bytecodes): Recognize special cases of compare-goto
6925         combinations and call specialized emitters for them.
6926         * linux-x86-low.c (amd64_emit_eq_goto): New function.
6927         (amd64_emit_ne_goto): New function.
6928         (amd64_emit_lt_goto): New function.
6929         (amd64_emit_le_goto): New function.
6930         (amd64_emit_gt_goto): New function.
6931         (amd64_emit_ge_goto): New function.
6932         (amd64_emit_ops): Add the new functions.
6933         (i386_emit_eq_goto): New function.
6934         (i386_emit_ne_goto): New function.
6935         (i386_emit_lt_goto): New function.
6936         (i386_emit_le_goto): New function.
6937         (i386_emit_gt_goto): New function.
6938         (i386_emit_ge_goto): New function.
6939         (i386_emit_ops): Add the new functions.
6940
6941 2011-09-08  Stan Shebs  <stan@codesourcery.com>
6942
6943         * linux-x86-low.c (i386_emit_prologue): Save %ebx.
6944         (i386_emit_epilogue): Restore %ebx.
6945
6946 2011-08-31  Jie Zhang  <jzhang918@gmail.com>
6947
6948         * server.c (step_thread): Remove definition.
6949         (process_serial_event): Don't handle Hs.
6950         * server.h (step_thread): Remove declaration.
6951         * target.c (set_desired_inferior): Remove use of step_thread.
6952
6953 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
6954
6955         * linux-low.c: Include linux-procfs.h.
6956         (linux_attach_lwp_1): Update comments.
6957         (linux_attach): Scan for existing threads when attaching to a
6958         process that is the tgid.
6959         * Makefile.in: Update dependencies.
6960
6961 2011-08-24  Luis Machado  <lgustavo@codesourcery.com>
6962
6963         * configure.srv: Add linux-procfs.o dependencies.
6964
6965 2011-08-14  Yao Qi  <yao@codesourcery.com>
6966
6967         * target.h (struct target_ops): Fix indent.
6968         * win32-low.c (win32_target_ops): Fix comment.
6969
6970 2011-08-14  Andrew Jenner  <andrew@codesourcery.com>
6971             Yao Qi  <yao@codesourcery.com>
6972
6973         * Makefile.in (clean): Remove tic6x-*.c files.
6974         (linux-tic6x-low.o, tic6x-c62x-linux.o, tic6x-c64x-linux.o): New rules.
6975         (tic6x-c64xp-linux.o, tic6x-c62x-linux.c, tic6x-c64x-linux.c): Likewise.
6976         (tic6x-c64xp-linux.c): Likewise.
6977         * configure.srv: Add support for tic6x-*-uclinux.
6978         * linux-tic6x-low.c: New.
6979         * linux-low.c (PT_TEXT_ADDR, PT_DATA_ADDR, PT_TEXT_END_ADDR): Define.
6980
6981 2011-08-14  Andrew Stubbs <ams@codesourcery.com>
6982             Yao Qi  <yao@codesourcery.com>
6983
6984         * target.h (struct target_ops): Add read_loadmap.
6985         * linux-low.c (struct target_loadseg): New type.
6986         (struct target_loadmap): New type.
6987         (linux_read_loadmap): New function.
6988         (linux_target_ops): Add linux_read_loadmap.
6989         * server.c (handle_query): Support qXfer:fdpic:read packet.
6990         * win32-low.c (win32_target_ops): Initialize field `read_loadmap'
6991         to NULL.
6992
6993 2011-08-05  Eli Zaretskii  <eliz@gnu.org>
6994
6995         * win32-low.c: Include <stdint.h>.
6996
6997 2011-07-22  Pedro Alves  <pedro@codesourcery.com>
6998
6999         * i386-low.c (i386_insert_aligned_watchpoint): Don't pass the info
7000         to the inferior here.
7001         (i386_remove_aligned_watchpoint): Ditto.
7002         (i386_handle_nonaligned_watchpoint): Return immediate on fail to
7003         fit part of the watchpoint in the debug registers.
7004         (i386_update_inferior_debug_regs): New.
7005         (i386_low_insert_watchpoint): Work on a local mirror of the debug
7006         registers, and only update the inferior on success.
7007         (i386_low_remove_watchpoint): Ditto.
7008
7009 2011-07-22  Kwok Cheung Yeung  <kcy@codesourcery.com>
7010
7011         * linux-low.c (compare_ints, unique, list_threads, show_process,
7012         linux_core_of_thread): Delete.
7013         (linux_target_ops): Change linux_core_of_thread to
7014         linux_common_core_of_thread.
7015         (linux_qxfer_osdata): Defer to linux_common_xfer_osdata.
7016         * utils.c (malloc_failure): Change type of argument.
7017         (xmalloc, xrealloc, xcalloc, xsnprintf): Delete.
7018         * Makefile.in (SFILES): Add common/common-utils.c, common/xml-utils.c,
7019         common/linux-osdata.c, common/ptid.c and common/buffer.c.
7020         (OBS): Add xml-utils.o, common-utils.o, ptid.o and buffer.o.
7021         (IPA_OBJS): Add common-utils-ipa.o.
7022         (ptid_h, linux_osdata_h): New macros.
7023         (server_h): Add common/common-utils.h, common/xml-utils.h,
7024         common/buffer.h, common/gdb_assert.h, common/gdb_locale.h and
7025         common/ptid.h.
7026         (common-utils-ipa.o, common-utils.o, xml-utils.o, linux-osdata.o,
7027         ptid.o, buffer.o): New rules.
7028         (linux-low.o): Add common/linux-osdata.h as a dependency.
7029         * configure.srv (srv_tgtobj): Add linux-osdata.o to Linux targets.
7030         * configure.ac: Add AC_HEADER_DIRENT check.
7031         * config.in: Regenerate.
7032         * configure: Regenerate.
7033         * remote-utils.c (xml_escape_text): Delete.
7034         (buffer_grow, buffer_free, buffer_init, buffer_finish,
7035         buffer_xml_printf): Move to common/buffer.c.
7036         * server.c (main): Remove call to initialize_inferiors.
7037         * server.h (struct ptid, ptid_t, minus_one_ptid, null_ptid,
7038         ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp, ptid_get_tid,
7039         ptid_equal, ptid_is_pid, initialize_inferiors, xml_escape_text,
7040         internal_error, gdb_assert, gdb_assert_fail): Delete.
7041         (struct buffer, buffer_grow, buffer_free, buffer_init, buffer_finish,
7042         buffer_xml_printf, buffer_grow_str, buffer_grow_str0): Move to
7043         common/buffer.h.
7044         * inferiors.c (null_ptid, minus_one_ptid, ptid_build, pid_to_ptid,
7045         ptid_get_pid, ptid_get_lwp, ptid_get_tid, ptid_equal, ptid_is_pid,
7046         initialize_inferiors): Delete.
7047
7048 2011-07-20  Pedro Alves  <pedro@codesourcery.com>
7049
7050         * tracepoint.c (tracepoint_look_up_symbols): Return upon the first
7051         symbol error.
7052
7053 2011-05-31  Pedro Alves  <pedro@codesourcery.com>
7054
7055         * linux-x86-low.c (i386_dr_low_get_addr): Fix off by one in
7056         assertion.
7057         * win32-i386-low.c (i386_dr_low_get_addr): Ditto.
7058
7059 2011-05-26  Yao Qi  <yao@codesourcery.com>
7060
7061         * Makefile.in (thread-db.o): Track dependence to
7062         common/gdb_thread_db.h.
7063         * thread-db.c: include gdb_thread_db.h from right place.
7064
7065 2011-05-16  Adrian Cornish  <gnu@bluedreamer.com>
7066
7067         * linux-i386-ipa.c (supply_static_tracepoint_registers): Pass
7068         __FILE__ and __LINE__ to internal_error.
7069
7070 2011-05-13  Doug Evans  <dje@google.com>
7071
7072         * thread-db.c (try_thread_db_load_from_sdir): New function.
7073         (try_thread_db_load_from_dir): New function.
7074         (thread_db_load_search): Handle $sdir, ignore $pdir.
7075         Remove trying of system directories if search of
7076         libthread-db-search-path fails, that is now done via $sdir.
7077
7078 2011-05-12  Kwok Cheung Yeung  <kcy@codesourcery.com>
7079
7080         * server.c (handle_query): Add EnableDisableTracepoints to the list
7081         of supported features.
7082         * tracepoint.c (clear_installed_tracepoints): Uninstall disabled
7083         tracepoints.
7084         (cmd_qtenable_disable): New.
7085         (cmd_qtstart): Install tracepoints even if disabled.
7086         (handle_tracepoint_general_set): Add call to cmd_qtenable_disable on
7087         receiving a QTEnable or QTDisable packet.
7088         (gdb_collect): Skip data collection if fast tracepoint is disabled.
7089         (ust_marker_to_static_tracepoint): Do not ignore disabled static
7090         tracepoints.
7091         (gdb_probe): Skip data collection if static tracepoint is disabled.
7092
7093 2011-05-10  Doug Evans  <dje@google.com>
7094
7095         * thread-db.c (thread_db_handle_monitor_command): Handle elided path.
7096
7097 2011-05-04  Doug Evans  <dje@google.com>
7098
7099         * linux-low.c (linux_join): Skip process lookup.
7100         * spu-low.c (spu_join): Ditto.
7101         * server.c (join_inferiors_callback): Delete.
7102         (process_serial_event): For 'D' packet (detach) call join_inferior
7103         directly.
7104
7105 2011-05-04  Joseph Myers  <joseph@codesourcery.com>
7106
7107         * README: Don't mention xscale*-*-linux*.
7108         * configure.srv (xscale*-*-linux*): Don't handle target.
7109
7110 2011-04-27  Nathan Froyd  <froydnj@codesourcery.com>
7111
7112         * linux-x86-low.c (amd64_emit_const): Call memcpy instead of
7113         casting pointers.
7114         (amd64_emit_reg, amd64_emit_int_call_1, amd64_emit_void_call_2):
7115         (i386_emit_const, i386_emit_reg, i386_emit_int_call_1):
7116         (i386_emit_void_call_2): Likewise.
7117
7118 2011-04-26  Yao Qi  <yao@codesourcery.com>
7119
7120         * linux-low.c: Move common macros to linux-ptrace.h.
7121         Include linux-ptrace.h.
7122         * Makefile.in (linux_ptrace_h): New.
7123         (linux-low.o): Depends on linux-ptrace.h.
7124
7125 2011-04-24  Jan Kratochvil  <jan.kratochvil@redhat.com>
7126
7127         * remote-utils.c (handle_accept_event): Close LISTEN_DESC only if
7128         RUN_ONCE.  Comment for the LISTEN_DESC delete_file_handler call.
7129         (remote_prepare): New function with most of the TCP code from ...
7130         (remote_open): ... here.  Detect PORT here unconditionally.  Move also
7131         setting transport_is_reliable.
7132         * server.c (run_once): New variable.
7133         (gdbserver_usage): Document it.
7134         (main): Set run_once for `--once'.  Call remote_prepare.  Exit after
7135         the first run if RUN_ONCE.
7136         * server.h (run_once, remote_prepare): New declarations.
7137
7138 2011-04-19  Tom Tromey  <tromey@redhat.com>
7139
7140         * win32-low.c (handle_load_dll): Remove duplicate "the".
7141
7142 2011-04-07  Pierre Muller  <muller@ics.u-strasbg.fr>
7143
7144         Remove support for old Cygwin 1.5 versions.
7145         * win32-low.c (win32_create_inferior): Use new cygwin_path_list
7146         function to avoid warning.
7147         (win32_add_one_solib): Use cygwin_conv_path function to avoid
7148         warning.
7149
7150 2011-03-18  Pierre Muller  <muller@ics.u-strasbg.fr>
7151
7152         * gdbserver/server.h (Macro _): Define it if not available.
7153
7154 2011-03-14  Michael Snyder  <msnyder@vmware.com>
7155
7156         * hostio.c (handle_close): Remove unnecessary null test.
7157
7158 2011-03-10  Joel Brobecker  <brobecker@adacore.com>
7159
7160         * Makefile.in (maintainer-clean realclean distclean): Remove
7161         "make ...  subdir_do" command.
7162
7163 2011-03-10  Michael Snyder  <msnyder@vmware.com>
7164
7165         * tracepoint.c (tracepoint_finish_step): Fix loop variable.
7166
7167         * server.c (handle_v_run): Free alloced buffer on early return.
7168
7169 2011-03-09  Yao Qi  <yao@codesourcery.com>
7170
7171         Revert:
7172         2011-03-04  Yao Qi  <yao@codesourcery.com>
7173
7174         * Makefile.in: Remove GNU make feature --directory.
7175
7176         2011-03-05  Yao Qi  <yao@codesourcery.com>
7177
7178         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7179         (subdir_do): New make target.  Copied from gdb/Makefile.
7180         (maintainer-clean, realclean, distclean, clean): Call corresponding
7181         make targets in common/Makefile.
7182
7183         2011-02-11  Yao Qi  <yao@codesourcery.com>
7184
7185         * configure.ac: Call AC_PROG_RANLIB.
7186         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7187         * configure: Regenerate.
7188
7189 2011-03-07  Jan Kratochvil  <jan.kratochvil@redhat.com>
7190
7191         * remote-utils.c (putpkt_binary_1): Calculate BUF2 size dynamically.
7192
7193 2011-03-06  Yao Qi  <yao@codesourcery.com>
7194
7195         * Makefile.in (REQUIRED_SUBDIRS): Remove $(LIBCOMMON_DIR).
7196
7197 2011-03-05  Yao Qi  <yao@codesourcery.com>
7198
7199         * Makefile.in (CLEANDIRS, REQUIRED_SUBDIRS): New variable.
7200         (subdir_do): New make target.  Copied from gdb/Makefile.
7201         (maintainer-clean, realclean, distclean, clean): Call corresponding
7202         make targets in common/Makefile.
7203
7204 2011-03-04  Yao Qi  <yao@codesourcery.com>
7205
7206         * Makefile.in: Remove GNU make feature --directory.
7207
7208 2011-03-04  Michael Snyder  <msnyder@vmware.com>
7209
7210         * server.c (queue_stop_reply): Call xmalloc not malloc.
7211
7212 2011-03-02  Michael Snyder  <msnyder@vmware.com>
7213
7214         * linux-arm-low.c (arm_arch_setup): Replace malloc with xmalloc.
7215
7216 2011-02-28  Michael Snyder  <msnyder@vmware.com>
7217
7218         * tracepoint.c (cmd_qtv): Discard unused value 'packet'.
7219         (cmd_qtframe): Ditto.
7220         (cmd_qtbuffer): Ditto.
7221         (cmd_bigqtbuffer): Ditto.
7222
7223         * utils.c (decimal2str): Initialize 'width' to nine, then
7224         don't mess with it.
7225
7226 2011-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
7227
7228         * hostio.c (require_data): Free *data, not data.
7229
7230 2011-02-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
7231
7232         * hostio.c (require_data): Use free, not xfree.
7233
7234 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7235
7236         * server.c (handle_query): Discard unused value.
7237
7238         * hostio.c (require_data): Free malloc memory before returning
7239         error.
7240
7241 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7242
7243         * linux-low.c (list_threads): Call closedir for dirent.
7244
7245 2011-02-27  Michael Snyder  <msnyder@vmware.com>
7246
7247         * i386-low.c (i386-length_and_rw_bits): Comment the fact that
7248         a case statement falls through.
7249
7250         * linux-low.c (linux_xfer_siginfo): Fix fencepost error.
7251
7252         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): Fix fencepost error
7253         in comparison.
7254
7255 2011-02-26  Michael Snyder  <msnyder@vmware.com>
7256
7257         * utils.c (decimal2str): Eliminate dead code and dead param.
7258         (pulongest): Drop dead param from call to decimal2str.
7259         (plongest): Ditto.
7260
7261 2011-02-24  Joel Brobecker  <brobecker@adacore.com>
7262
7263         Revert the following patch (not approved yet):
7264         2011-02-21  Hui Zhu  <teawater@gmail.com>
7265         * tracepoint.c (tp_printf): New function.
7266         (eval_agent_expr): Handle gdb_agent_op_printf.
7267
7268 2011-02-21  Hui Zhu  <teawater@gmail.com>
7269
7270         * tracepoint.c (tp_printf): New function.
7271         (eval_agent_expr): Handle gdb_agent_op_printf.
7272
7273 2011-02-18  Tom Tromey  <tromey@redhat.com>
7274
7275         * Makefile.in (tracepoint-ipa.o): Depend on ax.def.
7276         (tracepoint.o): Likewise.
7277         * tracepoint.c (enum gdb_agent_op): Use ax.def.
7278         (gdb_agent_op_names): Likewise.
7279
7280 2011-02-18  Tom Tromey  <tromey@redhat.com>
7281
7282         * tracepoint.c (enum gdb_agent_op) <gdb_agent_op_pick,
7283         gdb_agent_op_rot>: New constants.
7284         (gdb_agent_op_names): Add pick and roll.
7285         (eval_agent_expr) <gdb_agent_op_pick, gdb_agent_op_rot>: New
7286         cases.
7287
7288 2011-02-15  Jan Kratochvil  <jan.kratochvil@redhat.com>
7289
7290         * aclocal.m4: Regenerated with aclocal-1.11.1.
7291
7292 2011-02-14  Pedro Alves  <pedro@codesourcery.com>
7293
7294         * server.c (handle_qxfer_traceframe_info): New.
7295         (qxfer_packets): Register "traceframe-info".
7296         (handle_query): Report support for qXfer:traceframe-info:read+.
7297         * tracepoint.c (match_blocktype): New.
7298         (traceframe_find_block_type): Rename to ...
7299         (traceframe_walk_blocks): ... this.  Add callback filter argument,
7300         and use it.
7301         (traceframe_find_block_type): New, reimplemented on top of
7302         traceframe_walk_blocks.
7303         (build_traceframe_info_xml): New.
7304         (traceframe_read_info): New.
7305         * server.h (traceframe_read_info): Declare.
7306
7307 2011-02-11  Yao Qi  <yao@codesourcery.com>
7308
7309         * configure.ac: Call AC_PROG_RANLIB.
7310         * Makefile.in: Remove signals.o from OBS.  Link libcommon.a.
7311         * configure: Regenerate.
7312
7313 2011-02-07  Pedro Alves  <pedro@codesourcery.com>
7314
7315         * server.c (gdb_read_memory): Change return semantics to allow
7316         partial transfers.
7317         (handle_search_memory_1): Adjust.
7318         (process_serial_event) <'m' packet>: Handle partial transfers.
7319         * tracepoint.c (traceframe_read_mem): Handle partial transfers.
7320
7321 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7322
7323         * regcache.c (init_register_cache): Initialize
7324         regcache->register_status.
7325         (free_register_cache): Release regcache->register_status.
7326         (regcache_cpy): Copy register_status.
7327         (registers_to_string): Print 'x's for unavailable registers.
7328         (supply_register): Mark the register's status valid or
7329         unavailable, depending on whether a buffer was passed in or not.
7330         (supply_register_zeroed): New.
7331         (supply_regblock): Mark the registers' status valid or
7332         unavailable, depending on whether a buffer was passed in or not.
7333         * regcache.h (REG_UNAVAILABLE, REG_VALID): New defines.
7334         (struct regcache): New `register_status' field.
7335         (supply_register_zeroed): Declare.
7336         * i387-fp.c (i387_xsave_to_cache): Zero out registers using
7337         supply_register_zeroed, rather than passing a NULL buffer to
7338         supply_register.
7339         * tracepoint.c (fetch_traceframe_registers): Update comment.
7340
7341 2011-01-28  Pedro Alves  <pedro@codesourcery.com>
7342
7343         * i387-fp.c (i387_xsave_to_cache): Make passing NULL as register
7344         buffer explicit.
7345
7346 2011-01-25  Pedro Alves  <pedro@codesourcery.com>
7347
7348         * server.h (decode_xfer_write): Change prototype.
7349         * remote-utils.c (decode_xfer_write): Remove `annex' parameter,
7350         and don't extract the annex here.
7351         * server.c (decode_xfer_read): Remove `annex' parameter,
7352         and don't extract the annex here.
7353         (decode_xfer): New.
7354         (struct qxfer): New.
7355         (handle_qxfer_auxv, handle_qxfer_features, handle_qxfer_libraries)
7356         (handle_qxfer_osdata, handle_qxfer_siginfo, handle_qxfer_spu)
7357         (handle_qxfer_statictrace): New functions, abstracted out from
7358         handle_query, and made to use the struct qxfer interface.
7359         (handle_threads_qxfer_proper): Rename to ...
7360         (handle_qxfer_threads_proper): ... this.
7361         (handle_threads_qxfer): Rename to ...
7362         (handle_qxfer_threads): ... this.  Adjust.
7363         (qxfer_packets): New array.
7364         (handle_qxfer): New function.
7365         (handle_query): Use handle_qxfer.
7366
7367 2011-01-05  Michael Snyder  <msnyder@msnyder-server.eng.vmware.com>
7368
7369         * gdbreplay.c: Shorten lines of >= 80 columns.
7370         * linux-low.c: Ditto.
7371         * linux-ppc-low.c: Ditto.
7372         * linux-s390-low.c: Ditto.
7373         * linux-sparc-low.c: Ditto.
7374         * linux-x86-low.c: Ditto.
7375         * linux-xtensa-low.c: Ditto.
7376         * mem-break.c: Ditto.
7377         * nto-low.c: Ditto.
7378         * regcache.h: Ditto.
7379         * remote-utils.c: Ditto.
7380         * server.c: Ditto.
7381         * server.h: Ditto.
7382         * thread-db.c: Ditto.
7383         * tracepoint.c: Ditto.
7384         * utils.c: Ditto.
7385         * win32-low.h: Ditto.
7386
7387 2011-01-05  Joel Brobecker  <brobecker@adacore.com>
7388
7389         * gdbserver/configure.ac, gdbserver/gdbserver.1: Copyright year
7390         update.
7391
7392 2011-01-01  Joel Brobecker  <brobecker@adacore.com>
7393
7394         * server.c (gdbserver_version): Update copyright year in version
7395         output.
7396         * gdbreplay.c (gdbreplay_version): Ditto.
7397
7398 2010-12-29  Jie Zhang  <jie.zhang@analog.com>
7399
7400         * configure.srv (bfin-*-*linux*): Handle Blackfin/Linux targets.
7401         * linux-bfin-low.c: New file.
7402         * linux-low.c: Define PT_TEXT_ADDR, PT_TEXT_END_ADDR, and
7403         PT_DATA_ADDR for BFIN targets.
7404         * Makefile.in (SFILES): Add linux-bfin-low.c.
7405         (clean): Remove reg-bfin.c.
7406         (linux-bfin-low.o, reg-bfin.o, reg-bfin.c): New targets.
7407         * README: Mention supported Blackfin targets.
7408
7409 2010-12-23  Mike Frysinger  <vapier@gentoo.org>
7410
7411         * .gitignore: New file.
7412
7413 2010-11-16  Mike Frysinger  <vapier@gentoo.org>
7414
7415         * linux-low.c (linux_tracefork_child): Add char* cast to arg.
7416
7417 2010-10-22  Jie Zhang  <jie@codesourcery.com>
7418
7419         * Makefile.in: Add FLAGS_TO_PASS variable.
7420         (install): Remove dependency of install-only and recursively
7421         invoke make for install-only.
7422
7423 2010-10-04  Doug Evans  <dje@google.com>
7424
7425         * Makefile.in (uninstall): Use $(DESTDIR).
7426
7427 2010-09-24  Pedro Alves  <pedro@codesourcery.com>
7428
7429         PR gdb/11842
7430
7431         * linux-x86-low.c (compat_siginfo_from_siginfo)
7432         (siginfo_from_compat_siginfo): Also copy si_pid and si_uid when
7433         si_code is < 0.  Check for si_code == SI_TIMER before checking for
7434         si_code < 0.
7435
7436 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7437
7438         * lynx-i386-low.c: New file.
7439         * configure.srv: Add handling of i[34567]86-*-lynxos* targets.
7440
7441 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7442
7443         * lynx-low.c (ptrace_request_to_str): Remove handling for
7444         request values that have been removed in LynxOS 5.x.
7445
7446 2010-09-13  Joel Brobecker  <brobecker@adacore.com>
7447
7448         * lynx-low.c, lynx-ppc-loc.c: Include <sys/ptrace.h> instead of
7449         <ptrace.h>
7450
7451 2010-09-09  Nathan Sidwell  <nathan@codesourcery.com>
7452
7453         * configure.ac: Add --enable-inprocess-agent option.
7454         * configure: Rebuilt.
7455
7456 2010-09-06  Yao Qi  <yao@codesourcery.com>
7457
7458         * linux-low.c (linux_kill): Remove unused variable.
7459         (linux_stabilize_threads): Likewise.
7460         * server.c (start_inferior): Likewise.
7461         (queue_stop_reply_callback): Likewise.
7462         * tracepoint.c (do_action_at_tracepoint): Likewise.
7463
7464 2010-09-06  Yao Qi  <yao@codesourcery.com>
7465
7466         * linux-low.c (maybe_move_out_of_jump_pad): Restore current_inferior
7467         on return.
7468
7469 2010-09-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
7470
7471         * target.c (mywait) <TARGET_WAITKIND_EXITED>: Fix to use INTEGER.
7472
7473 2010-09-06  Pedro Alves  <pedro@codesourcery.com>
7474
7475         * Makefile.in (install-only): Replace $IPA_DEPFILES with
7476         "$(IPA_DEPFILES)".
7477
7478 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7479
7480         * gdbserver/lynx-low.c, gdbserver/lynx-low.h,
7481         gdbserver/lynx-ppc-low.c: New files.
7482         * Makefile.in (lynx_low_h): New variable.
7483         (lynx-low.o, lynx-ppc-low.o): New rules.
7484         * configure.ac: On LynxOS, link with -lnetinet.
7485         * configure.srv: Add handling of powerpc-*-lynxos* targets.
7486         * configure: regenerate.
7487
7488 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7489
7490         * Makefile.in (vasprintf.o, vsnprintf.o): New rules.
7491         * configure.ac: Add check for vasprintf and vsnprintf.
7492         * configure, config.in: Regenerate.
7493         * server.h (vasprintf, vsnprintf): Add conditional declarations.
7494
7495 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7496
7497         * gdbreplay.c: Move include of alloca.h up, next to include of
7498         malloc.h.
7499         * server.h: Add include of malloc.h.
7500         * mem-break.c: Remove include of malloc.h.
7501         * server.c, tracepoint.c, utils.c, win32-low.c: Likewise.
7502
7503 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7504
7505         * Makefile.in (memmem.o): Build with -Wno-error.
7506
7507 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7508
7509         * utils.c (xsnprintf): Make non-static.
7510         * server.h: Add xsnprintf declaration.
7511         * linux-low.c, nto-low.c, target.c, thread-db.c, tracepoint.c:
7512         replace calls to snprintf by calls to xsnprintf throughout.
7513
7514 2010-09-01  Joel Brobecker  <brobecker@adacore.com>
7515
7516         * configure.ac: Add configure check for alloca.
7517         * configure, config.in: Regenerate.
7518         * server.h: Include alloca.h if it exists.
7519         * gdbreplay.c: Include alloca.h if it exists.
7520
7521 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7522
7523         * linux-low.c (__SIGRTMIN): Define if not already defined.
7524         (linux_create_inferior): Check for __ANDROID__ rather than
7525         __SIGRTMIN.
7526         (enqueue_one_deferred_signal): Don't requeue non-RT signals that
7527         are already deferred.
7528         (linux_wait_1): Check for __ANDROID__ rather than __SIGRTMIN.
7529         (linux_resume_one_thread): Don't queue a SIGSTOP if the lwp is
7530         stopped and already has a pending signal to report.
7531         (proceed_one_lwp): : Don't queue a SIGSTOP if the lwp already has
7532         a pending signal to report or is moving out of a jump pad.
7533         (linux_init_signals): Check for __ANDROID__ rather than
7534         __SIGRTMIN.
7535
7536 2010-08-28  Pedro Alves  <pedro@codesourcery.com>
7537
7538         * linux-low.c (linux_stabilize_threads): Wrap debug output in a
7539         debug_threads check.  Avoid a linear search when not doing debug
7540         output.
7541
7542 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7543
7544         * event-loop.c (event_handle_func): Adjust to use gdb_fildes_t.
7545         (struct gdb_event) <fd>: Change type to gdb_fildes_t.
7546         (struct file_handler) <fd>: Change type to gdb_fildes_t.
7547         (process_event): Change local fd's type to gdb_fildes_t.
7548         (create_file_handler): Adjust prototype.
7549         (delete_file_handler): Adjust prototype.
7550         (handle_file_event): Adjust prototype.  Use pfildes.
7551         (create_file_event): Adjsut prototype.
7552         * remote-utils.c (remote_desc, listen_desc): Change type to
7553         gdb_fildes_t.
7554         * server.h: New gdb_fildes_t typedef.
7555         [USE_WIN32API]: Include winsock2.h.
7556         (delete_file_handler, add_file_handler): Adjust prototypes.
7557         (pfildes): Declare.
7558         * utils.c (pfildes): New.
7559
7560 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7561
7562         * configure.ac (build_warnings): Add -Wno-char-subscripts.
7563         * configure: Regenerate.
7564
7565 2010-08-27  Pedro Alves  <pedro@codesourcery.com>
7566
7567         * linux-low.c (linux_unprepare_to_access_memory): Rename to ...
7568         (linux_done_accessing_memory): ... this.
7569         (linux_target_ops): Adjust.
7570         * linux-x86-low.c (x86_insert_point, x86_remove_point): Adjust.
7571         * nto-low.c (nto_target_ops): Adjust comment.
7572         * server.c (gdb_read_memory, gdb_write_memory): Adjust.
7573         * spu-low.c (spu_target_ops): Adjust comment.
7574         * target.h (target_ops): Rename unprepare_to_access_memory field
7575         to done_accessing_memory.
7576         (unprepare_to_access_memory): Rename to ...
7577         (done_accessing_memory): ... this.
7578
7579 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7580
7581         * linux-low.c (linux_prepare_to_access_memory): New.
7582         (linux_unprepare_to_access_memory): New.
7583         (linux_target_ops): Install them.
7584         * server.c (read_memory): Rename to ...
7585         (gdb_read_memory): ... this.  Use
7586         prepare_to_access_memory/prepare_to_access_memory.
7587         (write_memory): Rename to ...
7588         (gdb_write_memory): ... this.  Use
7589         prepare_to_access_memory/prepare_to_access_memory.
7590         (handle_search_memory_1): Adjust.
7591         (process_serial_event): Adjust.
7592         * target.h (struct target_ops): New fields
7593         prepare_to_access_memory and unprepare_to_access_memory.
7594         (prepare_to_access_memory, unprepare_to_access_memory): New.
7595         * linux-x86-low.c (x86_insert_point, x86_remove_point): Use
7596         prepare_to_access_memory/prepare_to_access_memory.
7597         * nto-low.c (nto_target_ops): Adjust.
7598         * spu-low.c (spu_target_ops): Adjust.
7599         * win32-low.c (win32_target_ops): Adjust.
7600
7601 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7602
7603         * Makefile.in (WARN_CFLAGS): Get it from configure.
7604         (WERROR_CFLAGS): New.
7605         (INTERNAL_CFLAGS): Add WERROR_CFLAGS.
7606         * configure.ac: Introduce --enable-werror, which adds -Werror to
7607         the compiler command line.  Enabled by default.  Disable with
7608         --disable-werror.  Add -Wdeclaration-after-statement
7609         Wpointer-arith and -Wformat-nonliteral to warning flags.
7610         * configure: Regenerate.
7611
7612 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7613
7614         * mem-break.c [HAVE_MALLOC_H]: Include malloc.h.
7615
7616 2010-08-26  Pedro Alves  <pedro@codesourcery.com>
7617
7618         * gdbreplay.c (remote_error): New.
7619         (gdbchar): New.
7620         (expect): Use gdbchar.  Check for error reading from GDB.
7621         Clarify sync error output.
7622         (play): Check for errors writing to GDB.
7623         * linux-low.c (sigchld_handler): Really ignore `write' errors.
7624         * remote-utils.c (getpkt): Check for errors writing to the remote
7625         descriptor.
7626
7627 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7628
7629         * linux-low.c (linux_wait_1): Move non-debugging code out of
7630         `debug_threads' control.
7631
7632 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7633
7634         * linux-low.c (linux_wait_1): Don't set last_status here.
7635         * server.c (push_event, queue_stop_reply_callback): Assert we're
7636         not pushing a TARGET_WAITKIND_IGNORE event.
7637         (start_inferior, start_inferior, attach_inferior, handle_v_cont)
7638         (myresume, handle_target_event): Set the thread's last_resume_kind
7639         and last_status from the target returned status.
7640
7641 2010-08-25  Pedro Alves  <pedro@codesourcery.com>
7642
7643         PR threads/10729
7644
7645         * linux-x86-low.c (update_debug_registers_callback): New.
7646         (i386_dr_low_set_addr): Use it.
7647         (i386_dr_low_get_addr): New.
7648         (i386_dr_low_set_control): Use update_debug_registers_callback.
7649         (i386_dr_low_get_control): New.
7650         (i386_dr_low_get_status): Adjust.
7651         * linux-low.c (linux_stop_lwp): New.
7652         * linux-low.h (linux_stop_lwp): Declare.
7653
7654         * i386-low.c (I386_DR_GET_RW_LEN): Take the dr7 contents as
7655         argument instead of a i386_debug_reg_state.
7656         (I386_DR_WATCH_HIT): Take the dr6 contents as argument instead of
7657         a i386_debug_reg_state.
7658         (i386_insert_aligned_watchpoint): Adjust.
7659         (i386_remove_aligned_watchpoint): Adjust.
7660         (i386_low_stopped_data_address): Read the debug registers from the
7661         inferior instead of from the mirrors.
7662         * i386-low.h (struct i386_debug_reg_state): Extend comment.
7663         (i386_dr_low_get_addr): Declare.
7664         (i386_dr_low_get_control): Declare.
7665         (i386_dr_low_get_status): Change prototype.
7666
7667         * win32-i386-low.c (dr_status_mirror, dr_control_mirror): New globals.
7668         (i386_dr_low_get_addr): New.
7669         (i386_dr_low_get_control): New.
7670         (i386_dr_low_get_status): Adjust prototype.  Return
7671         dr_status_mirror.
7672         (i386_initial_stuff): Clear dr_status_mirror and
7673         dr_control_mirror.
7674         (i386_get_thread_context): Adjust.
7675         (i386_set_thread_context): Adjust.
7676         (i386_thread_added): Adjust.
7677
7678 2010-08-24  Pedro Alves  <pedro@codesourcery.com>
7679
7680         * linux-low.h (linux_thread_area): Delete declaration.
7681
7682 2010-08-11  Thomas Schwinge  <thomas@codesourcery.com>
7683
7684         * linux-low.c (linux_wait_1): Correctly return the ptid of the child
7685         after its termination.
7686
7687 2010-08-09  Pedro Alves  <pedro@codesourcery.com>
7688
7689         * linux-low.c (gdb_wants_lwp_stopped): Delete.
7690         (gdb_wants_all_stopped): Delete.
7691         (linux_wait_1): Don't call them.
7692         * server.c (handle_v_cont): Tag all threads as want-stopped.
7693         (gdb_wants_thread_stopped): Fix comments.  Tag the thread that
7694         stopped as "client-wants-stopped".
7695
7696 2010-07-31  Pedro Alves  <pedro@codesourcery.com>
7697
7698         * Makefile.in (signals_h): New.
7699         (server_h): Depend on it.
7700         (server.o): Don't depend on $(signals_def).
7701         (signals.o): Depend on $(signals_def).
7702
7703 2010-07-31  Jan Kratochvil  <jan.kratochvil@redhat.com>
7704
7705         * Makefile.in (signals_def): New.
7706         (server_h): Append include/gdb/signals.h and signals_def.
7707         (server.o): Append signals_def.
7708
7709 2010-07-25  Jan Kratochvil  <jan.kratochvil@redhat.com>
7710
7711         * server.c (handle_target_event): Use target_signal_to_host for
7712         resume_info.sig initialization.
7713         * target.h (struct thread_resume) <sig>: New comment.
7714
7715 2010-07-20  Ozkan Sezer  <sezeroz@gmail.com>
7716
7717         * server.c (handle_query): strcpy() the returned string from paddress()
7718         instead of sprintf().
7719         * utils.c (paddress): Return phex_nz().
7720
7721 2010-07-07  Joel Brobecker  <brobecker@adacore.com>
7722
7723         * server.c (handle_v_cont): Call mourn_inferior if process
7724         just exited.
7725         (myresume): Likewise.
7726
7727 2010-07-01  Pedro Alves  <pedro@codesourcery.com>
7728
7729         Static tracepoints, and integration with UST.
7730
7731         * configure.ac: Handle --with-ust.  substitute ustlibs and ustinc.
7732         * mem-break.c (uninsert_all_breakpoints)
7733         (reinsert_all_breakpoints): New.
7734         * mem-break.h (reinsert_all_breakpoints, uninsert_all_breakpoints):
7735         * tracepoint.c (ust_loaded, helper_thread_id, cmd_buf): New.
7736         (gdb_agent_ust_loaded, helper_thread_id)
7737         (gdb_agent_helper_thread_id): New macros.
7738         (struct ipa_sym_addresses): Add addr_ust_loaded,
7739         addr_helper_thread_id, addr_cmd_buf.
7740         (symbol_list): Add ust_loaded, helper_thread_id, cmd_buf.
7741         (in_process_agent_loaded_ust): New.
7742         (write_e_ust_not_loaded): New.
7743         (maybe_write_ipa_ust_not_loaded): New.
7744         (struct collect_static_trace_data_action): New.
7745         (enum tracepoint_type) <static_tracepoint>: New.
7746         (struct tracepoint) <handle>: Mention static tracepoints.
7747         (struct static_tracepoint_ctx): New.
7748         (CMD_BUF_SIZE): New.
7749         (add_tracepoint_action): Handle static tracepoint actions.
7750         (unprobe_marker_at): New.
7751         (clear_installed_tracepoints): Handle static tracepoints.
7752         (cmd_qtdp): Handle static tracepoints.
7753         (probe_marker_at): New.
7754         (cmd_qtstart): Handle static tracepoints.
7755         (response_tracepoint): Handle static tracepoints.
7756         (cmd_qtfstm, cmd_qtsstm, cmd_qtstmat): New.
7757         (handle_tracepoint_query): Handle qTfSTM, qTsSTM and qTSTMat.
7758         (get_context_regcache): Handle static tracepoints.
7759         (do_action_at_tracepoint): Handle static tracepoint actions.
7760         (traceframe_find_block_type): Handle static trace data blocks.
7761         (traceframe_read_sdata): New.
7762         (download_tracepoints): Download static tracepoint actions.
7763         [HAVE_UST] Include ust/ust.h, dlfcn.h, sys/socket.h, and sys/un.h.
7764         (GDB_PROBE_NAME): New.
7765         (ust_ops): New.
7766         (GET_UST_SYM): New.
7767         (USTF): New.
7768         (dlsym_ust): New.
7769         (ust_marker_to_static_tracepoint): New.
7770         (gdb_probe): New.
7771         (collect_ust_data_at_tracepoint): New.
7772         (gdb_ust_probe): New.
7773         (UNIX_PATH_MAX, SOCK_DIR): New.
7774         (gdb_ust_connect_sync_socket): New.
7775         (resume_thread, stop_thread): New.
7776         (run_inferior_command): New.
7777         (init_named_socket): New.
7778         (gdb_ust_socket_init): New.
7779         (cstr_to_hexstr): New.
7780         (next_st): New.
7781         (first_marker, next_marker): New.
7782         (response_ust_marker): New.
7783         (cmd_qtfstm, cmd_qtsstm): New.
7784         (unprobe_marker_at, probe_marker_at): New.
7785         (cmd_qtstmat, gdb_ust_thread): New.
7786         (gdb_ust_init): New.
7787         (initialize_tracepoint_ftlib): Call gdb_ust_init.
7788         * linux-amd64-ipa.c [HAVE_UST]: Include ust/processor.h
7789         (ST_REGENTRY): New.
7790         (x86_64_st_collect_regmap): New.
7791         (X86_64_NUM_ST_COLLECT_GREGS): New.
7792         (AMD64_RIP_REGNUM): New.
7793         (supply_static_tracepoint_registers): New.
7794         * linux-i386-ipa.c [HAVE_UST]: Include ust/processor.h
7795         (ST_REGENTRY): New.
7796         (i386_st_collect_regmap): New.
7797         (i386_NUM_ST_COLLECT_GREGS): New.
7798         (supply_static_tracepoint_registers): New.
7799         * server.c (handle_query): Handle qXfer:statictrace:read.
7800         <qSupported>: Report support for StaticTracepoints, and
7801         qXfer:statictrace:read features.
7802         * server.h (traceframe_read_sdata)
7803         (supply_static_tracepoint_registers): Declare.
7804         * remote-utils.c (convert_int_to_ascii, hexchars, ishex, tohex)
7805         (unpack_varlen_hex): Include in IPA build.
7806         * Makefile.in (ustlibs, ustinc): New.
7807         (IPA_OBJS): Add remote-utils-ipa.o.
7808         ($(IPA_LIB)): Link -ldl and -lpthread.
7809         (UST_CFLAGS): New.
7810         (IPAGENT_CFLAGS): Add UST_CFLAGS.
7811         * config.in, configure: Regenerate.
7812
7813 2010-06-20  Ian Lance Taylor  <iant@google.com>
7814             Pedro Alves  <pedro@codesourcery.com>
7815
7816         * linux-x86-low.c (always_true): Delete.
7817         (EMIT_ASM, EMIT_ASM32): Use an uncondition asm jmp instead of
7818         trying to fool the compiler with always_true.
7819
7820 2010-06-20  Pedro Alves  <pedro@codesourcery.com>
7821
7822         * tracepoint.c (condition_true_at_tracepoint): Don't run compiled
7823         conditions in gdbserver.
7824
7825 2010-06-19  Ulrich Weigand  <uweigand@de.ibm.com>
7826
7827         * spu-low.c (spu_read_memory): Wrap around local store limit.
7828         (spu_write_memory): Likewise.
7829
7830 2010-06-15  Pedro Alves  <pedro@codesourcery.com>
7831
7832         * linux-x86-low.c (amd64_emit_const, amd64_emit_void_call_2)
7833         (i386_emit_const, i386_emit_void_call_2): Replace int64_t uses with
7834         LONGEST uses.
7835         * server.h (struct emit_ops): Replace int64_t uses with LONGEST
7836         uses.
7837         * tracepoint.c (emit_const, emit_void_call_2): Replace int64_t
7838         uses with LONGEST uses.
7839
7840 2010-06-14  Stan Shebs  <stan@codesourcery.com>
7841             Pedro Alves  <pedro@codesourcery.com>
7842
7843         Bytecode compiler.
7844
7845         * linux-x86-low.c: Include limits.h.
7846         (add_insns): New.
7847         (always_true): New.
7848         (EMIT_ASM): New.
7849         (EMIT_ASM32): New.
7850         (amd64_emit_prologue, amd64_emit_epilogue, amd64_emit_add)
7851         (amd64_emit_sub, amd64_emit_mul, amd64_emit_lsh)
7852         (amd64_emit_rsh_signed, amd64_emit_rsh_unsigned, amd64_emit_ext,
7853         (amd64_emit_log_not, amd64_emit_bit_and, amd64_emit_bit_or)
7854         (amd64_emit_bit_xor, amd64_emit_bit_not, amd64_emit_equal,
7855         (amd64_emit_less_signed, amd64_emit_less_unsigned, amd64_emit_ref,
7856         (amd64_emit_if_goto, amd64_emit_goto, amd64_write_goto_address)
7857         (amd64_emit_const, amd64_emit_call, amd64_emit_reg)
7858         (amd64_emit_pop, amd64_emit_stack_flush, amd64_emit_zero_ext)
7859         (amd64_emit_swap, amd64_emit_stack_adjust, amd64_emit_int_call_1)
7860         (amd64_emit_void_call_2): New.
7861         (amd64_emit_ops): New.
7862         (i386_emit_prologue, i386_emit_epilogue, i386_emit_add)
7863         (i386_emit_sub,i386_emit_mul, i386_emit_lsh, i386_emit_rsh_signed)
7864         (i386_emit_rsh_unsigned, i386_emit_ext, i386_emit_log_not)
7865         (i386_emit_bit_and, i386_emit_bit_or, i386_emit_bit_xor)
7866         (i386_emit_bit_not, i386_emit_equal, i386_emit_less_signed)
7867         (i386_emit_less_unsigned, i386_emit_ref, i386_emit_if_goto)
7868         (i386_emit_goto, i386_write_goto_address, i386_emit_const)
7869         (i386_emit_call, i386_emit_reg, i386_emit_pop)
7870         (i386_emit_stack_flush, i386_emit_zero_ext, i386_emit_swap)
7871         (i386_emit_stack_adjust, i386_emit_int_call_1)
7872         (i386_emit_void_call_2): New.
7873         (i386_emit_ops): New.
7874         (x86_emit_ops): New.
7875         (the_low_target): Install x86_emit_ops.
7876         * server.h (struct emit_ops): New.
7877         (get_raw_reg_func_addr): Declare.
7878         (current_insn_ptr, emit_error): Declare.
7879         * tracepoint.c (get_raw_reg, get_trace_state_variable_value)
7880         (set_trace_state_variable_value): New defines.
7881         (struct ipa_sym_addresses): New fields addr_get_raw_reg,
7882         addr_get_trace_state_variable_value and
7883         addr_set_trace_state_variable_value.
7884         (symbol_list): New fields for get_raw_reg,
7885         get_trace_state_variable_value and set_trace_state_variable_value.
7886         (condfn): New typedef.
7887         (struct tracepoint): New field `compiled_cond'.
7888         (do_action_at_tracepoint): Clear compiled_cond.
7889         (get_trace_state_variable_value, set_trace_state_variable_value):
7890         Export in the IPA.
7891         (condition_true_at_tracepoint): If there's a compiled condition,
7892         run that.
7893         (current_insn_ptr, emit_error): New globals.
7894         (struct bytecode_address): New.
7895         (get_raw_reg_func_addr): New.
7896         (emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul)
7897         (emit_lsh, emit_rsh_signed, emit_rsh_unsigned, emit_ext)
7898         (emit_log_not, emit_bit_and, emit_bit_or, emit_bit_xor)
7899         (emit_bit_not, emit_equal, emit_less_signed, emit_less_unsigned)
7900         (emit_ref, emit_if_goto, emit_goto, write_goto_address, emit_const)
7901         (emit_reg, emit_pop, emit_stack_flush, emit_zero_ext, emit_swap)
7902         (emit_stack_adjust, emit_int_call_1, emit_void_call_2): New.
7903         (compile_tracepoint_condition, compile_bytecodes): New.
7904         * target.h (emit_ops): Forward declare.
7905         (struct target_ops): New field emit_ops.
7906         (target_emit_ops): New.
7907         * linux-amd64-ipa.c (gdb_agent_get_raw_reg): New.
7908         * linux-i386-ipa.c (gdb_agent_get_raw_reg): New.
7909         * linux-low.c (linux_emit_ops): New.
7910         (linux_target_ops): Install it.
7911         * linux-low.h (struct linux_target_ops): New field emit_ops.
7912
7913 2010-06-14  Ulrich Weigand  <uweigand@de.ibm.com>
7914
7915         * linux-ppc-low.c (ppc_arch_setup): Use private regcache to test MSR.
7916         * linux-s390-low.c (ppc_arch_setup): Use private regcache to test PSW.
7917
7918 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
7919             Stan Shebs  <stan@codesourcery.com>
7920
7921         * Makefile.in (IPA_DEPFILES, extra_libraries): New.
7922         (all): Depend on $(extra_libraries).
7923         (install-only): Install the IPA.
7924         (IPA_OBJS, IPA_LIB): New.
7925         (clean): Remove the IPA lib.
7926         (IPAGENT_CFLAGS): New.
7927         (tracepoint-ipa.o, utils-ipa.o, remote-utils-ipa.o)
7928         (regcache-ipa.o, i386-linux-ipa.o, linux-i386-ipa.o)
7929         (linux-amd64-ipa.o, amd64-linux-ipa.o): New rules.
7930         * linux-amd64-ipa.c, linux-i386-ipa.c: New files.
7931         * configure.ac: Check for atomic builtins support in the compiler.
7932         (IPA_DEPFILES, extra_libraries): Define.
7933         * configure.srv (ipa_obj): Add description.
7934         (ipa_i386_linux_regobj, ipa_amd64_linux_regobj): Define.
7935         (i[34567]86-*-linux*): Set ipa_obj.
7936         (x86_64-*-linux*): Set ipa_obj.
7937         * linux-low.c (stabilizing_threads): New.
7938         (supports_fast_tracepoints): New.
7939         (linux_detach): Stabilize threads before detaching.
7940         (handle_tracepoints): Handle internal tracing breakpoints.  Assert
7941         the lwp is either not stabilizing, or is moving out of a jump pad.
7942         (linux_fast_tracepoint_collecting): New.
7943         (maybe_move_out_of_jump_pad): New.
7944         (enqueue_one_deferred_signal): New.
7945         (dequeue_one_deferred_signal): New.
7946         (linux_wait_for_event_1): If moving out of a jump pad, defer
7947         pending signals to later.
7948         (linux_stabilize_threads): New.
7949         (linux_wait_1): Check if threads need moving out of jump pads, and
7950         do it if so.
7951         (stuck_in_jump_pad_callback): New.
7952         (move_out_of_jump_pad_callback): New.
7953         (lwp_running): New.
7954         (linux_resume_one_lwp): Handle moving out of jump pads.
7955         (linux_set_resume_request): Dequeue deferred signals.
7956         (need_step_over_p): Also step over fast tracepoint jumps.
7957         (start_step_over): Also uninsert fast tracepoint jumps.
7958         (finish_step_over): Also reinsert fast tracepoint jumps.
7959         (linux_install_fast_tracepoint_jump): New.
7960         (linux_target_ops): Install linux_stabilize_threads and
7961         linux_install_fast_tracepoint_jump_pad.
7962         * linux-low.h (linux_target_ops) <get_thread_area,
7963         install_fast_tracepoint_jump_pad>: New fields.
7964         (struct lwp_info) <collecting_fast_tracepoint,
7965         pending_signals_to_report, exit_jump_pad_bkpt>: New fields.
7966         (linux_get_thread_area): Declare.
7967         * linux-x86-low.c (jump_insn): New.
7968         (x86_get_thread_area): New.
7969         (append_insns): New.
7970         (push_opcode): New.
7971         (amd64_install_fast_tracepoint_jump_pad): New.
7972         (i386_install_fast_tracepoint_jump_pad): New.
7973         (x86_install_fast_tracepoint_jump_pad): New.
7974         (the_low_target): Install x86_get_thread_area and
7975         x86_install_fast_tracepoint_jump_pad.
7976         * mem-break.c (set_raw_breakpoint_at): Use read_inferior_memory.
7977         (struct fast_tracepoint_jump): New.
7978         (fast_tracepoint_jump_insn): New.
7979         (fast_tracepoint_jump_shadow): New.
7980         (find_fast_tracepoint_jump_at): New.
7981         (fast_tracepoint_jump_here): New.
7982         (delete_fast_tracepoint_jump): New.
7983         (set_fast_tracepoint_jump): New.
7984         (uninsert_fast_tracepoint_jumps_at): New.
7985         (reinsert_fast_tracepoint_jumps_at): New.
7986         (set_breakpoint_at): Use write_inferior_memory.
7987         (uninsert_raw_breakpoint): Use write_inferior_memory.
7988         (check_mem_read): Mask out fast tracepoint jumps.
7989         (check_mem_write): Mask out fast tracepoint jumps.
7990         * mem-break.h (struct fast_tracepoint_jump): Forward declare.
7991         (set_fast_tracepoint_jump): Declare.
7992         (delete_fast_tracepoint_jump)
7993         (fast_tracepoint_jump_here, uninsert_fast_tracepoint_jumps_at)
7994         (reinsert_fast_tracepoint_jumps_at): Declare.
7995         * regcache.c: Don't compile many functions when building the
7996         in-process agent library.
7997         (init_register_cache) [IN_PROCESS_AGENT]: Don't allow allocating
7998         the register buffer in the heap.
7999         (free_register_cache): If the register buffer isn't owned by the
8000         regcache, don't free it.
8001         (set_register_cache) [IN_PROCESS_AGENT]: Don't re-alocate
8002         pre-existing register caches.
8003         * remote-utils.c (convert_int_to_ascii): Constify `from' parameter
8004         type.
8005         (convert_ascii_to_int): : Constify `from' parameter type.
8006         (decode_M_packet, decode_X_packet): Replace the `to' parameter by
8007         a `to_p' pointer to pointer parameter.  If TO_P is NULL, malloc
8008         the needed buffer in-place.
8009         (relocate_instruction): New.
8010         * server.c (handle_query) <qSymbols>: If the target supports
8011         tracepoints, give it a chance of looking up symbols.  Report
8012         support for fast tracepoints.
8013         (handle_status): Stabilize threads.
8014         (process_serial_event): Adjust.
8015         * server.h (struct fast_tracepoint_jump): Forward declare.
8016         (struct process_info) <fast_tracepoint_jumps>: New field.
8017         (convert_ascii_to_int, convert_int_to_ascii): Adjust.
8018         (decode_X_packet, decode_M_packet): Adjust.
8019         (relocate_instruction): Declare.
8020         (in_process_agent_loaded): Declare.
8021         (tracepoint_look_up_symbols): Declare.
8022         (struct fast_tpoint_collect_status): Declare.
8023         (fast_tracepoint_collecting): Declare.
8024         (force_unlock_trace_buffer): Declare.
8025         (handle_tracepoint_bkpts): Declare.
8026         (initialize_low_tracepoint)
8027         (supply_fast_tracepoint_registers) [IN_PROCESS_AGENT]: Declare.
8028         * target.h (struct target_ops) <stabilize_threads,
8029         install_fast_tracepoint_jump_pad>: New fields.
8030         (stabilize_threads, install_fast_tracepoint_jump_pad): New.
8031         * tracepoint.c [HAVE_MALLOC_H]: Include malloc.h.
8032         [HAVE_STDINT_H]: Include stdint.h.
8033         (trace_debug_1): Rename to ...
8034         (trace_vdebug): ... this.
8035         (trace_debug): Rename to ...
8036         (trace_debug_1): ... this.  Add `level' parameter.
8037         (trace_debug): New.
8038         (ATTR_USED, ATTR_NOINLINE): New.
8039         (IP_AGENT_EXPORT): New.
8040         (gdb_tp_heap_buffer, gdb_jump_pad_buffer, gdb_jump_pad_buffer_end)
8041         (collecting, gdb_collect, stop_tracing, flush_trace_buffer)
8042         (about_to_request_buffer_space, trace_buffer_is_full)
8043         (stopping_tracepoint, expr_eval_result, error_tracepoint)
8044         (tracepoints, tracing, trace_buffer_ctrl, trace_buffer_ctrl_curr)
8045         (trace_buffer_lo, trace_buffer_hi, traceframe_read_count)
8046         (traceframe_write_count, traceframes_created)
8047         (trace_state_variables)
8048         New renaming defines.
8049         (struct ipa_sym_addresses): New.
8050         (STRINGIZE_1, STRINGIZE, IPA_SYM): New.
8051         (symbol_list): New.
8052         (ipa_sym_addrs): New.
8053         (all_tracepoint_symbols_looked_up): New.
8054         (in_process_agent_loaded): New.
8055         (write_e_ipa_not_loaded): New.
8056         (maybe_write_ipa_not_loaded): New.
8057         (tracepoint_look_up_symbols): New.
8058         (debug_threads) [IN_PROCESS_AGENT]: New.
8059         (read_inferior_memory) [IN_PROCESS_AGENT]: New.
8060         (UNKNOWN_SIDE_EFFECTS): New.
8061         (stop_tracing): New.
8062         (flush_trace_buffer): New.
8063         (stop_tracing_bkpt): New.
8064         (flush_trace_buffer_bkpt): New.
8065         (read_inferior_integer): New.
8066         (read_inferior_uinteger): New.
8067         (read_inferior_data_pointer): New.
8068         (write_inferior_data_pointer): New.
8069         (write_inferior_integer): New.
8070         (write_inferior_uinteger): New.
8071         (struct collect_static_trace_data_action): Delete.
8072         (enum tracepoint_type): New.
8073         (struct tracepoint) <type>: New field `type'.
8074         <actions_str, step_actions, step_actions_str>: Only include in
8075         GDBserver.
8076         <orig_size, obj_addr_on_target, adjusted_insn_addr>
8077         <adjusted_insn_addr_end, jump_pad, jump_pad_end>: New fields.
8078         (tracepoints): Use IP_AGENT_EXPORT.
8079         (last_tracepoint): Don't include in the IPA.
8080         (stopping_tracepoint): Use IP_AGENT_EXPORT.
8081         (trace_buffer_is_full): Use IP_AGENT_EXPORT.
8082         (alloced_trace_state_variables): New.
8083         (trace_state_variables): Use IP_AGENT_EXPORT.
8084         (traceframe_t): Delete unused variable.
8085         (circular_trace_buffer): Don't include in the IPA.
8086         (trace_buffer_start): Delete.
8087         (struct trace_buffer_control): New.
8088         (trace_buffer_free): Delete.
8089         (struct ipa_trace_buffer_control): New.
8090         (GDBSERVER_FLUSH_COUNT_MASK, GDBSERVER_FLUSH_COUNT_MASK_PREV)
8091         (GDBSERVER_FLUSH_COUNT_MASK_CURR, GDBSERVER_UPDATED_FLUSH_COUNT_BIT):
8092         New.
8093         (trace_buffer_ctrl): New.
8094         (TRACE_BUFFER_CTRL_CURR): New.
8095         (trace_buffer_start, trace_buffer_free, trace_buffer_end_free):
8096         Reimplement as macros.
8097         (trace_buffer_wrap): Delete.
8098         (traceframe_write_count, traceframe_read_count)
8099         (traceframes_created, tracing): Use IP_AGENT_EXPORT.
8100         (struct tracepoint_hit_ctx) <type>: New field.
8101         (struct fast_tracepoint_ctx): New.
8102         (memory_barrier): New.
8103         (cmpxchg): New.
8104         (record_tracepoint_error): Update atomically in the IPA.
8105         (clear_inferior_trace_buffer): New.
8106         (about_to_request_buffer_space): New.
8107         (trace_buffer_alloc): Handle GDBserver and inferior simulatenous
8108         updating the same buffer.
8109         (add_tracepoint): Default the tracepoint's type to trap
8110         tracepoint, and orig_size to -1.
8111         (get_trace_state_variable) [IN_PROCESS_AGENT]: Handle allocated
8112         internal variables.
8113         (create_trace_state_variable): New parameter `gdb'.  Handle it.
8114         (clear_installed_tracepoints): Clear fast tracepoint jumps.
8115         (cmd_qtdp): Handle fast tracepoints.
8116         (cmd_qtdv): Adjust.
8117         (max_jump_pad_size): New.
8118         (gdb_jump_pad_head): New.
8119         (get_jump_space_head): New.
8120         (claim_jump_space): New.
8121         (sort_tracepoints): New.
8122         (MAX_JUMP_SIZE): New.
8123         (cmd_qtstart): Handle fast tracepoints.  Sync tracepoints with the
8124         IPA.
8125         (stop_tracing) [IN_PROCESS_AGENT]: Don't include the tdisconnected
8126         support.  Upload fast traceframes, and delete internal IPA
8127         breakpoints.
8128         (stop_tracing_handler): New.
8129         (flush_trace_buffer_handler): New.
8130         (cmd_qtstop): Upload fast tracepoints.
8131         (response_tracepoint): Handle fast tracepoints.
8132         (tracepoint_finished_step): Upload fast traceframes.  Set the
8133         tracepoint hit context's tracepoint type.
8134         (handle_tracepoint_bkpts): New.
8135         (tracepoint_was_hit): Set the tracepoint hit context's tracepoint
8136         type.  Add comment about fast tracepoints.
8137         (collect_data_at_tracepoint) [IN_PROCESS_AGENT]: Don't access the
8138         non-existing action_str field.
8139         (get_context_regcache): Handle fast tracepoints.
8140         (do_action_at_tracepoint) [!IN_PROCESS_AGENT]: Don't write the PC
8141         to the regcache.
8142         (fast_tracepoint_from_jump_pad_address): New.
8143         (fast_tracepoint_from_ipa_tpoint_address): New.
8144         (collecting_t): New.
8145         (force_unlock_trace_buffer): New.
8146         (fast_tracepoint_collecting): New.
8147         (collecting): New.
8148         (gdb_collect): New.
8149         (write_inferior_data_ptr): New.
8150         (target_tp_heap): New.
8151         (target_malloc): New.
8152         (download_agent_expr): New.
8153         (UALIGN): New.
8154         (download_tracepoints): New.
8155         (download_trace_state_variables): New.
8156         (upload_fast_traceframes): New.
8157         (IPA_FIRST_TRACEFRAME): New.
8158         (IPA_NEXT_TRACEFRAME_1): New.
8159         (IPA_NEXT_TRACEFRAME): New.
8160         [IN_PROCESS_AGENT]: Include sys/mman.h and fcntl.h.
8161         [IN_PROCESS_AGENT] (gdb_tp_heap_buffer, gdb_jump_pad_buffer)
8162         (gdb_jump_pad_buffer_end): New.
8163         [IN_PROCESS_AGENT] (initialize_tracepoint_ftlib): New.
8164         (initialize_tracepoint): Adjust.
8165         [IN_PROCESS_AGENT]: Allocate the IPA heap, and jump pad scratch
8166         buffer.  Initialize the low module.
8167         * utils.c (PREFIX, TOOLNAME): New.
8168         (malloc_failure): Use PREFIX.
8169         (error): In the IPA, an error causes an exit.
8170         (fatal, warning): Use PREFIX.
8171         (internal_error): Use TOOLNAME.
8172         (NUMCELLS): Increase to 10.
8173         * configure, config.in: Regenerate.
8174
8175 2010-06-01  Pedro Alves  <pedro@codesourcery.com>
8176
8177         * server.c (handle_query) <qSupported>: Do two passes over the
8178         qSupported string to avoid nesting strtok.
8179
8180 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8181
8182         * Makefile.in (SFILES): Add $(srcdir)/proc-service.list.
8183         (CDEPS): New.
8184         * configure.ac (RDYNAMIC): New AC_MSG_CHECKING wrapping.  Test also
8185         -Wl,--dynamic-list.
8186         * configure: Regenerate.
8187         * proc-service.list: New.
8188
8189 2010-05-28  Jan Kratochvil  <jan.kratochvil@redhat.com>
8190
8191         * linux-low.c (linux_core_of_thread): Fix crash on invalid CONTENT.
8192         New comment.
8193
8194 2010-05-26  Ozkan Sezer  <sezeroz@gmail.com>
8195
8196         * gdbreplay.c (remote_open): Check error return from socket() call by
8197         its equality to -1 not by it being negative.
8198         * remote-utils.c (remote_open): Likewise.
8199
8200 2010-05-23  Pedro Alves  <pedro@codesourcery.com>
8201
8202         * config.h: Regenerate.
8203
8204 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8205
8206         * linux-m68k-low.c (ps_get_thread_area): Don't define if kernel
8207         doesn't provide PTRACE_GET_THREAD_AREA.
8208
8209 2010-05-19  Maxim Kuvyrkov  <maxim@codesourcery.com>
8210
8211         * linux-m68k-low.c: Include <asm/ptrace.h>
8212         (ps_get_thread_area): Implement.
8213
8214 2010-05-03  Doug Evans  <dje@google.com>
8215
8216         * event-loop.c (struct callback_event): New struct.
8217         (callback_list): New global.
8218         (append_callback_event, delete_callback_event): New functions.
8219         (process_callback): New function.
8220         (start_event_loop): Call it.
8221         * remote-utils.c (NOT_SCHEDULED): Define.
8222         (readchar_buf, readchar_bufcnt, readchar_bufp): New static globals,
8223         moved out of readchar.
8224         (readchar): Rewrite.  Call reschedule before returning.
8225         (reset_readchar): New function.
8226         (remote_close): Call it.
8227         (process_remaining, reschedule): New functions.
8228         * server.h (callback_handler_func): New typedef.
8229         (append_callback_event, delete_callback_event): Declare.
8230
8231 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8232
8233         * proc-service.c (ps_pglobal_lookup): Use
8234         thread_db_look_up_one_symbol.
8235         * remote-utils.c (look_up_one_symbol): Add new `may_ask_gdb'
8236         parameter.  Use it instead of all_symbols_looked_up.
8237         * server.h (struct process_info) <all_symbols_looked_up>: Delete
8238         field.
8239         (all_symbols_looked_up): Don't declare.
8240         (look_up_one_symbol): Add new `may_ask_gdb' parameter.
8241         * thread-db.c (struct thread_db) <all_symbols_looked_up>: New
8242         field.
8243         (thread_db_look_up_symbols): Adjust call to look_up_one_symbol.
8244         Set all_symbols_looked_up here.
8245         (thread_db_look_up_one_symbol): New.
8246         (thread_db_get_tls_address): Adjust.
8247         (thread_db_load_search, try_thread_db_load_1): Always allocate the
8248         thread_db object on the heap, and tentatively set it in the
8249         process structure.
8250         (thread_db_init): Don't set all_symbols_looked_up here.
8251         * linux-low.h (thread_db_look_up_one_symbol): Declare.
8252
8253 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8254
8255         * linux-low.c (linux_kill, linux_detach): Adjust.
8256         (status_pending_p_callback): Remove redundant statement.  Check
8257         for !TARGET_WAITIKIND_IGNORE, instead of
8258         TARGET_WAITKIND_STOPPED.
8259         (handle_tracepoints): Make sure LWP is locked.  Adjust.
8260         (linux_wait_for_event_1): Adjust.
8261         (linux_cancel_breakpoints): New.
8262         (unsuspend_one_lwp): New.
8263         (unsuspend_all_lwps): New.
8264         (linux_wait_1): If finishing a step-over, unsuspend all lwps.
8265         (send_sigstop_callback): Change return type to int, add new
8266         `except' parameter and handle it.
8267         (suspend_and_send_sigstop_callback): New.
8268         (stop_all_lwps): Add new `suspend' and `expect' parameters, and
8269         pass them down.  If SUSPEND, also increment the lwp's suspend
8270         count.
8271         (linux_resume_one_lwp): Add notice about resuming a suspended LWP.
8272         (need_step_over_p): Don't consider suspended LWPs.
8273         (start_step_over): Adjust.
8274         (proceed_one_lwp): Change return type to int, add new `except'
8275         parameter and handle it.
8276         (unsuspend_and_proceed_one_lwp): New.
8277         (proceed_all_lwps): Use find_inferior instead of
8278         for_each_inferior.
8279         (unstop_all_lwps): Add `unsuspend' parameter.  If UNSUSPEND, them
8280         also decrement the suspend count of LWPs.  Pass `except' down,
8281         instead of hacking its suspend count.
8282         (linux_pause_all): Add `freeze' parameter.  Adjust.
8283         (linux_unpause_all): New.
8284         (linux_target_ops): Install linux_unpause_all.
8285         * server.c (handle_status): Adjust.
8286         * target.h (struct target_ops): New fields `unpause_all' and
8287         `cancel_breakpoints'.  Add new parameter to `pause_all'.
8288         (pause_all): Add new `freeze' parameter.
8289         (unpause_all): New.
8290         (cancel_breakpoints): New.
8291         * tracepoint.c (clear_installed_tracepoints): Pause threads, and
8292         cancel breakpoints.
8293         (cmd_qtstart): Pause threads.
8294         (stop_tracing): Pause threads, and cancel breakpoints.
8295         * win32-low.c (win32_target_ops): Adjust.
8296
8297 2010-05-03  Pedro Alves  <pedro@codesourcery.com>
8298
8299         * linux-low.c (linux_wait_for_event_1): Move passing the signal to
8300         the inferior right away from here...
8301         (linux_wait_1): ... to here, and adjust to check the thread's
8302         last_resume_kind instead of the lwp's step or stop_expected flags.
8303
8304 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8305
8306         * README: Use consistent `GDB' and `GDBserver' spellings.
8307
8308 2010-05-02  Pedro Alves  <pedro@codesourcery.com>
8309
8310         * linux-low.c (linux_kill_one_lwp): Assume the lwp is stopped.
8311         (linux_kill): Stop all lwps here.  Don't delete the main lwp here.
8312         (linux_detach_one_lwp): Assume the lwp is stopped.
8313         (any_thread_of): Delete.
8314         (linux_detach): Stop all lwps here.  Don't blindly delete all
8315         breakpoints.
8316         (delete_lwp_callback): New.
8317         (linux_mourn): Delete all lwps of the process that is gone.
8318         (linux_wait_1): Don't delete the last lwp of the process here.
8319         * mem-break.h (mark_breakpoints_out): Declare.
8320         * mem-break.c (mark_breakpoints_out): New.
8321         (free_all_breakpoints): Use it.
8322         * server.c (handle_target_event): If the process is gone, mark
8323         breakpoints out.
8324         * thread-db.c (struct thread_db) <create_bp>: New field.
8325         (thread_db_enable_reporting): Fix prototype.  Store a thread event
8326         breakpoint reference in the thread_db struct.
8327         (thread_db_load_search): Clear the thread_db object.
8328         (try_thread_db_load_1): Ditto.
8329         (switch_to_process): New.
8330         (disable_thread_event_reporting): Use it.
8331         (remove_thread_event_breakpoints): New.
8332         (thread_db_detach, thread_db_mourn): Use it.
8333
8334 2010-05-01  Pedro Alves  <pedro@codesourcery.com>
8335
8336         * linux-low.c (linux_enable_event_reporting): New.
8337         (linux_wait_for_event_1, handle_extended_wait): Use it.
8338
8339 2010-04-30  Pedro Alves  <pedro@codesourcery.com>
8340
8341         * linux-low.c (linux_kill_one_lwp, linux_kill)
8342         (linux_detach_one_lwp): Adjust to send_sigstop interface change.
8343         (send_sigstop): Take an lwp_info as parameter instead.  Queue a
8344         SIGSTOP even if the LWP is stopped.
8345         (send_sigstop_callback): New.
8346         (stop_all_lwps): Use send_sigstop_callback instead.
8347         (linux_resume_one_thread): Adjust.
8348         (proceed_one_lwp): Still proceed an LWP that the client has
8349         requested to stop, if we haven't reported it as stopped yet.  Make
8350         sure that LWPs the client want stopped, have a pending SIGSTOP.
8351
8352 2010-04-26  Doug Evans  <dje@google.com>
8353
8354         * server.c (handle_general_set): Make static.
8355
8356         * remote-utils.c (putpkt_binary_1): Call readchar instead of read.
8357         Print received char after testing for error/eof instead of before.
8358         (input_interrupt): Tweak comment.
8359
8360 2010-04-23  Doug Evans  <dje@google.com>
8361
8362         * server.c (start_inferior): Print inferior argv if --debug.
8363
8364 2010-04-21  Aleksandar Ristovski  <aristovski@qnx.com>
8365
8366         * Makefile.in (nto_low_h nto-low.o nto-x86-low.o): New dependency lists.
8367         * nto-x86-low.c: Include server.h
8368
8369 2010-04-20  Pierre Muller  <muller@ics.u-strasbg.fr>
8370
8371         * win32-i386-low.c: Use __x86_64__ macro instead of __x86_64 to
8372         be consistent with other sources of this directory.
8373         (init_registers_amd64): Correct name of source file of this function
8374         in the comment.
8375
8376 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8377
8378         * configure.srv (x86_64-*-mingw*): New configuration for Windows
8379         64-bit executables.
8380
8381 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8382
8383         * win32-i386-low.c: Add 64-bit support.
8384         (CONTEXT_EXTENDED_REGISTERS): Set macro to zero if not exisiting.
8385         (init_registers_amd64): Declare.
8386         (mappings): Add 64-bit version of array.
8387         (init_windows_x86): New function.
8388         (the_low_target): Change init_arch field to init_windows_x86.
8389
8390 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8391
8392         * win32-low.c: Adapt to support also 64-bit architecture.
8393         (child_xfer_memory): Use uintptr_t type for local variable `addr'.
8394         (get_image_name): Use SIZE_T type for local variable `done'.
8395         (psapi_get_dll_name): Use LPVOID type for parameter `BaseAddress'.
8396         (toolhelp_get_dll_name): Idem.
8397         (handle_load_dll): Use CORE_ADDR type for local variable `load_addr'.
8398         Use uintptr_t typecast to avoid warning.
8399         (handle_unload_dll): Use uintptr_t typecast to avoid warning.
8400         (handle_exception): Use phex_nz to avoid warning.
8401         (win32_wait): Remove unused local variable `process'.
8402
8403 2010-04-19  Pierre Muller  <muller@ics.u-strasbg.fr>
8404
8405         * configure.srv (srv_amd64_regobj): Replace `x86-64-avx.o' by
8406         `amd64-avx.o'.
8407
8408 2010-04-17  Pierre Muller  <muller@ics.u-strasbg.fr>
8409
8410         * configure.ac: Use `ws2_32' library for srv_mingw.
8411         * configure: Regenerate.
8412         * gdbreplay.c: Include winsock2.h instead of winsock.h.
8413         * remote-utils.c: Likewise.
8414
8415 2010-04-17  H.J. Lu  <hongjiu.lu@intel.com>
8416
8417         * linux-x86-low.c (xmltarget_amd64_linux_no_xml): Define only
8418         if __x86_64__ is defined.
8419
8420 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8421
8422         * configure: Regenerate.
8423
8424 2010-04-16  Pierre Muller  <muller@ics.u-strasbg.fr>
8425
8426         * server.c (handle_query): Handle 'qGetTIBAddr' query.
8427         * target.h (target_ops): New get_tib_address field.
8428         * win32-low.h (win32_thread_info): Add thread_local_base field.
8429         * win32-low.c (child_add_thread): Add tlb argument.
8430         Set thread_local_base field to TLB.
8431         (get_child_debug_event): Adapt to child_add_thread change.
8432         (win32_get_tib_address): New function.
8433         (win32_target_ops): Set get_tib_address field to
8434         win32_get_tib_address.
8435         * linux-low.c (linux_target_ops): Set get_tib_address field to NULL.
8436
8437 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8438
8439         * linux-low.c (linux_mourn): Also remove the process.
8440         * server.c (handle_target_event): Don't remove the process here.
8441         * nto-low.c (nto_mourn): New.
8442         (nto_target_ops): Install it.
8443         * spu-low.c (spu_mourn): New.
8444         (spu_target_ops): Install it.
8445         * win32-low.c (win32_mourn): New.
8446         (win32_target_ops): Install it.
8447
8448 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8449
8450         * server.h (buffer_xml_printf): Remove redundant `;'.
8451
8452 2010-04-12  Pedro Alves  <pedro@codesourcery.com>
8453
8454         * regcache.c (set_register_cache): Invalidate regcaches before
8455         changing the register cache layout.
8456         (regcache_invalidate_one): Allow a NULL regcache.
8457         * linux-x86-low.c (x86_linux_update_xmltarget): Invalidate
8458         regcaches before changing the register cache layout or the target
8459         regsets.
8460
8461 2010-04-12  H.J. Lu  <hongjiu.lu@intel.com>
8462
8463         * linux-x86-low.c (x86_linux_update_xmltarget): Avoid unused
8464         variable warning on Linux/x86-64.
8465
8466 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8467
8468         GDBserver disconnected tracing support.
8469
8470         * linux-low.c (linux_remove_process): Delete.
8471         (add_lwp): Don't set last_resume_kind here.
8472         (linux_kill): Use `mourn'.
8473         (linux_detach): Use `thread_db_detach', and `mourn'.
8474         (linux_mourn): New.
8475         (linux_attach_lwp_1): Adjust comment.
8476         (linux_attach): last_resume_kind moved the thread_info; adjust.
8477         (status_pending_p_callback): Adjust.
8478         (linux_wait_for_event_1): Adjust.
8479         (count_events_callback, select_singlestep_lwp_callback)
8480         (select_event_lwp_callback, cancel_breakpoints_callback)
8481         (db_wants_lwp_stopped, linux_wait_1, need_step_over_p)
8482         (proceed_one_lwp): Adjust.
8483         (linux_async): Add debug output.
8484         (linux_thread_stopped): New.
8485         (linux_pause_all): New.
8486         (linux_target_ops): Install linux_mourn, linux_thread_stopped and
8487         linux_pause_all.
8488         * linux-low.h (struct lwp_info): Delete last_resume_kind field.
8489         (thread_db_free): Delete declaration.
8490         (thread_db_detach, thread_db_mourn): Declare.
8491         * thread-db.c (thread_db_init): Use thread_db_mourn.
8492         (thread_db_free): Delete, split in two.
8493         (disable_thread_event_reporting): New.
8494         (thread_db_detach): New.
8495         (thread_db_mourn): New.
8496
8497         * server.h (struct thread_info) <last_resume_kind>: New field.
8498         <attached>: Add comment.
8499         <gdb_detached>: New field.
8500         (handler_func): Change return type to int.
8501         (handle_serial_event, handle_target_event): Ditto.
8502         (gdb_connected): Declare.
8503         (tracing): Delete.
8504         (disconnected_tracing): Declare.
8505         (stop_tracing): Declare.
8506
8507         * server.c (handle_query) <qSupported>: Report support for
8508         disconnected tracing.
8509         (queue_stop_reply_callback): Account for running threads.
8510         (gdb_wants_thread_stopped): New.
8511         (gdb_wants_all_threads_stopped): New.
8512         (gdb_reattached_process): New.
8513         (handle_status): Clear the `gdb_detached' flag of all processes.
8514         In all-stop, stop all threads.
8515         (main): Be sure to leave tfind mode.  Handle disconnected tracing.
8516         (process_serial_event): If the remote connection breaks, or if an
8517         exit was forced with "monitor exit", force an event loop exit.
8518         Handle disconnected tracing on detach.
8519         (handle_serial_event): Adjust.
8520         (handle_target_event): If GDB isn't connected, forward events back
8521         to the inferior, unless the last process exited, in which case,
8522         exit gdbserver.  Adjust interface.
8523
8524         * remote-utils.c (remote_open): Don't block in accept.  Instead
8525         register an event loop source on the listen socket file
8526         descriptor.  Refactor bits into ...
8527         (listen_desc): ... this new global.
8528         (gdb_connected): ... this new function.
8529         (enable_async_notification): ... this new function.
8530         (handle_accept_event): ... this new function.
8531         (remote_close): Clear remote_desc.
8532
8533         * inferiors.c (add_thread): Set the new thread's last_resume_kind.
8534
8535         * target.h (struct target_ops) <mourn, thread_stopped, pause_all>:
8536         New fields.
8537         (mourn_inferior): Define.
8538         (target_process_qsupported): Avoid the dangling else problem.
8539         (thread_stopped): Define.
8540         (pause_all): Define.
8541         (target_waitstatus_to_string): Declare.
8542         * target.c (target_waitstatus_to_string): New.
8543
8544         * tracepoint.c (tracing): Make extern.
8545         (disconnected_tracing): New.
8546         (stop_tracing): Make extern.  Handle tracing stops due to GDB
8547         disconnecting.
8548         (cmd_qtdisconnected): New.
8549         (cmd_qtstatus): Report disconnected tracing status in trace reply.
8550         (handle_tracepoint_general_set): Handle QTDisconnected.
8551
8552         * event-loop.c (event_handler_func): Change return type to int.
8553         (process_event): Bail out if the event handler wants the event
8554         loop to stop.
8555         (handle_file_event): Ditto.
8556         (start_event_loop): Bail out if the event handler wants the event
8557         loop to stop.
8558
8559         * nto-low.c (nto_target_ops): Adjust.
8560         * spu-low.c (spu_wait): Don't remove the process here.
8561         (spu_target_ops): Adjust.
8562         * win32-low.c (win32_wait): Don't remove the process here.
8563         (win32_target_ops): Adjust.
8564
8565 2010-04-11  Pedro Alves  <pedro@codesourcery.com>
8566
8567         * regcache.c (realloc_register_cache): Invalidate inferior's
8568         regcache before recreating it.
8569
8570 2010-04-09  Pedro Alves  <pedro@codesourcery.com>
8571
8572         * tracepoint.c (cmd_qtstatus): Report trace buffer circularity.
8573
8574 2010-04-09  Stan Shebs  <stan@codesourcery.com>
8575             Pedro Alves  <pedro@codesourcery.com>
8576
8577         * server.h (LONGEST): New.
8578         (struct thread_info) <while_stepping>: New field.
8579         (unpack_varlen_hex, xrealloc, pulongest, plongest, phex_nz):
8580         Declare.
8581         (initialize_tracepoint, handle_tracepoint_general_set)
8582         (handle_tracepoint_query, tracepoint_finished_step)
8583         (tracepoint_was_hit, release_while_stepping_state_list):
8584         (current_traceframe): Declare.
8585         * server.c (handle_general_set): Handle tracepoint packets.
8586         (read_memory): New.
8587         (write_memory): New.
8588         (handle_search_memory_1): Use read_memory.
8589         (handle_query): Report support for conditional tracepoints, trace
8590         state variables, and tracepoint sources.  Handle tracepoint
8591         queries.
8592         (main): Initialize the tracepoints module.
8593         (process_serial_event): Handle traceframe reads/writes.
8594
8595         * linux-low.c (handle_tracepoints): New.
8596         (linux_wait_1): Call it.
8597         (linux_resume_one_lwp): Handle while-stepping.
8598         (linux_supports_tracepoints, linux_read_pc, linux_write_pc): New.
8599         (linux_target_ops): Install them.
8600         * linux-low.h (struct linux_target_ops) <supports_tracepoints>:
8601         New field.
8602         * linux-x86-low.c (x86_supports_tracepoints): New.
8603         (the_low_target). Install it.
8604
8605         * mem-break.h (delete_breakpoint): Declare.
8606         * mem-break.c (delete_breakpoint): Make external.
8607
8608         * target.h (struct target_ops): Add `supports_tracepoints',
8609         `read_pc', and `write_pc' fields.
8610         (target_supports_tracepoints): Define.
8611         * utils.c (xrealloc, decimal2str, pulongest, plongest, thirty_two)
8612         (phex_nz): New.
8613
8614         * regcache.h (struct regcache) <registers_owned>: New field.
8615         (init_register_cache, regcache_cpy): Declare.
8616         (regcache_read_pc, regcache_write_pc): Declare.
8617         (register_cache_size): Declare.
8618         (supply_regblock): Declare.
8619         * regcache.c (init_register_cache): New.
8620         (new_register_cache): Use it.
8621         (regcache_cpy): New.
8622         (register_cache_size): New.
8623         (supply_regblock): New.
8624         (regcache_read_pc, regcache_write_pc): New.
8625
8626         * tracepoint.c: New.
8627
8628         * Makefile.in (OBS): Add tracepoint.o.
8629         (tracepoint.o): New rule.
8630
8631 2010-04-08  H.J. Lu  <hongjiu.lu@intel.com>
8632
8633         * Makefile.in (clean): Also remove i386-mmx.c i386-mmx-linux.c.
8634         (i386-mmx.o): New.
8635         (i386-mmx.c): Likewise.
8636         (i386-mmx-linux.o): Likewise.
8637         (i386-mmx-linux.c): Likewise.
8638
8639         * configure.srv (srv_i386_regobj): Add i386-mmx.o.
8640         (srv_i386_linux_regobj): Add i386-mmx-linux.o.
8641         (srv_i386_xmlfiles): Add i386/i386-mmx.xml.
8642         (srv_i386_linux_xmlfiles): Add i386/i386-mmx-linux.xml.
8643
8644         * linux-x86-low.c (init_registers_i386_mmx_linux): New.
8645         (x86_linux_update_xmltarget): Call init_registers_i386_mmx_linux
8646         and return if ptrace PTRACE_GETFPXREGS failed in 32bit.
8647
8648 2010-04-07  H.J. Lu  <hongjiu.lu@intel.com>
8649
8650         * Makefile.in (clean): Updated.
8651         (i386-avx.o): New.
8652         (i386-avx.c): Likewise.
8653         (i386-avx-linux.o): Likewise.
8654         (i386-avx-linux.c): Likewise.
8655         (amd64-avx.o): Likewise.
8656         (amd64-avx.c): Likewise.
8657         (amd64-avx-linux.o): Likewise.
8658         (amd64-avx-linux.c): Likewise.
8659
8660         * configure.srv (srv_i386_regobj): Add i386-avx.o.
8661         (srv_i386_linux_regobj): Add i386-avx-linux.o.
8662         (srv_amd64_regobj): Add amd64-avx.o.
8663         (srv_amd64_linux_regobj): Add amd64-avx-linux.o.
8664         (srv_i386_32bit_xmlfiles): Add i386/32bit-avx.xml.
8665         (srv_i386_64bit_xmlfiles): Add i386/64bit-avx.xml.
8666         (srv_i386_xmlfiles): Add i386/i386-avx.xml.
8667         (srv_amd64_xmlfiles): Add i386/amd64-avx.xml.
8668         (srv_i386_linux_xmlfiles): Add i386/i386-avx-linux.xml.
8669         (srv_amd64_linux_xmlfiles): Add i386/amd64-avx-linux.xml.
8670
8671         * i387-fp.c: Include "i386-xstate.h".
8672         (i387_xsave): New.
8673         (i387_cache_to_xsave): Likewise.
8674         (i387_xsave_to_cache): Likewise.
8675         (x86_xcr0): Likewise.
8676
8677         * i387-fp.h (i387_cache_to_xsave): Likewise.
8678         (i387_xsave_to_cache): Likewise.
8679         (x86_xcr0): Likewise.
8680
8681         * linux-arm-low.c (target_regsets): Initialize nt_type to 0.
8682         * linux-crisv32-low.c (target_regsets): Likewise.
8683         * linux-m68k-low.c (target_regsets): Likewise.
8684         * linux-mips-low.c (target_regsets): Likewise.
8685         * linux-ppc-low.c (target_regsets): Likewise.
8686         * linux-s390-low.c (target_regsets): Likewise.
8687         * linux-sh-low.c (target_regsets): Likewise.
8688         * linux-sparc-low.c (target_regsets): Likewise.
8689         * linux-xtensa-low.c (target_regsets): Likewise.
8690
8691         * linux-low.c: Include <sys/uio.h>.
8692         (regsets_fetch_inferior_registers): Support nt_type.
8693         (regsets_store_inferior_registers): Likewise.
8694         (linux_process_qsupported): New.
8695         (linux_target_ops): Add linux_process_qsupported.
8696
8697         * linux-low.h (regset_info): Add nt_type.
8698         (linux_target_ops): Add process_qsupported.
8699
8700         * linux-x86-low.c: Include "i386-xstate.h", "elf/common.h"
8701         and <sys/uio.h>.
8702         (init_registers_i386_avx_linux): New.
8703         (init_registers_amd64_avx_linux): Likewise.
8704         (xmltarget_i386_linux_no_xml): Likewise.
8705         (xmltarget_amd64_linux_no_xml): Likewise.
8706         (PTRACE_GETREGSET): Likewise.
8707         (PTRACE_SETREGSET): Likewise.
8708         (x86_fill_xstateregset): Likewise.
8709         (x86_store_xstateregset): Likewise.
8710         (use_xml): Likewise.
8711         (x86_linux_update_xmltarget): Likewise.
8712         (x86_linux_process_qsupported): Likewise.
8713         (target_regsets): Add NT_X86_XSTATE entry and Initialize nt_type.
8714         (x86_arch_setup): Don't call init_registers_amd64_linux nor
8715         init_registers_i386_linux here.  Call
8716         x86_linux_update_xmltarget.
8717         (the_low_target): Add x86_linux_process_qsupported.
8718
8719         * server.c (handle_query): Call target_process_qsupported.
8720
8721         * target.h (target_ops): Add process_qsupported.
8722         (target_process_qsupported): New.
8723
8724 2010-04-03  Pedro Alves  <pedro@codesourcery.com>
8725
8726         * inferiors.c (add_thread): Set last_status kind to
8727         TARGET_WAITKIND_IGNORE.
8728         * linux-low.c (cancel_breakpoint): Remove unnecessary regcache
8729         fetch.  Use ptid_of.  Avoid unnecessary get_lwp_thread calls.
8730         (linux_wait_1): Move `thread' local definition to block that uses
8731         it.  Don't NULL initialize `event_child'.
8732         (linux_resume_one_thread): Avoid unnecessary get_lwp_thread calls.
8733         Alway set the thread's last_status to TARGET_WAITKIND_IGNORE.
8734         * linux-x86-low.c (x86_breakpoint_at): Read raw memory.
8735
8736 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8737
8738         * linux-low.c (get_stop_pc): Don't adjust the PC if stopped with
8739         an extended waitstatus, or by a watchpoint.
8740         (cancel_breakpoints_callback): Don't cancel a breakpoint if the
8741         thread was stepping or has been stopped by a watchpoint.
8742
8743 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8744
8745         * mem-break.c (struct raw_breakpoint): New field shlib_disabled.
8746         (set_gdb_breakpoint_at): If GDB is inserting a breakpoint on top
8747         of another, then delete the previous, and validate all
8748         breakpoints.
8749         (validate_inserted_breakpoint): New.
8750         (delete_disabled_breakpoints): New.
8751         (validate_breakpoints): New.
8752         (check_mem_read): Validate breakpoints before trusting their
8753         shadow.  Delete disabled breakpoints.
8754         (check_mem_write): Validate breakpoints before trusting they
8755         should be inserted.  Delete disabled breakpoints.
8756         * mem-break.h (validate_breakpoints):
8757         * server.c (handle_query): Validate breakpoints when we see a
8758         qSymbol query.
8759
8760 2010-04-01  Pedro Alves  <pedro@codesourcery.com>
8761
8762         * linux-low.c (linux_wait_1): Avoid setting need_step_over is
8763         there's a GDB breakpoint at stop_pc.  Always report a trap to GDB
8764         if we could tell there's a GDB breakpoint at stop_pc.
8765         (need_step_over_p): Don't do a step over if we find a GDB
8766         breakpoint at the resume PC.
8767
8768         * mem-break.c (struct raw_breakpoint): New.
8769         (enum bkpt_type): New type `gdb_breakpoint'.
8770         (struct breakpoint): Delete the `PC', `old_data' and `inserted'
8771         fields.  New field `raw'.
8772         (find_raw_breakpoint_at): New.
8773         (set_raw_breakpoint_at): Handle refcounting.  Create a raw
8774         breakpoint instead.
8775         (set_breakpoint_at): Adjust.
8776         (delete_raw_breakpoint): New.
8777         (release_breakpoint): New.
8778         (delete_breakpoint): Rename to...
8779         (delete_breakpoint_1): ... this.  Add proc parameter.  Use
8780         release_breakpoint.  Return ENOENT.
8781         (delete_breakpoint): Reimplement.
8782         (find_breakpoint_at): Delete.
8783         (find_gdb_breakpoint_at): New.
8784         (delete_breakpoint_at): Delete.
8785         (set_gdb_breakpoint_at): New.
8786         (delete_gdb_breakpoint_at): New.
8787         (gdb_breakpoint_here): New.
8788         (set_reinsert_breakpoint): Use release_breakpoint.
8789         (uninsert_breakpoint): Rename to ...
8790         (uninsert_raw_breakpoint): ... this.
8791         (uninsert_breakpoints_at): Adjust to handle raw breakpoints.
8792         (reinsert_raw_breakpoint): Change parameter type to
8793         raw_breakpoint.
8794         (reinsert_breakpoints_at): Adjust to handle raw breakpoints
8795         instead.
8796         (check_breakpoints): Adjust.  Use release_breakpoint.
8797         (breakpoint_here): Rewrite using find_raw_breakpoint_at.
8798         (breakpoint_inserted_here): Ditto.
8799         (check_mem_read): Adjust to iterate over raw breakpoints instead.
8800         Don't trust the breakpoint's shadow if it is not inserted.
8801         (check_mem_write): Adjust to iterate over raw breakpoints instead.
8802         (delete_all_breakpoints): Adjust.
8803         (free_all_breakpoints): Mark all breakpoints as uninserted, and
8804         use delete_breakpoint_1.
8805
8806         * mem-break.h (breakpoints_supported): Delete declaration.
8807         (set_gdb_breakpoint_at): Declare.
8808         (gdb_breakpoint_here): Declare.
8809         (delete_breakpoint_at): Delete.
8810         (delete_gdb_breakpoint_at): Declare.
8811
8812         * server.h (struct raw_breakpoint): Forward declare.
8813         (struct process_info): New field `raw_breakpoints'.
8814
8815         * linux-x86-low.c (x86_insert_point, x86_remote_point): Handle Z0
8816         breakpoints.
8817
8818 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8819
8820         * linux-low.c (status_pending_p_callback): Fix comment.
8821         (linux_wait_for_event_1): Move most of the internal breakpoint
8822         handling from here...
8823         (linux_wait_1): ... to here.
8824         (count_events_callback): New.
8825         (select_singlestep_lwp_callback): New.
8826         (select_event_lwp_callback): New.
8827         (cancel_breakpoints_callback): New.
8828         (select_event_lwp): New.
8829         (linux_wait_1): Simplify internal breakpoint handling.  Give equal
8830         priority to all LWPs that have had events that should be reported
8831         to the client.  Cancel breakpoints when about to reporting the
8832         event to the client, not while stopping lwps.  No longer cancel
8833         finished single-steps here.
8834         (cancel_finished_single_step): Delete.
8835         (cancel_finished_single_steps): Delete.
8836
8837 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8838
8839         * mem-break.c (enum bkpt_type): New.
8840         (struct breakpoint): New field `type'.
8841         (set_breakpoint_at): Change return type to struct breakpoint
8842         pointer.  Set type to `other_breakpoint' by default.
8843         (delete_breakpoint): Rewrite, supporting more than one breakpoint
8844         in the breakpoint list.
8845         (delete_reinsert_breakpoints): Only delete reinsert breakpoints.
8846         (reinsert_breakpoint): Rename to ...
8847         (reinsert_raw_breakpoint): ... this.
8848         (reinsert_breakpoints_at): Adjust.
8849         * mem-break.h (struct breakpoint): Declare.
8850         (set_breakpoint_at): Change return type to struct breakpoint
8851         pointer.
8852
8853 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8854
8855         * server.c (handle_query): Assign, not compare.
8856
8857 2010-03-24  Pedro Alves  <pedro@codesourcery.com>
8858
8859         Teach linux gdbserver to step-over-breakpoints.
8860
8861         * linux-low.c (can_hardware_single_step): New.
8862         (supports_breakpoints): New.
8863         (handle_extended_wait): If stopping threads, read the stop pc of
8864         the new cloned LWP.
8865         (get_pc): New.
8866         (get_stop_pc): Add `lwp' parameter.  Handle it.  Bail out if the
8867         low target doesn't support retrieving the PC.
8868         (add_lwp): Set last_resume_kind to resume_continue.
8869         (linux_attach_lwp_1): Adjust comments.  Always set stop_expected.
8870         (linux_attach): Don't clear stop_expected.  Set the lwp's
8871         last_resume_kind to resume_stop.
8872         (linux_detach_one_lwp): Don't check for removed breakpoints.
8873         (check_removed_breakpoint): Delete.
8874         (status_pending_p): Rename to ...
8875         (status_pending_p_callback): ... this.  Don't check for removed
8876         breakpoints.  Don't consider threads that are stopped from GDB's
8877         perspective.
8878         (linux_wait_for_lwp): Always read the stop_pc here.
8879         (cancel_breakpoint): New.
8880         (step_over_bkpt): New global.
8881         (linux_wait_for_event_1): Implement stepping over breakpoints.
8882         (gdb_wants_lwp_stopped): New.
8883         (gdb_wants_all_stopped): New.
8884         (linux_wait_1): Tag threads as gdb-wants-stopped.  Cancel finished
8885         single-step traps here.  Store the thread's last reported target
8886         wait status.
8887         (send_sigstop): Don't clear stop_expected.  Always set it,
8888         instead.
8889         (mark_lwp_dead): Remove reference to pending_is_breakpoint.
8890         (cancel_finished_single_step): New.
8891         (cancel_finished_single_steps): New.
8892         (wait_for_sigstop): Don't cancel finished single-step traps here.
8893         (linux_resume_one_lwp): Don't check for removed breakpoints.
8894         Don't set `step' on non-hardware step archs.
8895         (linux_set_resume_request): Ignore resume_stop requests if already
8896         stopping or stopped.  Set the lwp's last_resume_kind.
8897         (resume_status_pending_p): Don't check for removed breakpoints.
8898         (need_step_over_p): New.
8899         (start_step_over): New.
8900         (finish_step_over): New.
8901         (linux_resume_one_thread): Always queue a sigstop for resume_stop
8902         requests.  Clear the thread's last reported target waitstatus.
8903         Don't use the `suspended' flag.  Don't consider pending breakpoints.
8904         (linux_resume): Start a step-over if necessary.
8905         (proceed_one_lwp): New.
8906         (proceed_all_lwps): New.
8907         (unstop_all_lwps): New.
8908         * linux-low.h (struct lwp_info): Rewrite comment for the
8909         `suspended' flag.  Add the `stop_pc' field.  Delete the
8910         `pending_stop_pc' field.  Tweak the `stepping' flag's comment.
8911         Add `'last_resume_kind' and `need_step_over' fields.
8912         * inferiors.c (struct thread_info): Delete, moved elsewhere.
8913         * mem-break.c (struct breakpoint): Delete `reinserting' flag.
8914         Delete `breakpoint_to_reinsert' field.  New flag `inserted'.
8915         (set_raw_breakpoint_at): New.
8916         (set_breakpoint_at): Rewrite to use it.
8917         (reinsert_breakpoint_handler): Delete.
8918         (set_reinsert_breakpoint): New.
8919         (reinsert_breakpoint_by_bp): Delete.
8920         (delete_reinsert_breakpoints): New.
8921         (uninsert_breakpoint): Rewrite.
8922         (uninsert_breakpoints_at): New.
8923         (reinsert_breakpoint): Rewrite.
8924         (reinsert_breakpoints_at): New.
8925         (check_breakpoints): Rewrite.
8926         (breakpoint_here): New.
8927         (breakpoint_inserted_here): New.
8928         (check_mem_read): Adjust.
8929         * mem-break.h (breakpoints_supported, breakpoint_here)
8930         (breakpoint_inserted_here, set_reinsert_breakpoint): Declare.
8931         (reinsert_breakpoint_by_bp): Delete declaration.
8932         (delete_reinsert_breakpoints): Declare.
8933         (reinsert_breakpoint): Delete declaration.
8934         (reinsert_breakpoints_at): Declare.
8935         (uninsert_breakpoint): Delete declaration.
8936         (uninsert_breakpoints_at): Declare.
8937         (check_breakpoints): Adjust prototype.
8938         * server.h: Adjust include order.
8939         (struct thread_info): Declare here.  Add a `last_status' field.
8940
8941 2010-03-23  Michael Snyder  <msnyder@vmware.com>
8942
8943         * server.c (crc32): New function.
8944         (handle_query): Add handling for 'qCRC:' request.
8945
8946 2010-03-23  Pedro Alves  <pedro@codesourcery.com>
8947
8948         * linux-x86-low.c (x86_linux_prepare_to_resume): Clear DR6 if the
8949         lwp had been stopped by a watchpoint.
8950
8951 2010-03-16  Pedro Alves  <pedro@codesourcery.com>
8952
8953         * server.h (internal_error): Declare.
8954         (gdb_assert, ASSERT_FUNCTION, gdb_assert_fail): Define.
8955         * utils.c (internal_error): New function.
8956
8957 2010-03-15  Andreas Schwab  <schwab@redhat.com>
8958
8959         * configure.srv: Fix typo setting srv_regobj.
8960
8961 2010-03-15  Pedro Alves  <pedro@codesourcery.com>
8962
8963         * linux-low.c (fetch_register): Avoid passing a non string literal
8964         format to `error'.
8965         (usr_store_inferior_registers): Ditto.
8966
8967 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
8968
8969         * linux-low.c (linux_write_memory): Bail out early if peeking
8970         memory failed.
8971
8972 2010-03-14  Pedro Alves  <pedro@codesourcery.com>
8973
8974         * linux-low.h (struct lwp_info): New fields
8975         `stopped_by_watchpoint' and `stopped_data_address'.
8976         * linux-low.c (linux_wait_for_lwp): Check for watchpoint triggers
8977         here, and cache them in the lwp object.
8978         (wait_for_sigstop): Check stopped_by_watchpoint lwp field
8979         directly.
8980         (linux_resume_one_lwp): Clear the lwp's stopped_by_watchpoint
8981         field.
8982         (linux_stopped_by_watchpoint): Rewrite.
8983         (linux_stopped_data_address): Rewrite.
8984
8985 2010-03-06  Simo Melenius  <simo.melenius@iki.fi>
8986
8987         * linux-low.c (linux_wait_for_lwp): Fetch the regcache after
8988         switching the current inferior, not before.
8989
8990 2010-03-01  H.J. Lu  <hongjiu.lu@intel.com>
8991
8992         * Makefile.in (clean): Replace reg-i386.c, reg-x86-64.c,
8993         reg-i386-linux.c and reg-x86-64-linux.c with i386.c, amd64.c,
8994         i386-linux.c and amd64-linux.c.
8995         (reg-i386.o): Removed.
8996         (reg-i386.c): Likewise.
8997         (reg-i386-linux.o): Likewise.
8998         (reg-i386-linux.c): Likewise.
8999         (reg-x86-64.o): Likewise.
9000         (reg-x86-64.c): Likewise.
9001         (reg-x86-64-linux.o): Likewise.
9002         (reg-x86-64-linux.c): Likewise.
9003         (i386.o): New.
9004         (i386.c): Likewise.
9005         (i386-linux.o): Likewise.
9006         (i386-linux.c): Likewise.
9007         (amd64.o): Likewise.
9008         (amd64.c): Likewise.
9009         (amd64-linux.o): Likewise.
9010         (amd64-linux.c): Likewise.
9011
9012         * configure.srv (srv_i386_regobj): New.
9013         (srv_i386_linux_regobj): Likewise.
9014         (srv_amd64_regobj): Likewise.
9015         (srv_amd64_linux_regobj): Likewise.
9016         (srv_i386_32bit_xmlfiles): Likewise.
9017         (srv_i386_64bit_xmlfiles): Likewise.
9018         (srv_i386_xmlfiles): Likewise.
9019         (srv_amd64_xmlfiles): Likewise.
9020         (srv_i386_linux_xmlfiles): Likewise.
9021         (srv_amd64_linux_xmlfiles): Likewise.
9022         (i[34567]86-*-cygwin*): Set srv_regobj to $srv_i386_regobj.  Set
9023         srv_xmlfiles to $srv_i386_xmlfiles.
9024         (i[34567]86-*-mingw32ce*): Likewise.
9025         (i[34567]86-*-mingw*): Likewise.
9026         (i[34567]86-*-nto*): Likewise.
9027         (i[34567]86-*-linux*): Set srv_regobj to $srv_i386_linux_regobj
9028         and $srv_amd64_linux_regobj.  Set srv_xmlfiles to
9029         $srv_i386_linux_xmlfiles and $srv_amd64_linux_xmlfiles.
9030         (x86_64-*-linux*): Likewise.
9031
9032         * linux-x86-low.c (init_registers_x86_64_linux): Removed.
9033         (init_registers_amd64_linux): New.
9034         (x86_arch_setup): Replace init_registers_x86_64_linux with
9035         init_registers_amd64_linux.
9036
9037 2010-02-23  Maxim Kuvyrkov  <maxim@codesourcery.com>
9038
9039         * configure.ac: Check for libdl.  If it is not available link against
9040         static libthread_db.
9041         * configure: Regenerate.
9042
9043 2010-02-22  Pedro Alves  <pedro@codesourcery.com>
9044
9045         PR9605
9046
9047         * i386-low.c (i386_length_and_rw_bits): Throw a fatal error if
9048         handing a read watchpoint.
9049         (i386_low_insert_watchpoint): Read watchpoints aren't supported.
9050
9051 2010-02-12  Doug Evans  <dje@google.com>
9052
9053         * linux-low.c (linux_supports_tracefork_flag): Document.
9054         (linux_look_up_symbols): Add comment.
9055
9056 2010-02-03  H.J. Lu  <hongjiu.lu@intel.com>
9057
9058         * regcache.c (supply_register): Clear regcache if buf is NULL.
9059
9060 2010-02-02  Nicolas Roche  <roche@sourceware.org>
9061             Joel Brobecker  <brobecker@adacore.com>
9062
9063         * inferiors.c (find_inferior): Add function documentation.
9064         (unloaded_dll): Handle the case where the unloaded dll has not
9065         been previously registered in the dll list.
9066
9067 2010-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
9068
9069         * linux-arm-low.c (thumb_breakpoint_len): Delete.
9070         (thumb2_breakpoint): New.
9071         (arm_breakpoint_at): Check for Thumb-2 breakpoints.
9072
9073 2010-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
9074
9075         * linux-low.c (get_stop_pc): Check for SIGTRAP.
9076         (linux_wait_for_event_1): Handle SIGILL and SIGSEGV as possible
9077         breakpoints.
9078
9079 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9080
9081         * linux-ppc-low.c (ppc_arch_setup): Adjust to regcache changes.
9082
9083 2010-01-21  Jan Kratochvil  <jan.kratochvil@redhat.com>
9084
9085         * linux-s390-low.c (s390_collect_ptrace_register)
9086         (s390_supply_ptrace_register): Adjust it for the new regcache parameter.
9087
9088 2010-01-21  Doug Evans  <dje@google.com>
9089
9090         * linux-low.c (PTRACE_ARG3_TYPE): Change from long to void*.
9091         (PTRACE_ARG4_TYPE): New macro.
9092         (handle_extended_wait): Cast ptrace arg4 to PTRACE_ARG4_TYPE.
9093         (linux_wait_for_event_1, linux_resume_one_lwp): Ditto.
9094         (fetch_register): Cast to uintptr_t before casting to PTRACE_ARG3_TYPE.
9095         (usr_store_inferior_registers): Ditto.
9096         (linux_read_memory, linux_write_memory): Ditto.
9097         (linux_test_for_tracefork): Ditto.
9098
9099         * linux-arm-low.c: Remove redundant include of gdb_proc_service.h.
9100         Only include elf.h if gdb_proc_service.h didn't include linux/elf.h.
9101
9102 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9103
9104         * proc-service.c (ps_lgetregs): Don't refetch registers from the
9105         target.
9106
9107 2010-01-21  Pedro Alves  <pedro@codesourcery.com>
9108
9109         * spu-low.c (spu_fetch_registers, spu_store_registers): Change
9110         prototype to take a regcache.  Adjust.
9111
9112 2010-01-20  Pedro Alves  <pedro@codesourcery.com>
9113
9114         * regcache.h (struct thread_info): Forward declare.
9115         (struct regcache): New.
9116         (new_register_cache): Adjust prototype.
9117         (get_thread_regcache): Declare.
9118         (free_register_cache): Adjust prototype.
9119         (registers_to_string, registers_from_string): Ditto.
9120         (supply_register, supply_register_by_name, collect_register)
9121         (collect_register_as_string, collect_register_by_name): Ditto.
9122         * regcache.c (struct inferior_regcache_data): Delete.
9123         (get_regcache): Rename to ...
9124         (get_thread_regcache): ... this.  Adjust.  Switch inferior before
9125         fetching registers.
9126         (regcache_invalidate_one): Adjust.
9127         (regcache_invalidate): Fix prototype.
9128         (new_register_cache): Return the new register cache.
9129         (free_register_cache): Change prototype.
9130         (realloc_register_cache): Adjust.
9131         (registers_to_string): Change prototype to take a regcache.  Adjust.
9132         (registers_from_string): Ditto.
9133         (register_data): Ditto.
9134         (supply_register): Ditto.
9135         (supply_register_by_name): Ditto.
9136         (collect_register): Ditto.
9137         (collect_register_as_string): Ditto.
9138         (collect_register_by_name): Ditto.
9139         * server.c (process_serial_event): Adjust.
9140         * linux-low.h (regset_fill_func, regset_store_func): Change
9141         prototype.
9142         (get_pc, set_pc, collect_ptrace_register, supply_ptrace_register):
9143         Change prototype.
9144         * linux-low.c (get_stop_pc): Adjust.
9145         (check_removed_breakpoint): Adjust.
9146         (linux_wait_for_event): Adjust.
9147         (linux_resume_one_lwp): Adjust.
9148         (fetch_register): Add regcache parameter.  Adjust.
9149         (usr_store_inferior_registers): Ditto.
9150         (regsets_fetch_inferior_registers): Ditto.
9151         (regsets_store_inferior_registers): Ditto.
9152         (linux_fetch_registers, linux_store_registers): Ditto.
9153         * i387-fp.c (i387_cache_to_fsave): Change prototype to take a
9154         regcache.  Adjust.
9155         (i387_fsave_to_cache, i387_cache_to_fxsave, i387_fxsave_to_cache):
9156         Ditto.
9157         * i387-fp.h (i387_cache_to_fsave, i387_fsave_to_cache): Change
9158         prototype to take a regcache.
9159         (i387_cache_to_fxsave, i387_fxsave_to_cache): Ditto.
9160         * remote-utils.c (convert_ascii_to_int, outreg)
9161         (prepare_resume_reply): Change prototype to take a regcache.
9162         Adjust.
9163         * target.h (struct target_ops) <fetch_registers, store_registers>:
9164         Change prototype to take a regcache.
9165         (fetch_inferior_registers, store_inferior_registers): Change
9166         prototype to take a regcache.  Adjust.
9167         * proc-service.c (ps_lgetregs): Adjust.
9168         * linux-x86-low.c (x86_fill_gregset, x86_store_gregset)
9169         (x86_fill_fpregset, x86_store_fpregset, x86_fill_fpxregset)
9170         (x86_store_fpxregset, x86_get_pc, x86_set_pc): Change prototype to
9171         take a regcache.  Adjust.
9172         * linux-arm-low.c (arm_fill_gregset, arm_store_gregset)
9173         (arm_fill_wmmxregset, arm_store_wmmxregset, arm_fill_vfpregset)
9174         (arm_store_vfpregset, arm_get_pc, arm_set_pc):
9175         (arm_breakpoint_at): Change prototype to take a regcache.  Adjust.
9176         * linux-cris-low.c (cris_get_pc, cris_set_pc)
9177         (cris_cannot_fetch_register):
9178         (cris_breakpoint_at): Change prototype to take a regcache.
9179         Adjust.
9180         * linux-crisv32-low.c (cris_get_pc, cris_set_pc,
9181         cris_reinsert_addr, cris_write_data_breakpoint): Change prototype
9182         to take a regcache.  Adjust.
9183         (cris_breakpoint_at, cris_insert_point, cris_remove_point):
9184         Adjust.
9185         * linux-m32r-low.c (m32r_get_pc, m32r_set_pc): Change prototype to
9186         take a regcache.  Adjust.
9187         * linux-m68k-low.c (m68k_fill_gregset, m68k_store_gregset)
9188         (m68k_fill_fpregset, m68k_store_fpregset, m68k_get_pc,
9189         (m68k_set_pc): Change prototype to take a regcache.  Adjust.
9190         * linux-mips-low.c (mips_get_pc):
9191         (mips_set_pc): Change prototype to take a regcache.  Adjust.
9192         (mips_reinsert_addr): Adjust.
9193         (mips_collect_register): Change prototype to take a regcache.
9194         Adjust.
9195         (mips_supply_register):
9196         (mips_collect_register_32bit, mips_supply_register_32bit)
9197         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
9198         (mips_store_fpregset): Ditto.
9199         * linux-ppc-low.c (ppc_supply_ptrace_register)
9200         (ppc_supply_ptrace_register): Ditto.
9201         (parse_spufs_run): Adjust.
9202         (ppc_get_pc, ppc_set_pc, ppc_fill_gregset, ppc_fill_vsxregset)
9203         (ppc_store_vsxregset, ppc_fill_vrregset, ppc_store_vrregset)
9204         (ppc_fill_evrregset, ppc_store_evrregset): Change prototype to
9205         take a regcache.  Adjust.
9206         * linux-s390-low.c (s390_collect_ptrace_register)
9207         (s390_supply_ptrace_register, s390_fill_gregset, s390_get_pc)
9208         (s390_set_pc): Change prototype to take a regcache.  Adjust.
9209         (s390_arch_setup): Adjust.
9210         * linux-sh-low.c (sh_get_pc, sh_breakpoint_at)
9211         (sh_fill_gregset): Change prototype to take a regcache.  Adjust.
9212         * linux-sparc-low.c (sparc_fill_gregset_to_stack)
9213         (sparc_fill_gregset, sparc_store_gregset_from_stack)
9214         (sparc_store_gregset, sparc_get_pc): Change prototype to take a
9215         regcache.  Adjust.
9216         (sparc_breakpoint_at): Adjust.
9217         * linux-xtensa-low.c (xtensa_fill_gregset):
9218         (xtensa_store_gregset):
9219         (xtensa_fill_xtregset, xtensa_store_xtregset, xtensa_get_pc)
9220         (xtensa_set_pc): Change prototype to take a regcache.  Adjust.
9221         * nto-low.c (nto_fetch_registers, nto_store_registers): Change
9222         prototype to take a regcache.  Adjust.
9223         * win32-arm-low.c (arm_fetch_inferior_register)
9224         (arm_store_inferior_register): Change prototype to take a
9225         regcache.  Adjust.
9226         * win32-i386-low.c (i386_fetch_inferior_register)
9227         (i386_store_inferior_register): Change prototype to take a
9228         regcache.  Adjust.
9229         * win32-low.c (child_fetch_inferior_registers)
9230         (child_store_inferior_registers): Change prototype to take a
9231         regcache.  Adjust.
9232         (win32_wait): Adjust.
9233         (win32_fetch_inferior_registers): Change prototype to take a
9234         regcache.  Adjust.
9235         (win32_store_inferior_registers): Adjust.
9236         * win32-low.h (struct win32_target_ops) <fetch_inferior_register,
9237         store_inferior_register>: Change prototype to take a regcache.
9238
9239 2010-01-20  Doug Evans  <dje@google.com>
9240
9241         * linux-low.c (linux_create_inferior): Wrap use of __SIGRTMIN in
9242         #ifdef.
9243         (linux_wait_for_event1, linux_init_signals): Ditto.
9244         (W_STOPCODE): Provide definition if missing.
9245
9246 2010-01-13  Vladimir Prus  <vladimir@codesourcery.com>
9247
9248         * linux-low.c (linux_core_of_thread): New.
9249         (compare_ints, show_process, list_threads): New.
9250         (linux_qxfer_osdata): Report threads and cores.
9251         (linux_target_op): Register linux_core_of_thread.
9252         * remote-utils.c (prepare_resume_reply): Report the core.
9253         (buffer_xml_printf): Support %d specifier.
9254         * server.c (handle_threads_qxfer_proper, handle_threads_qxfer):
9255         New.
9256         (handle_query): Handle qXfer:threads.  Announce availability
9257         thereof.
9258         * target.h (struct target_ops): New field core_of_thread.
9259
9260 2010-01-04  Ulrich Weigand  <uweigand@de.ibm.com>
9261
9262         * Makefile.in (clean): Remove new generated files.
9263         (reg-s390.o, reg-s390.c): Remove rules.
9264         (reg-s390x.o, reg-s390x.c): Likewise.
9265         (s390-linux32.o, s390-linux32.c): Add rules.
9266         (s390-linux64.o, s390-linux64.c): Likewise.
9267         (s390x-linux64.o, s390x-linux64.c): Likewise.
9268         * configure.srv (s390*-*-linux*): Update srv_regobj and srv_xmlfiles.
9269         * linux-s390-low.c: Include <elf.h>.
9270         (HWCAP_S390_HIGH_GPRS): Define if undefined.
9271         (init_registers_s390): Remove prototype.
9272         (init_registers_s390x): Likewise.
9273         (init_registers_s390_linux32): Add prototype.
9274         (init_registers_s390_linux64): Likewise.
9275         (init_registers_s390x_linux64): Likewise.
9276         (s390_num_regs_3264): New define.
9277         (s390_regmap_3264): New global variable.
9278         (s390_cannot_fetch_register): Remove obsolete check.
9279         (s390_cannot_store_register): Likewise.
9280         (s390_collect_ptrace_register): Handle upper/lower register halves.
9281         (s390_supply_ptrace_register): Likewise.
9282         (s390_fill_gregset): Update to register number changes.
9283         (s390_get_hwcap): New routine.
9284         (s390_arch_setup): Detect 32-bit process running on 64-bit system.
9285         Install appropriate regmap and register set.
9286
9287 2010-01-01  Joel Brobecker  <brobecker@adacore.com>
9288
9289         * server.c (gdbserver_version): Update copyright year to 2010.
9290         * gdbreplay.c (gdbreplay_version): Likewise.
9291
9292 2009-12-28  Doug Evans  <dje@google.com>
9293
9294         * linux-low.c: Delete inclusion of ansidecl.h, elf/common.h,
9295         elf/external.h.  Include <elf.h> instead but only if necessary.
9296
9297 2009-12-28  Pedro Alves  <pedro@codesourcery.com>
9298
9299         * linux-low.c (linux_remove_process): Remove `detaching'
9300         parameter.  Don't release/detach from thread_db here.
9301         (linux_kill): Release/detach from thread_db here, ...
9302         (linux_detach): ... and here, before actually detaching.
9303         (linux_wait_1): ... and here, when a process exits.
9304         * thread-db.c (any_thread_of): New.
9305         (thread_db_free): Switch the current inferior to a thread of the
9306         passed in process.
9307
9308 2009-12-21  Doug Evans  <dje@google.com>
9309
9310         * linux-x86-low.c: Delete outdated comment about Elf32_Phdr.
9311
9312         * linux-low.c (kill_lwp): Use __NR_tkill instead of SYS_tkill.
9313         Move definition of tkill_failed to ifdef __NR_tkill to avoid gcc
9314         warning ifndef __NR_tkill.  Move setting of errno there too.
9315         Delete unnecessary resetting of errno after syscall.
9316         Minor comment changes to match gdb/linux-nat.c:kill_lwp.
9317
9318         * configure.ac: Check for dladdr.
9319         * config.in: Regenerate.
9320         * configure: Regenerate.
9321         * thread-db.c (dladdr_to_soname): Only define ifdef HAVE_DLADDR.
9322         (try_thread_db_load): Update.
9323
9324         * linux-low.c (my_waitpid): Delete unnecessary prototype.
9325
9326 2009-12-18  Doug Evans  <dje@google.com>
9327
9328         * event-loop.c: Include unistd.h if it exists.
9329
9330         * linux-low.c (my_waitpid): Move definition away from being in
9331         between linux_tracefork_child/linux_test_for_tracefork.
9332
9333         * gdb_proc_service.h (psaddr_t): Fix type.
9334         * thread-db.c (thread_db_info.td_thr_tls_get_addr_p): Fix
9335         signature to match glibc.
9336
9337 2009-12-16  Doug Evans  <dje@google.com>
9338
9339         * linux-low.c (linux_read_memory): Fix argument to read.
9340
9341 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9342
9343         * win32-low.c (get_child_debug_event): On EXIT_THREAD_DEBUG_EVENT
9344         events, don't leave current_inferior pointing at null.
9345
9346 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9347
9348         * win32-low.c (LOG): Delete.
9349         (OUTMSG): Output to stderr.
9350         (OUTMSG2): Conditionalize on `debug_threads' variable, instead of
9351         on compile time LOG macro.
9352         (win32_wait): Fix debug output.
9353
9354 2009-11-26  Pedro Alves  <pedro@codesourcery.com>
9355
9356         * win32-low.c (win32_add_one_solib): If the dll name is
9357         "ntdll.dll", prepend the system directory to the dll path.
9358
9359 2009-11-17  Daniel Jacobowitz  <dan@codesourcery.com>
9360
9361         * m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
9362
9363 2009-11-17  Nathan Sidwell  <nathan@codesourcery.com>
9364             Vladimir Prus  <vladimir@codesourcery.com>
9365
9366         * Makefile.in (reg-cf.o, reg-cf.c): New targets.
9367         * configure.ac: Check for __mcoldfire__ and set
9368         gdb_cv_m68k_is_coldfire.
9369         * configure.srv: Use gdb_cv_m68k_is_coldfire to select between
9370         reg-cf.o and reg-m68k.o.
9371         * configure: Regenerated.
9372
9373 2009-11-16  Pedro Alves  <pedro@codesourcery.com>
9374
9375         * linux-low.c (linux_remove_process): Add `detaching' parameter.
9376         Pass it to thread_db_free.
9377         (linux_kill, linux_detach, linux_wait_1): Adjust to pass the
9378         proper `detaching' argument to linux_remove_process.
9379         * linux-low.h (thread_db_free): Add `detaching' parameter.
9380         * thread-db.c (thread_db_init): Pass false as `detaching' argument
9381         to thread_db_free.
9382         (thread_db_free): Add `detaching' parameter.  Only
9383         call td_ta_clear_event if detaching from process.
9384
9385 2009-11-12  Maxim Kuvyrkov  <maxim@codesourcery.com>
9386
9387         * thread-db.c (thread_db_free): Fix typo.
9388
9389 2009-11-11  Paul Pluzhnikov  <ppluzhnikov@google.com>
9390
9391         PR gdb/10838
9392         * thread-db.c (thread_db_free): Call td_ta_clear_event.
9393
9394 2009-11-03  Nathan Sidwell  <nathan@codesourcery.com>
9395
9396         * configure.ac (i[34567]86-*): Check if we're targetting x86-64
9397         with an i686 compiler.
9398         * configure.srv (i[34567]86-*-linux*): Pull in x86-64 handling if
9399         needed.
9400         * configure: Rebuilt.
9401
9402 2009-10-29  Sandra Loosemore  <sandra@codesourcery.com>
9403
9404         PR gdb/10783
9405
9406         * server.c (handle_search_memory_1): Correct read_addr initialization
9407         in loop for searching subsequent chunks.
9408
9409 2009-10-29  Paul Pluzhnikov  <ppluzhnikov@google.com>
9410
9411         * configure.ac: New --with-libthread-db option.
9412         * thread-db.c: Allow direct dependence on libthread_db.
9413         (thread_db_free): Adjust.
9414         * config.in: Regenerate.
9415         * configure: Likewise.
9416
9417 2009-10-28  Paul Pluzhnikov  <ppluzhnikov@google.com>
9418
9419         PR gdb/10757
9420         * thread-db.c (attach_thread): New function.
9421         (maybe_attach_thread): Return success/failure.
9422         (find_new_threads_callback): Adjust.
9423         (thread_db_find_new_threads): Loop until no new threads.
9424
9425 2009-10-13  Pedro Alves  <pedro@codesourcery.com>
9426
9427         * proc-service.c (ps_lgetregs): Formatting.
9428
9429 2009-10-08  Paul Pluzhnikov  <ppluzhnikov@google.com>
9430
9431         * acinclude.m4: (SRV_CHECK_THREAD_DB, SRV_CHECK_TLS_GET_ADDR): Remove.
9432         * configure.ac: Adjust.
9433         * linux-low.h (struct process_info_private): Move members to struct
9434         thread_db.
9435         (thread_db_free, thread_db_handle_monitor_command): New prototype.
9436         * linux-low.c (linux_remove_process): Adjust.
9437         (linux_wait_for_event_1, linux_look_up_symbols): Likewise.
9438         * server.c (handle_query): Move code ...
9439         (handle_monitor_command): ... here. New function.
9440         * target.h (struct target_ops): New member.
9441         * thread-db.c (struct thread_db): New.
9442         (libthread_db_search_path): New variable.
9443         (thread_db_create_event, thread_db_enable_reporting)
9444         (find_one_thread, maybe_attach_thread, find_new_threads_callback)
9445         (thread_db_find_new_threads, (thread_db_get_tls_address): Adjust.
9446         (try_thread_db_load_1, dladdr_to_soname): New functions.
9447         (try_thread_db_load, thread_db_load_search): New functions.
9448         (thread_db_init): Search for libthread_db.
9449         (thread_db_free): New function.
9450         (thread_db_handle_monitor_command): Likewise.
9451         * config.in: Regenerate.
9452         * configure: Regenerate.
9453
9454 2009-09-27  Ulrich Weigand  <uweigand@de.ibm.com>
9455
9456         * spu-low.c (spu_kill): Wait for inferior to terminate.
9457         Call clear_inferiors.
9458         (spu_detach): Call clear_inferiors.
9459
9460 2009-08-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9461
9462         * aclocal.m4: Regenerate.
9463         * config.in: Likewise.
9464         * configure: Likewise.
9465
9466 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9467
9468         * linux-ppc-low.c (INSTR_SC, NR_spu_run): Define.
9469         (parse_spufs_run): New function.
9470         (ppc_get_pc, ppc_set_pc): Detect and handle SPU PC.
9471         (ppc_breakpoint_at): Handle SPU breakpoints.
9472
9473 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9474
9475         * linux-low.c: Include <sys/stat.h> and <sys/vfs.h>.
9476         (SPUFS_MAGIC): Define.
9477         (spu_enumerate_spu_ids): New function.
9478         (linux_qxfer_spu): New function.
9479         (linux_target_ops): Install linux_qxfer_spu.
9480
9481 2009-07-31  Ulrich Weigand  <uweigand@de.ibm.com>
9482
9483         * configure.srv (powerpc*-*-linux*): Add powerpc-cell32l.o
9484         and powerpc-cell64l.o to srv_regobj.  Add rs6000/powerpc-cell32l.xml
9485         and rs6000/powerpc-cell64l.xml to srv_xmlfiles.
9486         * Makefile.in (powerpc-cell32l.o, powerpc-cell32l.c): New rules.
9487         (powerpc-cell64l.o, powerpc-cell64l.c): Likewise.
9488         (clean): Handle powerpc-cell32l.c and powerpc-cell64l.c.
9489         * linux-ppc-low.c (PPC_FEATURE_CELL): Define.
9490         (init_registers_powerpc_cell32l): Add prototype.
9491         (init_registers_powerpc_cell64l): Likewise.
9492         (ppc_arch_setup): Detect Cell/B.E. architecture.
9493
9494 2009-07-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
9495
9496         * Makefile.in (datarootdir): New variable.
9497
9498 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9499
9500         * linux-low.c (linux_write_memory): Update debugging output.
9501         * Makefile.in (clean): Add new descriptions.
9502         (arm-with-vfpv2.o, arm-with-vfpv2.c, arm-with-vfpv3.o)
9503         (arm-with-vfpv3.c, arm-with-neon.o, arm-with-neon.c): New rules.
9504         * configure.srv: Add new files for arm*-*-linux*.
9505         * linux-arm-low.c: Add new declarations.
9506         (PTRACE_GETVFPREGS, PTRACE_SETVFPREGS): Define if undefined.
9507         (arm_hwcap, HWCAP_VFP, HWCAP_IWMMXT, HWCAP_NEON, HWCAP_VFPv3)
9508         (HWCAP_VFPv3D16): New.
9509         (arm_fill_wmmxregset, arm_store_wmmxregset): Check HWCAP_IWMMXT
9510         instead of __IWMMXT__.
9511         (arm_fill_vfpregset, arm_store_vfpregset, arm_get_hwcap)
9512         (arm_arch_setup): New.
9513         (target_regsets): Remove #ifdef.  Add VFP regset.
9514         (the_low_target): Use arm_arch_setup.
9515
9516 2009-07-28  Daniel Jacobowitz  <dan@codesourcery.com>
9517
9518         * linux-low.c (linux_kill_one_lwp): Adjust kernel workaround to skip
9519         the main thread again.
9520
9521 2009-07-06  Aleksandar Ristovski  <aristovski@qnx.com>
9522
9523         Adding Neutrino gdbserver.
9524         * configure: Regenerated.
9525         * configure.ac: Add case for srv_qnx and set LIBS accordingly.
9526         * configure.srv (i[34567]86-*-nto*): New target.
9527         * nto-low.c, nto-low.h, nto-x86-low.c: New files.
9528         * remote-utils.c [__QNX__]: Include sys/iomgr.h
9529         (nto_comctrl) [__QNX__]: New function.
9530         (enable_async_io, disable_async_io) [__QNX__]: Call nto_comctrl.
9531
9532 2009-07-05  Danny Backx  <dannybackx@users.sourceforge.net>
9533
9534         * configure.srv (i[34567]86-*-mingw32ce*): Add i386-low.o to
9535         srv_tgtobj.
9536
9537 2009-07-04  Danny Backx  <dannybackx@users.sourceforge.net>
9538             Pedro Alves  <pedro@codesourcery.com>
9539
9540         * win32-i386-low.c (i386_get_thread_context): Handle systems that
9541         don't support CONTEXT_EXTENDED_REGISTERS.
9542         (i386_win32_breakpoint, i386_win32_breakpoint_len): New.
9543         (the_low_target): Install them.
9544         * win32-low.c (get_child_debug_event): Handle WaitForDebugEvent
9545         failing with ERROR_PIPE_NOT_CONNECTED.
9546
9547 2009-06-30  Doug Evans  <dje@google.com>
9548             Pierre Muller  <muller@ics.u-strasbg.fr>
9549
9550         Add h/w watchpoint support to x86-linux, win32-i386.
9551         * Makefile.in (SFILES): Add i386-low.c
9552         (i386_low_h): Define.
9553         (i386-low.o): Add dependencies.
9554         (linux-x86-low.o): Add i386-low.h dependency.
9555         (win32-i386-low.o): Ditto.
9556         * i386-low.c: New file.
9557         * i386-low.h: New file.
9558         * configure.srv (i[34567]86-*-cygwin*): Add i386-low.o to srv_tgtobj.
9559         (i[34567]86-*-linux*, i[34567]86-*-mingw*, x86_64-*-linux*): Ditto.
9560         * linux-low.c (linux_add_process): Initialize arch_private.
9561         (linux_remove_process): Free arch_private.
9562         (add_lwp): Initialize arch_private.
9563         (delete_lwp): Free arch_private.
9564         (linux_resume_one_lwp): Call the_low_target.prepare_to_resume if
9565         provided.
9566         * linux-low.h (process_info_private): New member arch_private.
9567         (lwp_info): New member arch_private.
9568         (linux_target_ops): New members new_process, new_thread,
9569         prepare_to_resume.
9570         (ptid_of): New macro.
9571         * linux-x86-low.c: Include stddef.h, i386-low.h.
9572         (arch_process_info): New struct.
9573         (arch_lwp_info): New struct.
9574         (x86_linux_dr_get, x86_linux_dr_set): New functions.
9575         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9576         (i386_dr_low_get_status): New function.
9577         (x86_insert_point, x86_remove_point): New functions.
9578         (x86_stopped_by_watchpoint): New function.
9579         (x86_stopped_data_address): New function.
9580         (x86_linux_new_process, x86_linux_new_thread): New functions.
9581         (x86_linux_prepare_to_resume): New function.
9582         (the_low_target): Add entries for insert_point, remove_point,
9583         stopped_by_watchpoint, stopped_data_address, new_process, new_thread,
9584         prepare_to_resume.
9585         * server.c (debug_hw_points): New global.
9586         (monitor_show_help): Document set debug-hw-points.
9587         (handle_query): Process "set debug-hw-points".
9588         * server.h (debug_hw_points): Declare.
9589         (paddress): Declare.
9590         * utils.c (NUMCELLS, CELLSIZE): New macros.
9591         (get_sell, xsnprintf, paddress): New functions.
9592         * win32-arm-low.c (the_low_target): Add entries for insert_point,
9593         remove_point, stopped_by_watchpoint, stopped_data_address.
9594         * win32-i386-low.c: Include i386-low.h.
9595         (debug_reg_state): Replaces dr.
9596         (i386_dr_low_set_addr, i386_dr_low_set_control): New functions.
9597         (i386_dr_low_get_status): New function.
9598         (i386_insert_point, i386_remove_point): New functions.
9599         (i386_stopped_by_watchpoint): New function.
9600         (i386_stopped_data_address): New function.
9601         (i386_initial_stuff): Update.
9602         (get_thread_context,set_thread_context,i386_thread_added): Update.
9603         (the_low_target): Add entries for insert_point,
9604         remove_point, stopped_by_watchpoint, stopped_data_address.
9605         * win32-low.c (win32_insert_watchpoint): New function.
9606         (win32_remove_watchpoint): New function.
9607         (win32_stopped_by_watchpoint): New function.
9608         (win32_stopped_data_address): New function.
9609         (win32_target_ops): Add entries for insert_watchpoint,
9610         remove_watchpoint, stopped_by_watchpoint, stopped_data_address.
9611         * win32-low.h (win32_target_ops): New members insert_point,
9612         remove_point, stopped_by_watchpoint, stopped_data_address.
9613
9614 2009-06-25  Pedro Alves  <pedro@codesourcery.com>
9615
9616         * server.c (process_serial_event): Re-return unsupported, not
9617         error, if the type isn't recognized.  Re-allow supporting only
9618         insert or remove packets.  Also call require_running for
9619         breakpoints.  Add missing break statement to default case.  Tidy.
9620         * target.h (struct target_ops): Rename insert_watchpoint to
9621         insert_point, and remove_watchpoint to remove_point.
9622
9623         * linux-low.h (struct linux_target_ops): Likewise.
9624         * linux-low.c (linux_insert_watchpoint): Rename to ...
9625         (linux_insert_point): ... this.  Adjust.
9626         (linux_remove_watchpoint): Rename to ...
9627         (linux_remove_point): ... this.  Adjust.
9628         (linux_target_ops): Adjust.
9629         * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
9630         (cris_insert_point): ... this.
9631         (cris_remove_watchpoint): Rename to ...
9632         (cris_remove_point): ... this.
9633         (the_low_target): Adjust.
9634
9635 2009-06-24  Pierre Muller  <muller@ics.u-strasbg.fr>
9636
9637         * server.c (handle_v_kill): Pass signal_pid to
9638         kill_inferior if multi_process is zero.
9639
9640 2009-06-23  Aleksandar Ristovski  <aristovski@qnx.com>
9641
9642         * server.c (process_serial_event): Add support for Z0 and Z1 packet.
9643         * target.h (target_ops): Comment for *_watchpoint to make it clear
9644         the functions can get types '0' and '1'.
9645
9646 2009-06-22  Aleksandar Ristovski  <aristovski@qnx.com>
9647
9648         * linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
9649         * proc-service.c (ps_lgetregs): Pass -1 to fetch all registers.
9650         * regcache.c (get_regcache): Likewise.
9651         * spu-low.c (spu_fetch_registers): Remove 0 to -1 conversion.
9652         * win32-low.c (child_fetch_inferior_registers): Remove check for
9653         regno 0.
9654
9655 2009-06-19  Aleksandar Ristovski  <aristovski@qnx.com>
9656             Pedro Alves <pedro@codesourcery.com>
9657
9658         * target.h (struct target_ops) <supports_multi_process>: New
9659         callback.
9660         (target_supports_multi_process): New.
9661         * server.c (handle_query): Even if GDB reports support, only
9662         enable multi-process if the target also supports it.  Report
9663         multi-process support only if the target backend supports it.
9664         * linux-low.c (linux_supports_multi_process): New function.
9665         (linux_target_ops): Install it as target_supports_multi_process
9666         callback.
9667
9668 2009-05-24  Doug Evans  <dje@google.com>
9669
9670         Global renaming of find_thread_pid to find_thread_ptid.
9671         * server.h (find_thread_ptid): Renamed from find_thread_pid.
9672         * inferiors.c (find_thread_ptid): Renamed from find_thread_pid.
9673         All callers updated.
9674
9675         * linux-low.c (handle_extended_wait): Use linux_resume_one_lwp
9676         to resume the newly created thread, don't call ptrace (PTRACE_CONT)
9677         directly.
9678
9679         * linux-low.c (get_stop_pc): Print pc if debug_threads.
9680         (check_removed_breakpoint, linux_wait_for_lwp): Ditto.
9681         (linux_resume_one_lwp): Ditto.
9682
9683 2009-05-23  Doug Evans  <dje@google.com>
9684
9685         * linux-low.c (linux_resume_one_lwp): Change type of first arg
9686         from struct inferior_list_entry * to struct lwp_info *.
9687         All callers updated.
9688
9689 2009-05-13  Doug Evans  <dje@google.com>
9690
9691         * linux-x86-low.c: Don't include assert.h.
9692         (x86_siginfo_fixup): Use fatal, not assert.
9693         (x86_arch_setup): Fix comment.
9694
9695 2009-05-12  Doug Evans  <dje@google.com>
9696
9697         Biarch support for i386/amd64 gdbserver.
9698         * Makefile.in (SFILES): Remove linux-i386-low.c, linux-x86-64-low.c.
9699         Add linux-x86-low.c.
9700         (linux-i386-low.o, linux-x86-64-low.o): Delete.
9701         (linux-x86-low.o): Add.
9702         * linux-x86-64-low.c: Delete.
9703         * linux-i386-low.c: Delete.
9704         * linux-x86-low.c: New file.
9705         * configure.srv (i?86-linux srv_tgtobj): Replace linux-i386-low.o with
9706         linux-x86-low.o.
9707         (x86_64-linux srv_tgtobj): Replace linux-x86-64-low.o with
9708         linux-x86-low.o.
9709         (x86_64-linux srv_regobj): Add reg-i386-linux.o.
9710         * linux-low.c: Include ansidecl.h, elf/common.h, elf/external.h.
9711         (linux_child_pid_to_exec_file): New function.
9712         (elf_64_header_p, elf_64_file_p): New functions.
9713         (siginfo_fixup): New function.
9714         (linux_xfer_siginfo): New local inf_siginfo.  Call siginfo_fixup to
9715         give target a chance to convert layout.
9716         * linux-low.h (linux_target_ops): New member siginfo_fixup.
9717         (linux_child_pid_to_exec_file, elf_64_file_p): Declare.
9718
9719 2009-05-07  Doug Evans  <dje@google.com>
9720
9721         * linux-low.c (regsets_fetch_inferior_registers): Fix memory leak.
9722         (regsets_store_inferior_registers): Ditto.
9723
9724 2009-05-06  Pedro Alves  <pedro@codesourcery.com>
9725
9726         PR server/10048
9727
9728         * linux-low.c (must_set_ptrace_flags): Delete.
9729         (linux_create_inferior): Set `lwp->must_set_ptrace_flags' instead
9730         of the global.
9731         (linux_attach_lwp_1): Don't set PTRACE_SETOPTIONS here.  Set
9732         `lwp->must_set_ptrace_flags' instead.
9733         (linux_wait_for_event_1): Set ptrace options here.
9734         (linux_wait_1): ... not here.
9735
9736 2009-04-30  Doug Evans  <dje@google.com>
9737
9738         * inferiors.c (started_inferior_callback): New function.
9739         (attached_inferior_callback): New function.
9740         (have_started_inferiors_p, have_attached_inferiors_p): New functions.
9741         * server.c (print_started_pid, print_attached_pid): New functions.
9742         (detach_or_kill_for_exit): New function.
9743         (main): Call it instead of for_each_inferior (kill_inferior_callback).
9744         * server.h (have_started_inferiors_p): Declare.
9745         (have_attached_inferiors_p): Declare.
9746
9747         * inferiors.c (remove_process): Fix memory leak, free process.
9748         * linux-low.c (linux_remove_process): New function.
9749         (linux_kill): Call it instead of remove_process.
9750         (linux_detach, linux_wait_1): Ditto.
9751
9752 2009-04-19  Danny Backx  <dannybackx@users.sourceforge.net>
9753
9754         * configure.srv: Add x86 Windows CE target.
9755
9756 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9757
9758         * inferiors.c (get_thread_process): Make global.
9759         * server.h (get_thread_process): Add prototype.
9760         * thread-db.c (find_one_thread): Use get_thread_process
9761         instead of current_process.
9762         (thread_db_get_tls_address): Do not crash if called when
9763         thread layer is not yet initialized.
9764
9765 2009-04-03  Ulrich Weigand  <uweigand@de.ibm.com>
9766
9767         * remote-utils.c (prepare_resume_reply): Null-terminate packet.
9768         * spu-low.c (current_tid): Rename to ...
9769         (current_ptid): ... this.
9770         (fetch_ppc_register, fetch_ppc_memory, store_ppc_memory,
9771         spu_proc_xfer_spu, spu_resume, spu_request_interrupt): Use
9772         ptid_get_lwp (current_ptid) instead of current_tid.
9773         (spu_kill, spu_detach, spu_join, spu_wait): Use pid argument
9774         instead of current_tid.  Use find_process_pid to verify pid
9775         argument is valid.  Pass proper argument to remove_process.
9776         (spu_thread_alive): Compare current_ptid instead of current_tid.
9777         (spu_resume): Likewise.
9778
9779 2009-04-02  Pedro Alves  <pedro@codesourcery.com>
9780
9781         * linux-low.c (usr_store_inferior_registers): Declare local `pid'
9782         variable.
9783
9784 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
9785
9786         Implement the multiprocess extensions, and add linux multiprocess
9787         support.
9788
9789         * server.h (ULONGEST): Declare.
9790         (struct ptid, ptid_t): New.
9791         (minus_one_ptid, null_ptid): Declare.
9792         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9793         (ptid_get_tid, ptid_equal, ptid_is_pid): Declare.
9794         (struct inferior_list_entry): Change `id' type from unsigned from
9795         to ptid_t.
9796         (struct sym_cache, struct breakpoint, struct
9797         process_info_private): Forward declare.
9798         (struct process_info): Declare.
9799         (current_process): Declare.
9800         (all_processes): Declare.
9801         (initialize_inferiors): Declare.
9802         (add_thread): Adjust to use ptid_t.
9803         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): Ditto.
9804         (add_process, remove_process, find_thread_pid): Declare.
9805         (find_inferior_id): Adjust to use ptid_t.
9806         (cont_thread, general_thread, step_thread): Change type to ptid_t.
9807         (multi_process): Declare.
9808         (push_event): Adjust to use ptid_t.
9809         (read_ptid, write_ptid): Declare.
9810         (prepare_resume_reply): Adjust to use ptid_t.
9811         (clear_symbol_cache): Declare.
9812         * inferiors.c (all_processes): New.
9813         (null_ptid, minus_one_ptid): New.
9814         (ptid_build, pid_to_ptid, ptid_get_pid, ptid_get_lwp)
9815         (ptid_get_tid, ptid_equal, ptid_is_pid): New.
9816         (add_thread): Change unsigned long to ptid.  Remove gdb_id
9817         parameter.  Adjust.
9818         (thread_id_to_gdb_id, thread_to_gdb_id): Change unsigned long to ptid.
9819         (gdb_id_to_thread): Rename to ...
9820         (find_thread_pid): ... this.  Change unsigned long to ptid.
9821         (gdb_id_to_thread_id, find_inferior_id): Change unsigned long to ptid.
9822         (loaded_dll, pull_pid_from_list): Adjust.
9823         (add_process, remove_process, find_process_pid)
9824         (get_thread_process, current_process, initialize_inferiors): New.
9825         * target.h (struct thread_resume) <thread>: Change type to ptid_t.
9826         (struct target_waitstatus) <related_pid>: Ditto.
9827         (struct target_ops) <kill, detach>: Add `pid' argument.  Change
9828         return type to int.
9829         (struct target_ops) <join>: Add `pid' argument.
9830         (struct target_ops) <thread_alive>: Change pid's type to ptid_t.
9831         (struct target_ops) <wait>: Add `ptid' field.  Change return type
9832         to ptid.
9833         (kill_inferior, detach_inferior, join_inferior): Add `pid' argument.
9834         (mywait): Add `ptid' argument.  Change return type to ptid_t.
9835         (target_pid_to_str): Declare.
9836         * target.c (set_desired_inferior): Adjust to use ptids.
9837         (mywait): Add new `ptid' argument.  Adjust.
9838         (target_pid_to_str): New.
9839         * mem-break.h (free_all_breakpoints): Declare.
9840         * mem-break.c (breakpoints): Delelete.
9841         (set_breakpoint_at, delete_breakpoint, find_breakpoint_at)
9842         (check_mem_read, check_mem_write, delete_all_breakpoints): Adjust
9843         to use per-process breakpoint list.
9844         (free_all_breakpoints): New.
9845         * remote-utils.c (struct sym_cache) <name>: Drop `const'.
9846         (symbol_cache, all_symbols_looked_up): Delete.
9847         (hexchars): New.
9848         (ishex, unpack_varlen_hex, write_ptid, hex_or_minus_one,
9849         read_ptid): New.
9850         (prepare_resume_reply): Change ptid argument's type from unsigned
9851         long to ptid_t.  Adjust.  Implement W;process and X;process.
9852         (free_sym_cache, clear_symbol_cache): New.
9853         (look_up_one_symbol): Adjust to per-process symbol cache.  *
9854         * server.c (cont_thread, general_thread, step_thread): Change type
9855         to ptid_t.
9856         (attached): Delete.
9857         (multi_process): New.
9858         (last_ptid): Change type to ptid_t.
9859         (struct vstop_notif) <ptid>: Change type to ptid_t.
9860         (queue_stop_reply, push_event): Change `ptid' argument's type to
9861         ptid_t.
9862         (discard_queued_stop_replies): Add `pid' argument.
9863         (start_inferior): Adjust to use ptids.  Adjust to mywait interface
9864         changes.  Don't reference the `attached' global.
9865         (attach_inferior): Adjust to mywait interface changes.
9866         (handle_query): Adjust to use ptids.  Parse GDB's qSupported
9867         features.  Handle and report "multiprocess+".  Handle
9868         "qAttached:PID".
9869         (handle_v_cont): Adjust to use ptids.  Adjust to mywait interface
9870         changes.
9871         (handle_v_kill): New.
9872         (handle_v_stopped): Adjust to use target_pid_to_str.
9873         (handle_v_requests): Allow multiple attaches and runs when
9874         multiprocess extensions are in effect.  Handle "vKill".
9875         (myresume): Adjust to use ptids.
9876         (queue_stop_reply_callback): Add `arg' parameter.  Handle it.
9877         (handle_status): Adjust to discard_queued_stop_replies interface
9878         change.
9879         (first_thread_of, kill_inferior_callback)
9880         (detach_or_kill_inferior_callback, join_inferiors_callback): New.
9881         (main): Call initialize_inferiors.  Adjust to use ptids, killing
9882         and detaching from all inferiors.  Handle multiprocess packet
9883         variants.
9884         * linux-low.h: Include gdb_proc_service.h.
9885         (struct process_info_private): New.
9886         (struct linux_target_ops) <pid_of>: Use ptid_get_pid.
9887         <lwpid_of>: Use ptid_get_lwp.
9888         (get_lwp_thread): Adjust.
9889         (struct lwp_info): Add `dead' member.
9890         (find_lwp_pid): Declare.
9891         * linux-low.c (thread_db_active): Delete.
9892         (new_inferior): Adjust comment.
9893         (inferior_pid): Delete.
9894         (linux_add_process): New.
9895         (handle_extended_wait): Adjust.
9896         (add_lwp): Change unsigned long to ptid.
9897         (linux_create_inferior): Add process to processes table.  Adjust
9898         to use ptids.  Don't set new_inferior here.
9899         (linux_attach_lwp): Rename to ...
9900         (linux_attach_lwp_1): ... this.  Add `initial' argument.  Handle
9901         it.  Adjust to use ptids.
9902         (linux_attach_lwp): New.
9903         (linux_attach): Add process to processes table.  Don't set
9904         new_inferior here.
9905         (struct counter): New.
9906         (second_thread_of_pid_p, last_thread_of_process_p): New.
9907         (linux_kill_one_lwp): Add `args' parameter.  Handle it.  Adjust to
9908         multiple processes.
9909         (linux_kill): Add `pid' argument.  Handle it.  Adjust to multiple
9910         processes.  Remove process from process table.
9911         (linux_detach_one_lwp): Add `args' parameter.  Handle it.  Adjust
9912         to multiple processes.
9913         (any_thread_of): New.
9914         (linux_detach): Add `pid' argument, and handle it.  Remove process
9915         from processes table.
9916         (linux_join): Add `pid' argument.  Handle it.
9917         (linux_thread_alive): Change unsighed long argument to ptid_t.
9918         Consider dead lwps as not being alive.
9919         (status_pending_p): Rename `dummy' argument to `arg'.  Filter out
9920         threads we're not interested in.
9921         (same_lwp, find_lwp_pid): New.
9922         (linux_wait_for_lwp): Change `pid' argument's type from int to
9923         ptid_t.  Adjust.
9924         (linux_wait_for_event): Rename to ...
9925         (linux_wait_for_event_1): ... this.  Change `pid' argument's type
9926         from int to ptid_t.  Adjust.
9927         (linux_wait_for_event): New.
9928         (linux_wait_1): Add `ptid' argument.  Change return type to
9929         ptid_t.  Adjust.  Use last_thread_of_process_p.  Remove processes
9930         that exit from the process table.
9931         (linux_wait): Add `ptid' argument.  Change return type to ptid_t.
9932         Adjust.
9933         (mark_lwp_dead): New.
9934         (wait_for_sigstop): Adjust to use ptids.  If a process exits while
9935         stopping all threads, mark its main lwp as dead.
9936         (linux_set_resume_request, linux_resume_one_thread): Adjust to use
9937         ptids.
9938         (fetch_register, usr_store_inferior_registers)
9939         (regsets_fetch_inferior_registers)
9940         (regsets_store_inferior_registers, linux_read_memory)
9941         (linux_write_memory): Inline `inferior_pid'.
9942         (linux_look_up_symbols): Adjust to use per-process
9943         `thread_db_active'.
9944         (linux_request_interrupt): Adjust to use ptids.
9945         (linux_read_auxv): Inline `inferior_pid'.
9946         (initialize_low): Don't reference thread_db_active.
9947         * gdb_proc_service.h (struct ps_prochandle) <pid>: Remove.
9948         * proc-service.c (ps_lgetregs): Use find_lwp_pid.
9949         (ps_getpid): Return the pid of the current inferior.
9950         * thread-db.c (proc_handle, thread_agent): Delete.
9951         (thread_db_create_event, thread_db_enable_reporting): Adjust to
9952         per-process data.
9953         (find_one_thread): Change argument type to ptid_t.  Adjust to
9954         per-process data.
9955         (maybe_attach_thread): Adjust to per-process data and ptids.
9956         (thread_db_find_new_threads): Ditto.
9957         (thread_db_init): Ditto.
9958         * spu-low.c (spu_create_inferior, spu_attach): Add process to
9959         processes table.  Adjust to use ptids.
9960         (spu_kill, spu_detach): Adjust interface.  Remove process from
9961         processes table.
9962         (spu_join, spu_thread_alive): Adjust interface.
9963         (spu_wait): Adjust interface.  Remove process from processes
9964         table.  Adjust to use ptids.
9965         * win32-low.c (current_inferior_tid): Delete.
9966         (current_inferior_ptid): New.
9967         (debug_event_ptid): New.
9968         (thread_rec): Take a ptid.  Adjust.
9969         (child_add_thread): Add `pid' argument.  Adjust to use ptids.
9970         (child_delete_thread): Ditto.
9971         (do_initial_child_stuff): Add `attached' argument.  Add process to
9972         processes table.
9973         (child_fetch_inferior_registers, child_store_inferior_registers):
9974         Adjust.
9975         (win32_create_inferior): Pass 0 to do_initial_child_stuff.
9976         (win32_attach): Pass 1 to do_initial_child_stuff.
9977         (win32_kill): Adjust interface.  Remove process from processes
9978         table.
9979         (win32_detach): Ditto.
9980         (win32_join): Adjust interface.
9981         (win32_thread_alive): Take a ptid.
9982         (win32_resume): Adjust to use ptids.
9983         (get_child_debug_event): Ditto.
9984         (win32_wait): Adjust interface.  Remove exiting process from
9985         processes table.
9986
9987 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
9988
9989         Non-stop mode support.
9990
9991         * server.h (non_stop): Declare.
9992         (gdb_client_data, handler_func): Declare.
9993         (delete_file_handler, add_file_handler, start_event_loop):
9994         Declare.
9995         (handle_serial_event, handle_target_event, push_event)
9996         (putpkt_notif): Declare.
9997         * target.h (enum resume_kind): New.
9998         (struct thread_resume): Replace `step' field by `kind' field.
9999         (TARGET_WNOHANG): Define.
10000         (struct target_ops) <wait>: Add `options' argument.
10001         <supports_non_stop, async, start_non_stop>: New fields.
10002         (target_supports_non_stop, target_async): New.
10003         (start_non_stop): Declare.
10004         (mywait): Add `options' argument.
10005         * target.c (mywait): Add `options' argument.  Print child exit
10006         notifications here.
10007         (start_non_stop): New.
10008         * server.c (non_stop, own_buf, mem_buf): New globals.
10009         (struct vstop_notif): New.
10010         (notif_queue): New global.
10011         (queue_stop_reply, push_event, discard_queued_stop_replies)
10012         (send_next_stop_reply): New.
10013         (start_inferior): Adjust to use resume_kind.  Adjust to mywait
10014         interface changes.
10015         (attach_inferior): In non-stop mode, don't wait for the target
10016         here.
10017         (handle_general_set): Handle QNonStop.
10018         (handle_query): When handling qC, return the current general
10019         thread, instead of the first thread of the list.
10020         (handle_query): If the backend supports non-stop mode, include
10021         QNonStop+ in the qSupported query response.
10022         (handle_v_cont): Adjust to use resume_kind.  Handle resume_stop
10023         and non-stop mode.
10024         (handle_v_attach, handle_v_run): Handle non-stop mode.
10025         (handle_v_stopped): New.
10026         (handle_v_requests): Report support for vCont;t.  Handle vStopped.
10027         (myresume): Adjust to use resume_kind.  Handle non-stop.
10028         (queue_stop_reply_callback): New.
10029         (handle_status): Handle non-stop mode.
10030         (main): Clear non_stop flag on reconnection.  Use the event-loop.
10031         Refactor serial protocol handling from here ...
10032         (process_serial_event): ... to this new function.  When GDB
10033         selects any thread, select one here.  In non-stop mode, wait until
10034         GDB acks all pending events before exiting.
10035         (handle_serial_event, handle_target_event): New.
10036         * remote-utils.c (remote_open): Install remote_desc in the event
10037         loop.
10038         (remote_close): Remove remote_desc from the event loop.
10039         (putpkt_binary): Rename to...
10040         (putpkt_binary_1): ... this.  Add `is_notic' argument.  Handle it.
10041         (putpkt_binary): New as wrapper around putpkt_binary_1.
10042         (putpkt_notif): New.
10043         (prepare_resume_reply): In non-stop mode, don't change the
10044         general_thread.
10045         * event-loop.c: New.
10046         * Makefile.in (OBJ): Add event-loop.o.
10047         (event-loop.o): New rule.
10048
10049         * linux-low.h (pid_of): Moved here.
10050         (lwpid_of): New.
10051         (get_lwp_thread): Use lwpid_of.
10052         (struct lwp_info): Delete `lwpid' field.  Add `suspended' field.
10053         * linux-low.c (pid_of): Delete.
10054         (inferior_pid): Use lwpid_of.
10055         (linux_event_pipe): New.
10056         (target_is_async_p): New.
10057         (delete_lwp): New.
10058         (handle_extended_wait): Use lwpid_of.
10059         (add_lwp): Don't set lwpid field.
10060         (linux_attach_lwp): Adjust debug output.  Use lwpid_of.
10061         (linux_kill_one_lwp): If killing a running lwp, stop it first.
10062         Use lwpid_of.  Adjust to linux_wait_for_event interface changes.
10063         (linux_detach_one_lwp): If detaching from a running lwp, stop it
10064         first.  Adjust to linux_wait_for_event interface changes.  Use
10065         lwpid_of.
10066         (linux_detach): Don't delete the main lwp here.
10067         (linux_join): Use my_waitpid.  Avoid signal_pid.  Use lwpid_of.
10068         (status_pending_p): Don't consider explicitly suspended lwps.
10069         (linux_wait_for_lwp): Take an integer pid instead of a lwp_info
10070         pointer.  Add OPTIONS argument.  Change return type to int.  Use
10071         my_waitpid instead of sleeping.  Handle WNOHANG.  Use lwpid_of.
10072         (linux_wait_for_event): Take an integer pid instead of a lwp_info
10073         pointer.  Add status pointer argument.  Return a pid instead of a
10074         status.  Use lwpid_of.  Adjust to linux_wait_for_lwp interface
10075         changes.  In non-stop mode, don't switch to a random thread.
10076         (linux_wait): Rename to...
10077         (linux_wait_1): ... this.  Add target_options argument, and handle
10078         it.  Adjust to use resume_kind.  Use lwpid_of.  In non-stop mode,
10079         don't handle the continue thread.  Handle TARGET_WNOHANG.  Merge
10080         clean exit and signal exit code.  Don't stop all threads in
10081         non-stop mode.  In all-stop mode, only stop all threads when
10082         reporting a stop to GDB.  Handle explicit thread stop requests.
10083         (async_file_flush, async_file_mark): New.
10084         (linux_wait): New.
10085         (send_sigstop): Use lwpid_of.
10086         (wait_for_sigstop): Use lwpid_of.  Adjust to linux_wait_for_event
10087         interface changes.  In non-stop mode, don't switch to a random
10088         thread.
10089         (linux_resume_one_lwp): Use lwpid_of.
10090         (linux_continue_one_thread, linux_queue_one_thread): Merge into ...
10091         (linux_resume_one_thread): ... this.  Handle resume_stop.  In
10092         non-stop mode, don't look for pending flag in all threads.
10093         (resume_status_pending_p): Don't consider explicitly suspended
10094         threads.
10095         (my_waitpid): Reimplement.  Emulate __WALL.
10096         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10097         Use lwpid_of.
10098         (sigchld_handler, linux_supports_non_stop, linux_async)
10099         (linux_start_non_stop): New.
10100         (linux_target_ops): Register linux_supports_non_stop, linux_async
10101         and linux_start_non_stop.
10102         (initialize_low): Install SIGCHLD handler.
10103         * thread-db.c (thread_db_create_event, find_one_thread)
10104         (thread_db_get_tls_address): Use lwpid_of.
10105         * win32-low.c (win32_detach): Adjust to use resume_kind.
10106         (win32_wait): Add `options' argument.
10107         * spu-low.c (spu_resume): Adjust to use resume_kind.
10108         (spu_wait): Add `options' argument.
10109
10110 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10111
10112         Decouple target code from remote protocol.
10113
10114         * target.h (enum target_waitkind): New.
10115         (struct target_waitstatus): New.
10116         (struct target_ops) <wait>: Return an unsigned long.  Take a
10117         target_waitstatus pointer instead of a char pointer.
10118         (mywait): Likewise.
10119         * target.c (mywait): Change prototype to return an unsigned long.
10120         Take a target_waitstatus pointer instead of a char pointer.  Adjust.
10121         * server.h (thread_from_wait, old_thread_from_wait): Delete
10122         declarations.
10123         (prepare_resume_reply): Change prototype to take a
10124         target_waitstatus.
10125         * server.c (thread_from_wait, old_thread_from_wait): Delete.
10126         (last_status, last_ptid): New.
10127         (start_inferior): Remove "statusptr" argument.  Adjust.  Return a
10128         pid instead of a signal.
10129         (attach_inferior): Remove "status" and "signal" parameters.
10130         Adjust.
10131         (handle_query): For qGetTLSAddr, parse the thread id with strtol,
10132         not as an address.
10133         (handle_v_cont, handle_v_attach, handle_v_run, handle_v_kill)
10134         (handle_v_requests, myresume): Remove "status" and "signal"
10135         parameters.  Adjust.
10136         (handle_status): New.
10137         (main): Delete local `status'.  Adjust.
10138         * remote-utils.c: Include target.h.
10139         (prepare_resume_reply): Change prototype to take a
10140         target_waitstatus.  Adjust.
10141
10142         * linux-low.c (linux_wait): Adjust to new target_ops->wait
10143         interface.
10144         * spu-low.c (spu_wait): Adjust.
10145         * win32-low.c (enum target_waitkind, struct target_waitstatus):
10146         Delete.
10147         (win32_wait): Adjust.
10148
10149 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10150
10151         * target.h (struct thread_resume): Delete leave_stopped member.
10152         (struct target_ops): Add a `n' argument to the `resume' callback.
10153         * server.c (start_inferior): Adjust.
10154         (handle_v_cont, myresume): Adjust.
10155         * linux-low.c (check_removed_breakpoint): Adjust to resume
10156         interface change, and to removed leave_stopped field.
10157         (resume_ptr): Delete.
10158         (struct thread_resume_array): New.
10159         (linux_set_resume_request): Add new `arg' parameter.  Adjust to
10160         resume interface change.
10161         (linux_continue_one_thread, linux_queue_one_thread)
10162         (resume_status_pending_p): Check if the resume field is NULL
10163         instead of checking the leave_stopped member.
10164         (linux_resume): Adjust to the target resume interface change.
10165         * spu-low.c (spu_resume): Adjust to the target resume interface
10166         change.
10167         * win32-low.c (win32_detach, win32_resume): Ditto.
10168
10169 2009-04-01  Pedro Alves  <pedro@codesourcery.com>
10170
10171         * linux-low.c (linux_wait_for_event): Don't clear the `stepping'
10172         flag.
10173         (wait_for_sigstop): Don't leave a finished single-step SIGTRAP
10174         pending.
10175         (linux_continue_one_thread): Only preserve the stepping flag if
10176         there's a pending breakpoint.
10177
10178 2009-03-31  Pedro Alves  <pedro@codesourcery.com>
10179
10180         * server.c (main): After the inferior having exited, call
10181         remote_close before exiting gdbserver.
10182
10183 2009-03-25  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10184
10185         Fix size of FPSCR in Power 7 processors.
10186         * linux-ppc-low.c (PPC_FEATURE_ARCH_2_05): Remove #define.
10187         (PPC_FEATURE_HAS_DFP): New #define.
10188         (ppc_arch_setup): Check for DFP feature instead of ISA 2.05 to decide on
10189         size of the FPSCR.
10190
10191 2009-03-23  Pedro Alves  <pedro@codesourcery.com>
10192
10193         * server.c (handle_query) Whitespace and formatting.
10194
10195 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10196
10197         * i387-fp.c, linux-arm-low.c, linux-cris-low.c,
10198         linux-crisv32-low.c, linux-i386-low.c, linux-low.c,
10199         linux-mips-low.c, linux-s390-low.c, linux-sparc-low.c,
10200         linux-x86-64-low.c, linux-xtensa-low.c, proc-service.c,
10201         regcache.c, remote-utils.c, server.c, spu-low.c, target.h,
10202         thread-db.c, win32-low.c, xtensa-xtregs.c, gdbreplay.c,
10203         Makefile.in, configure.ac: Fix whitespace throughout.
10204         * configure: Regenerate.
10205
10206 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10207
10208         * inferiors.c (find_inferior): Make it safe for the callback
10209         function to delete the currently iterated inferior.
10210
10211 2009-03-22  Pedro Alves  <pedro@codesourcery.com>
10212
10213         * Makefile.in (linuw_low_h): Move higher.
10214         (thread-db.o): Depend on $(linux_low_h).
10215
10216 2009-03-17  Pedro Alves  <pedro@codesourcery.com>
10217
10218         Rename "process" to "lwp" throughout.
10219
10220         * linux-low.c (all_processes): Rename to...
10221         (all_lwps): ... this.
10222         (inferior_pid, handle_extended_wait, get_stop_pc): Adjust.
10223         (add_process): Rename to ...
10224         (add_lwp): ... this.  Adjust.
10225         (linux_create_inferior): Adjust.
10226         (linux_attach_lwp): Adjust.
10227         (linux_attach): Adjust.
10228         (linux_kill_one_process): Rename to ...
10229         (linux_kill_one_lwp): ... this.  Adjust.
10230         (linux_kill): Adjust.
10231         (linux_detach_one_process): Rename to ...
10232         (linux_detach_one_lwp): ... this.  Adjust.
10233         (linux_detach): Adjust.
10234         (check_removed_breakpoint): Adjust.
10235         (status_pending_p): Adjust.
10236         (linux_wait_for_process): Rename to ...
10237         (linux_wait_for_lwp): ... this.  Adjust.
10238         (linux_wait_for_event): Adjust.
10239         (send_sigstop): Adjust.
10240         (wait_for_sigstop): Adjust.
10241         (stop_all_processes): Rename to ...
10242         (stop_all_lwps): ... this.
10243         (linux_resume_one_process): Rename to ...
10244         (linux_resume_one_lwp): ... this.  Adjust.
10245         (linux_set_resume_request, linux_continue_one_thread)
10246         (linux_queue_one_thread, resume_status_pending_p)
10247         (usr_store_inferior_registers, regsets_store_inferior_registers)
10248         (linux_request_interrupt, linux_read_offsets, linux_xfer_siginfo):
10249         Adjust.
10250         * linux-low.h (get_process): Rename to ...
10251         (get_lwp): ... this.  Adjust.
10252         (get_thread_process): Rename to ...
10253         (get_thread_lwp): ... this.  Adjust.
10254         (get_process_thread): Rename to ...
10255         (get_lwp_thread): ... this.  Adjust.
10256         (struct process_info): Rename to ...
10257         (struct lwp_info): ... this.
10258         (all_processes): Rename to ...
10259         (all_lwps): ... this.
10260         * proc-service.c (ps_lgetregs): Adjust.
10261         * thread-db.c (thread_db_create_event, find_one_thread)
10262         (maybe_attach_thread, thread_db_get_tls_address): Adjust.
10263
10264 2009-03-14  Pedro Alves  <pedro@codesourcery.com>
10265
10266         * server.c (handle_query): Handle "qAttached".
10267
10268 2009-03-13  Nathan Sidwell  <nathan@codesourcery.com>
10269
10270         * Makefile.in, hostio-errno.c, errno.c, xtensa-xtregs.c: Change to
10271         GPLv3, update license URL.
10272
10273 2009-03-01  Doug Evans  <dje@google.com>
10274
10275         * Makefile.in (INCLUDE_CFLAGS): Add -I$(srcdir)/../common.
10276         (server_h): Add gdb_signals.h.
10277         (signals.o): Update.
10278         * server.h (target_signal_from_host,target_signal_to_host_p)
10279         (target_signal_to_host,target_signal_to_name): Moved to gdb_signals.h.
10280
10281 2009-02-14  Pierre Muller  <muller@ics.u-strasbg.fr>
10282
10283         * remote-utils.c (getpkt): Also generate remote-debug
10284         information if noack_mode is set.
10285
10286 2009-02-06  Pedro Alves  <pedro@codesourcery.com>
10287
10288         * server.c (handle_query): Report qXfer:siginfo:read and
10289         qXfer:siginfo:write as supported and handle them.
10290         * target.h (struct target_ops) <qxfer_siginfo>: New field.
10291         * linux-low.c (linux_xfer_siginfo): New.
10292         (linux_target_ops): Set it.
10293
10294 2009-01-26  Pedro Alves  <pedro@codesourcery.com>
10295
10296         * server.c (gdbserver_usage): Mention --remote-debug.
10297         (main): Accept '--remote-debug' switch.
10298
10299 2009-01-18  Doug Evans  <dje@google.com>
10300
10301         * regcache.c (new_register_cache): No need to check result of xcalloc.
10302         * server.c (handle_search_memory): Back out calls to xmalloc,
10303         result is checked and error is returned to user upon failure.
10304         (handle_query): Ditto.  Add more checks for result of malloc.
10305         (handle_v_cont): Check result of malloc, report error back to
10306         user upon failure.
10307         (handle_v_run): Ditto.  Call freeargv.
10308         * server.h (freeargv): Declare.
10309         * utils.c (freeargv): New fn.
10310
10311 2009-01-15  Doug Evans  <dje@google.com>
10312
10313         * gdbreplay.c (perror_with_name): Make arg const char *.
10314         * server.h (target_signal_to_name): Make return type const char *.
10315         * thread-db.c (thread_db_err_str): Make return type const char *.
10316         * utils.c (perror_with_name): Make arg const char *.
10317
10318 2009-01-14  Pedro Alves  <pedro@codesourcery.com>
10319
10320         * win32-low.c (get_child_debug_event): Issue a final DBG_CONTINUE
10321         when handling a EXIT_PROCESS_DEBUG_EVENT.
10322
10323 2009-01-06  Joel Brobecker  <brobecker@adacore.com>
10324
10325         * gdbreplay.c (gdbreplay_version): Update copyright year.
10326         * server.c (gdbserver_version): Likewise.
10327
10328 2009-01-05  Doug Evans  <dje@google.com>
10329
10330         * linux-low.c (linux_attach_lwp): Add some comments/fixmes.
10331         (handle_extended_wait): Improve comment.
10332
10333 2008-12-13  Doug Evans  <dje@google.com>
10334
10335         * utils.c (xmalloc,xcalloc,xstrdup): New fns.
10336         * server.h (ATTR_MALLOC): New macro.
10337         (xmalloc,xcalloc,xstrdup): Declare.
10338         * hostio.c: Replace malloc,calloc,strdup with xmalloc,xcalloc,xstrdup.
10339         * inferiors.c: Ditto.
10340         * linux-low.c: Ditto.
10341         * mem-break.c: Ditto.
10342         * regcache.c: Ditto.
10343         * remote-utils.c: Ditto.
10344         * server.c: Ditto.
10345         * target.c: Ditto.
10346         * win32-low.c: Ditto.
10347
10348 2008-12-12  Doug Evans  <dje@google.com>
10349
10350         * linux-low.c (linux_wait_for_process): Don't clobber current_inferior
10351         in debugging printf.
10352
10353         * linux-low.c (handle_extended_wait): Simplify, use my_waitpid.
10354
10355 2008-12-09  Doug Evans  <dje@google.com>
10356
10357         * linux-low.h (struct process_info): Delete member tid, unused.
10358         * thread-db.c (find_one_thread): Update.
10359         (maybe_attach_thread): Update.
10360
10361 2008-12-02  Pedro Alves  <pedro@codesourcery.com>
10362
10363         * target.h (struct target_ops): Add qxfer_osdata member.
10364         * linux-low.c: Include ctype.h and pwd.h and sys/types.h
10365         and dirent.h.
10366         (linux_qxfer_osdata): New functions.
10367         (linux_target_ops): Register linux_qxfer_osdata as qxfer_osdata
10368         callback.
10369         * server.c (handle_query): Handle "qXfer:osdata:read:".
10370         * remote-utils.c (buffer_grow, buffer_free, buffer_init, buffer_finish)
10371         (buffer_xml_printf): New functions.
10372         * server.h (struct buffer): New.
10373         (buffer_grow_str, buffer_grow_str0): New macros.
10374         (buffer_grow, buffer_free, buffer_init, buffer_finish)
10375         (buffer_xml_printf): Declare.
10376
10377 2008-11-24  Doug Evans  <dje@google.com>
10378
10379         * Makefile.in (VERSION,DIST,LINT,LINTFLAGS): Delete, unused.
10380
10381 2008-11-24  Daniel Jacobowitz  <dan@codesourcery.com>
10382
10383         * server.c (handle_v_run): Always use the supplied argument list.
10384
10385 2008-11-19  Bob Wilson  <bob.wilson@acm.org>
10386
10387         * xtensa-xtregs.c (XTENSA_ELF_XTREG_SIZE): Change to 4.
10388         (xtensa_regmap_table): Add entry for scompare1.
10389
10390 2008-11-18  Thiago Jung Bauermann  <bauerman@br.ibm.com>
10391
10392         * Makefile.in (powerpc-isa205-32l.o, powerpc-isa205-32l.c,
10393         powerpc-isa205-altivec32l.o, powerpc-isa205-altivec32l.c,
10394         powerpc-isa205-vsx32l.o, powerpc-isa205-vsx32l.c,
10395         powerpc-isa205-64l.o, powerpc-isa205-64l.c,
10396         powerpc-isa205-altivec64l.o, powerpc-isa205-altivec64l.c,
10397         powerpc-isa205-vsx64l.o, powerpc-isa205-vsx64l.c): New targets.
10398         * configure.srv (powerpc*-*-linux*): Add ISA 2.05 object files and
10399         XML target descriptions.
10400         * linux-ppc-low.c (ppc_arch_setup): Init registers with 64-bit FPSCR
10401         when inferior is running on an ISA 2.05 or later processor.  Add
10402         special case to return offset for full 64-bit slot of FPSCR when
10403         in 32-bits.
10404
10405 2008-11-14  Daniel Gutson  <dgutson@codesourcery.com>
10406
10407         * Makefile.in (SFILES, clean): Added sparc64 files.
10408         (reg-sparc64.o, reg-sparc64.c): New.
10409         * configure.srv (sparc*-*-linux*): New configuration.
10410         * linux-low.c (regsets_fetch_inferior_registers): Swap ptrace
10411         syscall arguments for SPARC.
10412         (regsets_store_inferior_registers): Likewise.
10413         * linux-sparc-low.c: New file.
10414
10415 2008-10-21  Doug Evans  <dje@google.com>
10416
10417         * Makefile.in (BFD_DIR,BFD,BFD_SRC,BFD_CFLAGS): Delete.
10418         (READLINE_DIR,READLINE_DEP): Delete.
10419         (INTERNAL_CFLAGS): Update.
10420         (LINTFLAGS): Update.
10421
10422 2008-10-10  Pedro Alves  <pedro@codesourcery.com>
10423
10424         * server.c (handle_v_run): If GDB didn't specify an argv, use the
10425         whole argv from the last run, not just argv[0].
10426
10427 2008-09-08  Pedro Alves  <pedro@codesourcery.com>
10428
10429         * regcache.c (new_register_cache): Return NULL if the register
10430         cache size isn't known yet.
10431         (free_register_cache): Avoid dereferencing a NULL regcache.
10432
10433 2008-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
10434
10435         * configure.srv: Merge MIPS and MIPS64.
10436
10437 2008-08-24  Maciej W. Rozycki  <macro@linux-mips.org>
10438
10439         * Makefile.in (uninstall): Apply $(EXEEXT) too.
10440
10441 2008-08-18  Luis Machado  <luisgpm@br.ibm.com>
10442
10443         * Makefile.in: Add required vsx dependencies.
10444
10445         * linux-ppc-low: Define PPC_FEATURE_HAS_VSX.
10446         Declare init_registers_powerpc_vsx32l.
10447         Declare init_registers_powerpc_vsx64l.
10448         Define PTRACE_GETVSXREGS and PTRACE_SETVSXREGS.
10449         (ppc_arch_setup): Check for VSX in hwcap.
10450         (ppc_fill_vsxregset): New function.
10451         (ppc_store_vsxregset): New function.
10452         Add new VSX entry in regset_info target_regsets.
10453
10454         * configure.srv: Add new VSX dependencies.
10455
10456 2008-08-12  Pedro Alves  <pedro@codesourcery.com>
10457
10458         * remote-utils.c (noack_mode, transport_is_reliable): New globals.
10459         (remote_open): Set or clear transport_is_reliable.
10460         (putpkt_binary): Don't expect acks in noack mode.
10461         (getpkt): Don't send ack/nac in noack mode.
10462         * server.c (handle_general_set): Handle QStartNoAckMode.
10463         (handle_query): If connected by tcp pass QStartNoAckMode+ in
10464         qSupported.
10465         (main): Reset noack_mode on every connection.
10466         * server.h (noack_mode): Declare.
10467
10468 2008-08-07  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
10469
10470         * Makefile.in (GDBREPLAY_OBS): New variable.
10471         (gdbreplay$(EXEEXT)): Use it to avoid unportable $^.
10472
10473 2008-08-05  Ulrich Weigand  <uweigand@de.ibm.com>
10474             Daniel Jacobowitz  <dan@codesourcery.com>
10475
10476         * linux-low.c (linux_resume_one_process): Ignore ESRCH.
10477         (usr_store_inferior_registers): Likewise.
10478         (regsets_store_inferior_registers): Likewise.
10479
10480 2008-07-31  Rolf Jansen  <rj@surtec.com>
10481             Pedro Alves  <pedro@codesourcery.com>
10482
10483         * configure.ac: Check for memmem declaration.
10484         * server.c [HAVE_MALLOC_H]: Include malloc.h.
10485         (disable_packet_vCont, disable_packet_Tthread, disable_packet_qC)
10486         (disable_packet_qfThreadInfo): Unconditionally compile.
10487         * server.h [!HAVE_DECL_MEMMEM]: Declare memmem.
10488         * configure, config.in: Regenerate.
10489
10490 2008-07-28  Doug Kwan  <dougkwan@google.com>
10491
10492         * linux-low.c (sys/dir.h, sys/user.h): Remove includes.
10493         (linux_write_memory): Remove declaration of errno.
10494
10495 2008-07-12  Ulrich Weigand  <uweigand@de.ibm.com>
10496
10497         * linux-low.c (handle_extended_wait): Do not use "status"
10498         variable uninitialized.
10499
10500 2008-07-07  Pedro Alves  <pedro@codesourcery.com>
10501
10502         * server.c (handle_v_attach): Inhibit reporting dll changes.
10503
10504 2008-06-27  Pedro Alves  <pedro@codesourcery.com>
10505
10506         * remote-utils.c (prepare_resume_reply): If requested, don't
10507         output "thread:TID" in the T stop reply.
10508
10509         * server.c (disable_packet_vCont, disable_packet_Tthread)
10510         (disable_packet_qC, disable_packet_qfThreadInfo): New globals.
10511         (handle_query): If requested, disable support for qC, qfThreadInfo
10512         and qsThreadInfo.
10513         (handle_v_requests): If requested, disable support for vCont.
10514         (gdbserver_show_disableable): New.
10515         (main): Handle --disable-packet and --disable-packet=LIST.
10516
10517         * server.h (disable_packet_vCont, disable_packet_Tthread)
10518         (disable_packet_qC, disable_packet_qfThreadInfo): Declare.
10519
10520 2008-06-20  Carlos O'Donell  <carlos@codesourcery.com>
10521
10522         * server.c (gdbserver_usage): Mention --version.
10523
10524 2008-06-06  Daniel Jacobowitz  <dan@codesourcery.com>
10525
10526         * Makefile.in (gdbreplay.o): New rule.
10527
10528 2008-06-06  Joseph Myers  <joseph@codesourcery.com>
10529
10530         * gdbreplay.c (gdbreplay_version): Say gdbreplay in version
10531         message, not gdbserver.
10532
10533 2008-06-05  Vladimir Prus  <vladimir@codesourcery.com>
10534             Nathan Sidwell  <nathan@codesourcery.com>
10535             Joseph Myers  <joseph@codesourcery.com>
10536
10537         * acinclude.m4: Include ../../config/acx.m4.
10538         * configure.ac: Use ACX_PKGVERSION and ACX_BUGURL.
10539         * configure, config.in: Regenerate.
10540         * Makefile.in (gdbreplay$(EXEEXT)): Add version.o.
10541         * server.c (gdbserver_version): Print PKGVERSION.
10542         (gdbsrever_usage): Add stream parameter.  Print REPORT_BUGS_TO.
10543         (main): Adjust gdbserver_usage calls.
10544         * gdbreplay.c (version, host_name): Add declarations.
10545         (gdbreplay_version, gdbreplay_usage): New.
10546         (main): Accept --version and --help options.
10547
10548 2008-06-04  Daniel Jacobowitz  <dan@codesourcery.com>
10549
10550         * linux-arm-low.c (thumb_breakpoint, thumb_breakpoint_len): New.
10551         (arm_breakpoint_at): Handle Thumb.
10552         (the_low_target): Add comment.
10553
10554 2008-05-29  Ulrich Weigand  <uweigand@de.ibm.com>
10555
10556         * linux-ppc-low.c (ppc_collect_ptrace_register): Clear buffer.
10557
10558 2008-05-09  Doug Evans  <dje@google.com>
10559
10560         * server.h (decode_search_memory_packet): Declare.
10561         * remote-utils.c (decode_search_memory_packet): New fn.
10562         * server.c (handle_search_memory_1): New fn.
10563         (handle_search_memory): New fn.
10564         (handle_query): Process qSearch:memory packets.
10565
10566 2008-05-08  Ulrich Weigand  <uweigand@de.ibm.com>
10567
10568         * regcache.c (registers_length): Remove.
10569         (set_register_cache): Verify that PBUFSIZ is large enough to hold a
10570         full register packet.
10571         * regcache.h (registers_length): Remove prototype.
10572         * server.h (PBUFSIZ): Define to 16384.
10573
10574 2008-05-03  Ulrich Weigand  <uweigand@de.ibm.com>
10575
10576         * configure.srv (powerpc*-*-linux*): Set srv_regobj to
10577         powerpc-32l.o, powerpc-altivec32l.o, powerpc-e500l.o,
10578         powerpc-64l.o, and powerpc-altivec64l.o.
10579         Remove rs6000/powerpc-32.xml, rs6000/powerpc-64.xml, and
10580         rs6000/powerpc-e500.xml; add rs6000/powerpc-32l.xml,
10581         rs6000/powerpc-altivec32l.xml, rs6000/powerpc-e500l.xml,
10582         rs6000/powerpc-64l.xml, rs6000/powerpc-altivec64l.xml,
10583         rs6000/power-linux.xml, and rs6000/power64-linux.xml
10584         to srv_xmlfiles.
10585
10586         * Makefile.in (reg-ppc.o, reg-ppc.c): Remove, replace by ...
10587         (powerpc-32l.o, powerpc-32l.c): ... these new rules.
10588         (powerpc-32.o, powerpc-32.c): Remove, replace by ...
10589         (powerpc-altivec32l.o, powerpc-altivec32l.c): ... these new rules.
10590         (powerpc-e500.o, powerpc-e500.c): Remove, replace by ...
10591         (powerpc-e500l.o, powerpc-e500l.c): ... these new rules.
10592         (reg-ppc64.o, reg-ppc64.c): Remove, replace by ...
10593         (powerpc-64l.o, powerpc-64l.c): ... these new rules.
10594         (powerpc-64.o, powerpc-64.c): Remove, replace by ...
10595         (powerpc-altivec64l.o, powerpc-altivec64l.c): ... these new rules.
10596         (clean): Update.
10597
10598         * linux-ppc-low.c (init_registers_ppc): Remove, replace by ...
10599         (init_registers_powerpc_32l): ... this new prototype.
10600         (init_registers_powerpc_32): Remove, replace by ...
10601         (init_registers_powerpc_altivec32l): ... this new prototype.
10602         (init_registers_powerpc_e500): Remove, replace by ...
10603         (init_registers_powerpc_e500l): ... this new prototype.
10604         (init_registers_ppc64): Remove, replace by ...
10605         (init_registers_powerpc_64l): ... this new prototype.
10606         (init_registers_powerpc_64): Remove, replace by ...
10607         (init_registers_powerpc_altivec64l): ... this new prototype.
10608         (ppc_num_regs): Set to 73.
10609         (PT_ORIG_R3, PT_TRAP): Define if necessary.
10610         (ppc_regmap, ppc_regmap_e500): Add values for orig_r3 and trap.
10611         (ppc_cannot_store_register): Handle orig_r3 and trap.
10612         (ppc_arch_setup): Update init_registers_... calls.
10613         (ppc_fill_gregset): Handle orig_r3 and trap.
10614
10615         * inferiors.c (clear_inferiors): Reset current_inferior.
10616
10617 2008-04-23  Paolo Bonzini  <bonzini@gnu.org>
10618
10619         * acinclude.m4: Add override.m4.
10620         * configure: Regenerate.
10621
10622 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10623
10624         * linux-ppc-low.c (ppc_arch_setup): Reset ppc_hwcap after the
10625         initial call to init_register_ppc64.
10626
10627 2008-04-21  Ulrich Weigand  <uweigand@de.ibm.com>
10628
10629         * configure.srv (powerpc64-*-linux*, powerpc-*-linux*): Merge into
10630         single powerpc*-*-linux* case.
10631         (s390-*-linux*, s390x-*-linux*): Merge into single s390*-*-linux* case.
10632
10633 2008-04-17  Ulrich Weigand  <uweigand@de.ibm.com>
10634
10635         * configure.srv [powerpc64-*-linux*]: Remove powerpc-e500.o from
10636         srv_regobj.  Remove rs6000/powerpc-e500.xml and rs6000/power-spe.xml
10637         from reg_xmlfiles.
10638         * linux-ppc-low.c: Include <elf.h>.
10639         (PPC_FEATURE_HAS_ALTIVEC, PPC_FEATURE_HAS_SPE): Define.
10640         (ppc_hwcap): New global variable.
10641         (ppc_regmap): Remove __SPE__ #ifdef sections.
10642         (ppc_regmap_e500): New global variable.
10643         (ppc_cannot_store_register): Update __SPE__ special case.
10644         (ppc_get_hwcap): New function.
10645         (ppc_arch_setup): Use it to determine whether inferior supports
10646         AltiVec or SPE registers.  Set the_low_target.regmap if appropriate.
10647         (ppc_fill_vrregset, ppc_store_vrregset): Define unconditionally.
10648         Do not access registers if target does not support AltiVec.
10649         (ppc_fill_evrregset, ppc_store_evrregset): Define unconditionally.
10650         Do not access registers if target does not support SPE.
10651         (target_regsets): Unconditionally include AltiVec and SPE regsets.
10652
10653 2008-04-17  Daniel Jacobowitz  <dan@codesourcery.com>
10654
10655         * linux-low.c (disabled_regsets, num_regsets): New.
10656         (use_regsets_p): Delete.
10657         (linux_wait_for_process): Clear disabled_regsets.
10658         (regsets_fetch_inferior_registers): Check and set it.
10659         (regsets_store_inferior_registers): Likewise.
10660         (linux_fetch_registers, linux_store_registers): Do not use
10661         use_regsets_p.
10662         (initialize_low): Allocate disabled_regsets.
10663
10664 2008-04-14  Daniel Jacobowitz  <dan@codesourcery.com>
10665
10666         * Makefile.in (LIBOBJS): New.
10667         (OBS): Use LIBOBJS.
10668         (memmem.o): New rule.
10669         * configure.ac: Use AC_CONFIG_LIBOBJ_DIR and check for memmem.
10670         * configure: Regenerated.
10671
10672 2008-04-04  Ulrich Weigand  <uweigand@de.ibm.com>
10673
10674         * server.c (handle_query): Never return "unsupported" for
10675         qXfer:features:read queries.
10676
10677 2008-03-27  Ulrich Weigand  <uweigand@de.ibm.com>
10678
10679         * server.c (get_features_xml): Fix inverted condition.
10680         (handle_query): Always support qXfer:feature:read.
10681
10682 2008-03-10  Daniel Jacobowitz  <dan@codesourcery.com>
10683
10684         * server.c (wrapper_argv): New.
10685         (start_inferior): Handle wrapper_argv.  If set, expect an extra
10686         trap.
10687         (gdbserver_usage): Document --wrapper.
10688         (main): Parse --wrapper.
10689
10690 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10691
10692         * configure.srv [powerpc64-*-linux*]: Add all files mentioned for
10693         powerpc-*-linux* to srv_regobj and reg_xmlfiles.
10694         * linux-ppc-low.c (ppc_get_pc): Support bi-arch operation.
10695         (ppc_set_pc): Likewise.
10696         (ppc_arch_setup): New function.
10697         (ppc_fill_gregset): Call ppc_collect_ptrace_register instead
10698         of collect_register.
10699         (the_low_target): Use ppc_arch_setup as arch_setup initializer.
10700
10701 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10702
10703         * configure.srv [powerpc64-*-linux*]: Use linux-ppc-low.o
10704         instead of linux-ppc64-low.o.
10705         * linux-ppc64-low.c: Remove file.
10706         * Makefile.in (SFILES): Remove linux-ppc64-low.c.
10707         (linux-ppc64-low.o): Remove rule.
10708
10709         * linux-ppc-low.c (init_registers_ppc64): Add prototype.
10710         (init_registers_powerpc_64): Likewise.
10711         (ppc_regmap): Conditionally define depending on __powerpc64__.
10712         (ppc_cannot_store_register): Do not special-case "fpscr" when
10713         compiled on __powerpc64__.
10714         (ppc_collect_ptrace_register): New function.
10715         (ppc_supply_ptrace_register): New function.
10716         (ppc_breakpoint): Change type to "unsigned int".
10717         (ppc_breakpoint_at): Change type of "insn" to "unsigned int".
10718         (the_low_target): Conditionally provide initializers for the
10719         arch_setup member depending on __powerpc64__.  Install
10720         collect_ptrace_register and supply_ptrace_register members.
10721
10722 2008-02-28  Ulrich Weigand  <uweigand@de.ibm.com>
10723
10724         * regcache.h (gdbserver_xmltarget): Add extern declaration.
10725         * server.c (gdbserver_xmltarget): Define.
10726         (get_features_xml): Use it to replace "target.xml" and arch_string.
10727
10728         * configure.srv: Remove srv_xmltarget.  Add XML files that were
10729         mentioned there to srv_xmlfiles instead.  Remove conditional tests
10730         on gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe; set
10731         srv_xmlfiles and srv_regobj to include all possible choices.
10732         * configure.ac (srv_xmltarget): Remove.
10733         (srv_xmlfiles): Do not add "target.xml".
10734         (gdb_cv_arm_iwmmxt, gdb_cv_ppc_altivec, gdb_cv_ppc_spe): Remove
10735         checks for supplementary target information.
10736         * configure: Regenerate.
10737         * Makefile.in (XML_TARGET): Remove.
10738         (target.xml): Remove rule.
10739         (clean): Do not clean up target.xml.
10740         (.PRECIOUS): Do not mention target.xml.
10741
10742         * target.h (struct target_ops): Remove arch_string member.
10743         * linux-low.c (linux_arch_string): Remove.
10744         (linux_target_ops): Remove arch_string initializer.
10745         * linux-low.h (struct linux_target_ops): Remove arch_string member.
10746         * linux-i386-low.c (the_low_target): Remove arch_string initializer.
10747         * linux-x86-64-low.c (the_low_target): Remove arch_string initializer.
10748         * spu-low.c (spu_arch_string): Remove.
10749         (spu_target_ops): Remove arch_string initializer.
10750         * win32-low.c (win32_arch_string): Remove.
10751         (win32_target_ops): Remove arch_string initializer.
10752         * win32-low.h (struct win32_target_ops): Remove arch_string member.
10753         * win32-arm-low.c (the_low_target): Remove arch_string initializer.
10754         * win32-i368-low.c (the_low_target): Remove arch_string initializer.
10755
10756 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10757
10758         * linux-low.h (struct linux_target_ops): Replace left_pad_xfer field
10759         by collect_ptrace_register and supply_ptrace_register hooks.
10760         * linux-low.c (fetch_register): Use supply_ptrace_register callback
10761         instead of checking for the_low_target.left_pad_xfer.
10762         (usr_store_inferior_registers): Use collect_ptrace_register callback
10763         instead of checking for the_low_target.left_pad_xfer.
10764
10765         * linux-s390-low.c (s390_collect_ptrace_register): New function.
10766         (s390_supply_ptrace_register): Likewise.
10767         (s390_fill_gregset): Call s390_collect_ptrace_register.
10768         (the_low_target): Update.
10769
10770         * linux-ppc64-low.c (ppc_collect_ptrace_register): New function.
10771         (ppc_supply_ptrace_register): Likewise.
10772         (the_low_target): Update.
10773
10774         * linux-i386-low.c (the_low_target): Update.
10775         * linux-x86-64-low.c (the_low_target): Update.
10776
10777 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10778
10779         * configure.srv [s390x-*-linux*]: Set srv_regobj to include both
10780         reg-s390.o and reg-s390x.o.
10781
10782         * linux-low.c (new_inferior): New global variable.
10783         (linux_create_inferior, linux_attach): Set it.
10784         (linux_wait_for_process): Call the_low_target.arch_setup after the
10785         target has stopped for the first time.
10786         (initialize_low): Do not call the_low_target.arch_setup.
10787
10788         * linux-s390-low.c (s390_get_pc): Support bi-arch operation.
10789         (s390_set_pc): Likewise.
10790         (s390_arch_setup): New function.
10791         (the_low_target): Use s390_arch_setup as arch_setup routine.
10792
10793         * regcache.c (realloc_register_cache): New function.
10794         (set_register_cache): Call it for each existing regcache.
10795
10796 2008-02-27  Ulrich Weigand  <uweigand@de.ibm.com>
10797
10798         * server.h (init_registers): Remove prototype.
10799
10800         * linux-low.h (struct linux_target_ops): Add arch_setup field.
10801         * linux-low.c (initialize_low): Call the_low_target.arch_setup ()
10802         instead of init_registers ().
10803         * linux-arm-low.c (init_registers_arm): Add prototype.
10804         (init_registers_arm_with_iwmmxt): Likewise.
10805         (the_low_target): Add initializer for arch_setup field.
10806         * linux-cris-low.c (init_registers_cris): Add prototype.
10807         (the_low_target): Add initializer for arch_setup field.
10808         * linux-crisv32-low.c (init_registers_crisv32): Add prototype.
10809         (the_low_target): Add initializer for arch_setup field.
10810         * linux-i386-low.c (init_registers_i386_linux): Add prototype.
10811         (the_low_target): Add initializer for arch_setup field.
10812         * linux-ia64-low.c (init_registers_ia64): Add prototype.
10813         (the_low_target): Add initializer for arch_setup field.
10814         * linux-m32r-low.c (init_registers_m32r): Add prototype.
10815         (the_low_target): Add initializer for arch_setup field.
10816         * linux-m68k-low.c (init_registers_m68k): Add prototype.
10817         (the_low_target): Add initializer for arch_setup field.
10818         * linux-mips-low.c (init_registers_mips_linux): Add prototype.
10819         (init_registers_mips64_linux): Likewise.
10820         (the_low_target): Add initializer for arch_setup field.
10821         * linux-ppc-low.c (init_registers_ppc): Add prototype.
10822         (init_registers_powerpc_32, init_registers_powerpc_e500): Likewise.
10823         (the_low_target): Add initializer for arch_setup field.
10824         * linux-ppc64-low.c (init_registers_ppc64): Add prototype.
10825         (init_registers_powerpc_64): Likewise.
10826         (the_low_target): Add initializer for arch_setup field.
10827         * linux-s390-low.c (init_registers_s390): Add prototype.
10828         (init_registers_s390x): Likewise.
10829         (the_low_target): Add initializer for arch_setup field.
10830         * linux-sh-low.c (init_registers_sh): Add prototype.
10831         (the_low_target): Add initializer for arch_setup field.
10832         * linux-x86-64-low.c (init_registers_x86_64_linux): Add prototype.
10833         (the_low_target): Add initializer for arch_setup field.
10834         * linux-xtensa-low.c (init_registers_xtensa): Add prototype.
10835         (the_low_target): Add initializer for arch_setup field.
10836
10837         * win32-low.h (struct win32_target_ops): Add arch_setup field.
10838         * win32-low.c (initialize_low): Call the_low_target.arch_setup ()
10839         instead of init_registers ().
10840         * win32-arm-low.c (init_registers_arm): Add prototype.
10841         (the_low_target): Add initializer for arch_setup field.
10842         * win32-i386-low.c (init_registers_i386): Add prototype.
10843         (the_low_target): Add initializer for arch_setup field.
10844
10845         * spu-low.c (init_registers_spu): Add prototype.
10846         (initialize_low): Call initialie_registers_spu () instead of
10847         initialize_registers ().
10848
10849 2008-02-19  Pedro Alves  <pedro@codesourcery.com>
10850
10851         * server.c (handle_v_requests): When handling the vRun and vAttach
10852         packets, if already debugging a process, don't kill it.  Return an
10853         error instead.
10854
10855 2008-02-17  Daniel Jacobowitz  <dan@codesourcery.com>
10856
10857         * server.c (handle_query): Correct length check.
10858
10859 2008-02-14  Pedro Alves  <pedro_alves@portugalmail.pt>
10860
10861         * win32-low.c (do_initial_child_stuff): Add process handle
10862         parameter.  Set current_process_handle and current_process_id from the
10863         parameters. Clear globals.
10864         (win32_create_inferior): Don't set current_process_handle and
10865         current_process_id here.  Instead pass them on the call to
10866         do_initial_child_stuff.
10867         (win32_attach): Likewise.
10868         (win32_clear_inferiors): New.
10869         (win32_kill): Don't close the current process handle or the
10870         current thread handle here.  Instead call win32_clear_inferiors.
10871         (win32_detach): Don't open a new handle to the process.  Call
10872         win32_clear_inferiors.
10873         (win32_join): Don't rely on current_process_handle; open a new
10874         handle using the process id.
10875         (win32_wait): Call win32_clear_inferiors when the inferior process
10876         has exited.
10877
10878 2008-02-14  Daniel Jacobowitz  <dan@codesourcery.com>
10879
10880         * server.c (monitor_show_help): Add "exit".
10881
10882 2008-02-11  Maxim Grigoriev  <maxim2405@gmail.com>
10883
10884         * Makefile.in (SFILES): Add linux-xtensa-low.c.
10885         (clean): Add reg-xtensa.c.
10886         (linux-xtensa-low.o, reg-xtensa.o, reg-xtensa.c): New dependencies.
10887         * configure.srv (xtensa*-*-linux*) New target.
10888         * linux-xtensa-low.c: New.
10889         * xtensa-xtregs.c: New.
10890
10891 2008-02-01  Pedro Alves  <pedro_alves@portugalmail.pt>
10892
10893         * hostio.c: Don't include errno.h.
10894         (errno_to_fileio_errno): Move to hostio-errno.
10895         * hostio.c: (hostio_error): Remove the error parameter.  Defer the
10896         error number outputting to the target->hostio_last_error callback.
10897         (hostio_packet_error): Use FILEIO_EINVAL directly.
10898         (handle_open, handle_pread, hostio_error, handle_unlink): Update
10899         calls to hostio_error.
10900         * hostio-errno.c: New.
10901         * server.h (hostio_last_error_from_errno): Declare.
10902         * target.h (target_ops): Add hostio_last_error member.
10903         * linux-low.c (linux_target_op): Register hostio_last_error_from_errno
10904         as hostio_last_error handler.
10905         * spu-low.c (spu_target_ops): Likewise.
10906         * win32-low.c [_WIN32_WCE] (win32_error_to_fileio_error)
10907         (wince_hostio_last_error): New functions.
10908         (win32_target_ops) [_WIN32_WCE]: Register wince_hostio_last_error
10909         as hostio_last_error handler.
10910         (win32_target_ops) [!_WIN32_WCE]: Register
10911         hostio_last_error_from_errno as hostio_last_error handler.
10912         * Makefile.in (SFILES): Add hostio.c and hostio-errno.c.
10913         (hostio-errno.o): New rule.
10914         * configure.ac (GDBSERVER_DEPFILES): Add $srv_hostio_err_objs.
10915         * configure.srv (srv_hostio_err_objs): New variable.  Default to
10916         hostio-errno.o.
10917         (arm*-*-mingw32ce*): Set srv_hostio_err_objs to "".
10918         * configure: Regenerate.
10919
10920 2008-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
10921
10922         * linux-low.c (linux_attach_lwp): Do not _exit after errors.
10923         (linux_kill, linux_detach): Clean up the process list.
10924         * remote-utils.c (remote_open): Improve port number parsing.
10925         (putpkt_binary, input_interrupt): Only send interrupts if the target
10926         is running.
10927         * server.c (extended_protocol): Make static.
10928         (attached): Define earlier.
10929         (exit_requested, response_needed, program_argv): New variables.
10930         (target_running): New.
10931         (start_inferior): Clear attached here.
10932         (attach_inferior): Set attached here.
10933         (require_running): Define.
10934         (handle_query): Use require_running and target_running.  Implement
10935         "monitor exit".
10936         (handle_v_attach, handle_v_run): New.
10937         (handle_v_requests): Use require_running.  Handle vAttach and vRun.
10938         (gdbserver_usage): Update.
10939         (main): Redo argument parsing.  Handle --debug and --multi.  Handle
10940         --attach along with other options or after the port.  Save
10941         program_argv.  Support no initial program.  Resynchronize
10942         communication with GDB after an error.  Handle "monitor exit".
10943         Use require_running and target_running.  Always allow the extended
10944         protocol.  Do not error out for Hc0 or Hc-1.  Do not automatically
10945         restart in extended mode.
10946         * README: Refer to the GDB manual.  Update --attach usage.
10947
10948 2007-12-20  Andreas Schwab  <schwab@suse.de>
10949
10950         * linux-low.c (STACK_SIZE): Define.
10951         (linux_tracefork_child): Use it.  Use __clone2 on ia64.
10952         (linux_test_for_tracefork): Likewise.
10953
10954 2007-12-18  Daniel Jacobowitz  <dan@codesourcery.com>
10955
10956         * linux-low.c (linux_wait_for_event): Update messages.  Do not
10957         reinsert auto-delete breakpoints.
10958         * mem-break.c (struct breakpoint): Change return type of handler to
10959         int.
10960         (set_breakpoint_at): Update handler type.
10961         (reinsert_breakpoint_handler): Return 1 instead of calling
10962         delete_breakpoint.
10963         (reinsert_breakpoint_by_bp): Check for the original breakpoint before
10964         setting a new one.
10965         (check_breakpoints): Delete auto-delete breakpoints and return 2.
10966         * mem-break.h (set_breakpoint_at): Update handler type.
10967         * thread-db.c (thread_db_create_event, thread_db_create_event): Update.
10968         * win32-low.c (auto_delete_breakpoint): New.
10969         (get_child_debug_event): Use it.
10970
10971 2007-12-16  Daniel Jacobowitz  <dan@codesourcery.com>
10972
10973         * configure.ac: Check for pread and pwrite.
10974         * hostio.c (handle_pread): Fall back to lseek and read.
10975         (handle_pwrite): Fall back to lseek and write.
10976         * config.in, configure: Regenerated.
10977
10978 2007-12-07  Daniel Jacobowitz  <dan@codesourcery.com>
10979
10980         * server.c (myresume): Add own_buf argument.
10981         (main): Update calls.
10982
10983 2007-12-06  Daniel Jacobowitz  <dan@codesourcery.com>
10984
10985         * linux-low.c (linux_wait, linux_resume): Do not handle async I/O.
10986         * remote-utils.c (remote_open): Do not call disable_async_io.
10987         (block_async_io): Delete.
10988         (unblock_async_io): Make static.
10989         (initialize_async_io): New.
10990         * server.c (handle_v_cont): Handle async I/O here.
10991         (myresume): Likewise.  Move other common resume tasks here...
10992         (main): ... from here.  Call initialize_async_io.  Disable async
10993         I/O before the main loop.
10994         * server.h (initialize_async_io): Declare.
10995         (block_async_io, unblock_async_io): Delete prototypes.
10996         * spu-low.c (spu_resume, spu_wait): Do not handle async I/O here.
10997
10998 2007-12-06  Mick Davis  <mickd@goanna.iinet.net.au>
10999
11000         * remote-utils.c (readchar): Allow binary data in received messages.
11001
11002 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11003
11004         * win32-low.c (attaching): New global.
11005         (win32_create_inferior): Clear the `attaching' global.
11006         (win32_attach): Set the `attaching' global.
11007         (get_child_debug_event) [_WIN32_WCE]: Stop the inferior when
11008         attaching.  Only set a breakpoint at the entry point if not
11009         attaching.
11010
11011 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11012
11013         * server.c (main): Don't report dll events on the initial
11014         connection on attaches.
11015
11016 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11017
11018         * server.c (main): Relax numerical bases supported for the pid of
11019         the --attach command line argument.
11020
11021 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11022
11023         * win32-low.c (win32_attach): Call OpenProcess before
11024         DebugActiveProcess, not after.  Add last error output to error
11025         call.
11026
11027 2007-12-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11028
11029         * win32-low.c (win32_get_thread_context)
11030         (win32_set_thread_context): New functions.
11031         (thread_rec): Use win32_get_thread_context.
11032         (continue_one_thread, win32_resume): Use win32_set_thread_context.
11033         * win32-low.h (win32_thread_info) [_WIN32_WCE]: Add `base_context'
11034         field.
11035
11036 2007-12-03  Leo Zayas
11037             Pedro Alves  <pedro_alves@portugalmail.pt>
11038
11039         * win32-low.c (soft_interrupt_requested, faked_breakpoint): New
11040         global variables.
11041         (child_add_thread): Minor cleanup.
11042         (child_continue): Resume artificially suspended threads before
11043         calling ContinueDebugEvent.
11044         (suspend_one_thread): New.
11045         (fake_breakpoint_event): New.
11046         (get_child_debug_event): Change return type to int.  Check here if
11047         gdb sent an interrupt request.  If a soft interrupt was requested,
11048         fake a breakpoint event.  Return 0 if there is no event to handle,
11049         and 1 otherwise.
11050         (win32_wait): Don't check here if gdb sent an interrupt request.
11051         Ensure there is a valid event to handle.
11052         (win32_request_interrupt): Add soft interruption method as last
11053         resort.
11054
11055 2007-12-03  Leo Zayas
11056             Pedro Alves  <pedro_alves@portugalmail.pt>
11057
11058         * win32-low.h (win32_thread_info): Add descriptions to the
11059         structure members.  Replace `suspend_count' counter by a
11060         `suspended' flag.
11061         * win32-low.c (thread_rec): Update condition of when to get the
11062         context from the inferior.  Rely on ContextFlags being set if it
11063         has already been retrieved.  Only suspend the inferior thread if
11064         we haven't already.  Warn if that fails.
11065         (continue_one_thread): s/suspend_count/suspended/.  Only call
11066         ResumeThread once.  Warn if that fails.
11067
11068 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11069
11070         * win32-low.c (win32_wait): Don't read from the inferior when it
11071         has already exited.
11072
11073 2007-12-02  Pedro Alves  <pedro_alves@portugalmail.pt>
11074
11075         * Makefile.in (win32_low_h): New variable.
11076         (win32-low.o): Add dependency on $(win32_low_h).
11077         (win32-arm-low.o, win32-i386-low.o): New rules.
11078
11079 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11080
11081         * hostio.c: Correct copyright year.
11082
11083 2007-11-30  Daniel Jacobowitz  <dan@codesourcery.com>
11084
11085         * Makefile.in (OBS): Add hostio.o.
11086         (hostio.o): New rule.
11087         * server.h (handle_vFile): Declare.
11088         * hostio.c: New file.
11089         * server.c (handle_v_requests): Take packet_len and new_packet_len
11090         for binary packets.  Call handle_vFile.
11091         (main): Update call to handle_v_requests.
11092
11093 2007-11-05  Daniel Jacobowitz  <dan@codesourcery.com>
11094
11095         * linux-low.c: Include <sched.h>.
11096
11097 2007-11-01  Daniel Jacobowitz  <dan@codesourcery.com>
11098
11099         * linux-low.c (linux_tracefork_grandchild): New.
11100         (linux_tracefork_child): Use clone.
11101         (linux_test_for_tracefork): Use clone; allocate and free a stack.
11102
11103 2007-10-31  Joel Brobecker  <brobecker@adacore.com>
11104
11105         * Makefile.in: Use $(SHELL) instead of "sh" to call regdat.sh.
11106
11107 2007-10-24  Daniel Jacobowitz  <dan@codesourcery.com>
11108
11109         * linux-low.c (handle_extended_wait): Handle unexpected signals.
11110
11111 2007-10-23  Daniel Jacobowitz  <dan@codesourcery.com>
11112
11113         * inferiors.c (change_inferior_id): Delete.
11114         (add_pid_to_list, pull_pid_from_list): New.
11115         * linux-low.c (PTRACE_SETOPTIONS, PTRACE_GETEVENTMSG)
11116         (PTRACE_O_TRACESYSGOOD, PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
11117         (PTRACE_O_TRACECLONE, PTRACE_O_TRACEEXEC, PTRACE_O_TRACEVFORKDONE)
11118         (PTRACE_O_TRACEEXIT, PTRACE_EVENT_FORK, PTRACE_EVENT_VFORK)
11119         (PTRACE_EVENT_CLONE, PTRACE_EVENT_EXEC, PTRACE_EVENT_VFORK_DONE)
11120         (PTRACE_EVENT_EXIT, __WALL): Provide default definitions.
11121         (stopped_pids, thread_db_active, must_set_ptrace_flags): New variables.
11122         (using_threads): Always set to 1.
11123         (handle_extended_wait): New.
11124         (add_process): Do not set TID.
11125         (linux_create_inferior): Set must_set_ptrace_flags.
11126         (linux_attach_lwp): Remove TID argument.  Do not check using_threads.
11127         Use PTRACE_SETOPTIONS.  Call new_thread_notify.  Update all callers.
11128         (linux_thread_alive): Rename TID argument to LWPID.
11129         (linux_wait_for_process): Handle unknown processes.  Do not use TID.
11130         (linux_wait_for_event): Do not use TID or check using_threads.  Update
11131         call to dead_thread_notify.  Call handle_extended_wait.
11132         (linux_create_inferior): Use PTRACE_SETOPTIONS.
11133         (send_sigstop): Delete sigstop_sent.
11134         (wait_for_sigstop): Avoid TID.
11135         (linux_supports_tracefork_flag, linux_tracefork_child, my_waitpid)
11136         (linux_test_for_tracefork): New.
11137         (linux_lookup_signals): Use thread_db_active and
11138         linux_supports_tracefork_flag.
11139         (initialize_low): Use thread_db_active and linux_test_for_tracefork.
11140         * linux-low.h (get_process_thread): Avoid TID.
11141         (struct process_ifo): Move thread_known and tid to the end.  Remove
11142         sigstop_sent.
11143         (linux_attach_lwp, thread_db_init): Update prototypes.
11144         * server.h (change_inferior_id): Delete prototype.
11145         (add_pid_to_list, pull_pid_from_list): New prototypes.
11146         * thread-db.c (thread_db_use_events): New.
11147         (find_first_thread): Rename to...
11148         (find_one_thread): ...this.  Update callers and messages.  Do not
11149         call fatal.  Check thread_db_use_events.  Do not call
11150         change_inferior_id or new_thread_notify.
11151         (maybe_attach_thread): Update.  Do not call new_thread_notify.
11152         (thread_db_init): Set thread_db_use_events.  Check use_events.
11153         * utils.c (fatal, warning): Correct message prefix.
11154
11155 2007-10-15  Daniel Jacobowitz  <dan@codesourcery.com>
11156
11157         * Makefile.in (clean): Remove new files.
11158         (powerpc-32.o, powerpc-32.c, powerpc-e500.o, powerpc-e500.c)
11159         (powerpc-64.o, powerpc-64.c): New rules.
11160         * configure.srv: Use alternate register sets for powerpc64-*-linux*
11161         with AltiVec, powerpc-*-linux* with AltiVec, and powerpc-*-linux*
11162         with SPE.
11163         * linux-ppc-low.c (ppc_regmap): Do not fetch the FP registers for
11164         SPE targets.
11165         (ppc_cannot_store_register): Do not check for FPSCR for SPE targets.
11166         (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, ppc_fill_vrregset)
11167         (ppc_store_vrregset, PTRACE_GETEVRREGS, PTRACE_SETEVRREGS)
11168         (struct gdb_evrregset_t, ppc_fill_evrregset, ppc_store_evrregset): New.
11169         (target_regsets): Add AltiVec and SPE register sets.
11170         * configure.ac: Check for AltiVec and SPE.
11171         * linux-ppc64-low.c (PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS)
11172         (ppc_fill_vrregset, ppc_store_vrregset): New.
11173         (target_regsets): Add AltiVec register set.
11174         * configure: Regenerated.
11175
11176 2007-09-19  Daniel Jacobowitz  <dan@codesourcery.com>
11177
11178         * linux-low.c (O_LARGEFILE): Define.
11179         (linux_read_memory): Use /proc/PID/mem.
11180         * configure.ac: Use AC_GNU_SOURCE.  Check for pread64.
11181         * configure, config.in: Regenerated.
11182
11183 2007-09-04  Daniel Jacobowitz  <dan@codesourcery.com>
11184
11185         * linux-low.c (linux_wait_for_event): Do not pass signals while
11186         single-stepping.
11187
11188 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11189
11190         * win32-low.c (create_process): New.
11191         (win32_create_inferior): Use create_process instead of
11192         CreateProcess.  If create_process failed retry appending an ".exe"
11193         suffix.  Store the GetLastError result immediatelly after
11194         create_process calls and use it on the call to error.
11195
11196 2007-09-03  Pedro Alves  <pedro_alves@portugalmail.pt>
11197
11198         * win32-low.c (handle_load_dll): Don't use toolhelp when waiting.
11199
11200 2007-08-23  Joel Brobecker  <brobecker@adacore.com>
11201
11202         * configure.ac: Switch license to GPLv3.
11203
11204 2007-08-01  Michael Snyder  <msnyder@access-company.com>
11205
11206         * remote-utils.c (putpkt_binary): Memory leak, free buf2.
11207
11208 2007-07-31  Pedro Alves  <pedro_alves@portugalmail.pt>
11209
11210         * win32-low.c (winapi_CloseToolhelp32Snapshot) [_WIN32_WCE]: New
11211         typedef.
11212         (win32_CloseToolhelp32Snapshot) [_WIN32_WCE]: New global var.
11213         (load_toolhelp) [_WIN32_WCE]: Load TOOLHELP.DLL.  Get
11214         CloseToolhelp32Snapshot.
11215         (toolhelp_get_dll_name) [_WIN32_WCE]: Close the snapshot with
11216         CloseToolhelp32Snapshot.
11217
11218 2007-07-27  Michael Snyder  <michael.snyder@access-company.com>
11219
11220         * server.c (main): Check for inferior exit before main loop.
11221
11222 2007-07-18  Pedro Alves  <pedro_alves@portugalmail.pt>
11223
11224         * remote-utils.c (remote_open): Set SO_KEEPALIVE on remote_desc
11225         instead of on tmp_desc.
11226
11227 2007-07-17  Pedro Alves  <pedro_alves@portugalmail.pt>
11228             Daniel Jacobowitz  <dan@codesourcery.com>
11229
11230         * inferiors.c (all_dlls, dlls_changed, get_dll): New.
11231         (add_thread): Minor cleanups.
11232         (clear_inferiors): Move lower in the file.  Clear the DLL
11233         list.
11234         (free_one_dll, match_dll, loaded_dll, unloaded_dll, clear_list): New.
11235         * remote-utils.c (prepare_resume_reply): Check dlls_changed.
11236         (xml_escape_text): New.
11237         * server.c (handle_query): Handle qXfer:libraries:read.  Report it
11238         for qSupported.
11239         (handle_v_cont): Report errors.
11240         (gdbserver_version): Update.
11241         (main): Correct size of own_buf.  Do not report initial DLL events.
11242         * server.h (struct dll_info, all_dlls, dlls_changed, loaded_dll)
11243         (unloaded_dll, xml_escape_text): New.
11244         * win32-low.c (enum target_waitkind): Update comments.
11245         (win32_add_one_solib, get_image_name, winapi_EnumProcessModules)
11246         (winapi_GetModuleInformation, winapi_GetModuleFileNameExA)
11247         (win32_EnumProcessModules, win32_GetModuleInformation)
11248         (win32_GetModuleFileNameExA, load_psapi, psapi_get_dll_name)
11249         (winapi_CreateToolhelp32Snapshot, winapi_Module32First)
11250         (winapi_Module32Next, win32_CreateToolhelp32Snapshot)
11251         (win32_Module32First, win32_Module32Next, load_toolhelp)
11252         (toolhelp_get_dll_name, handle_load_dll, handle_unload_dll): New.
11253         (get_child_debug_event): Handle DLL events.
11254         (win32_wait): Likewise.
11255
11256 2007-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11257
11258         * configure.srv: Set srv_linux_regsets for sh*-*-linux*.
11259         * linux-sh-low.c (sh_fill_gregset, target_regsets): New.
11260
11261 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11262
11263         * win32-low.c (handle_output_debug_string): Ignore event if not
11264         waiting.
11265
11266 2007-07-08  Pedro Alves  <pedro_alves@portugalmail.pt>
11267
11268         * win32-arm-low.c (arm_wince_breakpoint): Fix typo.
11269
11270 2007-07-03  Daniel Jacobowitz  <dan@codesourcery.com>
11271
11272         * remote-utils.c (look_up_one_symbol): Handle 'm' packets.
11273
11274 2007-07-02  Daniel Jacobowitz  <dan@codesourcery.com>
11275
11276         * inferiors.c (change_inferior_id): Add comment.
11277         * linux-low.c (check_removed_breakpoint): Add an early
11278         prototype.  Improve debug output.
11279         (linux_attach): Doc update.
11280         (linux_detach_one_process, linux_detach): Clean up before releasing
11281         each process.
11282         (send_sigstop, wait_for_sigstop): Improve comments and debug output.
11283         * linux-low.h (struct process_info): Doc improvement.
11284         * mem-break.c (delete_all_breakpoints): New.
11285         * mem-break.h (delete_all_breakpoints): New prototype.
11286         * thread-db.c (find_first_thread): New.
11287         (thread_db_create_event): Call it instead of
11288         thread_db_find_new_threads.  Clean up unused variables.
11289         (maybe_attach_thread): Remove first thread handling.
11290         (thread_db_find_new_threads): Use find_first_thread.
11291         (thread_db_get_tls_address): Likewise.
11292
11293 2007-06-27  Daniel Jacobowitz  <dan@codesourcery.com>
11294
11295         * thread-db.c (thread_db_find_new_threads): Add prototype.
11296         (thread_db_create_event): Check for the main thread before adding
11297         a new thread.
11298         (maybe_attach_thread): Only enable event reporting if TID == 0.
11299         (thread_db_get_tls_address): Check for new threads.
11300
11301 2007-06-20  Daniel Jacobowitz  <dan@codesourcery.com>
11302
11303         * linux-low.c (linux_create_inferior): Try execv before execvp.
11304         * spu-low.c (spu_create_inferior): Likewise.
11305
11306 2007-06-13  Mike Frysinger  <vapier@gentoo.org>
11307
11308         * linux-low.c (linux_create_inferior): Change execv to execvp.
11309         * spu-low.c (spu_create_inferior): Likewies.
11310
11311 2007-06-13  Daniel Jacobowitz  <dan@codesourcery.com>
11312
11313         * Makefile.in (clean): Clean new files instead of deleted ones.
11314         (reg-mips.o, reg-mips.c, reg-mips64.o, reg-mips64.c): Delete.
11315         (mips-linux.o, mips-linux.c, mips64-linux.o, mips64-linux.c): New
11316         rules.
11317         * configure.srv: Specify XML files and new regformats for MIPS and
11318         MIPS64 GNU/Linux.
11319         * linux-mips-low.c (mips_num_regs): Set to only used registers.
11320         (mips_regmap): Do not fetch $0.  Remove unused registers.  Add
11321         an entry for the restart register.
11322         (mips_cannot_fetch_register, mips_cannot_store_register)
11323         (mips_reinsert_addr, mips_fill_fpregset, mips_store_fpregset): Update
11324         register names to match the XML descriptions.
11325         (mips_fill_gregset, mips_store_gregset): Likewise.  Handle the
11326         restart register instead of $0.
11327
11328 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11329             Markus Deuling  <deuling@de.ibm.com>
11330
11331         * remote-utils.c (decode_xfer_write): New function.
11332         * server.h (decode_xfer_write): Add prototype.
11333         * server.c (handle_query): Add PACKET_LEN argument.  Support
11334         qXfer:spu:read and qXfer:spu:write packets.
11335         (main): Pass packet_len to handle_query.
11336         * spu-low.c (spu_target_ops): Add spu_proc_xfer_spu.
11337         * target.h (target_ops): Add qxfer_spu.
11338
11339 2007-06-12  Ulrich Weigand  <uweigand@de.ibm.com>
11340
11341         * spu-low.c (spu_proc_xfer_spu): Do not return failure when
11342         accessing non-seekable spufs files.
11343
11344 2007-05-16  Markus Deuling  <deuling@de.ibm.com>
11345
11346         * server.c (handle_query): Add reply for qC packet.
11347
11348 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11349             Leo Zayas  <lerele@champenstudios@com>
11350
11351         * server.h (check_remote_input_interrupt_request): New function.
11352         * remote_utils.c (INVALID_DESCRIPTOR): New define.
11353         (remote_desc): Initialize with INVALID_DESCRIPTOR.
11354         (input_interrupt): Expose on USE_WIN32API too.  Fix whitespace.
11355         (check_remote_input_interrupt_request): New function.
11356         * server.h (check_remote_input_interrupt_request): Declare.
11357         * win32-low.c (winapi_DebugBreakProcess,
11358         winapi_GenerateConsoleCtrlEvent): New typedefs.
11359         (get_child_debug_event): Lower Win32 debug event polling from 1 sec
11360         to 250 ms.
11361         (win32_wait): Check for remote interrupt request
11362         with check_remote_input_interrupt_request.
11363         (win32_request_interrupt): New function.
11364         (win32_target_op): Set request_interrupt to win32_request_interrupt.
11365
11366 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11367
11368         * win32-low.c (debug_registers_changed,
11369         debug_registers_used, CONTEXT_EXTENDED_REGISTERS,
11370         CONTEXT_FLOATING_POINT, CONTEXT_DEBUG_REGISTERS,
11371         CONTEXT_DEBUGGER, CONTEXT_DEBUGGER_DR): Delete.
11372         (thread_rec): Get context using the low target.
11373         (child_add_thread): Call thread_added on the low target,
11374         which does the same thing.
11375         (regptr): Delete.
11376         (do_initial_child_stuff): Remove debug registers references.
11377         Set context using the low target.  Resume threads after
11378         setting the contexts.
11379         (child_continue): Remove dead variable.  Remove debug
11380         registers references.
11381         (child_fetch_inferior_registers): Go through the low target.
11382         (do_child_store_inferior_registers): Remove.
11383         (child_store_inferior_registers): Go through the low target.
11384         (win32_resume): Remove debug registers references.
11385         Set context using the low target.
11386         (handle_exception): Change return type to void.  Don't record
11387         context here.  Set status to TARGET_WAITKIND_SPURIOUS on a
11388         first chance exception.
11389         (get_child_debug_event): Change return type to void.  Remove
11390         goto loop.  Always return after waiting for debug event.
11391         (win32_wait): Convert to switch statement.  Handle spurious
11392         events.
11393
11394         * win32-i386-low.c (debug_registers_changed,
11395         debug_registers_used): New.
11396         (initial_stuff): Rename to ...
11397         (i386_initial_stuff): ... this.  Clear debug registers
11398         state variables.
11399         (store_debug_registers): Delete.
11400         (i386_get_thread_context): New.
11401         (load_debug_registers): Delete.
11402         (i386_set_thread_context): New.
11403         (i386_thread_added): New.
11404         (single_step): Rename to ...
11405         (i386_single_step): ... this.
11406         (do_fetch_inferior_registers): Rename to ...
11407         (i386_fetch_inferior_register): ... this.
11408         (i386_store_inferior_register): New.
11409         (the_low_target): Adapt to new interface.
11410
11411         * win32-arm-low.c (CONTEXT_FLOATING_POINT): Define.
11412         (arm_get_thread_context): New.
11413         (arm_set_thread_context): New.
11414         (regptr): New.
11415         (do_fetch_inferior_registers): Rename to ...
11416         (arm_fetch_inferior_register): ... this.
11417         (arm_store_inferior_register): New.
11418         (arm_wince_breakpoint): Reimplement as unsigned long.
11419         (arm_wince_breakpoint_len): Define.
11420         (the_low_target): Adapt to new interface.
11421
11422         * win32-low.h (target_ops): Remove regmap, store_debug_registers and
11423         load_debug_registers.  Add get_thread_context, set_thread_context,
11424         thread_added and store_inferior_register.  Rename
11425         fetch_inferior_registers to fetch_inferior_register.
11426         (regptr): Remove declaration.
11427
11428 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11429
11430         * linux-low.c (linux_detach): Change return type to int.  Return 0.
11431         * spu-low.c (spu_detach): Likewise.
11432
11433 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11434
11435         * target.h (target_ops): Change return type of detach to int.
11436         Add join.
11437         (join_inferior): New.
11438         * server.c (main): Don't skip detach support on mingw32.
11439         If the inferior doesn't support detaching return error.
11440         Call join_inferior instead of using waitpid.
11441         * linux-low.c (linux_join): New.
11442         (linux_target_op): Add linux_join.
11443         * spu-low.c (spu_join): New.
11444         (spu_target_ops): Add spu_join.
11445         * win32-low.c (win32_detach): Adapt to new interface.
11446         Reopen current_process_handle before detaching.  Issue a child
11447         resume before detaching.
11448         (win32_join): New.
11449         (win32_target_op): Add win32_join.
11450
11451 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11452
11453         * win32-low.c (win32-attach): Fix return value.
11454         * target.h (target_ops): Describe ATTACH return values.
11455
11456 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11457
11458         * win32-low.c (GETPROCADDRESS): Define.
11459         (winapi_DebugActiveProcessStop): Add WINAPI.  typedef as pointer.
11460         (winapi_DebugSetProcessKillOnExit): Likewise.
11461         (win32_create_inferior): Force usage of ansi CreateProcessA.
11462         (win32_attach): Use GETPROCADDRESS.
11463         (win32_detach): Likewise.
11464
11465 2007-05-10  Pedro Alves  <pedro_alves@portugalmail.pt>
11466
11467         * win32-low.c (win32_wait): Don't use WSTOPSIG.
11468
11469 2007-03-30  Pedro Alves  <pedro_alves@portugalmail.pt>
11470
11471         * win32-low.c: Commit leftover changes from 2007-03-29.
11472
11473 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11474
11475         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Make 16-bit
11476         fields short instead of int.  Add explicit padding.
11477         (i387_cache_to_fsave): Remove unnecessary casts.
11478         (i387_fsave_to_cache): Doc fix.
11479         (i387_cache_to_fxsave): Remove unnecessary casts and masking.
11480
11481 2007-03-30  Daniel Jacobowitz  <dan@codesourcery.com>
11482
11483         * i387-fp.c (i387_cache_to_fxsave): Reinitialize val2 before use.
11484         (i387_fxsave_to_cache): Check fp->ftag while building ftag value.
11485
11486 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11487
11488         * configure.srv (arm*-*-mingw32ce*): Move near the other
11489         arm targets.
11490
11491 2007-03-29  Pedro Alves  <pedro_alves@portugalmail.pt>
11492
11493         * configure.ac: Add errno checking.
11494         (AC_CHECK_HEADERS): Add errno.h, fcntl.h, signal.h,
11495         sys/file.h and malloc.h.
11496         (AC_CHECK_DECLS): Add perror.
11497         (srv_mingwce): Handle.
11498         * configure.srv (i[34567]86-*-cygwin*): Add
11499         win32-i386-low.o to srv_tgtobj.
11500         (i[34567]86-*-mingw*): Likewise.
11501         (arm*-*-mingw32ce*): Add case.
11502         * gdbreplay.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11503         HAVE_FCNTL_H, HAVE_ERRNO_H, HAVE_MALLOC_H]: Check.
11504         [__MINGW32CE__] (strerror): New function.
11505         [__MINGW32CE__] (errno): Define to GetLastError.
11506         [__MINGW32CE__] (COUNTOF): New macro.
11507         (remote_open): Remove extra close call.
11508         * mem-break.c (delete_breakpoint_at): New function.
11509         * mem-break.h (delete_breakpoint_at): Declare.
11510         * remote-utils.c [HAVE_SYS_FILE_H, HAVE_SIGNAL_H,
11511         HAVE_FCNTL_H, HAVE_UNISTD_H, HAVE_ERRNO_H]: Check.
11512         [USE_WIN32API] (read, write): Add char* casts.
11513         * server.c [HAVE_UNISTD_H, HAVE_SIGNAL_H]: Check.
11514         * server.h: Include wincecompat.h on Windows CE.
11515         [HAVE_ERRNO_H]: Check.
11516         (perror): Declare if not declared.
11517         * utils.c: Add stdlib.h, errno.h and malloc.h includes.
11518         (perror_with_name): Remove errno declaration.
11519         * wincecompat.h: New.
11520         * wincecompat.c: New.
11521         * win32-low.h: New.
11522         * win32-arm-low.c: New.
11523         * win32-i386-low.c: New.
11524         (win32-low.c): Include mem-break.h and win32-low.h, and winnt.h.
11525         (OUTMSG2): Make it safe.
11526         (_T): New macro.
11527         (COUNTOF): New macro.
11528         (NUM_REGS): Get it from the low target.
11529         (CONTEXT_EXTENDED_REGISTERS, CONTEXT_FLOATING_POINT,
11530         CONTEXT_DEBUG_REGISTERS): Add fallbacks to 0.
11531         (thread_rec): Let low target handle debug registers.
11532         (child_add_thread): Likewise.
11533         (child_init_thread_list): Likewise.
11534         (continue_one_thread): Likewise.
11535         (regptr): New.
11536         (do_child_fetch_inferior_registers): Move to ...
11537         * win32-i386-low.c: ... here, and rename to ...
11538         (do_fetch_inferior_registers): ... this.
11539         * win32-low.c (child_fetch_inferior_registers):
11540         Go through the low target.
11541         (do_child_store_inferior_registers): Use regptr.
11542         (strwinerror): New function.
11543         (win32_create_inferior): Handle Windows CE.
11544         Use strwinerror instead of strerror on Windows error
11545         codes.  Add program to the error output.
11546         Don't close the main thread handle on Windows CE.
11547         (win32_attach): Use coredll.dll on Windows CE.
11548         (win32_kill): Close current process and current
11549         thread handles.
11550         (win32_detach): Use coredll.dll on Windows CE.
11551         (win32_resume): Let low target handle debug registers, and
11552         step request.
11553         (handle_exception): Add/Remove initial breakpoint.  Avoid
11554         non-existant WSTOPSIG on Windows CE.
11555         (win32_read_inferior_memory): Cast to remove warning.
11556         (win32_arch_string): Go through the low target.
11557         (initialize_low): Call set_breakpoint_data with the low
11558         target's breakpoint.
11559         * win32-low.c (dr, FLAG_TRACE_BIT, FCS_REGNUM,
11560         FOP_REGNUM, mappings): Move to ...
11561         * win32-i386-low.c: ... here.
11562         * win32-low.c (win32_thread_info): Move to ...
11563         * win32-low.h: ... here.
11564         * Makefile.in (SFILES): Add win32-low.c, win32-i386-low.c,
11565         win32-arm-low.c and wincecompat.c.
11566         (all:): Add $EXEEXT.
11567         (install-only:): Likewise.
11568         (gdbserver:): Likewise.
11569         (gdbreplay:): Likewise.
11570         * config.in: Regenerate.
11571         * configure: Regenerate.
11572
11573 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11574
11575         * win32-low.c: Rename typedef thread_info to
11576         win32_thread_info throughout.
11577
11578 2007-03-28  Pedro Alves  <pedro_alves@portugalmail.pt>
11579
11580         * win32-i386-low.c: Rename to ...
11581         * win32-low.c: ... this.
11582         * configure.srv: Replace win32-i386-low.o with win32-low.o.
11583         * Makefile.in: Likewise.
11584
11585 2007-03-27  Pedro Alves  <pedro_alves@portugalmail.pt>
11586
11587         * remote-utils.c (monitor_output): Constify msg parameter.
11588         * server.h (monitor_output): Likewise.
11589         * win32-i386-low.c (handle_output_debug_string): New.
11590         (win32_kill): Handle OUTPUT_DEBUG_STRING_EVENT events using
11591         handle_output_debug_string.
11592         (get_child_debug_event): Likewise.
11593
11594 2007-03-27  Mat Hostetter  <mat@lcs.mit.edu>
11595
11596         * server.c (main): Correct strtoul check.
11597
11598 2007-03-27  Jon Ringle  <jon@ringle.org>
11599
11600         * linux-low.c: Check __ARCH_HAS_MMU__ also.
11601
11602 2007-03-27  Brooks Moses  <brooks.moses@codesourcery.com>
11603
11604         * Makefile.in: Add dummy "pdf" and "install-pdf" targets.
11605
11606 2007-02-27  Daniel Jacobowitz  <dan@codesourcery.com>
11607
11608         * terminal.h: Check HAVE_SGTTY_H.
11609
11610 2007-02-27  Mat Hostetter  <mat@lcs.mit.edu>
11611
11612         * remote-utils.c (remote_open): Print out the assigned port number.
11613
11614 2007-02-26  Daniel Jacobowitz  <dan@codesourcery.com>
11615
11616         * remote-utils.c (monitor_output): New function.
11617         * server.c (debug_threads): Define here.
11618         (monitor_show_help): New function.
11619         (handle_query): Handle qRcmd.
11620         (main): Do not handle 'd' packet.
11621         * server.h (debug_threads, remote_debug, monitor_output): Declare.
11622         * linux-low.c, spu-low.c, win32-i386-low.c: Remove definitions
11623         of debug_threads.
11624
11625 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11626
11627         * Makefile.in (EXEEXT): New.
11628         (clean): Use $(EXEEXT).
11629
11630 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11631
11632         * target.h (target_ops): Rename send_signal to request_interrupt,
11633         and remove enum target_signal parameter.
11634         * linux-low.c (linux_request_interrupt): Rename from
11635         linux_send_signal, and always send SIGINT.
11636         * spu-low.c (spu_request_interrupt): Rename from spu_send_signal,
11637         and always send SIGINT.
11638         * remote-utils.c (putpkt_binary): Call request_interrupt, instead
11639         of send_signal.
11640         (input_interrupt): Likewise.
11641
11642 2007-02-25  Pedro Alves  <pedro_alves@portugalmail.pt>
11643
11644         * server.c (get_features_xml): Check if target implemented
11645         arch_string.
11646         * win32-i386-low.c (win32_arch_string): New.
11647         (win32_target_ops): Add win32_arch_string as arch_string member.
11648
11649 2007-02-22  Markus Deuling  <deuling@de.ibm.com>
11650
11651         * spu-low.c (spu_arch_string): New.
11652         (spu_target_ops): Add spu_arch_string.
11653
11654 2007-02-16  Daniel Jacobowitz  <dan@codesourcery.com>
11655
11656         * remote-utils.c: Remove HAVE_TERMINAL_H check.
11657         * configure.ac: Do not check for terminal.h.
11658         * configure, config.in: Regenerated.
11659
11660 2007-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
11661
11662         * Makefile.in (OBS): Add $(XML_BUILTIN).
11663         (XML_DIR, XML_TARGET, XML_FILES, XML_BUILTIN): New.
11664         (clean): Update.
11665         (target.xml, xml-builtin.c, stamp-xml, arm-with-iwmmxt.o)
11666         (arm-with-iwmmxt.c): New.
11667         * config.in, configure: Regenerate.
11668         * configure.ac: Check for iWMMXt.  Handle srv_xmltarget,
11669         srv_xmlbuiltin, and srv_xmlfiles.  Define USE_XML.
11670         * configure.srv: Mention srv_xmltarget and srv_xmlfiles.
11671         (arm*-*-linux*): Add iWMMXt and regset support.
11672         * linux-arm-low.c (PTRACE_GETWMMXREGS, PTRACE_SETWMMXREGS): Define.
11673         (arm_fill_gregset, arm_store_gregset, arm_fill_wmmxregset)
11674         (arm_store_wmmxregset, target_regsets): New.
11675         * server.c (get_features_xml): Take annex argument.  Check builtin
11676         XML documents.
11677         (handle_query): Handle multiple annexes.
11678
11679 2007-01-29  Daniel Jacobowitz  <dan@codesourcery.com>
11680
11681         * remote-utils.c [USE_WIN32API] (read, write): Define.
11682         (putpkt_binary, input_interrupt, readchar, getpkt): Use read and
11683         write.
11684
11685 2007-01-09  Daniel Jacobowitz  <dan@codesourcery.com>
11686
11687         * linux-i386-low.c (the_low_target): Set arch_string.
11688         * linux-x86-64-low.c (the_low_target): Likewise.
11689         * linux-low.c (linux_arch_string): New.
11690         (linux_target_ops): Add it.
11691         * linux-low.h (struct linux_target_ops): Add arch_string.
11692         * server.c (write_qxfer_response): Use const void * for DATA.
11693         (get_features_xml): New.
11694         (handle_query): Handle qXfer:features:read.  Report it for qSupported.
11695         * target.h (struct target_ops): Add arch_string method.
11696
11697 2007-01-03  Denis Pilat  <denis.pilat@st.com>
11698             Daniel Jacobowitz  <dan@codesourcery.com>
11699
11700         * linux-low.c (linux_kill): Handle being called with no threads.
11701         * win32-i386-low.c (win32_kill): Likewise.
11702         (get_child_debug_event): Clear current_process_handle.
11703
11704 2006-12-30  Denis PILAT  <denis.pilat@st.com>
11705             Daniel Jacobowitz  <dan@codesourcery.com>
11706
11707         * remote-utils.c (remote_open): Check the type of specified
11708         serial port devices before opening them.
11709         * server.c (main): Kill the inferior if an error occurs during
11710         the first remote_open.
11711
11712 2006-12-05  Markus Deuling  <deuling@de.ibm.com>
11713
11714         * README: Update supported targets.
11715
11716 2006-11-28  Daniel Jacobowitz  <dan@codesourcery.com>
11717
11718         * Makefile.in (clean): Remove reg-mips64.c.
11719         (reg-mips64.c, reg-mips64.o): New rules.
11720         * configure.srv: Handle mips64.  Include regset support for mips.
11721         * linux-mips-low.c (union mips_register): New.
11722         (mips_get_pc, mips_set_pc, mips_reinsert_addr): Use it.
11723         (mips_breakpoint, mips_breakpoint_at): Use int.
11724         (mips_collect_register, mips_supply_register)
11725         (mips_collect_register_32bit, mips_supply_register_32bit)
11726         (mips_fill_gregset, mips_store_gregset, mips_fill_fpregset)
11727         (mips_store_fpregset, target_regsets): New.
11728         * thread-db.c (thread_db_get_tls_address): Use uintptr_t.
11729
11730 2006-11-22  Ulrich Weigand  <uweigand@de.ibm.com>
11731
11732         * configure.srv: Add target "spu*-*-*".
11733         * Makefile.in (clean): Remove reg-spu.c.
11734         (reg-spu.c, reg-spu.o, spu-low.o): Add dependencies.
11735         * spu-low.c: New file.
11736
11737 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11738
11739         * configure.ac: Correct td_thr_tls_get_addr test.
11740         * configure: Regenerated.
11741
11742 2006-11-16  Daniel Jacobowitz  <dan@codesourcery.com>
11743
11744         * linux-low.c (linux_wait_for_event): Reformat.  Use the
11745         pass_signals array.
11746         * remote-utils.c (decode_address_to_semicolon): New.
11747         * server.c (pass_signals, handle_general_set): New.
11748         (handle_query): Mention QPassSignals for qSupported.
11749         (main): Call handle_general_set.
11750         * server.h (pass_signals, decode_address_to_semicolon): New.
11751
11752 2006-11-06  Daniel Jacobowitz  <dan@codesourcery.com>
11753
11754         * server.c (handle_query): Correct error handling for read_auxv.
11755
11756 2005-10-19  Ulrich Weigand  <uweigand@de.ibm.com>
11757
11758         * configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
11759         and srv_linux_thread_db to yes.
11760         * linux-s390-low.c (s390_fill_gregset): New function.
11761         (target_regsets): Define data structure.
11762
11763 2006-10-17  Daniel Jacobowitz  <dan@codesourcery.com>
11764
11765         * acinclude.m4 (SRV_CHECK_TLS_GET_ADDR): New.
11766         * configure.ac: Use it.  Define HAVE_TD_THR_TLS_GET_ADDR.
11767         * config.in, configure: Regenerated.
11768         * inferiors.c (gdb_id_to_thread): New function.
11769         (gdb_id_to_thread_id): Use it.
11770         * linux-low.c (linux_target_ops): Use thread_db_get_tls_address.
11771         * linux-low.h (struct process_info): Add th member.
11772         (thread_db_get_tls_address): New prototype.
11773         * remote-utils.c (decode_address): Make non-static.
11774         * server.c (handle_query): Handle qGetTLSAddr.
11775         * server.h (gdb_id_to_thread, decode_address): New prototypes.
11776         * target.h (struct target_ops): Add get_tls_address.
11777         * thread-db.c (maybe_attach_thread): Save the thread handle.
11778         (thread_db_get_tls_address): New.
11779
11780 2006-09-28  Daniel Jacobowitz  <dan@codesourcery.com>
11781
11782         * linux-low.c (PTRACE_GETSIGINFO, PTRACE_SETSIGINFO): Define.
11783         (linux_resume_one_process): Take a siginfo_t *.  Update all
11784         callers.  Queue it if necessary.  Use PTRACE_SETSIGINFO.
11785         (struct pending_signals): Add a siginfo_t.
11786         (linux_wait_for_process): Always set last_status.
11787         (linux_wait_for_event): Use PTRACE_GETSIGINFO.
11788         (linux_queue_one_thread): Use PTRACE_GETSIGINFO.
11789         * linux-low.h (struct process_info): Add last_status.
11790
11791 2006-09-21  Daniel Jacobowitz  <dan@codesourcery.com>
11792
11793         * remote-utils.c (try_rle): New function.
11794         (putpkt_binary): Use it.
11795
11796 2006-08-19  Daniel Jacobowitz  <dan@codesourcery.com>
11797
11798         * Makefile.in (clean): Clean reg-x86-64-linux.c.
11799         (reg-x86-64-linux.o, reg-x86-64-linux.c): New.
11800         * configure.srv (x86_64-*-linux*): Use reg-x86-64-linux.o.
11801         * linux-x86-64-low.c (x86_64_regmap): Include ORIG_RAX.
11802         (x86_64_fill_gregset, x86_64_store_gregset): Skip floating
11803         point registers.
11804
11805 2006-08-08  Richard Sandiford  <richard@codesourcery.com>
11806
11807         * server.c (terminal_fd): New variable.
11808         (old_foreground_pgrp): Likewise.
11809         (restore_old_foreground_pgrp): New function.
11810         (start_inferior): Record the terminal file descriptor in terminal_fd
11811         and its original foreground group in old_foreground_pgrp.  Register
11812         restore_old_foreground_pgrp with atexit().
11813
11814 2006-07-26  Daniel Jacobowitz  <dan@codesourcery.com>
11815
11816         * server.c (handle_query): Correct qPart to qXfer.
11817
11818 2006-07-22  Daniel Jacobowitz  <dan@codesourcery.com>
11819
11820         * configure.ac: Check for more headers which are missing on
11821         Windows.  Automatically supply -lwsock32 and USE_WIN32API.
11822         * configure.srv: Add Cygwin and mingw32.
11823         * remote-utils.c: Don't include headers unconditionally which
11824         are missing on mingw32.  Include <winsock.h> for mingw32.
11825         (remote_open): Adjust for mingw32 support.  Flush
11826         standard error after writing to it.
11827         (remote_close, putpkt_binary, input_interrupt, block_async_io)
11828         (unblock_async_io, enable_async_io, disable_async_io)
11829         (readchar, getpkt): Update for Winsock support.
11830         (prepare_resume_reply): Expect a protocol signal number.
11831         * server.c: Disable <sys/wait.h> on mingw32.
11832         (start_inferior): Adjust for mingw32 support.  Flush
11833         standard error after writing to it.
11834         (attach_inferior): Likewise.  Use protocol signal
11835         numbers.
11836         (main): Skip 'D' packet on mingw32.  Use protocol signal numbers
11837         and names.
11838         * win32-i386-low.c: New file.
11839         * Makefile.in (XM_CLIBS): Set.
11840         (gdbserver, gdbreplay): Use $(INTERNAL_CFLAGS).
11841         (win32-i386-low.o): New dependency rule.
11842         * linux-low.c (linux_wait): Use target signal numbers.
11843         * target.h (struct target_ops): Doc fix.
11844         * server.h (target_signal_to_name): New prototype.
11845         * gdbreplay.c: Don't include headers unconditionally which
11846         are missing on mingw32.  Include <winsock.h> for mingw32.
11847         (remote_close, remote_open): Adjust for Winsock support.
11848         * configure, config.in: Regenerated.
11849
11850 2006-07-12  Daniel Jacobowitz  <dan@codesourcery.com>
11851
11852         * server.c (decode_xfer_read, write_qxfer_response): New.
11853         (handle_query): Take a packet length argument.  Handle
11854         qXfer:auxv:read instead of qPart:auxv:read.  Mention it in
11855         the qSupported response.
11856         (main): Update call to handle_query.
11857
11858 2006-06-22  Daniel Jacobowitz  <dan@codesourcery.com>
11859
11860         * remote-utils.c (remote_escape_output, remote_unescape_input): New.
11861         (putpkt_binary): Renamed from putpkt and adjusted for binary
11862         data.
11863         (putpkt): New wrapper for putpkt_binary.
11864         (readchar): Don't mask off the high bit.
11865         (decode_X_packet): New function.
11866         * server.c (main): Call putpkt_binary if a handler sets the packet
11867         length.  Save the length of the incoming packet.  Handle 'X'.
11868         * server.h (gdb_byte, remote_escape_output, decode_X_packet): New.
11869
11870 2006-06-21  Daniel Jacobowitz  <dan@codesourcery.com>
11871
11872         * server.c (handle_query): Handle qSupported.
11873
11874 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
11875
11876         * remote-utils.c (all_symbols_looked_up): New variable.
11877         (look_up_one_symbol): Check it.
11878         * server.h (look_up_one_symbol): New declaration.
11879         * thread-db.c (thread_db_init): Set all_symbols_looked_up.
11880
11881 2006-05-30  Daniel Jacobowitz  <dan@codesourcery.com>
11882
11883         * Makefile.in (linux-arm-low.o): Update dependencies.
11884         * linux-arm-low.c: Include "gdb_proc_service.h".
11885         (PTRACE_GET_THREAD_AREA): Define.
11886         (ps_get_thread_area): New function.
11887
11888 2006-05-09  Nathan Sidwell  <nathan@codesourcery.com>
11889
11890         * configure.srv (m68k*-*-uclinux*): New target.
11891         * linux-low.c (linux_create_inferior): Use vfork on mmuless systems.
11892         (linux_resume_one_process): Remove extraneous cast.
11893         (linux_read_offsets): New.
11894         (linux_target_op): Add linux_read_offsets on mmuless systems.
11895         * server.c (handle_query): Add qOffsets logic.
11896         * target.h (struct target_ops): Add read_offsets.
11897
11898 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
11899
11900         * linux-mips-low.c: Include <sys/ptrace.h> and "gdb_proc_service.h".
11901         (PTRACE_GET_THREAD_AREA): Define.
11902         (ps_get_thread_area): New function.
11903         * Makefile.in (linux-i386-low.o, linux-mips-low.o)
11904         (linux-x86-64-low.o): Update.
11905
11906 2006-03-15  Daniel Jacobowitz  <dan@codesourcery.com>
11907
11908         * configure.ac: Remove checks for prfpregset_t.
11909         * gdb_proc_service.h: New file.
11910         * linux-i386-low.c, linux-x86-64-low.c, thread-db.c: Use the
11911         new "gdb_proc_service.h".
11912         * proc-service.c: Likewise.
11913         (ps_pglobal_lookup, ps_pdread, ps_pdwrite): Use psaddr_t.
11914         (ps_lgetfpregs, ps_lsetfpregs): Use a void* argument.
11915         * Makefile.in (gdb_proc_service_h): Updated.
11916         * configure, config.in: Regenerated.
11917
11918 2006-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
11919
11920         * remote-utils.c (prepare_resume_reply): Move declaration
11921         of gdb_id_from_wait to the top of the block.
11922
11923 2006-02-15  Daniel Jacobowitz  <dan@codesourcery.com>
11924
11925         * linux-low.c (regsets_store_inferior_registers): Read the regset
11926         from the target before filling it.
11927
11928 2006-02-08  Daniel Jacobowitz  <dan@codesourcery.com>
11929
11930         * server.c (attach_inferior): Return SIGTRAP for a successful
11931         attach.
11932
11933 2006-02-01  Daniel Jacobowitz  <dan@codesourcery.com>
11934
11935         * Makefile.in (OBS): Add version.o.
11936         (STAGESTUFF): Delete.
11937         (version.o): Add dependencies.
11938         (version.c): Replace rule.
11939         (clean): Remove version.c.
11940         * server.c (gdbserver_version): New.
11941         (gdbserver_usage): Use printf.
11942         (main): Handle --version and --help.
11943         * server.h (version, host_name): Add declarations.
11944
11945 2005-12-23  Eli Zaretskii  <eliz@gnu.org>
11946
11947         * linux-arm-low.c:
11948         * linux-arm-low.c:
11949         * inferiors.c:
11950         * i387-fp.h:
11951         * i387-fp.c:
11952         * gdbreplay.c:
11953         * regcache.c:
11954         * proc-service.c:
11955         * mem-break.h:
11956         * mem-break.c:
11957         * linux-x86-64-low.c:
11958         * linux-sh-low.c:
11959         * linux-s390-low.c:
11960         * linux-ppc64-low.c:
11961         * linux-ppc-low.c:
11962         * linux-mips-low.c:
11963         * linux-m68k-low.c:
11964         * linux-m32r-low.c:
11965         * linux-low.h:
11966         * linux-low.c:
11967         * linux-ia64-low.c:
11968         * linux-i386-low.c:
11969         * linux-crisv32-low.c:
11970         * thread-db.c:
11971         * terminal.h:
11972         * target.h:
11973         * target.c:
11974         * server.h:
11975         * server.c:
11976         * remote-utils.c:
11977         * regcache.h:
11978         * utils.c:
11979         * Makefile.in:
11980         * configure.ac:
11981         * gdbserver.1: Add (C) after Copyright.  Update the FSF
11982         address.
11983
11984 2005-11-13  Daniel Jacobowitz  <dan@codesourcery.com>
11985
11986         * linux-arm-low.c (arm_eabi_breakpoint): New variable.
11987         (arm_breakpoint_at): Recognize both breakpoints.
11988         (the_low_target): Use the correct breakpoint instruction.
11989
11990 2005-11-02  Daniel Jacobowitz  <dan@codesourcery.com>
11991
11992         * configure.srv (x86_64-*-linux*): Turn on thread_db support.
11993         * linux-x86-64-low.c (x86_64_breakpoint, x86_64_breakpoint_len)
11994         (x86_64_get_pc, x86_64_set_pc, x86_64_breakpoint_at): New.
11995         (the_low_target): Update.
11996
11997 2005-10-25  Andreas Schwab  <schwab@suse.de>
11998
11999         * server.c (main): Allocate mem_buf with PBUFSIZ bytes.
12000
12001         * linux-ia64-low.c (ia64_regmap): Remove NAT registers.
12002         (ia64_num_regs): Reduce to 462.
12003
12004 2005-09-17  Daniel Jacobowitz  <dan@codesourcery.com>
12005
12006         * acinclude.m4: Correct quoting.
12007         * aclocal.m4: Regenerated.
12008
12009         Suggested by SZOKOVACS Robert <szo@ies.hu>:
12010         * thread-db.c (thread_db_err_str): Handle TD_VERSION.
12011         (thread_db_init): Call thread_db_err_str.
12012         * configure.ac: Check for TD_VERSION.
12013         * config.in, configure: Regenerated.
12014
12015 2005-07-31  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
12016
12017         * server.h (error, fatal, warning): Add ATTR_FORMAT.
12018
12019 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12020
12021         * configure.ac: Define HAVE_LINUX_REGSETS even if PTRACE_GETREGS
12022         is not available.  Define HAVE_PTRACE_GETREGS if it is.
12023         * config.in, configure: Regenerated.
12024         * configure.srv: Set srv_linux_regsets for PowerPC and PowerPC64.
12025         * linux-i386-low.c, linux-m68k-low.c: Update to use
12026         HAVE_PTRACE_GETREGS.
12027         * linux-low.c (regsets_fetch_inferior_registers)
12028         (regsets_store_inferior_registers): Only return 0 if we processed
12029         GENERAL_REGS.
12030         * linux-ppc-low.c (ppc_fill_gregset, target_regsets): New.
12031         * linux-ppc64-low.c (ppc_fill_gregset, target_regsets): New.
12032
12033 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12034
12035         * inferiors.c (struct thread_info): Add gdb_id.
12036         (add_thread): Add gdb_id argument.
12037         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New.
12038         * linux-low.c (linux_create_inferior, linux_attach_lwp): Update
12039         calls to add_thread.
12040         * remote-utils.c (prepare_resume_reply: Use thread_to_gdb_id.
12041         * server.c (handle_query): Use thread_to_gdb_id.
12042         (handle_v_cont, main): Use gdb_id_to_thread_id.
12043         * server.h (add_thread): Update prototype.
12044         (thread_id_to_gdb_id, thread_to_gdb_id, gdb_id_to_thread_id): New
12045         prototypes.
12046
12047 2005-07-13  Daniel Jacobowitz  <dan@codesourcery.com>
12048
12049         * linux-low.c (fetch_register, usr_store_inferior_registers): Handle
12050         left-padded registers.
12051         * linux-low.h (struct linux_target_ops): Add left_pad_xfer.
12052         * linux-ppc64-low.c (the_low_target): Set left_pad_xfer.
12053
12054 2005-07-01  Steve Ellcey  <sje@cup.hp.com>
12055
12056         * configure.ac (BFD_NEED_DECLARATION): Replace with AC_CHECK_DECLS.
12057         * configure: Regenerate.
12058         * config.in: Regenerate.
12059         * server.h (NEED_DECLARATION_STRERROR):
12060         Replace with !HAVE_DECL_STRERROR.
12061
12062 2005-06-16  Daniel Jacobowitz  <dan@codesourcery.com>
12063
12064         * linux-low.c (linux_wait, linux_send_signal): Don't test
12065         an unsigned long variable for > 0 if it could be MAX_ULONG.
12066         * server.c (myresume): Likewise.
12067         * target.c (set_desired_inferior): Likewise.
12068
12069 2005-06-13  Mark Kettenis  <kettenis@gnu.org>
12070
12071         * configure.ac: Simplify and improve check for socklen_t.
12072         * configure, config.in: Regenerate.
12073
12074 2005-06-12  Daniel Jacobowitz  <dan@codesourcery.com>
12075
12076         * acconfig.h: Remove.
12077         * configure.ac: Add a test for socklen_t.  Use three-argument
12078         AC_DEFINE throughout.
12079         * config.in: Regenerated using autoheader 2.59.
12080         * configure: Regenerated.
12081
12082         * gdbreplay.c (socklen_t): Provide a default.
12083         (remote_open): Use socklen_t.
12084         * remote-utils.c (socklen_t): Provide a default.
12085         (remote_open): Use socklen_t.
12086         (convert_int_to_ascii, convert_ascii_to_int, decode_M_packet): Use
12087         unsigned char.
12088
12089         * i387-fp.c (struct i387_fsave, struct i387_fxsave): Use unsigned
12090         char for buffers.
12091         * linux-low.c (linux_read_memory, linux_write_memory)
12092         (linux_read_auxv): Likewise.
12093         * mem-break.c (breakpoint_data, set_breakpoint_data, check_mem_read)
12094         (check_mem_write): Likewise.
12095         * mem-break.h (set_breakpoint_data, check_mem_read, check_mem_write):
12096         Likewise.
12097         * regcache.c (struct inferior_rgcache_data, registers_to_string)
12098         (registers_from_string, register_data): Likewise.
12099         * server.c (handle_query, main): Likewise.
12100         * server.h (convert_ascii_to_int, convert_int_to_ascii)
12101         (decode_M_packet): Likewise.
12102         * target.c (read_inferior_memory, write_inferior_memory): Likewise.
12103         * target.h (struct target_ops): Update read_memory, write_memory,
12104         and read_auxv.
12105         (read_inferior_memory, write_inferior_memory): Update.
12106         * linux-low.h (struct linux_target_ops): Change type of breakpoint
12107         to unsigned char *.
12108         * linux-arm-low.c, linux-cris-low.c, linux-crisv32-low.c,
12109         linux-i386-low.c, linux-m32r-low.c, linux-m68k-low.c,
12110         linux-mips-low.c, linux-ppc-low.c, linux-ppc64-low.c,
12111         linux-s390-low.c, linux-sh-low.c: Update for changes in
12112         read_inferior_memory and the_low_target->breakpoint.
12113
12114 2005-05-28  Daniel Jacobowitz  <dan@codesourcery.com>
12115
12116         * Makefile.in (SFILES): Add linux-ppc64-low.c.
12117         (linux-ppc64-low.o, reg-ppc64.c, reg-ppc64.o): New targets.
12118         * configure.srv: Add powerpc64-*-linux*.
12119         * linux-ppc64-low.c: New file.
12120
12121 2005-05-23  Orjan Friberg  <orjanf@axis.com>
12122
12123         * linux-cris-low.c: New file with support for CRIS.
12124         * linux-crisv32-low.c: Ditto for CRISv32.
12125         * Makefile.in (SFILES): Add linux-cris-low.c, linux-crisv32-low.c.
12126         (clean): Add reg-cris.c and reg-crisv32.c.
12127         Add linux-cris-low.o, linux-crisv32-low.o, reg-cris.o, reg-cris.c,
12128         reg-crisv32.o, and reg-crisv32.c to make rules.
12129         * configure.srv: Add cris-*-linux* and crisv32-*-linux* to list of
12130         recognized targets.
12131
12132 2005-05-16  Ulrich Weigand  <uweigand@de.ibm.com>
12133
12134         * linux-low.c (fetch_register): Ensure buffer size is a multiple
12135         of sizeof (PTRACE_XFER_TYPE).
12136         (usr_store_inferior_registers): Likewise.  Zero out excess bytes.
12137
12138 2005-05-12  Orjan Friberg  <orjanf@axis.com>
12139
12140         * target.h (struct target_ops): Add insert_watchpoint,
12141         remove_watchpoint, stopped_by_watchpoint, stopped_data_address function
12142         pointers for hardware watchpoint support.
12143         * linux-low.h (struct linux_target_ops): Ditto.
12144         * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint)
12145         (linux_stopped_by_watchpoint, linux_stopped_data_address): New.  Add
12146         to linux_target_ops.
12147         * remote-utils.c (prepare_resume_reply): Add watchpoint information to
12148         reply packet.
12149         * server.c (main): Recognize 'Z' and 'z' packets.
12150
12151 2005-05-10  Ulrich Weigand  <uweigand@de.ibm.com>
12152
12153         * linux-s390-low.c (s390_breakpoint, s390_breakpoint_len): Define.
12154         (s390_get_pc, s390_set_pc, s390_breakpoint_at): New functions.
12155         (the_low_target): Add new members.
12156
12157 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12158
12159         * proc-service.c (ps_lgetregs): Search all_processes instead of
12160         all_threads.
12161
12162 2005-05-04  Daniel Jacobowitz  <dan@codesourcery.com>
12163
12164         * server.c (start_inferior): Change return type to int.
12165         (attach_inferior): Change sigptr to int *.
12166         (handle_v_cont, handle_v_requests): Change signal to int *.
12167         (main): Change signal to int.
12168
12169 2005-04-15  Kei Sakamoto  <sakamoto.kei@renesas.com>
12170
12171         * Makefile.in: Add linux-m32r-low.o, reg-m32r.c and reg-m32r.o.
12172         * configure.srv: Add m32r*-*-linux*.
12173         * linux-m32r-low.c: New file.
12174
12175 2005-03-04  Daniel Jacobowitz  <dan@codesourcery.com>
12176
12177         * Makefile.in (stamp-h): Set CONFIG_HEADERS explicitly.
12178
12179 2005-03-03  Daniel Jacobowitz  <dan@codesourcery.com>
12180
12181         * inferiors.c (change_inferior_id, add_thread, find_inferior_id):
12182         Take unsigned long arguments for PIDs.
12183         * linux-low.c (add_process, linux_attach_lwp, linux_attach)
12184         (linux_thread_alive, linux_wait_for_event, kill_lwp, send_sigstop)
12185         (wait_for_sigstop, linux_resume_one_process)
12186         (regsets_fetch_inferior_registers, linux_send_signal)
12187         (linux_read_auxv): Likewise.  Update the types of variables holding
12188         PIDs.  Update format string specifiers.
12189         * linux-low.h (struct process_info, linux_attach_lwp): Likewise.
12190         * remote-utils.c (prepare_resume_reply): Likewise.
12191         * server.c (cont_thread, general_thread, step_thread)
12192         (thread_from_wait, old_thread_from_wait, signal_pid): Change type to
12193         unsigned long.
12194         (handle_query): Update format specifiers.
12195         (handle_v_cont, main): Use strtoul for thread IDs.
12196         * server.h (struct inferior_list_entry): Use unsigned long for ID.
12197         (add_thread, find_inferior_id, change_inferior_id, cont_thread)
12198         (general_thread, step_thread, thread_from_wait)
12199         (old_thread_from_wait): Update.
12200         * target.h (struct thread_resume): Use unsigned long for THREAD.
12201         (struct target_ops): Use unsigned long for arguments to attach and
12202         thread_alive.
12203
12204 2005-02-24  Daniel Jacobowitz  <dan@codesourcery.com>
12205
12206         * acinclude.m4: Include bfd/bfd.m4 directly.
12207         * configure.ac: Use AC_ARG_PROGRAM.  Suggested by Aron Griffis
12208         <agriffis@toolchain.org>.
12209         * aclocal.m4, configure: Regenerated.
12210
12211 2005-01-07  Andrew Cagney  <cagney@gnu.org>
12212
12213         * configure.ac: Rename configure.in, require autoconf 2.59.
12214         * configure: Re-generate.
12215
12216 2004-12-08  Daniel Jacobowitz  <dan@debian.org>
12217
12218         * acinclude.m4 (SRV_CHECK_THREAD_DB): Add ps_get_thread_area.  Reset
12219         LIBS when finished.
12220         * aclocal.m4: Regenerated.
12221         * configure: Regenerated.
12222
12223 2004-11-21  Andreas Schwab  <schwab@suse.de>
12224
12225         * linux-m68k-low.c (m68k_num_gregs): Define.
12226         (m68k_fill_gregset, m68k_store_gregset, m68k_fill_fpregset)
12227         (m68k_store_fpregset, target_regsets) [HAVE_LINUX_REGSETS]: New.
12228         (m68k_breakpoint, m68k_breakpoint_len, m68k_get_pc, m68k_set_pc)
12229         (m68k_breakpoint_at): New.  Add to the_low_target.
12230
12231         * configure.srv (m68*-*-linux*): Set srv_linux_regsets and
12232         srv_linux_thread_db to yes.
12233
12234 2004-10-20  Joel Brobecker  <brobecker@gnat.com>
12235
12236         * linux-x86-64-low.c (ARCH_SET_GS): Add definition if missing.
12237         (ARCH_SET_FS): Likewise.
12238         (ARCH_GET_FS): Likewise.
12239         (ARCH_GET_GS): Likewise.
12240
12241 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12242
12243         * linux-i386-low.c (ps_get_thread_area): New.
12244         * linux-x86-64-low.c (ps_get_thread_area): New.
12245         * linux-low.c: Include <sys/syscall.h>.
12246         (linux_kill_one_process): Don't kill the first thread here.
12247         (linux_kill): Kill the first thread here.
12248         (kill_lwp): New function.
12249         (send_sigstop, linux_send_signal): Use it.
12250         * proc-service.c: Clean up #ifdefs.
12251         (fpregset_info): Delete.
12252         (ps_lgetregs): Update and enable implementation.
12253         (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled
12254         implementations.
12255         * remote-utils.c (struct sym_cache, symbol_cache): New.
12256         (input_interrupt): Print a clearer message.
12257         (async_io_enabled): New variable.
12258         (enable_async_io, disable_async_io): Use it.  Update comments.
12259         (look_up_one_symbol): Use the symbol cache.
12260         * thread-db.c (thread_db_look_up_symbols): New function.
12261         (thread_db_init): Update comments.  Call thread_db_look_up_symbols.
12262
12263 2004-10-16  Daniel Jacobowitz  <dan@debian.org>
12264
12265         * configure.in: Test for -rdynamic.
12266         * configure: Regenerated.
12267         * Makefile (INTERNAL_LDFLAGS): New.
12268         (gdbserver, gdbreplay): Use it.
12269
12270 2004-09-02  Andrew Cagney  <cagney@gnu.org>
12271
12272         * Makefile.in (TAGS): Replace TM_FILE with DEPRECATED_TM_FILE.
12273
12274 2004-03-23  Daniel Jacobowitz  <drow@mvista.com>
12275
12276         * linux-low.c (linux_wait): Clear all_processes list also.
12277
12278 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12279
12280         * linux-low.c: Include <errno.h>.  Remove extern declaration of
12281         errno.
12282
12283 2004-03-12  Daniel Jacobowitz  <drow@mvista.com>
12284
12285         * gdbreplay.c, server.h, utils.c: Update copyright years.
12286
12287 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12288
12289         * server.c (main): Print child status or termination signal from
12290         variable 'signal', not 'sig'.
12291
12292 2004-03-04  Nathan J. Williams  <nathanw@wasabisystems.com>
12293
12294         * linux-low.c (linux_read_memory): Change return type to
12295         int.  Check for and return error from ptrace().
12296         * target.c (read_inferior_memory): Change return type to int.  Pass
12297         back return status from the_target->read_memory().
12298         * target.h (struct target_ops): Adapt *read_memory() prototype.
12299         Update comment.
12300         (read_inferior_memory): Adapt prototype.
12301         * server.c (main): Return an error packet if
12302         read_inferior_memory() returns an error.
12303
12304 2004-03-04  Daniel Jacobowitz  <drow@mvista.com>
12305
12306         * Makefile.in (distclean): Remove config.h, stamp-h, and config.log.
12307         Unify with other clean targets.
12308
12309 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12310
12311         * server.c (handle_v_cont): Call set_desired_inferior.
12312
12313 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12314
12315         * remote-utils.c (prepare_resume_reply): Always supply "thread:".
12316
12317 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12318
12319         * linux-low.c (linux_wait): Unblock async I/O.
12320         (linux_resume): Block and enable async I/O.
12321         * remote-utils.c (block_async_io, unblock_async_io): New functions.
12322         * server.h (block_async_io, unblock_async_io): Add prototypes.
12323
12324 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12325
12326         * remote-utils.c (remote_open): Print a status notice after
12327         opening a TCP port.
12328         * server.c (attach_inferior): Print a status notice after
12329         attaching.
12330
12331 2004-02-29  Daniel Jacobowitz  <drow@mvista.com>
12332
12333         * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode.
12334
12335 2004-02-26  Daniel Jacobowitz  <drow@mvista.com>
12336
12337         * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the
12338         error packet.
12339         * server.c, target.h: Update copyright years.
12340
12341 2004-02-25  Roland McGrath  <roland@redhat.com>
12342
12343         * target.h (struct target_ops): New member `read_auxv'.
12344         * server.c (handle_query): Handle qPart:auxv:read: query using that.
12345         * linux-low.c (linux_read_auxv): New function.
12346         (linux_target_ops): Initialize `read_auxv' member to that.
12347
12348 2004-02-17  Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
12349
12350         Committed by Jim Blandy  <jimb@redhat.com>.
12351
12352         * linux-s390-low.c (s390_num_regs): Update.
12353         (s390_regmap): Remove control registers.  Use __s390x__ predefine
12354         instead of GPR_SIZE to distiguish s390 and s390x targets.
12355
12356 2004-01-31  Daniel Jacobowitz  <drow@mvista.com>
12357
12358         * linux-low.c: Update copyright year.
12359         (check_removed_breakpoint): Clear pending_is_breakpoint.
12360         (linux_set_resume_request, linux_queue_one_thread)
12361         (resume_status_pending_p): New functions.
12362         (linux_continue_one_thread): Use process->resume.
12363         (linux_resume): Only resume threads if there are no pending events.
12364         * linux-low.h (struct process_info): Add resume request
12365         pointer.
12366
12367 2004-01-30  Daniel Jacobowitz  <drow@mvista.com>
12368
12369         * regcache.c (new_register_cache): Clear the allocated register
12370         buffer.  Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>.
12371
12372 2003-10-13  Daniel Jacobowitz  <drow@mvista.com>
12373
12374         * linux-low.c (linux_resume): Take a struct thread_resume *
12375         argument.
12376         (linux_wait): Update call.
12377         (resume_ptr): New static variable.
12378         (linux_continue_one_thread): Renamed from
12379         linux_continue_one_process.  Use resume_ptr.
12380         (linux_resume): Use linux_continue_one_thread.
12381         * server.c (handle_v_cont, handle_v_requests): New functions.
12382         (myresume): New function.
12383         (main): Handle 'v' case.
12384         * target.h (struct thread_resume): New type.
12385         (struct target_ops): Change argument of "resume" to struct
12386         thread_resume *.
12387         (myresume): Delete macro.
12388
12389 2003-08-08  H.J. Lu  <hongjiu.lu@intel.com>
12390
12391         * Makefile.in (install-only): Create dest dir. Support DESTDIR.
12392         (uninstall): Support DESTDIR.
12393
12394 Mon Jul 21 20:09:34 UTC 2003  Brendan Conoboy  <blc@redhat.com>
12395
12396         * configure.srv: Add xscale*linux copy of arm*linux entry.
12397
12398 2003-07-24  Daniel Jacobowitz  <drow@mvista.com>
12399
12400         * linux-arm-low.c (arm_reinsert_addr): New function.
12401         (the_low_target): Add arm_reinsert_addr.
12402
12403 2003-07-08  Mark Kettenis  <kettenis@gnu.org>
12404
12405         * mem-break.c: Remove whitespace at end of file.
12406
12407 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12408
12409         * configure.in: Check whether we need to prototype strerror.
12410         * server.h: Optionally prototype strerror.
12411         * gdbreplay.c (perror_with_name): Use strerror.
12412         * linux-low.c (linux_attach_lwp): Use strerror.
12413         * utils.c (perror_with_name): Use strerror.
12414         * config.in, configure: Regenerated.
12415
12416 2003-06-28  Daniel Jacobowitz  <drow@mvista.com>
12417
12418         * linux-sh-low.c (sh_regmap): Fix FP register offsets, reported by
12419         SUGIOKA Toshinobu <sugioka@itonet.co.jp>.
12420
12421 2003-06-20  Daniel Jacobowitz  <drow@mvista.com>
12422
12423         * Makefile.in (SFILES): Update.
12424         * low-hppabsd.c, low-lynx.c, low-nbsd.c, low-sim.c, low-sparc.c,
12425         low-sun3.c: Remove files.
12426
12427 2003-06-17  Daniel Jacobowitz  <drow@mvista.com>
12428
12429         * linux-low.c: Move comment to linux_thread_alive where it belonged.
12430         (linux_detach_one_process, linux_detach): New functions.
12431         (linux_target_ops): Add linux_detach.
12432         * server.c (main): Handle 'D' packet.
12433         * target.h (struct target_ops): Add "detach" member.
12434         (detach_inferior): Define.
12435
12436 2003-06-13  Mark Kettenis  <kettenis@gnu.org>
12437
12438         From Kelley Cook  <kelleycook@wideopenwest.com>:
12439         * configure.srv: Accept i[34567]86 variants.
12440
12441 2003-06-05  Daniel Jacobowitz  <drow@mvista.com>
12442
12443         * linux-low.c (linux_wait_for_event): Correct comment typos.
12444         (linux_resume_one_process): Call check_removed_breakpoint.
12445         (linux_send_signal): New function.
12446         (linux_target_ops): Add linux_send_signal.
12447         * remote-utils.c (putpkt, input_interrupt): Use send_signal instead
12448         of kill.
12449         * target.h (struct target_ops): Add send_signal.
12450
12451 2003-05-29  Jim Blandy  <jimb@redhat.com>
12452
12453         * linux-low.c (usr_store_inferior_registers): Transfer buf in
12454         PTRACE_XFER_TYPE-sized chunks, not int-sized chunks.  Otherwise,
12455         if 'int' is smaller than PTRACE_XFER_TYPE, you end up throwing
12456         away part of the register's value.
12457
12458 2003-03-26  Daniel Jacobowitz  <drow@mvista.com>
12459
12460         * linux-low.c (linux_create_inferior): Use __SIGRTMIN.
12461         (linux_wait_for_event, linux_init_signals): Likewise.
12462
12463 2003-03-17  Daniel Jacobowitz  <drow@mvista.com>
12464
12465         * configure.in: Check for stdlib.h.
12466         * configure: Regenerated.
12467         * config.in: Regenerated.
12468
12469 2003-01-04  Andreas Schwab  <schwab@suse.de>
12470
12471         * linux-m68k-low.c (m68k_num_regs): Define to 29 instead of 31.
12472
12473 2003-01-02  Andrew Cagney  <ac131313@redhat.com>
12474
12475         * Makefile.in: Remove obsolete code.
12476
12477 2002-11-20  Daniel Jacobowitz  <drow@mvista.com>
12478
12479         * linux-s390-low.c (s390_regmap): Check GPR_SIZE instead of
12480         defined(PT_FPR0_HI).
12481
12482 2002-11-17  Stuart Hughes  <seh@zee2.com>
12483
12484         * linux-arm-low.c (arm_num_regs): Increase.
12485         (arm_regmap): Include status register.
12486
12487 2002-11-17  Daniel Jacobowitz  <drow@mvista.com>
12488
12489         * linux-low.c (register_addr): Remove incorrect -1 check.
12490
12491 2002-08-29  Daniel Jacobowitz  <drow@mvista.com>
12492
12493         * linux-low.c (linux_create_inferior): Call setpgid.  Return
12494         the new PID.
12495         (unstopped_p, linux_signal_pid): Remove.
12496         (linux_target_ops): Remove linux_signal_pid.
12497         * remote-utils.c (putpkt, input_interrupt): Use signal_pid
12498         global instead of target method.
12499         * target.h (struct target_ops): Remove signal_pid.  Update comment
12500         for create_inferior.
12501         * server.c (signal_pid): New variable.
12502         (create_inferior): Set signal_pid.  Block SIGTTOU and SIGTTIN in
12503         gdbserver.  Set the child to be the foreground process group.
12504         (attach_inferior): Set signal_pid.
12505
12506 2002-08-23  Daniel Jacobowitz  <drow@mvista.com>
12507
12508         * ChangeLog: New file, with entries from gdb/ChangeLog after GDB 5.2.
12509
12510 2002-08-20  Jim Blandy  <jimb@redhat.com>
12511
12512         * Makefile.in (LDFLAGS): Allow the configure script to establish a
12513         default for this.
12514
12515 2002-08-01  Andrew Cagney  <cagney@redhat.com>
12516
12517         * Makefile.in: Make chill references obsolete.
12518
12519 2002-07-24  Kevin Buettner  <kevinb@redhat.com>
12520
12521         * configure.in (unistd.h): Add to AC_CHECK_HEADERS list.
12522         * configure: Regenerate.
12523         * config.in: Regenerate.
12524
12525 2002-07-09  David O'Brien  <obrien@FreeBSD.org>
12526
12527         * gdbreplay.c (stdlib.h, unistd.h): Conditionaly include.
12528         (perror_with_name, remote_close, remote_open, expect, play): Static.
12529
12530 2002-07-04  Michal Ludvig  <mludvig@suse.cz>
12531
12532         * linux-x86-64-low.c (x86_64_regmap): Make it an array of
12533         byte offsets instead of an array of indexes.
12534         (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const.
12535
12536 2002-06-13  Daniel Jacobowitz  <drow@mvista.com>
12537
12538         * regcache.c: Add comment.
12539
12540 2002-06-11  Daniel Jacobowitz  <drow@mvista.com>
12541
12542         * thread-db.c: New file.
12543         * proc-service.c: New file.
12544         * acinclude.m4: New file.
12545         * Makefile.in: Add GDBSERVER_LIBS, gdb_proc_service_h,
12546         proc-service.o, and thread-db.o.
12547         (linux-low.o): Add USE_THREAD_DB.
12548         * acconfig.h: Add HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T,
12549         HAVE_LWPID_T, HAVE_PSADDR_T, and PRFPREGSET_T_BROKEN.
12550         * aclocal.m4: Regenerated.
12551         * config.in: Regenerated.
12552         * configure: Regenerated.
12553         * configure.in: Check for proc_service.h, sys/procfs.h,
12554         thread_db.h, and linux/elf.h headrs.
12555         Check for lwpid_t, psaddr_t, prgregset_t, prfpregset_t, and
12556         PRFPREGSET_T_BROKEN.  Introduce srv_thread_depfiles and USE_THREAD_DB.
12557         Check for -lthread_db and thread support.
12558         * configure.srv: Enable thread_db support for ARM, i386, MIPS,
12559         PowerPC, and SuperH.
12560         * i387-fp.c: Constify arguments.
12561         * i387-fp.h: Likewise.
12562         * inferiors.c: (struct thread_info): Renamed from
12563         `struct inferior_info'.  Remove PID member.  Use generic inferior
12564         list header.  All uses updated.
12565         (inferiors, signal_pid): Removed.
12566         (all_threads): New variable.
12567         (get_thread): Define.
12568         (add_inferior_to_list): New function.
12569         (for_each_inferior): New function.
12570         (change_inferior_id): New function.
12571         (add_inferior): Removed.
12572         (remove_inferior): New function.
12573         (add_thread): New function.
12574         (free_one_thread): New function.
12575         (remove_thread): New function.
12576         (clear_inferiors): Use for_each_inferior and free_one_thread.
12577         (find_inferior): New function.
12578         (find_inferior_id): New function.
12579         (inferior_target_data): Update argument type.
12580         (set_inferior_target_data): Likewise.
12581         (inferior_regcache_data): Likewise.
12582         (set_inferior_regcache_data): Likewise.
12583         * linux-low.c (linux_bp_reinsert): Remove.
12584         (all_processes, stopping_threads, using_thrads)
12585         (struct pending_signals, debug_threads, pid_of): New.
12586         (inferior_pid): Replace with macro.
12587         (struct inferior_linux_data): Remove.
12588         (get_stop_pc, add_process): New functions.
12589         (linux_create_inferior): Restore SIGRTMIN+1 before calling exec.
12590         Use add_process and add_thread.
12591         (linux_attach_lwp): New function, based on old linux_attach.  Use
12592         add_process and add_thread.  Set stop_expected for new threads.
12593         (linux_attach): New function.
12594         (linux_kill_one_process): New function.
12595         (linux_kill): Kill all LWPs.
12596         (linux_thread_alive): Use find_inferior_id.
12597         (check_removed_breakpoints, status_pending_p): New functions.
12598         (linux_wait_for_process): Renamed from linux_wait_for_one_inferior.
12599         Update.  Use WNOHANG.  Wait for cloned processes also.  Update process
12600         struct for the found process.
12601         (linux_wait_for_event): New function.
12602         (linux_wait): Use it.  Support LWPs.
12603         (send_sigstop, wait_for_sigstop, stop_all_processes)
12604         (linux_resume_one_process, linux_continue_one_process): New functions.
12605         (linux_resume): Support LWPs.
12606         (REGISTER_RAW_SIZE): Remove.
12607         (fetch_register): Use register_size instead.  Call supply_register.
12608         (usr_store_inferior_registers): Likewise.  Call collect_register.
12609         Fix recursive case.
12610         (regsets_fetch_inferior_registers): Improve error message.
12611         (regsets_store_inferior_registers): Add debugging.
12612         (linux_look_up_symbols): Call thread_db_init if USE_THREAD_DB.
12613         (unstopped_p, linux_signal_pid): New functions.
12614         (linux_target_ops): Add linux_signal_pid.
12615         (linux_init_signals): New function.
12616         (initialize_low): Call it.  Initialize using_threads.
12617         * regcache.c (inferior_regcache_data): Add valid
12618         flag.
12619         (get_regcache): Fetch registers lazily.  Add fetch argument
12620         and update all callers.
12621         (regcache_invalidate_one, regcache_invalidate): New
12622         functions.
12623         (new_register_cache): Renamed from create_register_cache.
12624         Return the new regcache.
12625         (free_register_cache): Change argument to a void *.
12626         (registers_to_string, registers_from_string): Call get_regcache
12627         with fetch flag set.
12628         (register_data): Make static.  Pass fetch flag to get_regcache.
12629         (supply_register): Call get_regcache with fetch flag clear.
12630         (collect_register): Call get_regcache with fetch flag set.
12631         (collect_register_as_string): New function.
12632         * regcache.h: Update.
12633         * remote-utils.c (putpkt): Flush after debug output and use
12634         stderr.
12635         Handle input interrupts while waiting for an ACK.
12636         (input_interrupt): Use signal_pid method.
12637         (getpkt): Flush after debug output and use stderr.
12638         (outreg): Use collect_register_as_string.
12639         (new_thread_notify, dead_thread_notify): New functions.
12640         (prepare_resume_reply): Check using_threads.  Set thread_from_wait
12641         and general_thread.
12642         (look_up_one_symbol): Flush after debug output.
12643         * server.c (step_thread, server_waiting): New variables.
12644         (start_inferior): Don't use signal_pid.  Update call to mywait.
12645         (attach_inferior): Update call to mywait.
12646         (handle_query): Handle qfThreadInfo and qsThreadInfo.
12647         (main): Don't fetch/store registers explicitly.  Use
12648         set_desired_inferior.  Support proposed ``Hs'' packet.  Update
12649         calls to mywait.
12650         * server.h: Update.
12651         (struct inferior_list, struct_inferior_list_entry): New.
12652         * target.c (set_desired_inferior): New.
12653         (write_inferior_memory): Constify.
12654         (mywait): New function.
12655         * target.h: Update.
12656         (struct target_ops): New signal_pid method.
12657         (mywait): Removed macro, added prototype.
12658
12659         * linux-low.h (regset_func): Removed.
12660         (regset_fill_func, regset_store_func): New.
12661         (enum regset_type): New.
12662         (struct regset_info): Add type field.  Use new operation types.
12663         (struct linux_target_ops): stop_pc renamed to get_pc.
12664         Add decr_pc_after_break and breakpoint_at.
12665         (get_process, get_thread_proess, get_process_thread)
12666         (strut process_info, all_processes, linux_attach_lwp)
12667         (thread_db_init): New.
12668
12669         * linux-arm-low.c (arm_get_pc, arm_set_pc,
12670         arm_breakpoint, arm_breakpoint_len, arm_breakpoint_at): New.
12671         (the_low_target): Add new members.
12672         * linux-i386-low.c (i386_store_gregset, i386_store_fpregset)
12673         (i386_store_fpxregset): Constify.
12674         (target_regsets): Add new kind identifier.
12675         (i386_get_pc): Renamed from i386_stop_pc.  Simplify.
12676         (i386_set_pc): Add debugging.
12677         (i386_breakpoint_at): New function.
12678         (the_low_target): Add new members.
12679         * linux-mips-low.c (mips_get_pc, mips_set_pc)
12680         (mips_breakpoint, mips_breakpoint_len, mips_reinsert_addr)
12681         (mips_breakpoint_at): New.
12682         (the_low_target): Add new members.
12683         * linux-ppc-low.c (ppc_get_pc, ppc_set_pc)
12684         (ppc_breakpoint, ppc_breakpoint_len, ppc_breakpoint_at): New.
12685         (the_low_target): Add new members.
12686         * linux-sh-low.c (sh_get_pc, sh_set_pc)
12687         (sh_breakpoint, sh_breakpoint_len, sh_breakpoint_at): New.
12688         (the_low_target): Add new members.
12689         * linux-x86-64-low.c (target_regsets): Add new kind
12690         identifier.
12691
12692 2002-05-15  Daniel Jacobowitz  <drow@mvista.com>
12693
12694         From Martin Pool <mbp@samba.org>:
12695         * server.c (gdbserver_usage): New function.
12696         (main): Call it.
12697
12698 2002-05-14  Daniel Jacobowitz  <drow@mvista.com>
12699
12700         * mem-break.c (reinsert_breakpoint_by_bp): Correct typo
12701         stop_at -> stop_pc.
12702
12703 2002-05-04  Andrew Cagney  <ac131313@redhat.com>
12704
12705         * Makefile.in: Remove obsolete code.
12706
12707 2002-04-24  Michal Ludvig  <mludvig@suse.cz>
12708
12709         * linux-low.c (regsets_fetch_inferior_registers),
12710         (regsets_store_inferior_registers): Removed cast to int from
12711         ptrace() calls.
12712         * regcache.h: Added declaration of struct inferior_info.
12713
12714 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12715
12716         * inferiors.c (struct inferior_info): Add regcache_data.
12717         (add_inferior): Call create_register_cache.
12718         (clear_inferiors): Call free_register_cache.
12719         (inferior_regcache_data, set_inferior_regcache_data): New functions.
12720         * regcache.c (struct inferior_regcache_data): New.
12721         (registers): Remove.
12722         (get_regcache): New function.
12723         (create_register_cache, free_register_cache): New functions.
12724         (set_register_cache): Don't initialize the register cache here.
12725         (registers_to_string, registers_from_string, register_data): Call
12726         get_regcache.
12727         * regcache.h: Add prototypes.
12728         * server.h: Likewise.
12729
12730 2002-04-20  Daniel Jacobowitz  <drow@mvista.com>
12731
12732         * mem-break.c: New file.
12733         * mem-break.h: New file.
12734         * Makefile.in: Add mem-break.o rule; update server.h
12735         dependencies.
12736         * inferiors.c (struct inferior_info): Add target_data
12737         member.
12738         (clear_inferiors): Free target_data member if set.
12739         (inferior_target_data, set_inferior_target_data): New functions.
12740         * linux-i386-low.c (i386_breakpoint, i386_breakpoint_len)
12741         (i386_stop_pc, i386_set_pc): New.  Add to the_low_target.
12742         * linux-low.c (linux_bp_reinsert): New variable.
12743         (struct inferior_linux_data): New.
12744         (linux_create_inferior): Use set_inferior_target_data.
12745         (linux_attach): Likewise.  Call add_inferior.
12746         (linux_wait_for_one_inferior): New function.
12747         (linux_wait): Call it.
12748         (linux_write_memory): Add const.
12749         (initialize_low): Call set_breakpoint_data.
12750         * linux-low.h (struct linux_target_ops): Add breakpoint
12751         handling members.
12752         * server.c (attach_inferior): Remove extra add_inferior
12753         call.
12754         * server.h: Include mem-break.h.  Update inferior.c
12755         prototypes.
12756         * target.c (read_inferior_memory)
12757         (write_inferior_memory): New functions.
12758         * target.h (read_inferior_memory)
12759         (write_inferior_memory): Change macros to prototypes.
12760         (struct target_ops): Update comments.  Add const to write_memory
12761         definition.
12762
12763 2002-04-11  Daniel Jacobowitz  <drow@mvista.com>
12764
12765         * linux-low.c (usr_store_inferior_registers): Support
12766         registers which are allowed to fail to store.
12767         * linux-low.h (linux_target_ops): Likewise.
12768         * linux-ppc-low.c (ppc_regmap): Support FPSCR.
12769         (ppc_cannot_store_register): FPSCR may not be storable.
12770
12771 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12772
12773         * server.h: Include <string.h> if HAVE_STRING_H.
12774         * ChangeLog: Correct paths in last ChangeLog entry.
12775
12776 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12777
12778         * linux-low.h: Remove obsolete prototypes.
12779         (struct linux_target_ops): New.
12780         (extern the_low_target): New.
12781         * linux-low.c (num_regs, regmap): Remove declarations.
12782         (register_addr): Use the_low_target explicitly.
12783         (fetch_register): Likewise.
12784         (usr_fetch_inferior_registers): Likewise.
12785         (usr_store_inferior_registers): Likewise.
12786         * linux-arm-low.c (num_regs): Remove.
12787         (arm_num_regs): Define.
12788         (arm_regmap): Renamed from regmap, made static.
12789         (arm_cannot_fetch_register): Renamed from cannot_fetch_register,
12790         made static.
12791         (arm_cannot_store_register): Renamed from cannot_store_register,
12792         made static.
12793         (the_low_target): New.
12794         * linux-i386-low.c (num_regs): Remove.
12795         (i386_num_regs): Define.
12796         (i386_regmap): Renamed from regmap, made static.
12797         (i386_cannot_fetch_register): Renamed from cannot_fetch_register,
12798         made static.
12799         (i386_cannot_store_register): Renamed from cannot_store_register,
12800         made static.
12801         (the_low_target): New.
12802         * linux-ia64-low.c (num_regs): Remove.
12803         (ia64_num_regs): Define.
12804         (ia64_regmap): Renamed from regmap, made static.
12805         (ia64_cannot_fetch_register): Renamed from cannot_fetch_register,
12806         made static.
12807         (ia64_cannot_store_register): Renamed from cannot_store_register,
12808         made static.
12809         (the_low_target): New.
12810         * linux-m68k-low.c (num_regs): Remove.
12811         (m68k_num_regs): Define.
12812         (m68k_regmap): Renamed from regmap, made static.
12813         (m68k_cannot_fetch_register): Renamed from cannot_fetch_register,
12814         made static.
12815         (m68k_cannot_store_register): Renamed from cannot_store_register,
12816         made static.
12817         (the_low_target): New.
12818         * linux-mips-low.c (num_regs): Remove.
12819         (mips_num_regs): Define.
12820         (mips_regmap): Renamed from regmap, made static.
12821         (mips_cannot_fetch_register): Renamed from cannot_fetch_register,
12822         made static.
12823         (mips_cannot_store_register): Renamed from cannot_store_register,
12824         made static.
12825         (the_low_target): New.
12826         * linux-ppc-low.c (num_regs): Remove.
12827         (ppc_num_regs): Define.
12828         (ppc_regmap): Renamed from regmap, made static.
12829         (ppc_cannot_fetch_register): Renamed from cannot_fetch_register,
12830         made static.
12831         (ppc_cannot_store_register): Renamed from cannot_store_register,
12832         made static.
12833         (the_low_target): New.
12834         * linux-s390-low.c (num_regs): Remove.
12835         (s390_num_regs): Define.
12836         (s390_regmap): Renamed from regmap, made static.
12837         (s390_cannot_fetch_register): Renamed from cannot_fetch_register,
12838         made static.
12839         (s390_cannot_store_register): Renamed from cannot_store_register,
12840         made static.
12841         (the_low_target): New.
12842         * linux-sh-low.c (num_regs): Remove.
12843         (sh_num_regs): Define.
12844         (sh_regmap): Renamed from regmap, made static.
12845         (sh_cannot_fetch_register): Renamed from cannot_fetch_register,
12846         made static.
12847         (sh_cannot_store_register): Renamed from cannot_store_register,
12848         made static.
12849         (the_low_target): New.
12850         * linux-x86-64-low.c (x86_64_regmap): Renamed from regmap.
12851         (the_low_target): New.
12852
12853 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12854
12855         * Makefile.in: Add stamp-h target.
12856         * configure.in: Create stamp-h.
12857         * configure: Regenerated.
12858
12859 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12860
12861         * inferiors.c: New file.
12862         * target.c: New file.
12863         * target.h: New file.
12864         * Makefile.in:  Add target.o and inferiors.o.  Update
12865         dependencies.
12866         * linux-low.c (inferior_pid): New static variable,
12867         moved from server.c.
12868         (linux_create_inferior): Renamed from create_inferior.
12869         Call add_inferior.  Return 0 on success instead of a PID.
12870         (linux_attach): Renamed from myattach.
12871         (linux_kill): Renamed from kill_inferior.  Call clear_inferiors ().
12872         (linux_thread_alive): Renamed from mythread_alive.
12873         (linux_wait): Renamed from mywait.  Call clear_inferiors () if the
12874         child dies.
12875         (linux_resume): Renamed from myresume.  Add missing ``return 0''.
12876         (regsets_store_inferior_registers): Correct error message.
12877         Add missing ``return 0''.
12878         (linux_fetch_registers): Renamed from fetch_inferior_registers.
12879         (linux_store_registers): Renamed from store_inferior_registers.
12880         (linux_read_memory): Renamed from read_inferior_memory.
12881         (linux_write_memory): Renamed from write_inferior_memory.
12882         (linux_target_ops): New structure.
12883         (initialize_low): Call set_target_ops ().
12884         * remote-utils.c (unhexify): New function.
12885         (hexify): New function.
12886         (input_interrupt): Send signals to ``signal_pid''.
12887         * server.c (inferior_pid): Remove.
12888         (start_inferior): Update create_inferior call.
12889         (attach_inferior): Call add_inferior.
12890         (handle_query): New function.
12891         (main): Call handle_query for `q' packets.
12892         * server.h: Include "target.h".  Remove obsolete prototypes.
12893         Add prototypes for "inferiors.c", "target.c", hexify, and unhexify.
12894
12895 2002-04-09  Daniel Jacobowitz  <drow@mvista.com>
12896
12897         * Makefile.in: Add WARN_CFLAGS.  Update configury
12898         dependencies.
12899         * configure.in: Check for <string.h>
12900         * configure: Regenerate.
12901         * config.in: Regenerate.
12902         * gdbreplay.c: Include needed system headers.
12903         (remote_open): Remove strchr prototype.
12904         * linux-low.h: Correct #ifdef to HAVE_LINUX_USRREGS.
12905         * regcache.c (supply_register): Change buf argument to const void *.
12906         (supply_register_by_name): Likewise.
12907         (collect_register): Change buf argument to void *.
12908         (collect_register_by_name): Likewise.
12909         * regcache.h: Add missing prototypes.
12910         * remote-utils.c: Include <arpa/inet.h> for inet_ntoa.
12911         * server.c (handle_query): New function.
12912         (attached): New static variable, moved out of main.
12913         (main): Quiet longjmp clobber warnings.
12914         * server.h: Add ATTR_NORETURN and ATTR_FORMAT.  Update prototypes.
12915         * utils.c (error): Remove NORETURN.
12916         (fatal): Likewise.