1 2003-01-16 Kevin Buettner <kevinb@redhat.com>
3 * config.in (LIBTHREAD_DB_SO): New macro.
4 * configure.in (mips64*linux*): Remove no-threads.o from
5 TARGET_MODULES list. Add thread-db.o to this list.
6 * configure: Regenerate.
8 2003-01-10 Kevin Buettner <kevinb@redhat.com>
10 * Makefile.in: Regenerate using "automake --cygnus --ignore-deps".
11 Someday, when ``depcomp'' is added to the top level, the
12 --ignore-deps flag can be discarded.
14 2002-12-18 Kevin Buettner <kevinb@redhat.com>
16 * ptrace-target.h, ptrace-target.c (ptrace_write_user)
17 (ptrace_read_user): Add struct gdbserv argument.
18 * linux-target.c: Fix all callers.
19 * ptrace-target.c (ptrace_write_user, ptrace_read_user): Add
21 (ptrace_xfer_mem): Fix debugging printf()s so that they'll print
22 useful results when sizeof (long long) is the same as
23 sizeof (ptrace_xfer_type).
24 (ptrace_xfer_mem): Decode address using gdbserv_host_bytes_from_reg()
25 instead of gdbserv_reg_to_ulong().
27 2002-12-02 Kevin Buettner <kevinb@redhat.com>
29 * linux-target.c (linux_get_reg, linux_set_reg, reg_from_regset)
30 (reg_to_regset, get_regset, put_regset reg_from_gregset)
31 (reg_to_gregset, reg_from_fpregset, reg_to_fpregset)
32 (reg_from_xregset, reg_to_xregset): Adjust all calls to
33 gdbserv_host_bytes_to_reg() and gdbserv_host_bytes_from_reg()
34 to account for change in interface. Remove code which is
35 no longer needed due to improvements in the aforementioned
37 (sign_extend): New constant.
38 (FPR_BASE, PC, CAUSE, BADVADDR, MMHI, MMLO, FPC_CSR, FPC_EIR):
39 Make sure these are defined.
41 (reginfo) [MIPS_LINUX_TARGET]: Use PROTO_SIZE to initialize
42 table with size (width) of registers to use when communicating
44 (NUM_REGS, PC_REGNUM, reginfo) [MIPS64_LINUX_TARGET]: Define.
46 2002-11-19 Michael Snyder <msnyder@redhat.com>
48 * ptrace-target.c: Fix typo in copyright.
50 2002-08-23 Kevin Buettner <kevinb@redhat.com>
52 * linux-target.c (linux_get_reg, linux_set_reg): Print an
53 error message for out of bound registers.
55 2002-08-23 Kevin Buettner <kevinb@redhat.com>
57 * linux-target.c (NUM_REGS) [X86_LINUX_TARGET]: Bump to 42.
58 (getregs_setregs_reginfo) [X86_LINUX_TARGET]: Add entry for
59 register ``orig_eax''.
60 (linux_get_reg, linux_set_reg): Make sure ``regno'' value is valid.
61 (linux_detach, linux_attach, decr_pc_after_break): Call fprintf()
63 (linux_detach, linux_attach): Don't always print informational
65 * ptrace-target.c (handle_waitstatus, ptrace_detach, ptrace_attach):
66 Don't always print informational messages. Use fprintf() instead
68 (noop_get_trap_number, noop_compute_signal, noop_exit_program)
69 (noop_signlestep_program, noop_break_program): Delete.
70 (ptrace_flush_i_cache): Renamed from noop_flush_i_cache. Update
71 reference in ptrace_attach().
72 (continue_lwp, singlestep_lwp, attach_lwp, stop_lwp, ps_pstop)
73 (ps_continue, ps_lstop): Use fprintf() instead of printf().
74 * server.c (errno.h): Include.
75 (usage): New function.
76 (main): Add option processing code.
77 * server.h (struct child_process): Add new field,
78 ``debug_informational''.
79 * thread-db.c (ps_plog, select_pending_event, send_pending_signals)
80 (wait_all_threads, thread_db_check_child_state): Use fprintf()
82 (thread_db_detach): Conditionally print informational messages.
83 Use fprintf() instead of printf().
85 2002-08-21 Kevin Buettner <kevinb@redhat.com>
87 * Makefile.am, configure.in, dummy-target.c, linux-target.c,
88 ptrace-target.c, ptrace-target.h, server.h, solaris-target.c,
89 thread-db.c: Change ``libremote'' references into ``RDA''
91 * Makefile.in, configure: Regenerate.
93 2002-08-15 Kevin Buettner <kevinb@redhat.com>
95 * dummy-target.c, gdb_proc_service.h, gdbserv-thread-db.h,
96 linux-target.c, no-threads.c, ptrace-target.c,
97 ptrace-target.h, server.c, server.h, solaris-target.c,
98 thread-db.c: Update copyright notices.
100 2002-05-16 Kevin Buettner <kevinb@redhat.com>
102 * config.in (GREGSET_T): Renamed from GDB_GREGSET_T.
103 (FPREGSET_T): Renamed from GDB_FPREGSET_T.
104 * configure.in: Likewise.
105 * gdbserv-thread-db.h: Likewise.
106 * linux-target.c: Likewise.
107 * thread-db.c: Likewise.
108 * gdb_proc_service.h: Remove everything that's not absolutely
111 2002-02-01 Kevin Buettner <kevinb@redhat.com>
113 * configure.in (arm32): Change to ``yes''.
114 * configure: Regenerate.
116 2002-01-30 Kevin Buettner <kevinb@redhat.com>
118 * linux-target.c (linux_get_reg) [GETREGS_SETREGS_REGINFO]: Add
120 (linux_set_reg) [GETREGS_SETREGS_REGINFO]: Likewise.
122 2002-01-28 Kevin Buettner <kevinb@redhat.com>
124 * linux-target.c (write_reg_bytes): Print return status in
125 ptrace failure message.
126 * ptrace-target.c (ptrace_write_user): Enable existing
127 Linux/MIPS related kernel bug workaround when MIPS_LINUX_TARGET
128 is defined (which is in addition to _MIPSEL).
130 2002-01-28 Kevin Buettner <kevinb@redhat.com>
132 * thread-db.c (struct regset_cache): New struct declaration.
133 (thread_db_map_id2thr_cache_valid, fpregset_cache, gregset_cache):
135 (thread_db_map_id2thr, thread_db_invalidate_map_id2thr_cache)
136 (initialize_regset_cache, initialize_regset_caches)
137 (thread_db_flush_regset_cache, thread_db_flush_regset_caches)
138 (thread_db_get_regset, thread_db_set_regset)
139 (thread_db_invalidate_regset_cache, thread_db_invalidate_regset_caches)
140 (thread_db_invalidate_caches, thread_db_getfpregs)
141 (thread_db_set_fpregs, thread_db_getgregs, thread_db_setgregs)
142 (td_thr_getfpregs_wrapper, td_thr_getgregs_wrapper)
143 (td_thr_setfpregs_wrapper, td_thr_setgregs_wrapper):
145 (update_thread_list, thread_db_get_thread_reg)
146 (thread_db_set_thread_reg): Call thread_db_map_id2thr() instead of
147 td_ta_map_id2thr_p().
148 (thread_db_get_thread_reg): Call thread_db_getfpregs() instead
149 of td_thr_getfpregs_p(). Call thread_db_getgregs() instead of
151 (thread_db_set_thread_reg): Likewise. Also, call
152 thread_db_setfpregs() instead of td_thr_setfpregs_p() and
153 call thread_db_setgregs() instead of td_thr_setgregs_p().
154 (continue_thread, thread_db_continue_program)
155 (thread_db_singlestep_program, thread_db_continue_thread)
156 (singlestep_thread): Call thread_db_flush_regset_caches() at
157 beginning of function and thread_db_invalidate_caches() at
159 (thread_db_attach): Initialize regset caches.
161 2002-01-15 Kevin Buettner <kevinb@redhat.com>
163 * config.in (Generated automatically comment): Revise to note
164 that this file was generated automatically at one time, but is
166 (LINUX_TARGET, SOLARIS_TARGET): Fix comments.
167 (MIPS_LINUX_TARGET): Add.
168 * configure.in (i?86*linux*, powerpc*linux*, arm*linux*, mips*linux*):
169 Eliminate unnecessary duplication.
170 (mips*linux*): Target is MIPS_LINUX_TARGET, not SH_LINUX_TARGET.
171 * gdbserv-thread-db.h (is_gp_reg): New function.
172 (is_fp_reg, is_extended_reg): Revise comments.
173 * linux-target.c (enum regset): Add new constant NOREGS.
174 (is_gp_reg): New function.
175 (PEEKUSER_POKEUSER_REGINFO) [MIPS_LINUX_TARGET]: Define.
176 (SIZEOF_REGMAP, SIZEOF_MAPPEDREG) [MIPS_LINUX_TARGET]: Delete.
177 (NUM_REGS) [MIPS_LINUX_TARGET]: Change from 38 to 70 to account
178 for addition of floating point support.
179 (regmap) [MIPS_LINUX_TARGET]: Delete this array.
180 (is_fp_reg, is_extended_reg) [MIPS_LINUX_TARGET]: Delete.
181 (reginfo) [MIPS_LINUX_TARGET]: Define.
182 (DEBUG): Delete this macro definition.
183 (disp_gdb_mesg, ptrace_get_mem, ptrace_set_mem): Delete function
185 (linux_get_reg, linux_set_reg) [PEEKUSER_POKEUSER_REGINFO]: Add
187 (put_regset) [PEEKUSER_POKEUSER_REGINFO]: Add missing return
189 (mips_get_reg): Use read_reg_bytes() to fetch the register.
190 (mips_singlestep_program): Eliminate unused variables ``u_regs_base'',
191 ``temp_reg''. Fix fprintf related format warning.
192 * ptrace-target.h (ptrace_check_child_state): Declare.
193 * thread-db.c (thread_db_get_thread_reg, thread_db_set_thread_reg):
194 Handle case of target not supporting one or more registers.
196 2001-10-15 Kevin Buettner <kevinb@redhat.com>
198 * gdbserv-thread-db.h (is_extended_reg, reg_to_xregset)
199 (reg_from_xregset): New functions.
200 (debug_get_pc, decr_pc_after_break): Add declaration.
201 * linux-target.c (sys/procfs.h): Include.
202 (MAX_REG_SIZE): New anonymous enum constant.
203 (enum regset): New enum.
204 (getregs_setregs_reginfo, peekuser_pokeuser_reginfo): New structs.
205 (offsetof, fieldsize): New macros.
206 (ARM_LINUX_TARGET, X86_LINUX_TARGET, PPC_LINUX_TARGET): Deleted
207 old data structures defining register maps for these registers.
208 Replaced with new tables using either getregs_setregs_reginfo
209 or peekuser_pokeuser_reginfo structs. Other architectures
210 remain the same, though reoranized somewhat.
211 (linux_next_gg_reg, linux_gg_reg_nr): Revise comments. Use
212 NUM_REGS instead of NUM_G_PACKET_REGS.
213 (get_xregsetsize): New function.
214 (linux_reg_format, linux_sizeof_reg, is_fp_reg, is_extended_reg)
215 [PEEKUSER_POKEUSER_REGINFO, GETREGS_SETREGS_REGINFO]: New functions.
216 (read_reg_bytes, write_reg_bytes, debug_get_reg, debug_get_pc)
217 (linux_get_reg, linux_set_reg, reg_from_regset, reg_to_regset)
218 (reg_from_gregset, reg_to_gregset, reg_from_fpregset, reg_to_fpregset)
219 (reg_from_xregset, reg_to_xregset, get_regset, put_regset, get_gregset)
220 (put_gregset, get_fpregset, put_fpregset, get_xregset, put_xregset)
221 [PEEKUSER_POKEUSER_REGINFO]: New functions.
222 (read_reg_as_ulong, write_reg_as_ulong, debug_get_reg, debug_get_pc)
223 (linux_get_reg, linux_set_reg, regs_from_gregset, regs_to_gregset)
224 (reg_from_fpregset, reg_to_fpregset, reg_from_xregset, reg_to_xregset)
225 (get_gregset, put_gregset, get_fpregset, put_fpregset, get_xregset)
226 (put_xregset) [GETREGS_SETREGS_REGINFO]: New functions.
227 (linux_process_get_regs, linux_process_get_reg, linux_process_set_reg)
228 (linux_process_set_regs, ppc_linux_process_set_reg)
229 (ppc_linux_process_get_reg, ppc_linux_process_set_regs)
230 (ppc_linux_process_get_regs): Deleted.
231 (linux_attach): Reorganize initializations.
232 (generic_linux_set_reg): Renamed to linux_set_reg.
233 (generic_linux_get_reg): Renamed to linux_get_reg.
234 (generic_linux_sizeof_reg): Renamed to linux_sizeof_reg.
235 (generic_linux_gg_reg_nr): Renamed to linux_gg_reg_nr.
236 (generic_linux_next_gg_reg): Renamed to linux_next_gg_reg.
237 (generic_linux_reg_format): Renamed to linux_reg_format.
238 (decr_pc_after_break): Consolidated versions of this function
239 down to two; one for x86 and one for everything else. Also,
240 add ``serv'' parameter and fix all callers.
241 (debug_get_pc, debug_get_reg): Now only three versions of
242 this function, one for PEEKUSER_POKEUSER_REGINFO code,
243 one for GETREGS_SETREGS_REGINFO code, and one for legacy
244 code. Also, debug_get_pc() now takes a ``serv'' parameter.
246 (ps_lgetregs): Use new get_gregset() interface.
247 (ps_lsetregs): Use new put_gregset() interface.
248 (ps_lgetfpregs, ps_lsetfpregs, ps_lgetxregsize, ps_lgetxregs)
249 (ps_lsetxregs): Implement.
250 * ptrace-target.c (ptrace_read_user, ptrace_write_user): Make
251 ``buff'' argument of type ``void *'' instead of ``char *''.
252 (ptrace_get_gregs): Add new parameter ``alt_pid''.
253 (ptrace_set_gregs): Likewise.
254 (ptrace_get_fpregs): Add new parameter alt_pid. Also fix call
255 to ptrace() so parameters are in correct order.
256 (ptrace_set_fpregs): Likewise.
257 (ptrace_get_fpxregs, ptrace_set_fpxregs): New functions.
258 * ptrace-target.h (ptrace_write_user, ptrace_read_user)
259 (ptrace_get_gregs, ptrace_set_gregs, ptrace_get_fpregs)
260 (ptrace_set_fpregs, ptrace_get_fpxregs, ptrace_set_fpxregs):
262 * thread-db.c (td_thr_getxregsize_p, td_thr_getxregs_p)
263 (td_thr_setxregs_p): New function pointers.
264 (thread_db_dlopen): Initialize new function pointers.
265 (send_pending_signals): Add ``process'' parameter so that
266 decr_pc_after_break() can get the ``serv'' argument. Fix all
268 (thread_db_get_thread_reg, thread_db_set_thread_reg): Add xregset
271 2001-10-14 Kevin Buettner <kevinb@redhat.com>
273 * ptrace-target.c (unistd.h): Include.
274 (close_open_files): New function.
275 (ptrace_create_child): In newly forked child process, call
276 close_open_files() before invoking execv().
278 2001-10-13 Kevin Buettner <kevinb@redhat.com>
280 * server.c (signal.h): Include.
281 (chld_handler): New function.
282 (main): Establish chld_handler as the SIGCHLD signal handler.
283 Also, wait 1 second instead of 0 seconds to avoid busy waiting.
285 2001-09-26 Louis Hamilton <hamilton@redhat.com>
287 * configure.in: Use thread-db.c for ARM.
288 * configure: Regenerated.
289 * linux-target.c (ARM_R11, ARM_R12): Added to regmap[].
290 (ARM_FP, ARM_CPSR): Revised mappings of these ARM registers.
291 (debug_get_reg, debug_get_pc, decr_pc_after_break) [ARM_LINUX_TARGET]:
294 2001-09-20 Kevin Buettner <kevinb@redhat.com>
296 * configure.in: Use thread-db.c for Linux/PPC too.
297 * configure: Regenerated.
298 * linux-target.c (linux_read_reg): Add forward declaration.
299 (debug_get_reg, debug_get_pc, decr_pc_after_break) [PPC_LINUX_TARGET]:
302 2001-09-20 Kevin Buettner <kevinb@redhat.com>
304 * linux-target.c (SIZEOF_MAPPEDREG) [PPC_LINUX_TARGET]: Add comment.
305 (PC_REGNUM) [PPC_LINUX_TARGET]: Remove FIXME comment.
306 (is_fp_reg) [PPC_LINUX_TARGET]: Revise upper bound on floating
307 point register numbers.
308 (ppc_linux_getset_reg): Rewritten to use regmap[] to fetch
309 ptrace() offsets. This'll handle the (previously unsupported)
310 floating point registers, cr, lr, ctr, and xer.
311 (ppc_linux_process_set_regs, ppc_linux_process_get_regs): Don't
312 hardcode loop upper bound.
313 (ppc_linux_process_get_regs): Revise declarator to match
314 process_get_regs member in struct gdbserv_target.
316 2001-09-18 Andrew Haley <aph@cambridge.redhat.com>
318 * server.c (main): Work around SIGCHLD problem.
320 2001-08-05 Michael Chastain <chastain@redhat.com>
322 * ptrace-target.c (ptrace_write_user): Ignore ESRCH on MIPS,
323 because mips linux kernel 2.4 has a bug where PTRACE_POKEUSER
324 returns -ESRCH even when it succeeds.
326 2001-08-03 Michael Keezer <mkeezer@redhat.com>
328 * configure.in: Add am33_2.0 & mn10300.
329 * config.in: Add AM33_LINUX_TARGET & AM33_2_0_LINUX_TARGET.
330 * linux-target.c: am33_2.0 & mn10300 support.
332 2001-07-23 David Howells <dhowells@redhat.com>
334 * ptrace-target.c: Added big-endian MIPS support.
335 * linux-target.c: ditto.
338 2001-06-25 Michael Snyder <msnyder@redhat.com>
340 * ptrace-target.c (ptrace_compute_signal): Implement conversion
341 from native signals to GDB's signal numbering.
342 (ptrace_process_signal): Implement conversion from GDB's signal
343 numbering to native signals.
344 (stop_lwp): Comment out debugging output of SIGSTOP signals.
345 * linix-target.c (linux_fromtarget_break): Call compute_signal.
346 (linux_fromtarget_terminate): Ditto.
347 * thread-db.c (thread_db_check_child_state): Don't do any conversion
348 when passing a signal directly back to the inferior; just copy from
349 stop_signal to signal_to_send.
350 (thread_db_fromtarget_thread_break): Convert signal from native
351 numbering to GDB's numbering.
353 2001-06-18 Michael Snyder <msnyder@redhat.com>
355 * linux-target.c (generic_linux_set_reg): Fix typo.
356 (decr_pc_after_break): Mute the debugging output.
358 2001-06-15 Michael Snyder <msnyder@redhat.com>
360 * thread_db.c: Disable noisy debugging output.
361 (select_pending_event): Add new selection criterion, giving
362 preference to a thread that is being single-stepped. This
363 avoids the problem of deciding whether to decrement the pc if
364 we don't know whether a SIGTRAP was caused by stepping or by
365 hitting a breakpoint.
367 2001-06-14 Michael Snyder <msnyder@redhat.com>
369 * thread-db.c (thread_db_set_gen, thread_db_get_gen): Rewrite
370 syntax for qSymbol messages.
371 * gdb_proc_service.h: New file.
372 * Makefile.am (INCLUDES): Remove $(srcdir)/../../include.
373 * Makefile.in: Regenerate.
375 2001-05-31 Michael Snyder <msnyder@redhat.com>
377 * thread-db.c (add_thread_to_list): Return explicit value!
379 2001-05-23 Jackie Smith Cashion <jsmith@redhat.com>
381 * linux-target.c: Change MIPS SIZEOF_MAPPEDREG from 1 to 4.
382 (linux_register_offset): For MIPS return regmap[regnum] instead of
383 SIZEOF_MAPPEDREG * regmap[regnum].
384 (mips_get_reg): Pass pid as argument to ptrace_read_user instead of
387 2001-05-22 Michael Snyder <msnyder@redhat.com>
389 * no-threads.c: New file.
390 * configure.in: Use thread-db.c only for specified architectures,
391 (including x86); otherwise default to using no-threads.c.
392 * configure: Regenerate.
394 2001-05-10 Martin M. Hunt <hunt@redhat.com>
396 * linux-target.c (is_fp_reg): New function for mips.
399 Merged changes from symbol branch with appropriate modifications.
401 Mon Mar 26 08:54:41 PST 2001 Brendan Conoboy <blc@redhat.com>
403 * configure.in: Added mipsvr4181el* target
404 * configure: regenerate
406 2001-01-26 Rudy Folden <rfolden@redhat.com>
408 * server.c: Changed name from gdbgeneral_xxx to gdbconnect_xx.
410 2001-01-24 Rudy Folden <rfolden@redhat.com>
412 * configure: Added mipsel* target.
413 * linux-target.c: Add support for MIPS processor, including single-
414 stepping which doesn't exist in mips ptrace.
415 * ptrace-target.c (ptrace_handle_waitstatus): Added single-stepping
416 instruction restore for mips.
417 (ptrace_attach): Added single stepping initialization code.
418 * server (main): Added generic interfaces, gdbgeneral_startup/shutdown
419 for serial or tcp/ip selection. Also added server_quit_p to X and W
420 for serial support (no socket shutdown).
421 * server.h (child_process): Added mips instruction save area for
424 2001-01-10 Rudy Folden <rfolden@redhat.com>
425 * ptrace-target.c (enum): Added U_REGS_OFFSET to processor
428 2001-04-26 Michael Snyder <msnyder@redhat.com>
430 * linux-target.c (is_fp_reg): New function.
431 (reg_from_fpregset, reg_to_fpregset): New functions.
432 Support for thread_db_get_thread_reg floating point regs.
433 * thread-db.c (thread_db_get_thread_reg, thread_db_set_thread_reg):
434 Infrastructure for support of floating point regs.
435 (Attach_thread): New function, abstracted from below.
436 (find_new_threads_callback): Call attach_thread.
437 (stop_thread): New function, abstracted from stop_all_threads.
438 (stop_all_threads): Call stop_thread.
439 (continue_thread): Test for lwp == 0 before calling continue_lwp.
440 * ptrace-target.c (stop_lwp): New function.
441 * gdbserv-thread-db.h (reg_to_regnum, reg_from_regnu): Declare.
443 2001-04-25 Michael Snyder <msnyder@redhat.com>
445 Move all ptrace references out of thread-db.c.
446 * gdbserv-thread-db.h: New file.
447 * thread-db.c (struct ps_prochandle): Move to gdbserv-thread-db.h.
448 (gdb_ps_prochandle_t): Ditto.
449 (gdb_ps_read_buf_t, gdb_ps_write_buf_t, gdb_ps_size_t): Ditto.
450 (ps_pstop, ps_pcontinue): Move to ptrace-target.c.
451 (ps_lstop, ps_lcontinue): Ditto.
452 (ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite): Ditto.
453 (ps_lgetxregsize): Move to linux-target.c.
454 (ps_lgetxregs, ps_lsetxregs, ps_getpid): Ditto.
455 (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Ditto.
456 (find_new_threads_callback): Abstract attach bits into new function
457 attach_lwp, and move that to ptrace-target.c.
458 (wait_all_threads): Call continue_lwp instead of ptrace.
459 (continue_pid): Rename as continue_lwp, move into ptrace-target.c.
460 (singlestep_pid): Rename as continue_lwp, move into ptrace-target.c.
461 (struct symbol_cache): Change value to a paddr_t.
462 (add_symbol_to_list, lookup_cached_symbol): Ditto.
463 * linux-target.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs,
464 ps_lsetfpregs, ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs,
465 ps_getpid): Moved to here from thread-db.c.
466 * ptrace-target.c (continue_lwp, singlestep_lwp, attach_lwp,
467 (ps_pstop, ps_pcontinue, ps_lstop, ps_lcontinue, ps_pdread,
468 ps_pdwrite, ps_ptread, ps_ptwrite): Moved here from thread-db.c.
469 (ptrace_handle_waitstatus): Renamed as handle_waitstatus.
470 (ps_lcontinue): Implement (untested).
471 * server.c (main): Check server_quit_p after calling gdbloop_poll.
474 2001-04-24 Michael Snyder <msnyder@redhat.com>
476 * thread-db.c (continue_pid, continue_thread): New functions.
477 (singlestep_pid, singlestep_thread): New functions.
478 (continue_all_threads): Use new function continue_thread.
479 (thread_db_continue_program): Ditto.
480 (thread_db_singlestep_program): Ditto.
481 (thread_db_continue_thread): Ditto.
482 (thread_db_singlestep_thread): Ditto.
484 * thread-db.c: Remove some debugging printfs.
485 Add activation and handling of the thread debug signal.
486 (get_thread_signals): Get the debug signal as well as the others.
487 Set target flag to activate the debug signal.
488 (set_target_int_by_name): New function.
489 (struct gdbserv_thread): Rename "sigstopped" flag to just "stopped".
490 (stop_all_threads): Mark the event thread "stopped".
491 (wait_all_threads): Mark the event thread "waited".
492 Don't stash the debug signal (throw it away).
493 (continue_all_threads): Always send the restart signal to any
494 thread that has just been attached.
495 (thread_db_check_child_state): Make two calls to waitpid (one with
496 WCLONE, one without) instead of alternating every other time.
497 Add debug_signal to the list of events to ignore.
498 (thread_db_attach): Add "__pthread_threads_debug" to list of symbols.
500 2001-04-20 Michael Snyder <msnyder@redhat.com>
502 * thread-db.c (thread_db_check_child_state): Add SIGCHLD to the
503 list of signals to ignore. When a thread exits, make sure that
504 the other threads get restarted.
506 2001-04-19 Michael Snyder <msnyder@redhat.com>
508 * thread-db.c (wait_all_threads): Save exit and term events.
509 Save SIGINT like any other signal event.
510 (send_pending_signals): Don't send SIGINT.
511 (select_pending_event): Give preference to SIGINT.
512 (thread_db_check_child_state): Move special handling of
513 cancel and restart signals to after the stop_all_threads
514 and wait_all_threads calls, so we can catch these signals
515 even if they aren't the first signal we get notification of.
517 2001-04-19 Michael Snyder <msnyder@redhat.com>
519 Major change to select an event so as to avoid starvation.
520 * thread-db.c (select_pending_event): New function. Choose an
521 event from the list of pending events, and make its thread the
523 (stop_all_threads): Don't mark the event thread. That will now
524 be done by select_pending_event.
525 (struct signal_list): Rename to event_list. Save the thread and
526 the entire wait status, so that all events (not just signals)
528 (add_pending_signal): Rename to add_pending_event.
529 (send_pending_signals): Ignore non-signal events.
530 Ignore the selected event (which will be returned to the debugger).
531 Push back breakpoint events (moved here from wait_all_threads).
532 (wait_all_threads): Remove special handling for SIGTRAP (moved
533 into send_pending_signals). Call select_pending_event.
534 (thread_db_check_child_status): Add initial event to event list.
536 2001-04-16 Michael Snyder <msnyder@redhat.com>
537 * thread-db.c (thread_db_continue_thread): Handle the signal param.
538 (thread_db_singlestep_thread): Ditto.
539 (thread_db_check_child_state): Handle exit and termination separately.
541 2001-04-13 Michael Snyder <msnyder@redhat.com>
543 * thread-db.c (find_new_threads_callback): Account for dead threads.
544 (update_thread_list): Keep zombie threads in thread list, but
545 delete them if they've been joined or detached.
546 (stop_all_threads): Don't stop dead threads.
547 (continue_all_threads): Don't continue if not waited.
548 (thread_db_check_child_state): Move handling of terminate and
549 exit earlier. Handle termination or exit of children specially.
550 (thread_db_get_thread_reg): Test for defunct threads.
551 (thread_db_set_thread_reg): Ditto.
552 * ptrace-target.c (ptrace_xfer_mem): Don't be noisy about ptrace
553 errors caused by illegal memory accesses.
555 2001-04-12 Andrew Cagney <ac131313@redhat.com>
557 * server.c: Include "gdbloop.h". Replace gdbsocket_poll with
559 * ptrace-target.c, linux-target.c, solaris-target.c:
560 * dummy-target.c: Update comments.
562 2001-04-11 Michael Snyder <msnyder@redhat.com>
564 * thread-db.c (struct gdbserv_thread): Add new flag 'stepping'.
565 (stop_all_threads): Add parameter 'process'.
566 Set the process->event_thread here, instead of in check_child_state.
567 (wait_all_threads): Accept process as a parameter instead of eventpid.
568 Handle SIGTRAP differently if the thread was singlestepping.
569 (thread_db_singlestep_program): Clear flags for event thread.
570 (thread_db_singlestep_thread): Ditto.
571 (thread_db_continue_program): Ditto.
572 (thread_db_continue_thread): Ditto.
573 (thread_db_check_child_state): Cancel the stepping flag.
574 Don't set the event thread, this is now done in stop_all_threads.
575 * linux-target.c (debug_get_reg, debug_get_pc): New functions.
576 Purely for debugging output. Architecture dependent.
578 2001-04-09 Michael Snyder <msnyder@redhat.com>
580 * thread_db.c (thread_db_continue_thread): Continue the actual
581 thread given, not necessarily the event thread.
582 (thread_db_singlestep_thread): Step the actual thread given,
583 not necessarily the event thread.
585 2001-04-09 Michael Snyder <msnyder@redhat.com>
587 * thread-db.c (stop_all_threads): Do not send SIGSTOP to a thread
588 if it has already been sigstopped.
589 (thread_db_continue_thread): New function. Continue a single thread.
590 (thread_db_singlestep_thread): New function. Step a single thread.
591 (thread_db_attach): Set up continue_thread, singlestep_thread methods.
593 2001-04-09 Michael Snyder <msnyder@redhat.com>
595 * linux-target.c (PC_REGNUM): New enum, define.
596 (decr_pc_after_break): New function. Architecture dependent.
597 This version will probably serve for all targets for which
598 DECR_PC_AFTER_BREAK is one. Those for which it is zero will
599 want to define a no-op version of this function.
600 * thread-db.c (first_thread_in_list): New function.
601 (update_thread_list, stop_all_threads, wait_all_threads,
602 continue_all_threads): Use first_thread_in_list in for loops.
603 (wait_all_threads): Handle SIGINT and SIGTRAP specially.
604 Throw away SIGINT for all threads but the event thread.
605 For SIGTRAP in other than the event thread, call decr_pc_after_break
606 (giving the thread a chance to hit the trap again later).
607 (thread_db_continue_program, thread_db_singlestep_program):
608 Continue the event thread before all the others.
610 2001-04-05 Michael Snyder <msnyder@redhat.com>
612 * thread-db.c (add_pending_signal, send_pending_signals):
613 New functions. Allow wait_all_threads to collect any signals
614 other than SIGSTOP from the threads and defer them.
615 (wait_all_threads): Loop on each thread and call waitpid until
616 we get SIGSTOP. Any other signals are pended by throwing them
617 into a list, and then sending them back to the threads using kill.
618 (thread_db_get_thread_reg): Remove temporary hack for libthread_db
619 bug. (thread_db_set_thread_reg): Ditto.
621 2001-04-04 Michael Snyder <msnyder@redhat.com>
623 * server.h (struct child_process): Add a 'running' flag.
624 * thread_db.c (continue_all_threads): Take gdbserv as argument.
625 Use it to find the current thread, and don't continue that one
626 (leave it up to the parent method to continue the event thread.)
627 (thread_db_continue_program): Child is running -- set a flag.
628 (thread_db_singlestep_program): Ditto.
629 (thread_db_check_child_state): Return immediately unles the child
630 is running. Because this is a polling routine, we don't want to
631 return any new events unles the child is officially running.
632 Call waitpid with -1 instead of the process->pid, so that we
633 can get events from the threads. Alternately use __WCLONE.
634 (thread_db_get_thread_reg): If thread is not specified, use
635 the event thread (if possible). Temporarily hack around a
636 bug in the thread_db library.
637 (thread_db_set_thread_reg): Ditto.
639 2001-04-04 Michael Snyder <msnyder@redhat.com>
641 * thread-db.c (continue_all_threads): Zero the attached, stopped,
642 and waited flags only if thread is successfully continued.
643 * linux-target.c: Fix broken endif directive.
644 * configure.in: Test for sys/procfs.h.
645 * config.in: Define HAVE_SYS_PROCFS_H.
646 * configure: Regenerate.
647 * thread-db.c (thread_list_lookup_by_pid): New function.
648 (thread_db_check_child_state): Cache the event thread.
649 (thread_db_fromtarget_thread_break): New function. Call
650 gdbserv_fromtarget_thread_break with the event thread.
651 (thread_db_attach): Take over the fromtarget_break vector.
652 * server.h (struct child_process): Add event_thread field.
654 2001-04-02 Michael Snyder <msnyder@redhat.com>
656 * thread-db.c: include errno.h for error reporting.
657 (struct gdbserv_thread): Add flag 'waited'.
658 (thread_db_type_str): New function for thread_extra_info.
659 (find_new_threads_callback): Use errno for error reporting.
660 (thread_db_thread_info): New function, for thread_extra_info.
661 (wait_all_threads): New function. Call waitpid on all threads
662 that have been attached or sigstopped. Incomplete -- needs to
663 push back any signals other than SIGSTOP.
664 (continue_all_threads): Send PTRACE_CONT only to threads that
665 have been attached or sigstopped.
666 (check_child_state): Call wait_all_threads.
667 (thread_db_attach): Activate thread_info vector.
669 2001-03-30 Michael Snyder <msnyder@redhat.com>
671 * linux-target.c (linux_read_reg, linux_write_reg): New functions.
672 Abstract out the code to actually read a register value, so that
673 it can be shared by several methods.
674 (get_gregset): Use sizeof (GREGSET_T).
675 (generic_linux_gg_reg_nr): New function. Support new reg methods.
676 (generic_linux_next_gg_reg): Ditto.
677 (generic_linux_sizeof_reg): Ditto.
678 (generic_linux_reg_format): Ditto.
679 (generic_linux_get_reg): New function. Newer register method,
680 non-thread-aware version.
681 (linux_attach): Use new register method in target vector.
682 * thread-db.c: Remove some developmental ifdef code.
683 (thread_db_get_thread_reg): Fall back on parentvec.get_reg
684 if no thread or no thread_agent available.
685 (thread_db_attach): Replace get_reg vector with get_thread_reg.
687 * ptrace-target.c (ptrace_write_user): For X86 target, skip
688 write-protected location in user/context address space.
689 * linux-target.c (linux_process_get_reg): Use linux_read_reg.
690 (linux_process_set_reg): Use linux_write_reg.
691 (put_gregset): New function. Write child's gregset.
692 (generic_linux_get_reg): Use SIZEOF_MAPPEDREG.
693 (generic_linux_set_reg): New function. Newer register method.
694 (linux_attach): Add set_reg to target vector, not process_set_reg.
695 * thread-db.c (ps_lsetregs): Implement by calling put_gregset.
696 (thread_db_set_thread_reg): New function. Implement set_thread_reg.
697 (thread_db_attach): Add set_thread_reg to target vector.
699 2001-03-29 Michael Snyder <msnyder@redhat.com>
701 * ptrace-target.c (ptrace_read_user, ptrace_write_user):
702 Accept an explicit pid instead of a struct gdbserv.
703 * linux-target.c: Include gdb_proc_service.h for gregset_t
704 (FIXME: better place to get it from?)
705 (linux_register_offset): Return signed long to facilitate
706 test for -1 error return value.
707 (ppc_linux_xfer_reg, linux_process_get_reg, linux_process_set_reg):
708 Calls to ptrace_read_user and ptrace_write_user now need a pid
709 argument instead of a struct gdbserv.
710 (reg_from_gregset): New function.
711 (reg_to_gregset): New function.
712 (get_gregset): New function. Read child's gregset.
713 * thread-db.c (ps_lgetregs): Implement by calling get_gregset.
714 (thread_db_dlopen, thread_db_open, thread_db_attach): Change
715 sense of return: -1 now means failure, 0 means success.
716 (thread_db_get_thread_reg): Call reg_from_gregset.
718 2001-03-29 Michael Snyder <msnyder@redhat.com>
720 * thread-db.c: Include signal.h, sys/ptrace.h (FIXME ptrace).
721 (struct symbol_cache): Make value (address) unsigned.
722 (add_symbol_to_list, lookup_cached_symbol): Ditto.
723 (struct gdbserv_thread): Add attached, stopped flags to thread.
724 (add_thread_to_list): Return pointer to new thread in list.
725 (delete_thread_from_list): New function.
726 (ps_pglobal_lookup, ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite):
727 Muffle debugging output.
728 (find_new_threads_callback): Muffle debugging output.
729 Add thread to list only if it isn't already there.
730 Use ptrace to attach to new threads. (FIXME explicit ptrace).
731 (update_thread_list): New function. Only place where td_ta_thr_iter
732 is called. Builds up the thread list, prunes it of any dead threads.
733 (thread_db_thread_next): Call update_thread_list.
734 (get_thread_signals): Read the values of the cancel and restart
735 signals from the target using hardcoded symbol names.
736 (stop_all_threads): New function. First cut. Deliver SIGSTOP
737 to all threads except the event thread and any new threads that
738 have just been attached.
739 (continue_all_threads): New function. First cut. Deliver
740 PTRACE_CONT to all threads except the main thread. Needs work.
741 (thread_db_continue_program): New function.
742 (thread_db_singlestep_program): New function.
743 (thread_db_get_thread_reg): New function, incomplete.
744 (thread_db_attach): Take over continue_program, singlestep_program.
745 Muffle some debugging output.
747 2001-03-26 Michael Snyder <msnyder@redhat.com>
749 * thread-db.c: New file. Linux thread debugging layer.
750 * linux-target.c (linux_attach): Call thread_db_attach.
751 * ptrace-target.c: Export ptrace_handle_waitstatus for
753 * configure.in: Add thread-db.c to linux target modules.
754 (GREGSET_T, FPREGSET_T, HAVE_LWPID_T, HAVE_PSADDR_T,
755 HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, LINUX_TARGET): Define.
756 * config.in (GREGSET_T, FPREGSET_T, HAVE_LWPID_T,
757 HAVE_PSADDR_T, HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, LINUX_TARGET):
759 * configure: Regenerate.
760 * Makefile.am (INCLUDES): Add $(srcdir)/../../include
761 (devo/include), so that header files can be shared with gdb.
762 (server_LDFLAGS): Add -ldl -rdynamic (FIXME configure).
763 * Makefile.in: Regenerate.
765 2001-03-22 Andrew Cagney <ac131313@redhat.com>
767 * server.c (main): Pass gdbserver.attach and process to
768 gdbserver_startup instead of gdbserver_poll.
770 2001-03-16 Michael Snyder <msnyder@redhat.com>
772 * linux-target.c (linux_detach): Pass new parameter to ptrace_detach.
773 Fix file header comment typo. Update copyright.
775 2001-03-16 Elena Zannoni <ezannoni@cygnus.com>
777 * dummy-target.c (dummy_detach): Add new parameter.
778 * linux-target.c (linux_detach): Ditto.
779 * ptrace-target.c (ptrace_detach): Ditto.
780 * solaris-target.c (solaris_detach): Ditto.
782 2001-03-14 Andrew Cagney <ac131313@redhat.com>
784 * ChangeLog: Move to here from ../native.
785 * Makefile.am: Ditto.
787 * configure.in: Ditto.
788 * dummy-target.c: Ditto.
789 * linux-target.c: Ditto.
790 * ptrace-target.c: Ditto.
791 * ptrace-target.h: Ditto.
794 * solaris-target.c: Ditto.
795 * Makefile.in: Regenerate.
799 2001-03-14 Andrew Cagney <ac131313@redhat.com>
801 * Makefile.am (INCLUDES): Update. Headers moved to ../include.
802 * Makefile.in: Regenerate.
804 2000-11-27 Michael Snyder <msnyder@happy.cygnus.com>
806 * ptrace-target.c (ptrace_xfer_mem): Return -1 on error.
808 2000-11-21 Michael Snyder <msnyder@cleaver.cygnus.com>
810 * ptrace-target.c (noop_flush_i_cache): Comment out superfluous
812 * linux-target.c (linux_process_get_reg): Return value of
813 linux_register_offset is unsigned (can't be less than zero).
814 (linux_process_rcmd): Just use '1' and '0' to control debug output.
816 2000-11-06 Michael Snyder <msnyder@cleaver.cygnus.com>
818 * dummy-target.c (dummy_attach): Fix order of memset args.
819 * linux-target.c (linux_attach): Ditto.
820 * ptrace-target.c (ptrace_attach): Ditto.
821 * solaris-target.c (solaris_attach): Ditto.
823 2000-10-19 Belinda Brazelle <brazelle@redhat.com>
825 * linux-target.c: Add support for Arm processor.
827 2000-10-12 Michael Snyder <msnyder@cleaver.cygnus.com>
829 * ptrace-target.c (ptrace_handle_waitstatus): Save exitstatus
830 in process->stop_signal.
832 2000-09-14 Michael Snyder <msnyder@michael.wirespeed.com>
834 * linux-target.c: Define regmap etc. for SH target.
835 * configure.in: Add defines for SH target.
836 * configure: Rebuild.
838 2000-09-13 Michael Snyder <msnyder@michael.wirespeed.com>
840 * server.h (fromtarget_terminate): New field. Also fix up
841 some overlooked function prototypes in the existing fields.
842 (struct client_process): Rename to struct child_process.
843 * linux-target.c (linux_fromtarget_terminate): New function.
844 Called from main when child terminates abnormally.
845 (linux_process_rcmd): New function. Catches "qRcmd" requests,
846 which are currently used just to turn on debug output.
847 * ptrace-target.c (ptrace_handle_waitstatus): Set stop_signal
848 for the WIFSTOPPED case. (ptrace_process_signal): Return zero
849 instead of the signal number, to let libremote know that we have
850 handled the signal. (ptrace_xfer_memory): Fix off-by-one error.
851 * solaris-target.c (solaris_fromtarget_terminate): New function.
852 * server.c (main): Call fromtarget_terminate for the 'T' case.
853 Do not request a one-second delay from gdbsocket_poll.
855 2000-09-08 Michael Snyder <msnyder@cleaver.cygnus.com>
857 * solaris-target.c: New file. Just a prototype, doesn't actually
858 work. Used to confirm configurability to multiple targets.
859 * dummy-target.c: New file. Dummy back-end for implementing new
860 targets such as solaris-target.c (above), before actually having
861 a working back-end. The dummy target works just like the sample
862 target in the samples directory.
863 * configure.in: Add AC_SUBST(TARGET_MODULES) to add the
864 appropriate target modules to the Makefile. Add solaris target.
865 * configure: Regenerate.
866 * Makefile.am: Move *-target.c into EXTRA_server_SOURCES.
867 Add TARGET_MODULES to server_LDADD. Define server_DEPENDENCIES.
868 * Makefile.in: Regenerate.
869 * ptrace-target.h: New file. Defines needed only by ptrace.
870 * server.h: Remove ptrace-specific defines to ptrace-target.h.
871 (struct server_vector): New, for target entry points.
872 (struct nativeserver): Rename to struct client_process.
873 * server.c: Use client_process for entry points, and server_vector.
874 * linux-target.c: Include ptrace-target.h.
875 (ppc_linux_get_reg): Rename to ppc_linux_process_get_reg.
876 (ppc_linux_set_reg): Rename to ppc_linux_process_set_reg.
877 (ppc_linux_get_regs): Rename to ppc_linux_process_get_regs.
878 (ppc_linux_set_regs): Rename to ppc_linux_process_set_regs.
879 (linux_get_reg): Rename to linux_process_get_reg.
880 (linux_set_reg): Rename to linux_process_set_reg.
881 (linux_get_regs): Rename to linux_process_get_regs.
882 (linux_set_regs): Rename to linux_process_set_regs.
883 (gdbserver_check_child_state): Rename to linux_check_child_state.
884 (gdbserver_fromtarget_break): Rename to linux_fromtarget_break.
885 (gdbserver_fromtarget_exit): Rename to linux_fromtarget_exit.
886 (struct server_vector gdbserver): New, defines entry points.
887 * ptrace-target.c: Include ptrace-target.h.
888 * aclocal.m4: New file.
890 2000-09-08 Michael Snyder <msnyder@cleaver.cygnus.com>
892 * linux-target.c (linux_get_reg, linux_set_reg): Remove direct
893 calls to ptrace; instead use service call into ptrace-target.c.
894 (linux_get_regs, linux_set_regs): Remove ifdef PPC; instead use
895 an ifdef in linux_attach to set up the target vector pointers.
896 (linux_attach): If PPC_LINUX_TARGET, use PPC versions of register
897 functions instead of generic ones. Define process_set_reg, so
898 that the "P" command is now handled.
900 2000-09-07 Michael Snyder <msnyder@cleaver.cygnus.com>
902 * ptrace-target.c (ptrace_read_user, ptrace_write_user): New
903 functions. Exported so that linux-target does not have to
904 call ptrace directly. (ptrace_get_gregs, ptrace_set_gregs,
905 ptrace_get_fpregs, ptrace_set_fpregs): New functions.
906 Exported for use by targets that use these methods.
907 (ptrace_xfer_mem): Use ptrace_arg3_type instead of long.
908 Add address to error messages.
909 * linux-target.c: Start using config macros, port to alpha and ppc.
910 (ppc_linux_xfer_reg, ppc_linux_getset_reg, ppc_linux_get_reg,
911 ppc_linux_set_reg, ppc_linux_get_regs, ppc_linux_set_regs):
912 New functions. Explicit knowledge of ppc linux register layout.
913 (linux_get_reg): Catch undefined regmap offsets.
914 (linux_set_reg): Ditto.
915 (linux_get_regs): Conditionally call ppc_linux_get_regs.
916 (linux_set_regs): Ditto.
917 * configure.in: Add PPC target, and export target defines.
918 * configure: Regenerate.
919 * config.in: Add new target defines.
921 2000-09-06 Michael Snyder <msnyder@cleaver.cygnus.com>
923 * Makefile.am: Define CC and CFLAGS.
924 * Makefile.in: Regenerate.
925 * configure.in: New file. Detect all manner of things.
926 * config.in: New file. Input file for config.h.
927 * configure: Generate.
928 * ptrace-target.c (ptrace_xfer_type): Move def'n into server.h.
929 (PTRACE_XFER_SIZE): Ditto.
930 * linux-target.c (ptrace_xfer_type): Move def'n into server.h.
931 (ptrace_arg3_type): Ditto.
932 * server.h: Use config macros to determine definitions of
933 ptrace_xfer_type, ptrace_arg1_type, ptrace_arg2_type,
934 ptrace_arg3_type, ptrace_arg4_type.
936 2000-09-05 Michael Snyder <msnyder@cleaver.cygnus.com>
938 * server.c (main): Detect exit status, and call fromtarget_exit
939 instead of fromtarget_break.
940 * linux-target.c (gdbserver_fromtarget_exit): New function.
941 * ptrace-target.c (ptrace_kill_program, ptrace_sigkill_program):
942 New functions. Send signals to the child.
943 (ptrace_exit_program): New function.
945 2000-09-05 Michael Snyder <msnyder@cleaver.cygnus.com>
947 * linux-target.c (linux_attach): Activate process_signal vector.
948 (gdbserver_check_child_state): Send real received signal, instead
950 * ptrace-target.c (ptrace_break_program): New function. Implement
951 control-c interrupt from host.
952 (ptrace_process_signal): Implement continuation signal.
953 (ptrace_singlestep_program): Ditto.
954 (ptrace_continue_program): Ditto.
955 (ptrace_get_trap_number): New function. Return signal to libremote.
956 (ptrace_compute_signal): Ditto.
957 (ptrace_attach): Activate break_program, process_signal, compute_signal
958 and get_trap_number vectors.
959 server.h (struct nativeserver): add signal_to_send field.
960 Rename stop_sig to stop_signal.
962 2000-09-05 Michael Snyder <msnyder@cleaver.cygnus.com>
964 * ptrace-target.c (ptrace_singlestep_program): Make ptrace args long.
965 FIXME: needs to be configurable.
966 * linux-target.c (linux_get_reg, linux_set_reg): Make regaddr and
967 regval configurable types. FIXME needs real configury.
969 2000-09-01 Michael Snyder <msnyder@cleaver.cygnus.com>
970 New directory "native" for native gdbserver in libremote.
971 * server.c: New file. Entry point and main event loop.
972 * server.h: New file. Shared declarations.
973 * linux-target.c: New file. Linux version of libremote native stub.
974 * ptrace-target.c: New file. Ptrace operations for libremote stub.
975 * Makefile.am: New file. Automake source.
976 * Makefile.in: New file. Automake-generated makefile source.
977 Note: this work is incomplete and only partially working.