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