OSDN Git Service

a7ccc25649709b59a651b8226a7535eaf1aed8da
[pf3gnuchains/pf3gnuchains4x.git] / rda / unix / ChangeLog
1 2009-11-30  Kevin Buettner  <kevinb@redhat.com>
2
3         * diagnostics.h, diagnostics.c (print_sigint_message): New function.
4         * linux-target.c (linux_process_rcmd): Add monitor commands
5         "interrupt-with-SIGSTOP and interrupt-with-SIGINT".
6         * server.h (struct child_process): Add new field
7         interrupt_with_SIGSTOP.
8         * thread-db.c (thread_db_break_program): Interrupt using either
9         SIGSTOP or SIGINT depending upon user's preference.
10
11 2009-11-23  Kevin Buettner  <kevinb@redhat.com>
12
13         * ptrace-target.c (syscall.h): Include.
14
15 2007-04-09  Kevin Buettner  <kevinb@redhat.com>
16
17         * linux-target.c (NUM_REGS)[FRV_LINUX_TARGET]: Update.
18         (frv_read_only_register): New function.
19         (reginfo)[FRV_LINUX_TARGET]: Mark as read-only.
20
21 2006-10-03  Kevin Buettner  <kevinb@redhat.com>
22
23         * server.h (struct ss_save): Add new field ``restore_action''.
24         * ptrace-target.c (handle_waitstatus): Invoke ``restore_action''.
25         * linux-target.c (LIR_REGNUM) [AM33_2_0_LINUX_TARGET]: Define.
26         (set_singlestep_breakpoint): Add ``restore_action'' parameter.
27         Fix all callers.
28         (am33_set_register, am33_restore_lir): New functions.
29         (am33_opcode_size): Change size of LIW instruction(s) to 0 so
30         that these will be handled explicitly in am33_singlestep.
31         (am33_singlestep): Handle LIW instructions.  Revise manner in
32         which Lcc and SETLB instructions are handled.
33
34 2006-03-16  Kevin Buettner  <kevinb@redhat.com>
35
36         * server.c (main): Change polling interval for gdbloop_poll()
37         from one second to ten milliseconds.
38
39 2005-12-07  Kevin Buettner  <kevinb@redhat.com>
40
41         * ptrace-target.c (ptrace_compute_signal, ptrace_process_signal):
42         Use __SIGRTMIN in place of SIGRTMIN.  Use __SIGRTMAX in place of
43         SIGRTMAX.
44         (ptrace_compute_signal): Consolidate logic which computes return
45         value.
46
47 2005-12-07  Kevin Buettner  <kevinb@redhat.com>
48
49         * Makefile.am (EXTRA_rda_SOURCES): Add diagnostics.c.
50         * configure.in (TARGET_MODULES): Add diagnostics.o.
51         * Makefile.in, configure: Regenerate.
52         * diagnostics.c: New file.
53         * diagnostics.h (output_O_packet, print_sigstop_message): New
54         functions.
55         * ptrace-target.c (diagnostics.h): Include.
56         (ptrace_break_program): Call print_sigstop_message().
57         * thread_db.c (thread_db_break_program): Likewise.
58
59 2005-12-02  Kevin Buettner  <kevinb@redhat.com>
60
61         * ptrace-target.c (ptrace_break_program): Use SIGSTOP instead of
62         SIGINT to interrupt inferior process.
63         * thread-db.c (thread_db_break_program): Likewise.
64
65 2005-12-01  Kevin Buettner  <kevinb@redhat.com>
66
67         * thread-db.c (handle_thread_db_event): Allow underlying target a
68         chance to look at the wait status too.
69         (thread_db_check_child_state): Ensure that there's a thread list
70         to work with when using the thread_db event model.
71
72 2005-12-01  Kevin Buettner  <kevinb@redhat.com>
73
74         * linux-target.c (reginfo) [AM33_2_0_LINUX_TARGET]: Don't use
75         ``sizeof (greg_t)'' due to this type not being defined any longer
76         in the headers that linux-target includes.
77
78 2005-11-11  Kevin Buettner  <kevinb@redhat.com>
79
80         * lwp-pool.c (clear_all_do_step_flags): New function.
81         (lwp_pool_singlestep_lwp): Use it.
82
83 2005-11-10  Kevin Buettner  <kevinb@redhat.com>
84
85         * lwp-pool.c (mark_lwp_as_dead_but_interesting): New function.
86         (wait_and_handle): Replace lines of code implementing guts of
87         new function mark_lwp_as_dead_but_interesting() with call to
88         that function.  Make a new call to this function after it
89         has been determined that an lwp has exited without leaving a
90         status.
91
92 2005-11-08  Kevin Buettner  <kevinb@redhat.com>
93
94         * lwp-pool.c (struct lwp): Add new member `do_step'.
95         (wait_and_handle): Clear `do_step' when a SIGTRAP is received.
96         (continue_or_step_lwp): New function.
97         (lwp_pool_continue_all, lwp_pool_continue_lwp): Call
98         continue_or_step_lwp() instead of continue_lwp().
99         (lwp_singlestep_lwp): Set `do_step' after a successful call to
100         singlestep_lwp().
101
102 2005-11-08  Kevin Buettner  <kevinb@redhat.com>
103
104         * linux-target.c (am33_singlestep_okay): Use `pid', not
105         `process->pid' when reading and writing memory since the
106         latter may refer to an already running thread.
107
108 2005-11-08  Kevin Buettner  <kevinb@redhat.com>
109
110         * diagnostics.h: New file.
111         * gdbserv-thread-db.h (debug_get_pc): Move declaration to new
112         file diagnostics.h.
113         * linux-target.c (diagnostics.h): Include.
114         (linux_process_rcmd): Add new monitor commands "lwp-pool-noisy",
115         "lwp-pool-quiet", "all-noisy", and "all-quiet".  Delete monitor
116         commands "proc-service-noisy" and "proc-service-quiet".
117         * lwp-pool.c (diagnostics.h): Include.
118         (debug_lwp_pool): Remove `static' qualifier.
119         (debug_report_state_change):  Add code for printing out the PC value
120         at which program stopped.
121         (debug_report_state_change, wait_and_handle, check_stop_pending)
122         (lwp_pool_waitpid, lwp_pool_stop_all, lwp_pool_continue_all)
123         (lwp_pool_continue_lwp, lwp_pool_attach): Add `serv' argument.  Fix
124         all callers.
125         * lwp-pool.h (lwp_pool_attach, lwp_pool_waitpid, lwp_pool_stop_all)
126         (lwp_pool_continue_all, lwp_pool_continue_lwp): Add `serv' argument.
127         (lwp_pool_singlestep_lwp): Revise comment regarding consistency of
128         not passing `serv' parameter.
129         * thread-db.c (diagnostics.h): Include.
130         (proc_service_noisy): Delete this unused global.
131         (attach_thread, continue_thread): Add `serv' parameter.  Fix all
132         callers.
133         (update_thread_list, thread_db_singlestep_program): Add diagnostic
134         messages.
135
136 2005-11-04  Kevin Buettner  <kevinb@redhat.com>
137
138         * thread-db.c (ALWAYS_UPDATE_THREAD_LIST): Define to be 0.
139         (handle_thread_db_event): Update thread list upon receipt of
140         TD_CREATE or TD_DEATH events.
141         (thread_db_check_child_state): Potentially disable, depending upon
142         value of ALWAYS_UPDATE_THREAD_LIST, the thread list update.
143         (thread_db_check_child_state): Update thread list for signal based
144         event model too.
145
146 2005-08-23  Kevin Buettner  <kevinb@redhat.com>
147
148         * configure.in (am33_2.0*linux*): New target.
149         * Makefile.in: Regenerate.
150         * aclocal.m4: Regenerate.
151         * config.in: Regenerate.
152         * configure: Regenerate.
153         * gdbserv-thread-db.h (mips_singlestep): Change return type to
154         ``void''.
155         (am33_singlestep): New declaration.
156         * linux-target.c [AM33_2_0_LINUX_TARGET]
157         (GETREGS_SETREGS_REGINFO, SOFTWARE_SINGLESTEP, PC_REGNUM, A0_REGNUM)
158         (A1_REGNUM, A2_REGNUM, A3_REGNUM, LAR_REGNUM, MDR_REGNUM, SP_REGNUM)
159         (NUM_REGS, sign_extend): Define.
160         (PT_A3, PT_A2, PT_D3, PT_D2, PT_MCVF, PT_MCRL, PT_MCRH, PT_MDRQ)
161         (PT_E1, PT_E0, PT_E7, PT_E6, PT_E5, PT_E4, PT_E3, PT_E2, PT_SP)
162         (PT_LAR, PT_LIR, PT_MDR, PT_A1, PT_A0, PT_D1, PT_D0, PT_ORIG_D0)
163         (PT_EPSW, PT_PC): Define.
164         (reginfo): New table.
165         (stock_table_to_am33, am33_table_to_stock, stock_bp_to_am33)
166         (am33_bp_to_stock, am33_make_bp_table, am33_set_bp, am33_delete_bp)
167         (am33_bp_hit_p, am33_make_arch): New functions.
168         (MAKE_ARCH): Define.
169         (am33_singlestep_program, am33_read_byte, am33_read_disp16)
170         (am33_read_disp32, am33_get_register, am33_get_areg, am33_singlestep):
171         New functions.
172         (am33_opcode_size): New table.
173         [MIPS_LINUX_TARGET | MIPS64_LINUX_TARGET] (SOFTWARE_SINGLESTEP):
174         Define.
175         (linux_attach): Set am33 specific ``singlestep_program''.  Revise
176         proprocessor condition upon which ``is_ss'' is set.
177         [SOFTWARE_SINGLESTEP] (set_singlestep_breakpoint): New function.
178         (mips_get_reg, mips_poke_instruction): Delete.
179         (mips_singlestep): Adjust return type.  Use set_singlestep_breakpoint()
180         where appropriate.
181         * ptrace-target.c (handle_waitstatus): Adjust call to ptrace_set_mem()
182         to account for different type of singlestep breakpoint shadow value.
183         Also, pass the stored breakpoint size.  Add diagnostics.
184         (ptrace_attach): Add AM33_2_0_LINUX_TARGET to list of targets needing
185         to clear ``is_ss''.
186         (singlestep_lwp): Add code to call am33 specific singlestep code.
187         * server.h (struct ss_save): Add AM33_2_0_LINUX_TARGET to the list
188         of preprocessor conditions which declare this struct.  Revise type
189         of ``ss_val'' from ``int'' to a ``char'' array.  Add new field
190         ``ss_size''.
191         (struct child_process): Define fields ``is_ss'' and ``ss_info'' for
192         AM33_2_0_LINUX_TARGET.
193
194 2005-08-23  Kevin Buettner  <kevinb@redhat.com>
195
196         * gdbserv-thread-db.h (proc_service_noisy): Declare.
197         * linux-target.c (linux_process_rcmd): Add "monitor" commands
198         for enabling and disabling various types of diagnostic messages.
199         Delete old "monitor 1" and "monitor 0" commands for enabling /
200         disabling just the back-end diagnostics.
201         (decr_pc_after_break): Delete extern declaration for
202         ``thread_db_noisy''.
203
204 2005-06-27  Jim Blandy  <jimb@redhat.com>
205
206         Add support for the Linux NPTL (New POSIX Thread Library) thread
207         implementation.
208         * arch.h, lwp-pool.c, lwp-pool.h, stock-breakpoints.c:
209         * stock-breakpoints.h: New files.
210         * gdbserv-thread-db.h (continue_lwp, singlestep_lwp, attach_lwp)
211         (stop_lwp): Move these ...
212         * lwp-ctrl.h: ... to here (new file).
213         * server.h (struct child_process): Include a pointer to the
214         architecture object, a breakpoint table, and a pointer to the
215         "focus thread".
216         * linux-target.c: Create architecture objects for the i386 and
217         FRV, and describe breakpoints for those architectures.
218         #include "arch.h".
219         [STOCK_BREAKPOINTS]: #include "stock-breakpoints.h".
220         (allocate_empty_arch): New function.
221         [X86_LINUX_TARGET] (stock_table_to_x86, x86_table_to_stock)
222         (stock_bp_to_x86, x86_bp_to_stock, x86_make_bp_table, x86_set_bp)
223         (x86_delete_bp, x86_bp_hit_p, x86_make_arch): New functions.
224         (MAKE_ARCH): #define to call x86_make_arch.
225         [X86_LINUX_TARGET] (stock_table_to_frv, frv_table_to_stock)
226         (stock_bp_to_frv, frv_bp_to_stock, frv_make_bp_table, frv_set_bp)
227         (frv_delete_bp, frv_bp_hit_p, frv_make_arch): New functions.
228         (MAKE_ARCH): #define to call frv_make_arch.
229         (linux_attach): If MAKE_ARCH is #defined, create an architecture
230         object for this process.  And if we have an architecture object,
231         make a breakpoint table.
232         * thread-db.c: #include <assert.h>, "arch.h", "lwp-ctrl.h", and
233         "lwp-pool.h".
234         (struct gdbserv_thread): Remove state-tracking flags 'attached',
235         'stopped', 'waited', and 'stepping'; all that state is handled
236         inside lwp-pool.c now.
237         (add_thread_to_list): Zero the entire newly allocated thread
238         structure.
239         (thread_list_lookup_by_lid): Prefer threads whose ti_lid values 
240         are different from that of the main process.
241         (thread_db_state_str, thread_db_type_str): Don't include
242         formatting spaces here.
243         (thread_db_event_str): New function.
244         (thread_debug_name): New function.
245         (get_thread_signals): Return a value indicating success or failure.
246         (ignore_thread_signal): New function.
247         (using_thread_db_events, create_notification, death_notification)
248         (get_event_notification, set_event_breakpoint)
249         (insert_thread_db_event_breakpoints)
250         (delete_thread_db_event_breakpoints, request_thread_db_events)
251         (hit_thread_db_event_breakpoint, handle_thread_db_event): New
252         variables and functions, for using libthread_db's event interface.
253         (thread_db_open): Gather error-handling code next to the operation
254         that might fail.  Decide here whether to use the signal-based
255         debugging interface, or the event-based debugging interface.
256         (stop_thread, stop_all_threads, struct event_list, pending_events)
257         (pending_events_listsize, pending_events_top, add_pending_event)
258         (select_pending_event, send_pending_signals, wait_all_threads):
259         Deleted; we now use lwp-pool.c for all this.
260         (attach_thread, continue_thread, continue_all_threads)
261         (singlestep_thread, thread_db_singlestep_program)
262         (thread_db_continue_thread, thread_db_singlestep_thread): Use the
263         lwp-pool.c functions, instead of calling the lwp manipulation
264         functions directly and managing state here.  Keep track of the
265         focus thread.
266         (find_new_threads_callback): Always call attach_thread.  If we're
267         using libthread_db events, enable event reporting for the new
268         thread.
269         (update_thread_list): Take the current child process as an
270         argument; if the current focus thread disappears, clear the
271         process's focus_thread pointer.
272         (thread_db_thread_next): Pass the current child process to
273         update_thread_list.
274         (thread_db_thread_info): Reformat thread descriptions.  Mark
275         threads whose pid is equal to the process ID.
276         (thread_db_check_child_state): Use the lwp-pool functions, instead
277         of calling waitpid and the old stop-all-threads functions.  If we
278         have a focus thread, only check for a status on that thread.
279         Check for libthread_db events.  Use ignore_thread_signal, instead
280         of writing it out.
281         (thread_db_break_program): New function.
282         (thread_db_attach): Register it as the target's 'break_program'
283         method.  Always preload the symbol list with the names we'll need
284         for the signal-based interface, even if we have td_symbol_list.
285         Use lwp_pool_new_stopped to register the initial thread.  Clear
286         the focus thread.
287         * ptrace-target.c: #define _GNU_SOURCE and #include <sys/types.h>
288         and <linux/unistd.h>, to get declarations for the functions we
289         need.
290         #include "lwp-ctrl.h".
291         (continue_lwp, singlestep_lwp, attach_lwp): Remove
292         unnecessary 'extern' keywords.  Move pre-function comments to
293         lwp-ctrl.h.  Take an ordinary 'pid_t', not an 'lwpid_t', since
294         we're calling ptrace / tkill, and that's what they expect; rename
295         arguments accordingly.  Preserve value of errno across calls to
296         fprintf when reporting errors.
297         (kill_lwp): All the above, and use tkill system call if available.
298         * configure.in: Whenever we include thread-db.o in TARGET_MODULES,
299         also include lwp-pool.o.
300         On i386 and FRV Linux, use the stock-breakpoints module.
301         * config.in: Add template for STOCK_BREAKPOINTS.
302         * Makefile.am (EXTRA_rda_SOURCES): Include stock-breakpoints.c.
303         * Makefile.in, aclocal.m4, configure: Regenerated.
304
305 2005-03-11  Jim Blandy  <jimb@redhat.com>
306
307         * linux-target.c (linux_get_reg) [GETREGS_SETREGS_REGINFO]: In the
308         NOREGS case, check that reginfo doesn't specify an offset outside
309         our zeroed buffer.
310
311 2005-03-10  Jim Blandy  <jimb@redhat.com>
312
313         Compile with no warnings.
314         * Makefile.am (AM_CFLAGS): Compile with -Wall.
315         * Makefile.in: Regenerated.
316         * gdbserv-thread-db.h (stop_lwp, handle_waitstatus, ps_pdread,
317         ps_pdwrite): Add declarations for these functions to
318         gdbserv-thread-db.h.
319         * linux-target.c: #include <string.h>, <sys/types.h>, and
320         <sys/wait.h> to get declarations for system functions used in this
321         file.
322         (linux_get_reg): When register REGNO doesn't exist, provide zeros
323         for its value; don't use an uninitialized pointer.
324         (linux_set_reg): Delete unused variables.
325         (decr_pc_after_break): Fix printf format directive to match
326         arguments.
327         * ptrace-target.c (ptrace_read_user, ptrace_check_child_state,
328         ptrace_attach): Delete unused variables.
329         (ptrace_singlestep_program, ptrace_continue_program): Fix printf
330         format directive to match arguments.
331         * server.c (invalid_speed): Same.
332         (main): Initialize infd, outfd, and speed.
333         (tty_raw): Use proper name for speed_t "zero baud" value.
334         * thread-db.c: #include <string.h> and "gdbserv-utils.h", to get
335         declarations for functions used in this file.
336         (thread_db_open, wait_all_threads) 
337         (thread_db_check_child_state, thread_db_get_thread_reg) 
338         (thread_db_set_thread_reg): Fix printf format directive to match
339         arguments.
340         (continue_thread, thread_db_get_thread_reg, continue_all_threads,
341         thread_db_attach): Delete unused variables.
342
343         * Makefile.in, aclocal.m4: Regenerated with automake 1.9.4.
344
345         Make config.in generated automatically again.
346         * configure.in: Provide descriptions for all the preprocessor
347         symbols we define.
348         * configure: Regenerated.
349         * config.in: Regenerated using autoheader.
350
351         * linux-target.c (frv_fdpic_loadmap_addresses): Use '%lx' for
352         unsigned long argument.
353
354 2005-02-08  Kevin Buettner  <kevinb@redhat.com
355
356         * thread-db.c (td_thr_tls_get_addr_p): New static global.
357         (thread_db_dlopen): Initialize ``td_thr_tls_get_addr_p''.
358         (thread_db_get_gen): Add support for qGetTLSAddr packet.
359
360 2004-12-13  Kevin Buettner  <kevinb@redhat.com>
361
362         * thread-db.c (thread_db_get_thread_reg): Don't allow a successful
363         return without first initializing ``reg''.
364         (thread_db_set_thread_reg): Remove code intended to for
365         thread_db_get_thread_reg().
366
367 2004-12-09  Jim Blandy  <jimb@redhat.com>
368
369         * aclocal.m4, configure: Regenerated.
370
371 2004-11-18  Kevin Buettner  <kevinb@redhat.com>
372
373         * thread-db.c (thread_db_set_thread_reg): Don't allow a successful
374         return without first initializing ``reg''.
375
376 2004-10-20  Jim Blandy  <jimb@redhat.com>
377
378         Use the libthread_db 'td_symbol_list' function to look up all the
379         symbols libthread_db will need when invited to by GDB.
380         * thread-db.c (add_symbol_to_list): Make 'name' argument const.
381         (td_symbol_list_p): New libthread_db function pointer.
382         (thread_db_dlopen): Initialize it.
383         (thread_db_attach): Use td_symbol_list to pre-load our symbol
384         cache with the names of all the symbols libthread_db will ever
385         request.
386
387         * thread-db.c (thread_db_get_gen): There's no reason to try to
388         open a thread agent until we've at least requested values for all
389         the symbols we know about.
390
391         * server.c (usage): Don't include the entire pathname in the usage
392         message.
393
394 2004-10-19  Jim Blandy  <jimb@redhat.com>
395
396         * thread-db.c (get_thread_signals): Doc fix.
397
398         * thread-db.c (enum symbol_cache_defined): Move this definition
399         above that of (struct symbol_cache), and give it a name.
400         (struct symbol_cache): Use that enum as the type of 'defined_p', so
401         the debugger will print symbol cache entries more helpfully.
402
403         * ptrace-target.c (ptrace_create_child): Don't use sys_nerr to
404         check that errno is in a valid range.  The use sys_nerr is
405         deprecated on GNU/Linux, and according to the ISO C standard and
406         POSIX, strerror always returns a valid string, even for invalid
407         errno codes.
408
409 2004-10-07  Jim Blandy  <jimb@redhat.com>
410
411         * Makefile.am (rda_DEPENDENCIES): Add ../lib/librda.la.
412         * Makefile.in: Regenerated.
413
414         * server.c (main): Check for an error return from
415         gdbsocket_startup.
416
417 2004-09-22  Jim Blandy  <jimb@theseus.home>
418
419         * thread-db.c (thread_db_open, thread_db_get_gen): Doc fixes.
420
421         * thread-db.c (thread_db_detach, thread_db_set_gen,
422         thread_db_thread_id): Make these functions static.
423
424 2004-09-13  Jim Blandy  <jimb@theseus.home>
425
426         * solaris-target.c (solaris_detach, solaris_attach): Change
427         "linux" to "solaris".
428
429 2004-08-11  Corinna Vinschen  <vinschen@redhat.com>
430
431         * linux-target.c (linux_write_reg): Print process->pid in case of
432         an error.
433
434 2004-07-19  Kevin Buettner  <kevinb@redhat.com>
435
436         * server.c (main): Set ``server_quit_p'' when debugged process
437         exits or terminates.
438
439 2004-06-03  Kevin Buettner  <kevinb@redhat.com>
440
441         * server.c (main): Ensure that thread related realtime signals
442         are ignored.
443
444 2004-04-20  Kevin Buettner  <kevinb@redhat.com>
445
446         * thread-db.c (lookup_sym): New function.
447         (thread_db_open): Print diagnostic message for failed dlopen()
448         call.  Call lookup_sym() which will print diagnostic for failed
449         dlsym() call.
450
451 2004-04-20  Kevin Buettner  <kevinb@redhat.com>
452
453         * server.c (main): Ignore realtime signals.
454
455 2004-04-05  Kevin Buettner  <kevinb@redhat.com>
456
457         * linux-target.c (reginfo) [FRV_LINUX_TARGET]: Add support for
458         registers fsr0, acc0-acc7, accg0-accg7, msr0, msr1, gner0, gner1,
459         fner0, and fner1.
460
461 2004-03-19  Kevin Buettner  <kevinb@redhat.com>
462
463         * ptrace-target.c (ptrace_exit_program): Cause main loop to exit.
464         * server.c (sys/types.h, sys/stat.h, fcntl.h, string.h, unistd.h)
465         (ctype.h, termios.h): Include.
466         (close_device, tty_raw, invalid_speed, parse_speed): New functions.
467         (speed_table): New static global.
468         (usage): Update usage message.
469         (main): Add support for connecting to serial devices.
470
471 2004-03-10  Kevin Buettner  <kevinb@redhat.com>
472
473         * linux-target.c (enum regset): Add constant OTHERREGS.
474         (struct peekuser_pokeuser_reginfo): Add new field,
475         alternate_register_read_write_method.  Adjust all initializers
476         accordingly.
477         (frv_fdpic_loadmap_addresses): New function.
478         (PTRACE_GETFDPIC, PTRACE_GETFDPIC_EXEC, PTRACE_GETFDPIC_INTERP):
479         Define.
480         (reginfo) [FRV_LINUX_TARGET]: Use slots 132 and 133 for the
481         loadmap registers.
482         
483 2004-03-10  Kevin Buettner  <kevinb@redhat.com>
484
485         * configure.in: Add "frv*linux*" to list of targets with thread
486         support.
487         * configure: Regenerate.
488         * Makefile.in: Regenerate using "automake --cygnus --ignore-deps".
489
490 2004-03-10  Kevin Buettner  <kevinb@redhat.com>
491
492         * ptrace-target.c (ptrace_create_child): Use vfork() instead of
493         fork().  Use PTRACE_ATTACH to attach to an existing process.
494         * server.c (usage): Update to include text about "-a".
495         (main): Allow use of -a switch to attach to an existing process.
496
497 2003-11-14  Kevin Buettner  <kevinb@redhat.com>
498
499         * config.in (FRV_LINUX_TARGET): Add.
500         * configure.in (sys/user.h): Don't check for this header; it's
501         not used.
502         (frv*linux*): Add rudimentary support for FR-V Linux.
503         * linux-target.c (PEEKUSER_POKEUSER_REGINFO, NUM_REGS, PC_REGNUM)
504         (sign_extend, greg_offset_and_size, fpreg_offset_and_size)
505         (noreg_offset_and_size, reginfo) [FRV_LINUX_TARGET]: Define.
506         * configure, Makefile.in: Regenerate.
507
508 2003-09-10  Kevin Buettner  <kevinb@redhat.com>
509
510         From Jimi Xenidis  <jimix@watson.ibm.com>:
511         * linux-target.c (reginfo): The MQ register is for IBM POWER
512         (pre-PowerPC) architecture, and is undefined in PPC GNU/Linux
513         environment.
514
515 2003-05-09  Kevin Buettner  <kevinb@redhat.com>
516
517         * linux-target.c (mips_singlestep): Don't any consider cop0 or cop1x
518         instructions to be conditional branches.  Expand set of cop1
519         opcodes considered to be conditional branches.
520
521 2003-05-08  Kevin Buettner  <kevinb@redhat.com>
522
523         * linux-target.c (mips_singlestep): Don't interpret all coprocessor
524         instructions as conditional branches.
525
526 2003-04-10  Kevin Buettner  <kevinb@redhat.com>
527
528         * linux-target.c (NUM_REGS) [MIPS_LINUX_TARGET, MIPS64_LINUX_TARGET]:
529         Bump to 72.
530         (struct peekuser_pokeuser_reginfo) [MIPS_LINUX_TARGET]: Use
531         PROTO_SIZE for ``bad'' and ``cause''.
532         (struct peekuser_pokeuser_reginfo) [MIPS_LINUX_TARGET]
533         [MIPS64_LINUX_TARGET]: Add ``fir'' register.
534
535 2003-02-07  Kevin Buettner  <kevinb@redhat.com>
536
537         * gdbserv-thread-db.h (singlestep_lwp): Add ``struct gdbserv *''
538         argument.  Adjust all callers.
539         (mips_singlestep) [MIPS_LINUX_TARGET, MIPS64_LINUX_TARGET]: New
540         function.
541         * linux-target.c (reginfo) [MIPS64_LINUX_TARGET]: Adjust some
542         of the fpregset/gregset related constants in this table.
543         (mips_get_reg): Add ``struct gdbserv *'' argument.  Adjust all
544         callers.
545         (mips_addr_as_reg, mips_peek_instruction, mips_poke_instruction):
546         New functions.
547         (mips_singlestep_program): Move bulk of implementation to and call...
548         (mips_singlestep): ...new function.  This new function no longer
549         makes any direct PTRACE_PEEKTEXT or PTRACE_POKETEXT operations.
550         Shadow breakpoint information is also stored in a slightly different
551         format.
552         * ptrace-target.c (server.h, ptrace-target.h): Adjust location
553         of #include statements so that gdbserv.h is included first.
554         (handle_waitstatus): Call ptrace_set_mem() instead of invoking
555         ptrace() directly.  Also adjust code to use somewhat different
556         shadow breakpoint structs.
557         (ptrace_set_mem, ptrace_get_mem): Remove ``static'' qualifier
558         from function declarators.
559         (singlestep_lwp): Add ``struct gdbserv *'' argument.
560         * ptrace-target.h (ptrace_get_mem, ptrace_set_mem): Declare.
561         * server.c (gdbserv.h): Include.
562         * server.h (struct ss_save): Add field ``in_use''.  Change
563         type of field ``ss_addr'' to struct ``gdbserv_reg''.
564         * thread-db.c (wait_all_threads): Revise diagnostic message to
565         print signal number for SIGDEBUG signal.
566         (singlestep_thread): Add ``struct gdbserv *'' argument.  Adjust
567         all callers.
568
569 2003-01-22  Kevin Buettner  <kevinb@redhat.com>
570
571         * linux-target.c (struct peekuser_pokeuser_reginfo)
572         [MIPS64_LINUX_TARGET, MIPS_LINUX_TARGET]: Disable registers ``cause''
573         and ``bad'' since they are not writable via ptrace().
574
575 2003-01-19  Alexandre Oliva  <aoliva@redhat.com>
576
577         * linux-target.c: Don't assume asm-mips/ is available, use just
578         asm instead.
579
580 2003-01-17  Kevin Buettner  <kevinb@redhat.com>
581
582         * configure.in (mips64*linux*n64, mips64*linux*n32, mips64*linux*o32):
583         Remove cases.  Instead, use compiler's preprocessor symbols to test
584         which ABI is being used.
585         * configure: Regenerate.
586
587 2003-01-16  Kevin Buettner  <kevinb@redhat.com>
588
589         * config.in (LIBTHREAD_DB_SO): New macro.
590         * configure.in (mips64*linux*): Remove no-threads.o from
591         TARGET_MODULES list.  Add thread-db.o to this list.
592         * configure: Regenerate.
593
594 2003-01-10  Kevin Buettner  <kevinb@redhat.com>
595
596         * Makefile.in: Regenerate using "automake --cygnus --ignore-deps".
597         Someday, when ``depcomp'' is added to the top level, the
598         --ignore-deps flag can be discarded.
599
600 2002-12-18  Kevin Buettner  <kevinb@redhat.com>
601
602         * ptrace-target.h, ptrace-target.c (ptrace_write_user)
603         (ptrace_read_user): Add struct gdbserv argument.
604         * linux-target.c: Fix all callers.
605         * ptrace-target.c (ptrace_write_user, ptrace_read_user): Add
606         debugging printf()s.
607         (ptrace_xfer_mem): Fix debugging printf()s so that they'll print
608         useful results when sizeof (long long) is the same as
609         sizeof (ptrace_xfer_type).
610         (ptrace_xfer_mem): Decode address using gdbserv_host_bytes_from_reg()
611         instead of gdbserv_reg_to_ulong().
612
613 2002-12-02  Kevin Buettner  <kevinb@redhat.com>
614
615         * linux-target.c (linux_get_reg, linux_set_reg, reg_from_regset)
616         (reg_to_regset, get_regset, put_regset reg_from_gregset)
617         (reg_to_gregset, reg_from_fpregset, reg_to_fpregset)
618         (reg_from_xregset, reg_to_xregset): Adjust all calls to
619         gdbserv_host_bytes_to_reg() and gdbserv_host_bytes_from_reg()
620         to account for change in interface.  Remove code which is
621         no longer needed due to improvements in the aforementioned
622         functions.
623         (sign_extend): New constant.
624         (FPR_BASE, PC, CAUSE, BADVADDR, MMHI, MMLO, FPC_CSR, FPC_EIR):
625         Make sure these are defined.
626         (PROTO_SIZE): Define.
627         (reginfo) [MIPS_LINUX_TARGET]: Use PROTO_SIZE to initialize
628         table with size (width) of registers to use when communicating
629         with the client.
630         (NUM_REGS, PC_REGNUM, reginfo) [MIPS64_LINUX_TARGET]: Define.
631
632 2002-11-19  Michael Snyder  <msnyder@redhat.com>
633
634         * ptrace-target.c: Fix typo in copyright.
635
636 2002-08-23  Kevin Buettner  <kevinb@redhat.com>
637
638         * linux-target.c (linux_get_reg, linux_set_reg): Print an
639         error message for out of bound registers.
640
641 2002-08-23  Kevin Buettner  <kevinb@redhat.com>
642
643         * linux-target.c (NUM_REGS) [X86_LINUX_TARGET]: Bump to 42.
644         (getregs_setregs_reginfo) [X86_LINUX_TARGET]: Add entry for
645         register ``orig_eax''.
646         (linux_get_reg, linux_set_reg): Make sure ``regno'' value is valid.
647         (linux_detach, linux_attach, decr_pc_after_break): Call fprintf()
648         instead of printf().
649         (linux_detach, linux_attach): Don't always print informational
650         messages.
651         * ptrace-target.c (handle_waitstatus, ptrace_detach, ptrace_attach):
652         Don't always print informational messages.  Use fprintf() instead
653         of printf().
654         (noop_get_trap_number, noop_compute_signal, noop_exit_program)
655         (noop_signlestep_program, noop_break_program): Delete.
656         (ptrace_flush_i_cache): Renamed from noop_flush_i_cache.  Update
657         reference in ptrace_attach().
658         (continue_lwp, singlestep_lwp, attach_lwp, stop_lwp, ps_pstop)
659         (ps_continue, ps_lstop): Use fprintf() instead of printf().
660         * server.c (errno.h): Include.
661         (usage): New function.
662         (main): Add option processing code.
663         * server.h (struct child_process): Add new field,
664         ``debug_informational''.
665         * thread-db.c (ps_plog, select_pending_event, send_pending_signals)
666         (wait_all_threads, thread_db_check_child_state): Use fprintf()
667         instead of printf().
668         (thread_db_detach): Conditionally print informational messages.
669         Use fprintf() instead of printf().
670
671 2002-08-21  Kevin Buettner  <kevinb@redhat.com>
672
673         * Makefile.am, configure.in, dummy-target.c, linux-target.c,
674         ptrace-target.c, ptrace-target.h, server.h, solaris-target.c,
675         thread-db.c: Change ``libremote'' references into ``RDA''
676         references.
677         * Makefile.in, configure: Regenerate.
678
679 2002-08-15  Kevin Buettner  <kevinb@redhat.com>
680
681         * dummy-target.c, gdb_proc_service.h, gdbserv-thread-db.h,
682         linux-target.c, no-threads.c, ptrace-target.c,
683         ptrace-target.h, server.c, server.h, solaris-target.c,
684         thread-db.c: Update copyright notices.
685
686 2002-05-16  Kevin Buettner  <kevinb@redhat.com>
687
688         * config.in (GREGSET_T): Renamed from GDB_GREGSET_T.
689         (FPREGSET_T): Renamed from GDB_FPREGSET_T.
690         * configure.in: Likewise.
691         * gdbserv-thread-db.h: Likewise.
692         * linux-target.c: Likewise.
693         * thread-db.c: Likewise.
694         * gdb_proc_service.h: Remove everything that's not absolutely
695         needed.
696
697 2002-02-01  Kevin Buettner  <kevinb@redhat.com>
698
699         * configure.in (arm32): Change to ``yes''.
700         * configure: Regenerate.
701
702 2002-01-30  Kevin Buettner  <kevinb@redhat.com>
703
704         * linux-target.c (linux_get_reg) [GETREGS_SETREGS_REGINFO]: Add
705         NOREGS support.
706         (linux_set_reg) [GETREGS_SETREGS_REGINFO]: Likewise.
707
708 2002-01-28  Kevin Buettner  <kevinb@redhat.com>
709
710         * linux-target.c (write_reg_bytes): Print return status in
711         ptrace failure message.
712         * ptrace-target.c (ptrace_write_user): Enable existing 
713         Linux/MIPS related kernel bug workaround when MIPS_LINUX_TARGET
714         is defined (which is in addition to _MIPSEL).
715
716 2002-01-28  Kevin Buettner  <kevinb@redhat.com>
717
718         * thread-db.c (struct regset_cache): New struct declaration.
719         (thread_db_map_id2thr_cache_valid, fpregset_cache, gregset_cache):
720         New static globals.
721         (thread_db_map_id2thr, thread_db_invalidate_map_id2thr_cache)
722         (initialize_regset_cache, initialize_regset_caches)
723         (thread_db_flush_regset_cache, thread_db_flush_regset_caches)
724         (thread_db_get_regset, thread_db_set_regset)
725         (thread_db_invalidate_regset_cache, thread_db_invalidate_regset_caches)
726         (thread_db_invalidate_caches, thread_db_getfpregs)
727         (thread_db_set_fpregs, thread_db_getgregs, thread_db_setgregs)
728         (td_thr_getfpregs_wrapper, td_thr_getgregs_wrapper)
729         (td_thr_setfpregs_wrapper, td_thr_setgregs_wrapper):
730         New functions.
731         (update_thread_list, thread_db_get_thread_reg)
732         (thread_db_set_thread_reg): Call thread_db_map_id2thr() instead of
733         td_ta_map_id2thr_p().
734         (thread_db_get_thread_reg): Call thread_db_getfpregs() instead
735         of td_thr_getfpregs_p().  Call thread_db_getgregs() instead of
736         td_thr_getgregs_p().
737         (thread_db_set_thread_reg): Likewise.  Also, call
738         thread_db_setfpregs() instead of td_thr_setfpregs_p() and
739         call thread_db_setgregs() instead of td_thr_setgregs_p().
740         (continue_thread, thread_db_continue_program)
741         (thread_db_singlestep_program, thread_db_continue_thread)
742         (singlestep_thread): Call thread_db_flush_regset_caches() at
743         beginning of function and thread_db_invalidate_caches() at
744         end of function.
745         (thread_db_attach): Initialize regset caches.
746
747 2002-01-15  Kevin Buettner  <kevinb@redhat.com>
748
749         * config.in (Generated automatically comment): Revise to note
750         that this file was generated automatically at one time, but is
751         no longer.
752         (LINUX_TARGET, SOLARIS_TARGET): Fix comments.
753         (MIPS_LINUX_TARGET): Add.
754         * configure.in (i?86*linux*, powerpc*linux*, arm*linux*, mips*linux*):
755         Eliminate unnecessary duplication.
756         (mips*linux*): Target is MIPS_LINUX_TARGET, not SH_LINUX_TARGET.
757         * gdbserv-thread-db.h (is_gp_reg): New function.
758         (is_fp_reg, is_extended_reg): Revise comments.
759         * linux-target.c (enum regset): Add new constant NOREGS.
760         (is_gp_reg): New function.
761         (PEEKUSER_POKEUSER_REGINFO) [MIPS_LINUX_TARGET]: Define.
762         (SIZEOF_REGMAP, SIZEOF_MAPPEDREG) [MIPS_LINUX_TARGET]: Delete.
763         (NUM_REGS) [MIPS_LINUX_TARGET]: Change from 38 to 70 to account
764         for addition of floating point support.
765         (regmap) [MIPS_LINUX_TARGET]: Delete this array.
766         (is_fp_reg, is_extended_reg) [MIPS_LINUX_TARGET]: Delete.
767         (reginfo) [MIPS_LINUX_TARGET]: Define.
768         (DEBUG): Delete this macro definition.
769         (disp_gdb_mesg, ptrace_get_mem, ptrace_set_mem): Delete function
770         declarations.
771         (linux_get_reg, linux_set_reg) [PEEKUSER_POKEUSER_REGINFO]: Add
772         NOREGS support.
773         (put_regset) [PEEKUSER_POKEUSER_REGINFO]: Add missing return
774         statement.
775         (mips_get_reg): Use read_reg_bytes() to fetch the register.
776         (mips_singlestep_program): Eliminate unused variables ``u_regs_base'',
777         ``temp_reg''.  Fix fprintf related format warning.
778         * ptrace-target.h (ptrace_check_child_state): Declare.
779         * thread-db.c (thread_db_get_thread_reg, thread_db_set_thread_reg):
780         Handle case of target not supporting one or more registers.
781
782 2001-10-15  Kevin Buettner  <kevinb@redhat.com>
783
784         * gdbserv-thread-db.h (is_extended_reg, reg_to_xregset)
785         (reg_from_xregset): New functions.
786         (debug_get_pc, decr_pc_after_break): Add declaration.
787         * linux-target.c (sys/procfs.h): Include.
788         (MAX_REG_SIZE): New anonymous enum constant.
789         (enum regset): New enum.
790         (getregs_setregs_reginfo, peekuser_pokeuser_reginfo): New structs.
791         (offsetof, fieldsize): New macros.
792         (ARM_LINUX_TARGET, X86_LINUX_TARGET, PPC_LINUX_TARGET): Deleted
793         old data structures defining register maps for these registers.
794         Replaced with new tables using either getregs_setregs_reginfo
795         or peekuser_pokeuser_reginfo structs.  Other architectures
796         remain the same, though reoranized somewhat.
797         (linux_next_gg_reg, linux_gg_reg_nr): Revise comments.  Use
798         NUM_REGS instead of NUM_G_PACKET_REGS.
799         (get_xregsetsize): New function.
800         (linux_reg_format, linux_sizeof_reg, is_fp_reg, is_extended_reg)
801         [PEEKUSER_POKEUSER_REGINFO, GETREGS_SETREGS_REGINFO]: New functions.
802         (read_reg_bytes, write_reg_bytes, debug_get_reg, debug_get_pc)
803         (linux_get_reg, linux_set_reg, reg_from_regset, reg_to_regset)
804         (reg_from_gregset, reg_to_gregset, reg_from_fpregset, reg_to_fpregset)
805         (reg_from_xregset, reg_to_xregset, get_regset, put_regset, get_gregset)
806         (put_gregset, get_fpregset, put_fpregset, get_xregset, put_xregset)
807         [PEEKUSER_POKEUSER_REGINFO]: New functions.
808         (read_reg_as_ulong, write_reg_as_ulong, debug_get_reg, debug_get_pc)
809         (linux_get_reg, linux_set_reg, regs_from_gregset, regs_to_gregset)
810         (reg_from_fpregset, reg_to_fpregset, reg_from_xregset, reg_to_xregset)
811         (get_gregset, put_gregset, get_fpregset, put_fpregset, get_xregset)
812         (put_xregset) [GETREGS_SETREGS_REGINFO]: New functions.
813         (linux_process_get_regs, linux_process_get_reg, linux_process_set_reg)
814         (linux_process_set_regs, ppc_linux_process_set_reg)
815         (ppc_linux_process_get_reg, ppc_linux_process_set_regs)
816         (ppc_linux_process_get_regs): Deleted.
817         (linux_attach): Reorganize initializations.
818         (generic_linux_set_reg): Renamed to linux_set_reg.
819         (generic_linux_get_reg): Renamed to linux_get_reg.
820         (generic_linux_sizeof_reg): Renamed to linux_sizeof_reg.
821         (generic_linux_gg_reg_nr): Renamed to linux_gg_reg_nr.
822         (generic_linux_next_gg_reg): Renamed to linux_next_gg_reg.
823         (generic_linux_reg_format): Renamed to linux_reg_format.
824         (decr_pc_after_break): Consolidated versions of this function
825         down to two; one for x86 and one for everything else.  Also,
826         add ``serv'' parameter and fix all callers.
827         (debug_get_pc, debug_get_reg): Now only three versions of
828         this function, one for PEEKUSER_POKEUSER_REGINFO code,
829         one for GETREGS_SETREGS_REGINFO code, and one for legacy
830         code.  Also, debug_get_pc() now takes a ``serv'' parameter.
831         Fixed all callers.
832         (ps_lgetregs): Use new get_gregset() interface.
833         (ps_lsetregs): Use new put_gregset() interface.
834         (ps_lgetfpregs, ps_lsetfpregs, ps_lgetxregsize, ps_lgetxregs)
835         (ps_lsetxregs): Implement.
836         * ptrace-target.c (ptrace_read_user, ptrace_write_user): Make
837         ``buff'' argument of type ``void *'' instead of ``char *''.
838         (ptrace_get_gregs): Add new parameter ``alt_pid''.
839         (ptrace_set_gregs): Likewise.
840         (ptrace_get_fpregs): Add new parameter alt_pid.  Also fix call
841         to ptrace() so parameters are in correct order.
842         (ptrace_set_fpregs): Likewise.
843         (ptrace_get_fpxregs, ptrace_set_fpxregs): New functions.
844         * ptrace-target.h (ptrace_write_user, ptrace_read_user)
845         (ptrace_get_gregs, ptrace_set_gregs, ptrace_get_fpregs)
846         (ptrace_set_fpregs, ptrace_get_fpxregs, ptrace_set_fpxregs):
847         Declare.
848         * thread-db.c (td_thr_getxregsize_p, td_thr_getxregs_p)
849         (td_thr_setxregs_p): New function pointers.
850         (thread_db_dlopen): Initialize new function pointers.
851         (send_pending_signals): Add ``process'' parameter so that
852         decr_pc_after_break() can get the ``serv'' argument.  Fix all
853         callers.
854         (thread_db_get_thread_reg, thread_db_set_thread_reg): Add xregset
855         support.
856
857 2001-10-14  Kevin Buettner  <kevinb@redhat.com>
858
859         * ptrace-target.c (unistd.h): Include.
860         (close_open_files): New function.
861         (ptrace_create_child):  In newly forked child process, call
862         close_open_files() before invoking execv().
863
864 2001-10-13  Kevin Buettner  <kevinb@redhat.com>
865
866         * server.c (signal.h): Include.
867         (chld_handler): New function.
868         (main): Establish chld_handler as the SIGCHLD signal handler.
869         Also, wait 1 second instead of 0 seconds to avoid busy waiting.
870
871 2001-09-26  Louis Hamilton  <hamilton@redhat.com>
872
873         * configure.in: Use thread-db.c for ARM.
874         * configure: Regenerated.
875         * linux-target.c (ARM_R11, ARM_R12): Added to regmap[].
876         (ARM_FP, ARM_CPSR): Revised mappings of these ARM registers.
877         (debug_get_reg, debug_get_pc, decr_pc_after_break) [ARM_LINUX_TARGET]:
878         New functions.
879         
880 2001-09-20  Kevin Buettner  <kevinb@redhat.com>
881
882         * configure.in: Use thread-db.c for Linux/PPC too.
883         * configure: Regenerated.
884         * linux-target.c (linux_read_reg): Add forward declaration.
885         (debug_get_reg, debug_get_pc, decr_pc_after_break) [PPC_LINUX_TARGET]:
886         New functions.
887
888 2001-09-20  Kevin Buettner  <kevinb@redhat.com>
889
890         * linux-target.c (SIZEOF_MAPPEDREG) [PPC_LINUX_TARGET]: Add comment.
891         (PC_REGNUM) [PPC_LINUX_TARGET]: Remove FIXME comment.
892         (is_fp_reg) [PPC_LINUX_TARGET]: Revise upper bound on floating
893         point register numbers.
894         (ppc_linux_getset_reg): Rewritten to use regmap[] to fetch
895         ptrace() offsets.  This'll handle the (previously unsupported)
896         floating point registers, cr, lr, ctr, and xer.
897         (ppc_linux_process_set_regs, ppc_linux_process_get_regs): Don't
898         hardcode loop upper bound.
899         (ppc_linux_process_get_regs): Revise declarator to match
900         process_get_regs member in struct gdbserv_target.
901
902 2001-09-18  Andrew Haley  <aph@cambridge.redhat.com>
903
904         * server.c (main): Work around SIGCHLD problem.
905
906 2001-08-05  Michael Chastain  <chastain@redhat.com>
907
908         * ptrace-target.c (ptrace_write_user): Ignore ESRCH on MIPS,
909         because mips linux kernel 2.4 has a bug where PTRACE_POKEUSER
910         returns -ESRCH even when it succeeds.
911
912 2001-08-03  Michael Keezer  <mkeezer@redhat.com>
913
914         * configure.in: Add am33_2.0 & mn10300.
915         * config.in: Add AM33_LINUX_TARGET & AM33_2_0_LINUX_TARGET.
916         * linux-target.c: am33_2.0 & mn10300 support.
917
918 2001-07-23  David Howells  <dhowells@redhat.com>
919
920         * ptrace-target.c: Added big-endian MIPS support.
921         * linux-target.c: ditto.
922         * server.h: ditto.
923
924 2001-06-25  Michael Snyder  <msnyder@redhat.com>
925
926         * ptrace-target.c (ptrace_compute_signal): Implement conversion 
927         from native signals to GDB's signal numbering.
928         (ptrace_process_signal): Implement conversion from GDB's signal
929         numbering to native signals.
930         (stop_lwp): Comment out debugging output of SIGSTOP signals.
931         * linix-target.c (linux_fromtarget_break): Call compute_signal.
932         (linux_fromtarget_terminate): Ditto.
933         * thread-db.c (thread_db_check_child_state): Don't do any conversion
934         when passing a signal directly back to the inferior; just copy from
935         stop_signal to signal_to_send.
936         (thread_db_fromtarget_thread_break): Convert signal from native
937         numbering to GDB's numbering.
938
939 2001-06-18  Michael Snyder  <msnyder@redhat.com>
940
941         * linux-target.c (generic_linux_set_reg): Fix typo.
942         (decr_pc_after_break): Mute the debugging output.
943
944 2001-06-15  Michael Snyder  <msnyder@redhat.com>
945
946         * thread_db.c: Disable noisy debugging output.
947         (select_pending_event): Add new selection criterion, giving
948         preference to a thread that is being single-stepped.  This 
949         avoids the problem of deciding whether to decrement the pc if
950         we don't know whether a SIGTRAP was caused by stepping or by
951         hitting a breakpoint.
952
953 2001-06-14  Michael Snyder  <msnyder@redhat.com>
954
955         * thread-db.c (thread_db_set_gen, thread_db_get_gen): Rewrite
956         syntax for qSymbol messages.
957         * gdb_proc_service.h: New file.
958         * Makefile.am (INCLUDES): Remove $(srcdir)/../../include.
959         * Makefile.in: Regenerate.
960
961 2001-05-31  Michael Snyder  <msnyder@redhat.com>
962
963         * thread-db.c (add_thread_to_list): Return explicit value!
964
965 2001-05-23  Jackie Smith Cashion <jsmith@redhat.com>
966
967         * linux-target.c: Change MIPS SIZEOF_MAPPEDREG from 1 to 4.
968         (linux_register_offset): For MIPS return regmap[regnum] instead of
969         SIZEOF_MAPPEDREG * regmap[regnum].
970         (mips_get_reg): Pass pid as argument to ptrace_read_user instead of
971         gdbserv pointer.
972         
973 2001-05-22  Michael Snyder  <msnyder@redhat.com>
974
975         * no-threads.c: New file.
976         * configure.in: Use thread-db.c only for specified architectures, 
977         (including x86); otherwise default to using no-threads.c.
978         * configure: Regenerate.
979         
980 2001-05-10  Martin M. Hunt  <hunt@redhat.com>   
981
982         * linux-target.c (is_fp_reg): New function for mips. 
983         FP not implemented.
984         
985         Merged changes from symbol branch with appropriate modifications.
986
987 Mon Mar 26 08:54:41 PST 2001  Brendan Conoboy <blc@redhat.com>
988  
989         * configure.in: Added mipsvr4181el* target
990         * configure: regenerate
991  
992 2001-01-26  Rudy Folden <rfolden@redhat.com>
993         
994         * server.c: Changed name from gdbgeneral_xxx to gdbconnect_xx.
995  
996 2001-01-24  Rudy Folden <rfolden@redhat.com>
997  
998         * configure: Added mipsel* target.
999         * linux-target.c: Add support for MIPS processor, including single-
1000         stepping which doesn't exist in mips ptrace.
1001         * ptrace-target.c (ptrace_handle_waitstatus): Added single-stepping
1002         instruction restore for mips.
1003         (ptrace_attach): Added single stepping initialization code.
1004         * server (main): Added generic interfaces, gdbgeneral_startup/shutdown
1005         for serial or tcp/ip selection. Also added server_quit_p to X and W 
1006         for serial support (no socket shutdown).
1007         * server.h (child_process): Added mips instruction save area for
1008         single-step support.
1009
1010         2001-01-10  Rudy Folden <rfolden@redhat.com>
1011         * ptrace-target.c (enum): Added U_REGS_OFFSET to processor
1012         dependent enums.
1013
1014 2001-04-26  Michael Snyder  <msnyder@redhat.com>
1015
1016         * linux-target.c (is_fp_reg): New function.
1017         (reg_from_fpregset, reg_to_fpregset): New functions.
1018         Support for thread_db_get_thread_reg floating point regs.
1019         * thread-db.c (thread_db_get_thread_reg, thread_db_set_thread_reg):
1020         Infrastructure for support of floating point regs.
1021         (Attach_thread): New function, abstracted from below.
1022         (find_new_threads_callback): Call attach_thread.
1023         (stop_thread): New function, abstracted from stop_all_threads.
1024         (stop_all_threads): Call stop_thread.
1025         (continue_thread): Test for lwp == 0 before calling continue_lwp.
1026         * ptrace-target.c (stop_lwp): New function.
1027         * gdbserv-thread-db.h (reg_to_regnum, reg_from_regnu): Declare.
1028
1029 2001-04-25  Michael Snyder  <msnyder@redhat.com>
1030
1031         Move all ptrace references out of thread-db.c.
1032         * gdbserv-thread-db.h: New file.
1033         * thread-db.c (struct ps_prochandle): Move to gdbserv-thread-db.h.
1034         (gdb_ps_prochandle_t): Ditto.
1035         (gdb_ps_read_buf_t, gdb_ps_write_buf_t, gdb_ps_size_t): Ditto.
1036         (ps_pstop, ps_pcontinue): Move to ptrace-target.c.
1037         (ps_lstop, ps_lcontinue): Ditto.
1038         (ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite): Ditto.
1039         (ps_lgetxregsize): Move to linux-target.c.
1040         (ps_lgetxregs, ps_lsetxregs, ps_getpid): Ditto.
1041         (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Ditto.
1042         (find_new_threads_callback): Abstract attach bits into new function
1043         attach_lwp, and move that to ptrace-target.c.
1044         (wait_all_threads): Call continue_lwp instead of ptrace.
1045         (continue_pid): Rename as continue_lwp, move into ptrace-target.c.
1046         (singlestep_pid): Rename as continue_lwp, move into ptrace-target.c.
1047         (struct symbol_cache): Change value to a paddr_t.
1048         (add_symbol_to_list, lookup_cached_symbol): Ditto.
1049         * linux-target.c (ps_lgetregs, ps_lsetregs, ps_lgetfpregs, 
1050         ps_lsetfpregs, ps_lgetxregsize, ps_lgetxregs, ps_lsetxregs,
1051         ps_getpid): Moved to here from thread-db.c.
1052         * ptrace-target.c (continue_lwp, singlestep_lwp, attach_lwp,
1053         (ps_pstop, ps_pcontinue, ps_lstop, ps_lcontinue, ps_pdread,
1054         ps_pdwrite, ps_ptread, ps_ptwrite): Moved here from thread-db.c.
1055         (ptrace_handle_waitstatus): Renamed as handle_waitstatus.
1056         (ps_lcontinue): Implement (untested).
1057         * server.c (main): Check server_quit_p after calling gdbloop_poll.
1058
1059
1060 2001-04-24  Michael Snyder  <msnyder@redhat.com>
1061
1062         * thread-db.c (continue_pid, continue_thread): New functions.
1063         (singlestep_pid, singlestep_thread): New functions.
1064         (continue_all_threads): Use new function continue_thread.
1065         (thread_db_continue_program): Ditto.
1066         (thread_db_singlestep_program): Ditto.
1067         (thread_db_continue_thread): Ditto.
1068         (thread_db_singlestep_thread): Ditto.
1069         
1070         * thread-db.c: Remove some debugging printfs.
1071         Add activation and handling of the thread debug signal.
1072         (get_thread_signals): Get the debug signal as well as the others.
1073         Set target flag to activate the debug signal.
1074         (set_target_int_by_name): New function.
1075         (struct gdbserv_thread): Rename "sigstopped" flag to just "stopped".
1076         (stop_all_threads): Mark the event thread "stopped".
1077         (wait_all_threads): Mark the event thread "waited".
1078         Don't stash the debug signal (throw it away).
1079         (continue_all_threads): Always send the restart signal to any
1080         thread that has just been attached.
1081         (thread_db_check_child_state): Make two calls to waitpid (one with
1082         WCLONE, one without) instead of alternating every other time.
1083         Add debug_signal to the list of events to ignore.
1084         (thread_db_attach): Add "__pthread_threads_debug" to list of symbols.
1085
1086 2001-04-20  Michael Snyder  <msnyder@redhat.com>
1087
1088         * thread-db.c (thread_db_check_child_state): Add SIGCHLD to the
1089         list of signals to ignore.  When a thread exits, make sure that
1090         the other threads get restarted.
1091
1092 2001-04-19  Michael Snyder  <msnyder@redhat.com>
1093
1094         * thread-db.c (wait_all_threads): Save exit and term events.
1095         Save SIGINT like any other signal event.  
1096         (send_pending_signals): Don't send SIGINT.
1097         (select_pending_event): Give preference to SIGINT.
1098         (thread_db_check_child_state): Move special handling of 
1099         cancel and restart signals to after the stop_all_threads
1100         and wait_all_threads calls, so we can catch these signals
1101         even if they aren't the first signal we get notification of.
1102
1103 2001-04-19  Michael Snyder  <msnyder@redhat.com>
1104
1105         Major change to select an event so as to avoid starvation.
1106         * thread-db.c (select_pending_event): New function.  Choose an
1107         event from the list of pending events, and make its thread the
1108         event thread.
1109         (stop_all_threads): Don't mark the event thread.  That will now
1110         be done by select_pending_event.
1111         (struct signal_list): Rename to event_list.  Save the thread and
1112         the entire wait status, so that all events (not just signals)
1113         can be saved.
1114         (add_pending_signal): Rename to add_pending_event.
1115         (send_pending_signals): Ignore non-signal events.
1116         Ignore the selected event (which will be returned to the debugger).
1117         Push back breakpoint events (moved here from wait_all_threads).
1118         (wait_all_threads): Remove special handling for SIGTRAP (moved
1119         into send_pending_signals).  Call select_pending_event.
1120         (thread_db_check_child_status): Add initial event to event list.
1121
1122 2001-04-16  Michael Snyder  <msnyder@redhat.com>
1123         * thread-db.c (thread_db_continue_thread): Handle the signal param.
1124         (thread_db_singlestep_thread): Ditto.
1125         (thread_db_check_child_state): Handle exit and termination separately.
1126
1127 2001-04-13  Michael Snyder  <msnyder@redhat.com>
1128
1129         * thread-db.c (find_new_threads_callback): Account for dead threads.
1130         (update_thread_list): Keep zombie threads in thread list, but
1131         delete them if they've been joined or detached.
1132         (stop_all_threads): Don't stop dead threads.
1133         (continue_all_threads): Don't continue if not waited.
1134         (thread_db_check_child_state): Move handling of terminate and
1135         exit earlier.  Handle termination or exit of children specially.
1136         (thread_db_get_thread_reg): Test for defunct threads.
1137         (thread_db_set_thread_reg): Ditto.
1138         * ptrace-target.c (ptrace_xfer_mem): Don't be noisy about ptrace
1139         errors caused by illegal memory accesses.
1140
1141 2001-04-12  Andrew Cagney  <ac131313@redhat.com>
1142
1143         * server.c: Include "gdbloop.h".  Replace gdbsocket_poll with
1144         gdbloop_poll.
1145         * ptrace-target.c, linux-target.c, solaris-target.c: 
1146         * dummy-target.c: Update comments.
1147
1148 2001-04-11  Michael Snyder  <msnyder@redhat.com>
1149
1150         * thread-db.c (struct gdbserv_thread): Add new flag 'stepping'.
1151         (stop_all_threads): Add parameter 'process'.
1152         Set the process->event_thread here, instead of in check_child_state.
1153         (wait_all_threads): Accept process as a parameter instead of eventpid.
1154         Handle SIGTRAP differently if the thread was singlestepping.
1155         (thread_db_singlestep_program): Clear flags for event thread.
1156         (thread_db_singlestep_thread): Ditto.
1157         (thread_db_continue_program): Ditto.
1158         (thread_db_continue_thread): Ditto.
1159         (thread_db_check_child_state): Cancel the stepping flag.
1160         Don't set the event thread, this is now done in stop_all_threads.
1161         * linux-target.c (debug_get_reg, debug_get_pc): New functions.
1162         Purely for debugging output.  Architecture dependent.
1163
1164 2001-04-09  Michael Snyder  <msnyder@redhat.com>
1165
1166         * thread_db.c (thread_db_continue_thread): Continue the actual
1167         thread given, not necessarily the event thread.
1168         (thread_db_singlestep_thread): Step the actual thread given, 
1169         not necessarily the event thread.
1170
1171 2001-04-09  Michael Snyder  <msnyder@redhat.com>
1172
1173         * thread-db.c (stop_all_threads): Do not send SIGSTOP to a thread
1174         if it has already been sigstopped.
1175         (thread_db_continue_thread): New function.  Continue a single thread.
1176         (thread_db_singlestep_thread): New function.  Step a single thread.
1177         (thread_db_attach): Set up continue_thread, singlestep_thread methods.
1178         
1179 2001-04-09  Michael Snyder  <msnyder@redhat.com>
1180
1181         * linux-target.c (PC_REGNUM): New enum, define.
1182         (decr_pc_after_break): New function.  Architecture dependent.
1183         This version will probably serve for all targets for which
1184         DECR_PC_AFTER_BREAK is one.  Those for which it is zero will
1185         want to define a no-op version of this function.
1186         * thread-db.c (first_thread_in_list): New function.
1187         (update_thread_list, stop_all_threads, wait_all_threads, 
1188         continue_all_threads): Use first_thread_in_list in for loops.
1189         (wait_all_threads): Handle SIGINT and SIGTRAP specially.
1190         Throw away SIGINT for all threads but the event thread.
1191         For SIGTRAP in other than the event thread, call decr_pc_after_break
1192         (giving the thread a chance to hit the trap again later).
1193         (thread_db_continue_program, thread_db_singlestep_program):
1194         Continue the event thread before all the others.
1195
1196 2001-04-05  Michael Snyder  <msnyder@redhat.com>
1197
1198         * thread-db.c (add_pending_signal, send_pending_signals):
1199         New functions.  Allow wait_all_threads to collect any signals
1200         other than SIGSTOP from the threads and defer them.
1201         (wait_all_threads): Loop on each thread and call waitpid until
1202         we get SIGSTOP.  Any other signals are pended by throwing them
1203         into a list, and then sending them back to the threads using kill.
1204         (thread_db_get_thread_reg): Remove temporary hack for libthread_db
1205         bug.  (thread_db_set_thread_reg): Ditto.
1206
1207 2001-04-04  Michael Snyder  <msnyder@redhat.com>
1208
1209         * server.h (struct child_process): Add a 'running' flag.
1210         * thread_db.c (continue_all_threads): Take gdbserv as argument.
1211         Use it to find the current thread, and don't continue that one
1212         (leave it up to the parent method to continue the event thread.)
1213         (thread_db_continue_program): Child is running -- set a flag.
1214         (thread_db_singlestep_program): Ditto.
1215         (thread_db_check_child_state): Return immediately unles the child
1216         is running.  Because this is a polling routine, we don't want to
1217         return any new events unles the child is officially running.
1218         Call waitpid with -1 instead of the process->pid, so that we
1219         can get events from the threads.  Alternately use __WCLONE.
1220         (thread_db_get_thread_reg): If thread is not specified, use
1221         the event thread (if possible).  Temporarily hack around a
1222         bug in the thread_db library.
1223         (thread_db_set_thread_reg): Ditto.
1224         
1225 2001-04-04  Michael Snyder  <msnyder@redhat.com>
1226
1227         * thread-db.c (continue_all_threads): Zero the attached, stopped,
1228         and waited flags only if thread is successfully continued.
1229         * linux-target.c: Fix broken endif directive.
1230         * configure.in: Test for sys/procfs.h.
1231         * config.in: Define HAVE_SYS_PROCFS_H.
1232         * configure: Regenerate.
1233         * thread-db.c (thread_list_lookup_by_pid): New function.
1234         (thread_db_check_child_state): Cache the event thread.
1235         (thread_db_fromtarget_thread_break): New function.  Call
1236         gdbserv_fromtarget_thread_break with the event thread.
1237         (thread_db_attach): Take over the fromtarget_break vector.
1238         * server.h (struct child_process): Add event_thread field.
1239
1240 2001-04-02  Michael Snyder  <msnyder@redhat.com>
1241
1242         * thread-db.c: include errno.h for error reporting.
1243         (struct gdbserv_thread): Add flag 'waited'.
1244         (thread_db_type_str): New function for thread_extra_info.
1245         (find_new_threads_callback): Use errno for error reporting.
1246         (thread_db_thread_info): New function, for thread_extra_info.
1247         (wait_all_threads): New function.  Call waitpid on all threads
1248         that have been attached or sigstopped.  Incomplete -- needs to
1249         push back any signals other than SIGSTOP.
1250         (continue_all_threads): Send PTRACE_CONT only to threads that
1251         have been attached or sigstopped.
1252         (check_child_state): Call wait_all_threads.
1253         (thread_db_attach): Activate thread_info vector.
1254
1255 2001-03-30  Michael Snyder  <msnyder@redhat.com>
1256
1257         * linux-target.c (linux_read_reg, linux_write_reg): New functions.
1258         Abstract out the code to actually read a register value, so that 
1259         it can be shared by several methods.
1260         (get_gregset): Use sizeof (GREGSET_T).
1261         (generic_linux_gg_reg_nr): New function.  Support new reg methods.
1262         (generic_linux_next_gg_reg): Ditto.
1263         (generic_linux_sizeof_reg): Ditto.
1264         (generic_linux_reg_format): Ditto.
1265         (generic_linux_get_reg): New function.  Newer register method,
1266         non-thread-aware version.
1267         (linux_attach): Use new register method in target vector.
1268         * thread-db.c: Remove some developmental ifdef code.
1269         (thread_db_get_thread_reg): Fall back on parentvec.get_reg
1270         if no thread or no thread_agent available.
1271         (thread_db_attach): Replace get_reg vector with get_thread_reg.
1272
1273         * ptrace-target.c (ptrace_write_user): For X86 target, skip
1274         write-protected location in user/context address space.
1275         * linux-target.c (linux_process_get_reg): Use linux_read_reg.
1276         (linux_process_set_reg): Use linux_write_reg.
1277         (put_gregset): New function.  Write child's gregset.
1278         (generic_linux_get_reg): Use SIZEOF_MAPPEDREG.
1279         (generic_linux_set_reg): New function.  Newer register method.
1280         (linux_attach): Add set_reg to target vector, not process_set_reg.
1281         * thread-db.c (ps_lsetregs): Implement by calling put_gregset.
1282         (thread_db_set_thread_reg): New function.  Implement set_thread_reg.
1283         (thread_db_attach): Add set_thread_reg to target vector.
1284
1285 2001-03-29  Michael Snyder  <msnyder@redhat.com>
1286
1287         * ptrace-target.c (ptrace_read_user, ptrace_write_user):
1288         Accept an explicit pid instead of a struct gdbserv.
1289         * linux-target.c: Include gdb_proc_service.h for gregset_t
1290         (FIXME: better place to get it from?)
1291         (linux_register_offset): Return signed long to facilitate 
1292         test for -1 error return value.
1293         (ppc_linux_xfer_reg, linux_process_get_reg, linux_process_set_reg):
1294         Calls to ptrace_read_user and ptrace_write_user now need a pid
1295         argument instead of a struct gdbserv.
1296         (reg_from_gregset): New function.
1297         (reg_to_gregset): New function.
1298         (get_gregset): New function.  Read child's gregset.
1299         * thread-db.c (ps_lgetregs): Implement by calling get_gregset.
1300         (thread_db_dlopen, thread_db_open, thread_db_attach): Change 
1301         sense of return: -1 now means failure, 0 means success.
1302         (thread_db_get_thread_reg): Call reg_from_gregset.
1303
1304 2001-03-29  Michael Snyder  <msnyder@redhat.com>
1305
1306         * thread-db.c: Include signal.h, sys/ptrace.h (FIXME ptrace).
1307         (struct symbol_cache): Make value (address) unsigned.
1308         (add_symbol_to_list, lookup_cached_symbol): Ditto.
1309         (struct gdbserv_thread): Add attached, stopped flags to thread.
1310         (add_thread_to_list): Return pointer to new thread in list.
1311         (delete_thread_from_list): New function.
1312         (ps_pglobal_lookup, ps_pdread, ps_pdwrite, ps_ptread, ps_ptwrite):
1313         Muffle debugging output.
1314         (find_new_threads_callback): Muffle debugging output.
1315         Add thread to list only if it isn't already there.
1316         Use ptrace to attach to new threads.  (FIXME explicit ptrace).
1317         (update_thread_list): New function.  Only place where td_ta_thr_iter
1318         is called.  Builds up the thread list, prunes it of any dead threads.
1319         (thread_db_thread_next): Call update_thread_list.
1320         (get_thread_signals): Read the values of the cancel and restart
1321         signals from the target using hardcoded symbol names.
1322         (stop_all_threads): New function.  First cut.  Deliver SIGSTOP
1323         to all threads except the event thread and any new threads that
1324         have just been attached.
1325         (continue_all_threads): New function.  First cut.  Deliver
1326         PTRACE_CONT to all threads except the main thread.  Needs work.
1327         (thread_db_continue_program): New function.  
1328         (thread_db_singlestep_program): New function.
1329         (thread_db_get_thread_reg): New function, incomplete.
1330         (thread_db_attach): Take over continue_program, singlestep_program.
1331         Muffle some debugging output.
1332
1333 2001-03-26  Michael Snyder  <msnyder@redhat.com>
1334
1335         * thread-db.c: New file.  Linux thread debugging layer.
1336         * linux-target.c (linux_attach): Call thread_db_attach.
1337         * ptrace-target.c: Export ptrace_handle_waitstatus for
1338         thread-db.c (FIXME).
1339         * configure.in: Add thread-db.c to linux target modules.
1340         (GREGSET_T, FPREGSET_T, HAVE_LWPID_T, HAVE_PSADDR_T,
1341         HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, LINUX_TARGET): Define.
1342         * config.in (GREGSET_T, FPREGSET_T, HAVE_LWPID_T, 
1343         HAVE_PSADDR_T, HAVE_PRGREGSET_T, HAVE_PRFPREGSET_T, LINUX_TARGET): 
1344         Default undefine.
1345         * configure: Regenerate.
1346         * Makefile.am (INCLUDES): Add $(srcdir)/../../include
1347         (devo/include), so that header files can be shared with gdb.
1348         (server_LDFLAGS): Add -ldl -rdynamic (FIXME configure).
1349         * Makefile.in: Regenerate.
1350
1351 2001-03-22  Andrew Cagney  <ac131313@redhat.com>
1352
1353         * server.c (main): Pass gdbserver.attach and process to
1354         gdbserver_startup instead of gdbserver_poll.
1355
1356 2001-03-16  Michael Snyder  <msnyder@redhat.com>
1357
1358         * linux-target.c (linux_detach): Pass new parameter to ptrace_detach.
1359         Fix file header comment typo.  Update copyright.
1360
1361 2001-03-16  Elena Zannoni  <ezannoni@cygnus.com>
1362
1363         * dummy-target.c (dummy_detach): Add new parameter.
1364         * linux-target.c (linux_detach): Ditto.
1365         * ptrace-target.c (ptrace_detach): Ditto.
1366         * solaris-target.c (solaris_detach): Ditto.
1367
1368 2001-03-14  Andrew Cagney  <ac131313@redhat.com>
1369
1370         * ChangeLog: Move to here from ../native.
1371         * Makefile.am: Ditto.
1372         * aclocal.m4: Ditto.
1373         * configure.in: Ditto.
1374         * dummy-target.c: Ditto.
1375         * linux-target.c: Ditto.
1376         * ptrace-target.c: Ditto.
1377         * ptrace-target.h: Ditto.
1378         * server.c: Ditto.
1379         * server.h: Ditto.
1380         * solaris-target.c: Ditto.
1381         * Makefile.in: Regenerate.
1382         * config.in: Ditto.
1383         * configure: Ditto.
1384
1385 2001-03-14  Andrew Cagney  <ac131313@redhat.com>
1386
1387         * Makefile.am (INCLUDES): Update. Headers moved to ../include.
1388         * Makefile.in: Regenerate.
1389
1390 2000-11-27  Michael Snyder  <msnyder@happy.cygnus.com>
1391
1392         * ptrace-target.c (ptrace_xfer_mem): Return -1 on error.
1393
1394 2000-11-21  Michael Snyder  <msnyder@cleaver.cygnus.com>
1395
1396         * ptrace-target.c (noop_flush_i_cache): Comment out superfluous
1397         debugging output.
1398         * linux-target.c (linux_process_get_reg): Return value of 
1399         linux_register_offset is unsigned (can't be less than zero).
1400         (linux_process_rcmd): Just use '1' and '0' to control debug output.
1401
1402 2000-11-06  Michael Snyder  <msnyder@cleaver.cygnus.com>
1403
1404         * dummy-target.c (dummy_attach): Fix order of memset args.
1405         * linux-target.c (linux_attach): Ditto.
1406         * ptrace-target.c (ptrace_attach): Ditto.
1407         * solaris-target.c (solaris_attach): Ditto.
1408
1409 2000-10-19  Belinda Brazelle <brazelle@redhat.com>
1410
1411         * linux-target.c: Add support for Arm processor.
1412
1413 2000-10-12  Michael Snyder  <msnyder@cleaver.cygnus.com>
1414
1415         * ptrace-target.c (ptrace_handle_waitstatus): Save exitstatus
1416         in process->stop_signal.
1417
1418 2000-09-14  Michael Snyder  <msnyder@michael.wirespeed.com>
1419
1420         * linux-target.c: Define regmap etc. for SH target.
1421         * configure.in: Add defines for SH target.
1422         * configure: Rebuild.
1423
1424 2000-09-13  Michael Snyder  <msnyder@michael.wirespeed.com>
1425
1426         * server.h (fromtarget_terminate): New field.  Also fix up 
1427         some overlooked function prototypes in the existing fields.
1428         (struct client_process): Rename to struct child_process.
1429         * linux-target.c (linux_fromtarget_terminate): New function.
1430         Called from main when child terminates abnormally.
1431         (linux_process_rcmd): New function.  Catches "qRcmd" requests, 
1432         which are currently used just to turn on debug output.
1433         * ptrace-target.c (ptrace_handle_waitstatus): Set stop_signal
1434         for the WIFSTOPPED case.  (ptrace_process_signal): Return zero
1435         instead of the signal number, to let libremote know that we have
1436         handled the signal.  (ptrace_xfer_memory): Fix off-by-one error.
1437         * solaris-target.c (solaris_fromtarget_terminate): New function.
1438         * server.c (main): Call fromtarget_terminate for the 'T' case.
1439         Do not request a one-second delay from gdbsocket_poll.
1440
1441 2000-09-08  Michael Snyder  <msnyder@cleaver.cygnus.com>
1442
1443         * solaris-target.c: New file.  Just a prototype, doesn't actually
1444         work.  Used to confirm configurability to multiple targets.
1445         * dummy-target.c: New file.  Dummy back-end for implementing new
1446         targets such as solaris-target.c (above), before actually having
1447         a working back-end.  The dummy target works just like the sample
1448         target in the samples directory.
1449         * configure.in: Add AC_SUBST(TARGET_MODULES) to add the 
1450         appropriate target modules to the Makefile.  Add solaris target.
1451         * configure: Regenerate.
1452         * Makefile.am: Move *-target.c into EXTRA_server_SOURCES.
1453         Add TARGET_MODULES to server_LDADD.  Define server_DEPENDENCIES.
1454         * Makefile.in: Regenerate.
1455         * ptrace-target.h: New file.  Defines needed only by ptrace.
1456         * server.h: Remove ptrace-specific defines to ptrace-target.h.
1457         (struct server_vector): New, for target entry points.
1458         (struct nativeserver): Rename to struct client_process.
1459         * server.c: Use client_process for entry points, and server_vector.
1460         * linux-target.c: Include ptrace-target.h.  
1461         (ppc_linux_get_reg): Rename to ppc_linux_process_get_reg.
1462         (ppc_linux_set_reg): Rename to ppc_linux_process_set_reg.
1463         (ppc_linux_get_regs): Rename to ppc_linux_process_get_regs.
1464         (ppc_linux_set_regs): Rename to ppc_linux_process_set_regs.
1465         (linux_get_reg): Rename to linux_process_get_reg.
1466         (linux_set_reg): Rename to linux_process_set_reg.
1467         (linux_get_regs): Rename to linux_process_get_regs.
1468         (linux_set_regs): Rename to linux_process_set_regs.
1469         (gdbserver_check_child_state): Rename to linux_check_child_state.
1470         (gdbserver_fromtarget_break): Rename to linux_fromtarget_break.
1471         (gdbserver_fromtarget_exit): Rename to linux_fromtarget_exit.
1472         (struct server_vector gdbserver): New, defines entry points.
1473         * ptrace-target.c: Include ptrace-target.h.
1474         * aclocal.m4: New file.
1475
1476 2000-09-08  Michael Snyder  <msnyder@cleaver.cygnus.com>
1477
1478         * linux-target.c (linux_get_reg, linux_set_reg): Remove direct
1479         calls to ptrace; instead use service call into ptrace-target.c.
1480         (linux_get_regs, linux_set_regs): Remove ifdef PPC; instead use
1481         an ifdef in linux_attach to set up the target vector pointers.
1482         (linux_attach): If PPC_LINUX_TARGET, use PPC versions of register
1483         functions instead of generic ones.  Define process_set_reg, so
1484         that the "P" command is now handled.
1485
1486 2000-09-07  Michael Snyder  <msnyder@cleaver.cygnus.com>
1487
1488         * ptrace-target.c (ptrace_read_user, ptrace_write_user): New 
1489         functions.  Exported so that linux-target does not have to 
1490         call ptrace directly.  (ptrace_get_gregs, ptrace_set_gregs, 
1491         ptrace_get_fpregs, ptrace_set_fpregs): New functions.
1492         Exported for use by targets that use these methods.
1493         (ptrace_xfer_mem): Use ptrace_arg3_type instead of long.
1494         Add address to error messages.  
1495         * linux-target.c: Start using config macros, port to alpha and ppc.
1496         (ppc_linux_xfer_reg, ppc_linux_getset_reg, ppc_linux_get_reg,
1497         ppc_linux_set_reg, ppc_linux_get_regs, ppc_linux_set_regs):
1498         New functions.  Explicit knowledge of ppc linux register layout.
1499         (linux_get_reg): Catch undefined regmap offsets.
1500         (linux_set_reg): Ditto.
1501         (linux_get_regs): Conditionally call ppc_linux_get_regs.
1502         (linux_set_regs): Ditto.
1503         * configure.in: Add PPC target, and export target defines.
1504         * configure: Regenerate.
1505         * config.in: Add new target defines.
1506
1507 2000-09-06  Michael Snyder  <msnyder@cleaver.cygnus.com>
1508
1509         * Makefile.am: Define CC and CFLAGS.
1510         * Makefile.in: Regenerate.
1511         * configure.in: New file.  Detect all manner of things.
1512         * config.in: New file.  Input file for config.h.
1513         * configure: Generate.
1514         * ptrace-target.c (ptrace_xfer_type): Move def'n into server.h.
1515         (PTRACE_XFER_SIZE): Ditto.
1516         * linux-target.c (ptrace_xfer_type): Move def'n into server.h.
1517         (ptrace_arg3_type): Ditto.
1518         * server.h: Use config macros to determine definitions of 
1519         ptrace_xfer_type, ptrace_arg1_type, ptrace_arg2_type, 
1520         ptrace_arg3_type, ptrace_arg4_type.
1521
1522 2000-09-05  Michael Snyder  <msnyder@cleaver.cygnus.com>
1523
1524         * server.c (main): Detect exit status, and call fromtarget_exit
1525         instead of fromtarget_break.
1526         * linux-target.c (gdbserver_fromtarget_exit): New function.
1527         * ptrace-target.c (ptrace_kill_program, ptrace_sigkill_program):
1528         New functions.  Send signals to the child.
1529         (ptrace_exit_program): New function.
1530
1531 2000-09-05  Michael Snyder  <msnyder@cleaver.cygnus.com>
1532
1533         * linux-target.c (linux_attach): Activate process_signal vector.
1534         (gdbserver_check_child_state): Send real received signal, instead
1535         of faking SIGTRAP.
1536         * ptrace-target.c (ptrace_break_program): New function.  Implement
1537         control-c interrupt from host.
1538         (ptrace_process_signal): Implement continuation signal.
1539         (ptrace_singlestep_program): Ditto.
1540         (ptrace_continue_program): Ditto.
1541         (ptrace_get_trap_number): New function.  Return signal to libremote.
1542         (ptrace_compute_signal): Ditto.
1543         (ptrace_attach): Activate break_program, process_signal, compute_signal
1544         and get_trap_number vectors.
1545         server.h (struct nativeserver): add signal_to_send field.
1546         Rename stop_sig to stop_signal.
1547
1548 2000-09-05  Michael Snyder  <msnyder@cleaver.cygnus.com>
1549
1550         * ptrace-target.c (ptrace_singlestep_program): Make ptrace args long.
1551         FIXME: needs to be configurable.
1552         * linux-target.c (linux_get_reg, linux_set_reg): Make regaddr and
1553         regval configurable types.  FIXME needs real configury.
1554
1555 2000-09-01  Michael Snyder  <msnyder@cleaver.cygnus.com>
1556         New directory "native" for native gdbserver in libremote.
1557         * server.c: New file.  Entry point and main event loop.
1558         * server.h: New file.  Shared declarations.
1559         * linux-target.c: New file.  Linux version of libremote native stub.
1560         * ptrace-target.c: New file.  Ptrace operations for libremote stub.
1561         * Makefile.am: New file.  Automake source.
1562         * Makefile.in: New file.  Automake-generated makefile source.
1563         Note: this work is incomplete and only partially working.
1564         
1565