GNU Binutils with patches for OS216
修訂 | 6301c13d9ebeab1b0470573b530fb181ad11526c (tree) |
---|---|
時間 | 2004-03-24 05:28:36 |
作者 | Elena Zannoni <ezannoni@kwik...> |
Commiter | Elena Zannoni |
merge mainline chenges into branch
@@ -1,3 +1,114 @@ | ||
1 | +2004-03-12 Daniel Jacobowitz <drow@mvista.com> | |
2 | + | |
3 | + * linux-low.c: Include <errno.h>. Remove extern declaration of | |
4 | + errno. | |
5 | + | |
6 | +2004-03-12 Daniel Jacobowitz <drow@mvista.com> | |
7 | + | |
8 | + * gdbreplay.c, server.h, utils.c: Update copyright years. | |
9 | + | |
10 | +2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com> | |
11 | + | |
12 | + * server.c (main): Print child status or termination signal from | |
13 | + variable 'signal', not 'sig'. | |
14 | + | |
15 | +2004-03-04 Nathan J. Williams <nathanw@wasabisystems.com> | |
16 | + | |
17 | + * linux-low.c (linux_read_memory): Change return type to | |
18 | + int. Check for and return error from ptrace(). | |
19 | + * target.c (read_inferior_memory): Change return type to int. Pass | |
20 | + back return status from the_target->read_memory(). | |
21 | + * target.h (struct target_ops): Adapt *read_memory() prototype. | |
22 | + Update comment. | |
23 | + (read_inferior_memory): Adapt prototype. | |
24 | + * server.c (main): Return an error packet if | |
25 | + read_inferior_memory() returns an error. | |
26 | + | |
27 | +2004-03-04 Daniel Jacobowitz <drow@mvista.com> | |
28 | + | |
29 | + * Makefile.in (distclean): Remove config.h, stamp-h, and config.log. | |
30 | + Unify with other clean targets. | |
31 | + | |
32 | +2004-02-29 Daniel Jacobowitz <drow@mvista.com> | |
33 | + | |
34 | + * server.c (handle_v_cont): Call set_desired_inferior. | |
35 | + | |
36 | +2004-02-29 Daniel Jacobowitz <drow@mvista.com> | |
37 | + | |
38 | + * remote-utils.c (prepare_resume_reply): Always supply "thread:". | |
39 | + | |
40 | +2004-02-29 Daniel Jacobowitz <drow@mvista.com> | |
41 | + | |
42 | + * linux-low.c (linux_wait): Unblock async I/O. | |
43 | + (linux_resume): Block and enable async I/O. | |
44 | + * remote-utils.c (block_async_io, unblock_async_io): New functions. | |
45 | + * server.h (block_async_io, unblock_async_io): Add prototypes. | |
46 | + | |
47 | +2004-02-29 Daniel Jacobowitz <drow@mvista.com> | |
48 | + | |
49 | + * remote-utils.c (remote_open): Print a status notice after | |
50 | + opening a TCP port. | |
51 | + * server.c (attach_inferior): Print a status notice after | |
52 | + attaching. | |
53 | + | |
54 | +2004-02-29 Daniel Jacobowitz <drow@mvista.com> | |
55 | + | |
56 | + * linux-arm-low.c (arm_get_pc): Print out stop PC in debug mode. | |
57 | + | |
58 | +2004-02-26 Daniel Jacobowitz <drow@mvista.com> | |
59 | + | |
60 | + * remote-utils.c (write_enn): Use "E01" instead of "ENN" for the | |
61 | + error packet. | |
62 | + * server.c, target.h: Update copyright years. | |
63 | + | |
64 | +2004-02-25 Roland McGrath <roland@redhat.com> | |
65 | + | |
66 | + * target.h (struct target_ops): New member `read_auxv'. | |
67 | + * server.c (handle_query): Handle qPart:auxv:read: query using that. | |
68 | + * linux-low.c (linux_read_auxv): New function. | |
69 | + (linux_target_ops): Initialize `read_auxv' member to that. | |
70 | + | |
71 | +2004-02-17 Ulrich Weigand <Ulrich.Weigand@de.ibm.com> | |
72 | + | |
73 | + Committed by Jim Blandy <jimb@redhat.com>. | |
74 | + | |
75 | + * linux-s390-low.c (s390_num_regs): Update. | |
76 | + (s390_regmap): Remove control registers. Use __s390x__ predefine | |
77 | + instead of GPR_SIZE to distiguish s390 and s390x targets. | |
78 | + | |
79 | +2004-01-31 Daniel Jacobowitz <drow@mvista.com> | |
80 | + | |
81 | + * linux-low.c: Update copyright year. | |
82 | + (check_removed_breakpoint): Clear pending_is_breakpoint. | |
83 | + (linux_set_resume_request, linux_queue_one_thread) | |
84 | + (resume_status_pending_p): New functions. | |
85 | + (linux_continue_one_thread): Use process->resume. | |
86 | + (linux_resume): Only resume threads if there are no pending events. | |
87 | + * linux-low.h (struct process_info): Add resume request | |
88 | + pointer. | |
89 | + | |
90 | +2004-01-30 Daniel Jacobowitz <drow@mvista.com> | |
91 | + | |
92 | + * regcache.c (new_register_cache): Clear the allocated register | |
93 | + buffer. Suggested by Atsushi Nemoto <anemo@mba.ocn.ne.jp>. | |
94 | + | |
95 | +2003-10-13 Daniel Jacobowitz <drow@mvista.com> | |
96 | + | |
97 | + * linux-low.c (linux_resume): Take a struct thread_resume * | |
98 | + argument. | |
99 | + (linux_wait): Update call. | |
100 | + (resume_ptr): New static variable. | |
101 | + (linux_continue_one_thread): Renamed from | |
102 | + linux_continue_one_process. Use resume_ptr. | |
103 | + (linux_resume): Use linux_continue_one_thread. | |
104 | + * server.c (handle_v_cont, handle_v_requests): New functions. | |
105 | + (myresume): New function. | |
106 | + (main): Handle 'v' case. | |
107 | + * target.h (struct thread_resume): New type. | |
108 | + (struct target_ops): Change argument of "resume" to struct | |
109 | + thread_resume *. | |
110 | + (myresume): Delete macro. | |
111 | + | |
1 | 112 | 2003-08-08 H.J. Lu <hongjiu.lu@intel.com> |
2 | 113 | |
3 | 114 | * Makefile.in (install-only): Create dest dir. Support DESTDIR. |
@@ -112,7 +223,7 @@ Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com> | ||
112 | 223 | for create_inferior. |
113 | 224 | * server.c (signal_pid): New variable. |
114 | 225 | (create_inferior): Set signal_pid. Block SIGTTOU and SIGTTIN in |
115 | - gdbserver. Set the child to be the foreground process group. | |
226 | + gdbserver. Set the child to be the foreground process group. | |
116 | 227 | (attach_inferior): Set signal_pid. |
117 | 228 | |
118 | 229 | 2002-08-23 Daniel Jacobowitz <drow@mvista.com> |
@@ -141,7 +252,7 @@ Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com> | ||
141 | 252 | |
142 | 253 | 2002-07-04 Michal Ludvig <mludvig@suse.cz> |
143 | 254 | |
144 | - * linux-x86-64-low.c (x86_64_regmap): Make it an array of | |
255 | + * linux-x86-64-low.c (x86_64_regmap): Make it an array of | |
145 | 256 | byte offsets instead of an array of indexes. |
146 | 257 | (x86_64_store_gregset, x86_64_store_fpregset): Parameter made const. |
147 | 258 |
@@ -526,4 +637,3 @@ Mon Jul 21 20:09:34 UTC 2003 Brendan Conoboy <blc@redhat.com> | ||
526 | 637 | * server.h: Add ATTR_NORETURN and ATTR_FORMAT. Update prototypes. |
527 | 638 | * utils.c (error): Remove NORETURN. |
528 | 639 | (fatal): Likewise. |
529 | - |
@@ -1,5 +1,5 @@ | ||
1 | 1 | # Copyright 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, |
2 | -# 1999, 2000, 2001, 2002 Free Software Foundation, Inc. | |
2 | +# 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | # This file is part of GDB. |
5 | 5 |
@@ -200,12 +200,8 @@ clean: | ||
200 | 200 | rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m68k.c reg-mips.c |
201 | 201 | rm -f reg-ppc.c reg-sh.c reg-x86-64.c reg-i386-linux.c |
202 | 202 | |
203 | -distclean: clean | |
204 | - rm -f nm.h tm.h xm.h config.status | |
205 | - rm -f Makefile | |
206 | - | |
207 | -maintainer-clean realclean: clean | |
208 | - rm -f nm.h tm.h xm.h config.status | |
203 | +maintainer-clean realclean distclean: clean | |
204 | + rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log | |
209 | 205 | rm -f Makefile |
210 | 206 | |
211 | 207 | STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Replay a remote debug session logfile for GDB. |
2 | - Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc. | |
2 | + Copyright 1996, 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc. | |
3 | 3 | Written by Fred Fish (fnf@cygnus.com) from pieces of gdbserver. |
4 | 4 | |
5 | 5 | This file is part of GDB. |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* GNU/Linux/ARM specific low level interface, for the remote server for GDB. |
2 | - Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 | |
2 | + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | This file is part of GDB. |
@@ -47,11 +47,15 @@ arm_cannot_fetch_register (int regno) | ||
47 | 47 | return (regno >= arm_num_regs); |
48 | 48 | } |
49 | 49 | |
50 | +extern int debug_threads; | |
51 | + | |
50 | 52 | static CORE_ADDR |
51 | 53 | arm_get_pc () |
52 | 54 | { |
53 | 55 | unsigned long pc; |
54 | 56 | collect_register_by_name ("pc", &pc); |
57 | + if (debug_threads) | |
58 | + fprintf (stderr, "stop pc is %08lx\n", pc); | |
55 | 59 | return pc; |
56 | 60 | } |
57 | 61 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Low level interface to ptrace, for the remote server for GDB. |
2 | - Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002 | |
2 | + Copyright 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | This file is part of GDB. |
@@ -34,6 +34,7 @@ | ||
34 | 34 | #include <string.h> |
35 | 35 | #include <stdlib.h> |
36 | 36 | #include <unistd.h> |
37 | +#include <errno.h> | |
37 | 38 | |
38 | 39 | /* ``all_threads'' is keyed by the LWP ID - it should be the thread ID instead, |
39 | 40 | however. This requires changing the ID in place when we go from !using_threads |
@@ -52,7 +53,7 @@ int using_threads; | ||
52 | 53 | |
53 | 54 | static void linux_resume_one_process (struct inferior_list_entry *entry, |
54 | 55 | int step, int signal); |
55 | -static void linux_resume (int step, int signal); | |
56 | +static void linux_resume (struct thread_resume *resume_info); | |
56 | 57 | static void stop_all_processes (void); |
57 | 58 | static int linux_wait_for_event (struct thread_info *child); |
58 | 59 |
@@ -69,8 +70,6 @@ struct pending_signals | ||
69 | 70 | static int use_regsets_p = 1; |
70 | 71 | #endif |
71 | 72 | |
72 | -extern int errno; | |
73 | - | |
74 | 73 | int debug_threads = 0; |
75 | 74 | |
76 | 75 | #define pid_of(proc) ((proc)->head.id) |
@@ -316,6 +315,7 @@ check_removed_breakpoint (struct process_info *event_child) | ||
316 | 315 | (*the_low_target.set_pc) (stop_pc); |
317 | 316 | |
318 | 317 | /* We consumed the pending SIGTRAP. */ |
318 | + event_child->pending_is_breakpoint = 0; | |
319 | 319 | event_child->status_pending_p = 0; |
320 | 320 | event_child->status_pending = 0; |
321 | 321 |
@@ -596,7 +596,7 @@ linux_wait_for_event (struct thread_info *child) | ||
596 | 596 | |
597 | 597 | /* If we were single-stepping, we definitely want to report the |
598 | 598 | SIGTRAP. The single-step operation has completed, so also |
599 | - clear the stepping flag; in general this does not matter, | |
599 | + clear the stepping flag; in general this does not matter, | |
600 | 600 | because the SIGTRAP will be reported to the client, which |
601 | 601 | will give us a new action for this thread, but clear it for |
602 | 602 | consistency anyway. It's safe to clear the stepping flag |
@@ -652,10 +652,16 @@ retry: | ||
652 | 652 | |
653 | 653 | /* No stepping, no signal - unless one is pending already, of course. */ |
654 | 654 | if (child == NULL) |
655 | - linux_resume (0, 0); | |
655 | + { | |
656 | + struct thread_resume resume_info; | |
657 | + resume_info.thread = -1; | |
658 | + resume_info.step = resume_info.sig = resume_info.leave_stopped = 0; | |
659 | + linux_resume (&resume_info); | |
660 | + } | |
656 | 661 | } |
657 | 662 | |
658 | 663 | enable_async_io (); |
664 | + unblock_async_io (); | |
659 | 665 | w = linux_wait_for_event (child); |
660 | 666 | stop_all_processes (); |
661 | 667 | disable_async_io (); |
@@ -835,7 +841,7 @@ linux_resume_one_process (struct inferior_list_entry *entry, | ||
835 | 841 | |
836 | 842 | check_removed_breakpoint (process); |
837 | 843 | |
838 | - if (debug_threads && the_low_target.get_pc != NULL) | |
844 | + if (debug_threads && the_low_target.get_pc != NULL) | |
839 | 845 | { |
840 | 846 | fprintf (stderr, " "); |
841 | 847 | (long) (*the_low_target.get_pc) (); |
@@ -868,33 +874,154 @@ linux_resume_one_process (struct inferior_list_entry *entry, | ||
868 | 874 | perror_with_name ("ptrace"); |
869 | 875 | } |
870 | 876 | |
871 | -/* This function is called once per process other than the first | |
872 | - one. The first process we are told the signal to continue | |
873 | - with, and whether to step or continue; for all others, any | |
874 | - existing signals will be marked in status_pending_p to be | |
875 | - reported momentarily, and we preserve the stepping flag. */ | |
877 | +static struct thread_resume *resume_ptr; | |
878 | + | |
879 | +/* This function is called once per thread. We look up the thread | |
880 | + in RESUME_PTR, and mark the thread with a pointer to the appropriate | |
881 | + resume request. | |
882 | + | |
883 | + This algorithm is O(threads * resume elements), but resume elements | |
884 | + is small (and will remain small at least until GDB supports thread | |
885 | + suspension). */ | |
876 | 886 | static void |
877 | -linux_continue_one_process (struct inferior_list_entry *entry) | |
887 | +linux_set_resume_request (struct inferior_list_entry *entry) | |
878 | 888 | { |
879 | 889 | struct process_info *process; |
890 | + struct thread_info *thread; | |
891 | + int ndx; | |
880 | 892 | |
881 | - process = (struct process_info *) entry; | |
882 | - linux_resume_one_process (entry, process->stepping, 0); | |
893 | + thread = (struct thread_info *) entry; | |
894 | + process = get_thread_process (thread); | |
895 | + | |
896 | + ndx = 0; | |
897 | + while (resume_ptr[ndx].thread != -1 && resume_ptr[ndx].thread != entry->id) | |
898 | + ndx++; | |
899 | + | |
900 | + process->resume = &resume_ptr[ndx]; | |
883 | 901 | } |
884 | 902 | |
903 | +/* This function is called once per thread. We check the thread's resume | |
904 | + request, which will tell us whether to resume, step, or leave the thread | |
905 | + stopped; and what signal, if any, it should be sent. For threads which | |
906 | + we aren't explicitly told otherwise, we preserve the stepping flag; this | |
907 | + is used for stepping over gdbserver-placed breakpoints. */ | |
908 | + | |
885 | 909 | static void |
886 | -linux_resume (int step, int signal) | |
910 | +linux_continue_one_thread (struct inferior_list_entry *entry) | |
887 | 911 | { |
888 | 912 | struct process_info *process; |
913 | + struct thread_info *thread; | |
914 | + int step; | |
915 | + | |
916 | + thread = (struct thread_info *) entry; | |
917 | + process = get_thread_process (thread); | |
918 | + | |
919 | + if (process->resume->leave_stopped) | |
920 | + return; | |
921 | + | |
922 | + if (process->resume->thread == -1) | |
923 | + step = process->stepping || process->resume->step; | |
924 | + else | |
925 | + step = process->resume->step; | |
926 | + | |
927 | + linux_resume_one_process (&process->head, step, process->resume->sig); | |
928 | + | |
929 | + process->resume = NULL; | |
930 | +} | |
931 | + | |
932 | +/* This function is called once per thread. We check the thread's resume | |
933 | + request, which will tell us whether to resume, step, or leave the thread | |
934 | + stopped; and what signal, if any, it should be sent. We queue any needed | |
935 | + signals, since we won't actually resume. We already have a pending event | |
936 | + to report, so we don't need to preserve any step requests; they should | |
937 | + be re-issued if necessary. */ | |
938 | + | |
939 | +static void | |
940 | +linux_queue_one_thread (struct inferior_list_entry *entry) | |
941 | +{ | |
942 | + struct process_info *process; | |
943 | + struct thread_info *thread; | |
944 | + | |
945 | + thread = (struct thread_info *) entry; | |
946 | + process = get_thread_process (thread); | |
947 | + | |
948 | + if (process->resume->leave_stopped) | |
949 | + return; | |
950 | + | |
951 | + /* If we have a new signal, enqueue the signal. */ | |
952 | + if (process->resume->sig != 0) | |
953 | + { | |
954 | + struct pending_signals *p_sig; | |
955 | + p_sig = malloc (sizeof (*p_sig)); | |
956 | + p_sig->prev = process->pending_signals; | |
957 | + p_sig->signal = process->resume->sig; | |
958 | + process->pending_signals = p_sig; | |
959 | + } | |
960 | + | |
961 | + process->resume = NULL; | |
962 | +} | |
963 | + | |
964 | +/* Set DUMMY if this process has an interesting status pending. */ | |
965 | +static int | |
966 | +resume_status_pending_p (struct inferior_list_entry *entry, void *flag_p) | |
967 | +{ | |
968 | + struct process_info *process = (struct process_info *) entry; | |
969 | + | |
970 | + /* Processes which will not be resumed are not interesting, because | |
971 | + we might not wait for them next time through linux_wait. */ | |
972 | + if (process->resume->leave_stopped) | |
973 | + return 0; | |
889 | 974 | |
890 | - process = get_thread_process (current_inferior); | |
975 | + /* If this thread has a removed breakpoint, we won't have any | |
976 | + events to report later, so check now. check_removed_breakpoint | |
977 | + may clear status_pending_p. We avoid calling check_removed_breakpoint | |
978 | + for any thread that we are not otherwise going to resume - this | |
979 | + lets us preserve stopped status when two threads hit a breakpoint. | |
980 | + GDB removes the breakpoint to single-step a particular thread | |
981 | + past it, then re-inserts it and resumes all threads. We want | |
982 | + to report the second thread without resuming it in the interim. */ | |
983 | + if (process->status_pending_p) | |
984 | + check_removed_breakpoint (process); | |
985 | + | |
986 | + if (process->status_pending_p) | |
987 | + * (int *) flag_p = 1; | |
988 | + | |
989 | + return 0; | |
990 | +} | |
991 | + | |
992 | +static void | |
993 | +linux_resume (struct thread_resume *resume_info) | |
994 | +{ | |
995 | + int pending_flag; | |
996 | + | |
997 | + /* Yes, the use of a global here is rather ugly. */ | |
998 | + resume_ptr = resume_info; | |
891 | 999 | |
892 | - /* If the current process has a status pending, this signal will | |
893 | - be enqueued and sent later. */ | |
894 | - linux_resume_one_process (&process->head, step, signal); | |
1000 | + for_each_inferior (&all_threads, linux_set_resume_request); | |
895 | 1001 | |
896 | - if (cont_thread == 0 || cont_thread == -1) | |
897 | - for_each_inferior (&all_processes, linux_continue_one_process); | |
1002 | + /* If there is a thread which would otherwise be resumed, which | |
1003 | + has a pending status, then don't resume any threads - we can just | |
1004 | + report the pending status. Make sure to queue any signals | |
1005 | + that would otherwise be sent. */ | |
1006 | + pending_flag = 0; | |
1007 | + find_inferior (&all_processes, resume_status_pending_p, &pending_flag); | |
1008 | + | |
1009 | + if (debug_threads) | |
1010 | + { | |
1011 | + if (pending_flag) | |
1012 | + fprintf (stderr, "Not resuming, pending status\n"); | |
1013 | + else | |
1014 | + fprintf (stderr, "Resuming, no pending status\n"); | |
1015 | + } | |
1016 | + | |
1017 | + if (pending_flag) | |
1018 | + for_each_inferior (&all_threads, linux_queue_one_thread); | |
1019 | + else | |
1020 | + { | |
1021 | + block_async_io (); | |
1022 | + enable_async_io (); | |
1023 | + for_each_inferior (&all_threads, linux_continue_one_thread); | |
1024 | + } | |
898 | 1025 | } |
899 | 1026 | |
900 | 1027 | #ifdef HAVE_LINUX_USRREGS |
@@ -1153,28 +1280,33 @@ linux_store_registers (int regno) | ||
1153 | 1280 | /* Copy LEN bytes from inferior's memory starting at MEMADDR |
1154 | 1281 | to debugger memory starting at MYADDR. */ |
1155 | 1282 | |
1156 | -static void | |
1283 | +static int | |
1157 | 1284 | linux_read_memory (CORE_ADDR memaddr, char *myaddr, int len) |
1158 | 1285 | { |
1159 | 1286 | register int i; |
1160 | 1287 | /* Round starting address down to longword boundary. */ |
1161 | 1288 | register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE); |
1162 | 1289 | /* Round ending address up; get number of longwords that makes. */ |
1163 | - register int count | |
1164 | - = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) | |
1290 | + register int count | |
1291 | + = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1) | |
1165 | 1292 | / sizeof (PTRACE_XFER_TYPE); |
1166 | 1293 | /* Allocate buffer of that many longwords. */ |
1167 | - register PTRACE_XFER_TYPE *buffer | |
1294 | + register PTRACE_XFER_TYPE *buffer | |
1168 | 1295 | = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE)); |
1169 | 1296 | |
1170 | 1297 | /* Read all the longwords */ |
1171 | 1298 | for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE)) |
1172 | 1299 | { |
1300 | + errno = 0; | |
1173 | 1301 | buffer[i] = ptrace (PTRACE_PEEKTEXT, inferior_pid, (PTRACE_ARG3_TYPE) addr, 0); |
1302 | + if (errno) | |
1303 | + return errno; | |
1174 | 1304 | } |
1175 | 1305 | |
1176 | 1306 | /* Copy appropriate bytes out of the buffer. */ |
1177 | 1307 | memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)), len); |
1308 | + | |
1309 | + return 0; | |
1178 | 1310 | } |
1179 | 1311 | |
1180 | 1312 | /* Copy LEN bytes of data from debugger memory at MYADDR |
@@ -1258,6 +1390,32 @@ linux_send_signal (int signum) | ||
1258 | 1390 | kill (signal_pid, signum); |
1259 | 1391 | } |
1260 | 1392 | |
1393 | +/* Copy LEN bytes from inferior's auxiliary vector starting at OFFSET | |
1394 | + to debugger memory starting at MYADDR. */ | |
1395 | + | |
1396 | +static int | |
1397 | +linux_read_auxv (CORE_ADDR offset, char *myaddr, unsigned int len) | |
1398 | +{ | |
1399 | + char filename[PATH_MAX]; | |
1400 | + int fd, n; | |
1401 | + | |
1402 | + snprintf (filename, sizeof filename, "/proc/%d/auxv", inferior_pid); | |
1403 | + | |
1404 | + fd = open (filename, O_RDONLY); | |
1405 | + if (fd < 0) | |
1406 | + return -1; | |
1407 | + | |
1408 | + if (offset != (CORE_ADDR) 0 | |
1409 | + && lseek (fd, (off_t) offset, SEEK_SET) != (off_t) offset) | |
1410 | + n = -1; | |
1411 | + else | |
1412 | + n = read (fd, myaddr, len); | |
1413 | + | |
1414 | + close (fd); | |
1415 | + | |
1416 | + return n; | |
1417 | +} | |
1418 | + | |
1261 | 1419 | |
1262 | 1420 | static struct target_ops linux_target_ops = { |
1263 | 1421 | linux_create_inferior, |
@@ -1273,6 +1431,7 @@ static struct target_ops linux_target_ops = { | ||
1273 | 1431 | linux_write_memory, |
1274 | 1432 | linux_look_up_symbols, |
1275 | 1433 | linux_send_signal, |
1434 | + linux_read_auxv, | |
1276 | 1435 | }; |
1277 | 1436 | |
1278 | 1437 | static void |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Internal interfaces for the GNU/Linux specific target code for gdbserver. |
2 | - Copyright 2002, Free Software Foundation, Inc. | |
2 | + Copyright 2002, 2004 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This file is part of GDB. |
5 | 5 |
@@ -106,7 +106,13 @@ struct process_info | ||
106 | 106 | /* If this is non-zero, it points to a chain of signals which need to |
107 | 107 | be delivered to this process. */ |
108 | 108 | struct pending_signals *pending_signals; |
109 | + | |
110 | + /* A link used when resuming. It is initialized from the resume request, | |
111 | + and then processed and cleared in linux_resume_one_process. */ | |
112 | + | |
113 | + struct thread_resume *resume; | |
109 | 114 | }; |
115 | + | |
110 | 116 | extern struct inferior_list all_processes; |
111 | 117 | |
112 | 118 | void linux_attach_lwp (int pid, int tid); |
@@ -27,7 +27,7 @@ | ||
27 | 27 | |
28 | 28 | #include <asm/ptrace.h> |
29 | 29 | |
30 | -#define s390_num_regs 67 | |
30 | +#define s390_num_regs 51 | |
31 | 31 | |
32 | 32 | static int s390_regmap[] = { |
33 | 33 | PT_PSWMASK, PT_PSWADDR, |
@@ -42,15 +42,9 @@ static int s390_regmap[] = { | ||
42 | 42 | PT_ACR8, PT_ACR9, PT_ACR10, PT_ACR11, |
43 | 43 | PT_ACR12, PT_ACR13, PT_ACR14, PT_ACR15, |
44 | 44 | |
45 | - -1, -1, -1, -1, | |
46 | - -1, -1, -1, -1, | |
47 | - -1, PT_CR_9, PT_CR_10, PT_CR_11, | |
48 | - -1, -1, -1, -1, | |
49 | - | |
50 | 45 | PT_FPC, |
51 | 46 | |
52 | -/* <asm/ptrace.h> defines GPR_SIZE. */ | |
53 | -#if GPR_SIZE == 4 | |
47 | +#ifndef __s390x__ | |
54 | 48 | PT_FPR0_HI, PT_FPR1_HI, PT_FPR2_HI, PT_FPR3_HI, |
55 | 49 | PT_FPR4_HI, PT_FPR5_HI, PT_FPR6_HI, PT_FPR7_HI, |
56 | 50 | PT_FPR8_HI, PT_FPR9_HI, PT_FPR10_HI, PT_FPR11_HI, |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Register support routines for the remote server for GDB. |
2 | - Copyright 2001, 2002 | |
2 | + Copyright 2001, 2002, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | This file is part of GDB. |
@@ -101,7 +101,10 @@ new_register_cache (void) | ||
101 | 101 | |
102 | 102 | regcache = malloc (sizeof (*regcache)); |
103 | 103 | |
104 | - regcache->registers = malloc (register_bytes); | |
104 | + /* Make sure to zero-initialize the register cache when it is created, | |
105 | + in case there are registers the target never fetches. This way they'll | |
106 | + read as zero instead of garbage. */ | |
107 | + regcache->registers = calloc (1, register_bytes); | |
105 | 108 | if (regcache->registers == NULL) |
106 | 109 | fatal ("Could not allocate register cache."); |
107 | 110 |
@@ -1,6 +1,6 @@ | ||
1 | 1 | /* Remote utility routines for the remote server for GDB. |
2 | 2 | Copyright 1986, 1989, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, |
3 | - 2002 | |
3 | + 2002, 2003, 2004 | |
4 | 4 | Free Software Foundation, Inc. |
5 | 5 | |
6 | 6 | This file is part of GDB. |
@@ -135,6 +135,8 @@ remote_open (char *name) | ||
135 | 135 | || listen (tmp_desc, 1)) |
136 | 136 | perror_with_name ("Can't bind address"); |
137 | 137 | |
138 | + fprintf (stderr, "Listening on port %d\n", port); | |
139 | + | |
138 | 140 | tmp = sizeof (sockaddr); |
139 | 141 | remote_desc = accept (tmp_desc, (struct sockaddr *) &sockaddr, &tmp); |
140 | 142 | if (remote_desc == -1) |
@@ -366,6 +368,24 @@ input_interrupt (int unused) | ||
366 | 368 | } |
367 | 369 | |
368 | 370 | void |
371 | +block_async_io (void) | |
372 | +{ | |
373 | + sigset_t sigio_set; | |
374 | + sigemptyset (&sigio_set); | |
375 | + sigaddset (&sigio_set, SIGIO); | |
376 | + sigprocmask (SIG_BLOCK, &sigio_set, NULL); | |
377 | +} | |
378 | + | |
379 | +void | |
380 | +unblock_async_io (void) | |
381 | +{ | |
382 | + sigset_t sigio_set; | |
383 | + sigemptyset (&sigio_set); | |
384 | + sigaddset (&sigio_set, SIGIO); | |
385 | + sigprocmask (SIG_UNBLOCK, &sigio_set, NULL); | |
386 | +} | |
387 | + | |
388 | +void | |
369 | 389 | enable_async_io (void) |
370 | 390 | { |
371 | 391 | signal (SIGIO, input_interrupt); |
@@ -487,9 +507,10 @@ write_ok (char *buf) | ||
487 | 507 | void |
488 | 508 | write_enn (char *buf) |
489 | 509 | { |
510 | + /* Some day, we should define the meanings of the error codes... */ | |
490 | 511 | buf[0] = 'E'; |
491 | - buf[1] = 'N'; | |
492 | - buf[2] = 'N'; | |
512 | + buf[1] = '0'; | |
513 | + buf[2] = '1'; | |
493 | 514 | buf[3] = '\0'; |
494 | 515 | } |
495 | 516 |
@@ -609,7 +630,11 @@ prepare_resume_reply (char *buf, char status, unsigned char signo) | ||
609 | 630 | thread_from_wait = ((struct inferior_list_entry *)current_inferior)->id; |
610 | 631 | if (debug_threads) |
611 | 632 | fprintf (stderr, "Writing resume reply for %d\n\n", thread_from_wait); |
612 | - if (old_thread_from_wait != thread_from_wait) | |
633 | + /* This if (1) ought to be unnecessary. But remote_wait in GDB | |
634 | + will claim this event belongs to inferior_ptid if we do not | |
635 | + specify a thread, and there's no way for gdbserver to know | |
636 | + what inferior_ptid is. */ | |
637 | + if (1 || old_thread_from_wait != thread_from_wait) | |
613 | 638 | { |
614 | 639 | general_thread = thread_from_wait; |
615 | 640 | sprintf (buf, "thread:%x;", thread_from_wait); |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Main code for remote server for GDB. |
2 | - Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002 | |
2 | + Copyright 1989, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | This file is part of GDB. |
@@ -70,6 +70,8 @@ attach_inferior (int pid, char *statusptr, unsigned char *sigptr) | ||
70 | 70 | if (myattach (pid) != 0) |
71 | 71 | return -1; |
72 | 72 | |
73 | + fprintf (stderr, "Attached; pid = %d\n", pid); | |
74 | + | |
73 | 75 | /* FIXME - It may be that we should get the SIGNAL_PID from the |
74 | 76 | attach function, so that it can be the main thread instead of |
75 | 77 | whichever we were told to attach to. */ |
@@ -104,7 +106,7 @@ handle_query (char *own_buf) | ||
104 | 106 | thread_ptr = thread_ptr->next; |
105 | 107 | return; |
106 | 108 | } |
107 | - | |
109 | + | |
108 | 110 | if (strcmp ("qsThreadInfo", own_buf) == 0) |
109 | 111 | { |
110 | 112 | if (thread_ptr != NULL) |
@@ -119,10 +121,180 @@ handle_query (char *own_buf) | ||
119 | 121 | return; |
120 | 122 | } |
121 | 123 | } |
122 | - | |
124 | + | |
125 | + if (the_target->read_auxv != NULL | |
126 | + && strncmp ("qPart:auxv:read::", own_buf, 17) == 0) | |
127 | + { | |
128 | + char data[(PBUFSIZ - 1) / 2]; | |
129 | + CORE_ADDR ofs; | |
130 | + unsigned int len; | |
131 | + int n; | |
132 | + decode_m_packet (&own_buf[17], &ofs, &len); /* "OFS,LEN" */ | |
133 | + if (len > sizeof data) | |
134 | + len = sizeof data; | |
135 | + n = (*the_target->read_auxv) (ofs, data, len); | |
136 | + if (n == 0) | |
137 | + write_ok (own_buf); | |
138 | + else if (n < 0) | |
139 | + write_enn (own_buf); | |
140 | + else | |
141 | + convert_int_to_ascii (data, own_buf, n); | |
142 | + return; | |
143 | + } | |
144 | + | |
145 | + /* Otherwise we didn't know what packet it was. Say we didn't | |
146 | + understand it. */ | |
147 | + own_buf[0] = 0; | |
148 | +} | |
149 | + | |
150 | +/* Parse vCont packets. */ | |
151 | +void | |
152 | +handle_v_cont (char *own_buf, char *status, unsigned char *signal) | |
153 | +{ | |
154 | + char *p, *q; | |
155 | + int n = 0, i = 0; | |
156 | + struct thread_resume *resume_info, default_action; | |
157 | + | |
158 | + /* Count the number of semicolons in the packet. There should be one | |
159 | + for every action. */ | |
160 | + p = &own_buf[5]; | |
161 | + while (p) | |
162 | + { | |
163 | + n++; | |
164 | + p++; | |
165 | + p = strchr (p, ';'); | |
166 | + } | |
167 | + /* Allocate room for one extra action, for the default remain-stopped | |
168 | + behavior; if no default action is in the list, we'll need the extra | |
169 | + slot. */ | |
170 | + resume_info = malloc ((n + 1) * sizeof (resume_info[0])); | |
171 | + | |
172 | + default_action.thread = -1; | |
173 | + default_action.leave_stopped = 1; | |
174 | + default_action.step = 0; | |
175 | + default_action.sig = 0; | |
176 | + | |
177 | + p = &own_buf[5]; | |
178 | + i = 0; | |
179 | + while (*p) | |
180 | + { | |
181 | + p++; | |
182 | + | |
183 | + resume_info[i].leave_stopped = 0; | |
184 | + | |
185 | + if (p[0] == 's' || p[0] == 'S') | |
186 | + resume_info[i].step = 1; | |
187 | + else if (p[0] == 'c' || p[0] == 'C') | |
188 | + resume_info[i].step = 0; | |
189 | + else | |
190 | + goto err; | |
191 | + | |
192 | + if (p[0] == 'S' || p[0] == 'C') | |
193 | + { | |
194 | + int sig; | |
195 | + sig = strtol (p + 1, &q, 16); | |
196 | + if (p == q) | |
197 | + goto err; | |
198 | + p = q; | |
199 | + | |
200 | + if (!target_signal_to_host_p (sig)) | |
201 | + goto err; | |
202 | + resume_info[i].sig = target_signal_to_host (sig); | |
203 | + } | |
204 | + else | |
205 | + { | |
206 | + resume_info[i].sig = 0; | |
207 | + p = p + 1; | |
208 | + } | |
209 | + | |
210 | + if (p[0] == 0) | |
211 | + { | |
212 | + resume_info[i].thread = -1; | |
213 | + default_action = resume_info[i]; | |
214 | + | |
215 | + /* Note: we don't increment i here, we'll overwrite this entry | |
216 | + the next time through. */ | |
217 | + } | |
218 | + else if (p[0] == ':') | |
219 | + { | |
220 | + resume_info[i].thread = strtol (p + 1, &q, 16); | |
221 | + if (p == q) | |
222 | + goto err; | |
223 | + p = q; | |
224 | + if (p[0] != ';' && p[0] != 0) | |
225 | + goto err; | |
226 | + | |
227 | + i++; | |
228 | + } | |
229 | + } | |
230 | + | |
231 | + resume_info[i] = default_action; | |
232 | + | |
233 | + /* Still used in occasional places in the backend. */ | |
234 | + if (n == 1 && resume_info[0].thread != -1) | |
235 | + cont_thread = resume_info[0].thread; | |
236 | + else | |
237 | + cont_thread = -1; | |
238 | + set_desired_inferior (0); | |
239 | + | |
240 | + (*the_target->resume) (resume_info); | |
241 | + | |
242 | + free (resume_info); | |
243 | + | |
244 | + *signal = mywait (status, 1); | |
245 | + prepare_resume_reply (own_buf, *status, *signal); | |
246 | + return; | |
247 | + | |
248 | +err: | |
249 | + /* No other way to report an error... */ | |
250 | + strcpy (own_buf, ""); | |
251 | + free (resume_info); | |
252 | + return; | |
253 | +} | |
254 | + | |
255 | +/* Handle all of the extended 'v' packets. */ | |
256 | +void | |
257 | +handle_v_requests (char *own_buf, char *status, unsigned char *signal) | |
258 | +{ | |
259 | + if (strncmp (own_buf, "vCont;", 6) == 0) | |
260 | + { | |
261 | + handle_v_cont (own_buf, status, signal); | |
262 | + return; | |
263 | + } | |
264 | + | |
265 | + if (strncmp (own_buf, "vCont?", 6) == 0) | |
266 | + { | |
267 | + strcpy (own_buf, "vCont;c;C;s;S"); | |
268 | + return; | |
269 | + } | |
270 | + | |
123 | 271 | /* Otherwise we didn't know what packet it was. Say we didn't |
124 | 272 | understand it. */ |
125 | 273 | own_buf[0] = 0; |
274 | + return; | |
275 | +} | |
276 | + | |
277 | +void | |
278 | +myresume (int step, int sig) | |
279 | +{ | |
280 | + struct thread_resume resume_info[2]; | |
281 | + int n = 0; | |
282 | + | |
283 | + if (step || sig || cont_thread > 0) | |
284 | + { | |
285 | + resume_info[0].thread | |
286 | + = ((struct inferior_list_entry *) current_inferior)->id; | |
287 | + resume_info[0].step = step; | |
288 | + resume_info[0].sig = sig; | |
289 | + resume_info[0].leave_stopped = 0; | |
290 | + n++; | |
291 | + } | |
292 | + resume_info[n].thread = -1; | |
293 | + resume_info[n].step = 0; | |
294 | + resume_info[n].sig = 0; | |
295 | + resume_info[n].leave_stopped = (cont_thread > 0); | |
296 | + | |
297 | + (*the_target->resume) (resume_info); | |
126 | 298 | } |
127 | 299 | |
128 | 300 | static int attached; |
@@ -222,7 +394,7 @@ main (int argc, char *argv[]) | ||
222 | 394 | detach_inferior (); |
223 | 395 | write_ok (own_buf); |
224 | 396 | putpkt (own_buf); |
225 | - remote_close (); | |
397 | + remote_close (); | |
226 | 398 | |
227 | 399 | /* If we are attached, then we can exit. Otherwise, we need to |
228 | 400 | hang around doing nothing, until the child is gone. */ |
@@ -290,8 +462,10 @@ main (int argc, char *argv[]) | ||
290 | 462 | break; |
291 | 463 | case 'm': |
292 | 464 | decode_m_packet (&own_buf[1], &mem_addr, &len); |
293 | - read_inferior_memory (mem_addr, mem_buf, len); | |
294 | - convert_int_to_ascii (mem_buf, own_buf, len); | |
465 | + if (read_inferior_memory (mem_addr, mem_buf, len) == 0) | |
466 | + convert_int_to_ascii (mem_buf, own_buf, len); | |
467 | + else | |
468 | + write_enn (own_buf); | |
295 | 469 | break; |
296 | 470 | case 'M': |
297 | 471 | decode_M_packet (&own_buf[1], &mem_addr, &len, mem_buf); |
@@ -383,6 +557,10 @@ main (int argc, char *argv[]) | ||
383 | 557 | own_buf[0] = '\0'; |
384 | 558 | break; |
385 | 559 | } |
560 | + case 'v': | |
561 | + /* Extended (long) request. */ | |
562 | + handle_v_requests (own_buf, &status, &signal); | |
563 | + break; | |
386 | 564 | default: |
387 | 565 | /* It is a request we don't understand. Respond with an |
388 | 566 | empty packet so that gdb knows that we don't support this |
@@ -395,9 +573,10 @@ main (int argc, char *argv[]) | ||
395 | 573 | |
396 | 574 | if (status == 'W') |
397 | 575 | fprintf (stderr, |
398 | - "\nChild exited with status %d\n", sig); | |
576 | + "\nChild exited with status %d\n", signal); | |
399 | 577 | if (status == 'X') |
400 | - fprintf (stderr, "\nChild terminated with signal = 0x%x\n", sig); | |
578 | + fprintf (stderr, "\nChild terminated with signal = 0x%x\n", | |
579 | + signal); | |
401 | 580 | if (status == 'W' || status == 'X') |
402 | 581 | { |
403 | 582 | if (extended_protocol) |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Common definitions for remote server for GDB. |
2 | - Copyright 1993, 1995, 1997, 1998, 1999, 2000, 2002 | |
2 | + Copyright 1993, 1995, 1997, 1998, 1999, 2000, 2002, 2003, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | This file is part of GDB. |
@@ -134,6 +134,8 @@ void write_ok (char *buf); | ||
134 | 134 | void write_enn (char *buf); |
135 | 135 | void enable_async_io (void); |
136 | 136 | void disable_async_io (void); |
137 | +void unblock_async_io (void); | |
138 | +void block_async_io (void); | |
137 | 139 | void convert_ascii_to_int (char *from, char *to, int n); |
138 | 140 | void convert_int_to_ascii (char *from, char *to, int n); |
139 | 141 | void new_thread_notify (int id); |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Target operations for the remote server for GDB. |
2 | - Copyright 2002 | |
2 | + Copyright 2002, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | Contributed by MontaVista Software. |
@@ -57,11 +57,13 @@ set_desired_inferior (int use_general) | ||
57 | 57 | current_inferior = found; |
58 | 58 | } |
59 | 59 | |
60 | -void | |
60 | +int | |
61 | 61 | read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len) |
62 | 62 | { |
63 | - (*the_target->read_memory) (memaddr, myaddr, len); | |
63 | + int res; | |
64 | + res = (*the_target->read_memory) (memaddr, myaddr, len); | |
64 | 65 | check_mem_read (memaddr, myaddr, len); |
66 | + return res; | |
65 | 67 | } |
66 | 68 | |
67 | 69 | int |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Target operations for the remote server for GDB. |
2 | - Copyright 2002 | |
2 | + Copyright 2002, 2003, 2004 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | Contributed by MontaVista Software. |
@@ -24,6 +24,25 @@ | ||
24 | 24 | #ifndef TARGET_H |
25 | 25 | #define TARGET_H |
26 | 26 | |
27 | +/* This structure describes how to resume a particular thread (or | |
28 | + all threads) based on the client's request. If thread is -1, then | |
29 | + this entry applies to all threads. These are generally passed around | |
30 | + as an array, and terminated by a thread == -1 entry. */ | |
31 | + | |
32 | +struct thread_resume | |
33 | +{ | |
34 | + int thread; | |
35 | + | |
36 | + /* If non-zero, leave this thread stopped. */ | |
37 | + int leave_stopped; | |
38 | + | |
39 | + /* If non-zero, we want to single-step. */ | |
40 | + int step; | |
41 | + | |
42 | + /* If non-zero, send this signal when we resume. */ | |
43 | + int sig; | |
44 | +}; | |
45 | + | |
27 | 46 | struct target_ops |
28 | 47 | { |
29 | 48 | /* Start a new process. |
@@ -56,14 +75,9 @@ struct target_ops | ||
56 | 75 | |
57 | 76 | int (*thread_alive) (int pid); |
58 | 77 | |
59 | - /* Resume the inferior process. | |
60 | - | |
61 | - If STEP is non-zero, we want to single-step. | |
62 | - | |
63 | - If SIGNAL is nonzero, send the process that signal as we resume it. | |
64 | - */ | |
78 | + /* Resume the inferior process. */ | |
65 | 79 | |
66 | - void (*resume) (int step, int signo); | |
80 | + void (*resume) (struct thread_resume *resume_info); | |
67 | 81 | |
68 | 82 | /* Wait for the inferior process to change state. |
69 | 83 |
@@ -78,7 +92,7 @@ struct target_ops | ||
78 | 92 | If REGNO is -1, fetch all registers; otherwise, fetch at least REGNO. */ |
79 | 93 | |
80 | 94 | void (*fetch_registers) (int regno); |
81 | - | |
95 | + | |
82 | 96 | /* Store registers to the inferior process. |
83 | 97 | |
84 | 98 | If REGNO is -1, store all registers; otherwise, store at least REGNO. */ |
@@ -88,9 +102,11 @@ struct target_ops | ||
88 | 102 | /* Read memory from the inferior process. This should generally be |
89 | 103 | called through read_inferior_memory, which handles breakpoint shadowing. |
90 | 104 | |
91 | - Read LEN bytes at MEMADDR into a buffer at MYADDR. */ | |
105 | + Read LEN bytes at MEMADDR into a buffer at MYADDR. | |
106 | + | |
107 | + Returns 0 on success and errno on failure. */ | |
92 | 108 | |
93 | - void (*read_memory) (CORE_ADDR memaddr, char *myaddr, int len); | |
109 | + int (*read_memory) (CORE_ADDR memaddr, char *myaddr, int len); | |
94 | 110 | |
95 | 111 | /* Write memory to the inferior process. This should generally be |
96 | 112 | called through write_inferior_memory, which handles breakpoint shadowing. |
@@ -111,6 +127,12 @@ struct target_ops | ||
111 | 127 | |
112 | 128 | /* Send a signal to the inferior process, however is appropriate. */ |
113 | 129 | void (*send_signal) (int); |
130 | + | |
131 | + /* Read auxiliary vector data from the inferior process. | |
132 | + | |
133 | + Read LEN bytes at OFFSET into a buffer at MYADDR. */ | |
134 | + | |
135 | + int (*read_auxv) (CORE_ADDR offset, char *myaddr, unsigned int len); | |
114 | 136 | }; |
115 | 137 | |
116 | 138 | extern struct target_ops *the_target; |
@@ -132,9 +154,6 @@ void set_target_ops (struct target_ops *); | ||
132 | 154 | #define mythread_alive(pid) \ |
133 | 155 | (*the_target->thread_alive) (pid) |
134 | 156 | |
135 | -#define myresume(step,signo) \ | |
136 | - (*the_target->resume) (step, signo) | |
137 | - | |
138 | 157 | #define fetch_inferior_registers(regno) \ |
139 | 158 | (*the_target->fetch_registers) (regno) |
140 | 159 |
@@ -143,7 +162,7 @@ void set_target_ops (struct target_ops *); | ||
143 | 162 | |
144 | 163 | unsigned char mywait (char *statusp, int connected_wait); |
145 | 164 | |
146 | -void read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len); | |
165 | +int read_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len); | |
147 | 166 | |
148 | 167 | int write_inferior_memory (CORE_ADDR memaddr, const char *myaddr, int len); |
149 | 168 |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* General utility routines for the remote server for GDB. |
2 | - Copyright 1986, 1989, 1993, 1995, 1996, 1997, 1999, 2000, 2002 | |
2 | + Copyright 1986, 1989, 1993, 1995, 1996, 1997, 1999, 2000, 2002, 2003 | |
3 | 3 | Free Software Foundation, Inc. |
4 | 4 | |
5 | 5 | This file is part of GDB. |