cosmetic changes, mainly long lines.

This commit is contained in:
Michael Snyder 1999-01-06 03:04:45 +00:00
parent 368fc7dba8
commit d036abbfd1

View file

@ -99,8 +99,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
resume at same address. resume at same address.
continue with Csig;AA..AA Continue with signal sig (hex signal continue with Csig;AA..AA Continue with signal sig (hex signal
signal number). If ;AA..AA is omitted, resume signal number). If ;AA..AA is omitted,
at same address. resume at same address.
step with Ssig;AA..AA Like 'C' but step not continue. step with Ssig;AA..AA Like 'C' but step not continue.
signal signal
@ -135,9 +135,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
or... XAA The process terminated with signal or... XAA The process terminated with signal
AA. AA.
or... OXX..XX XX..XX is hex encoding of ASCII data. This or... OXX..XX XX..XX is hex encoding of ASCII data. This
can happen at any time while the program is can happen at any time while the
running and the debugger should program is running and the debugger
continue to wait for 'W', 'T', etc. should continue to wait for
'W', 'T', etc.
thread alive TXX Find out if the thread XX is alive. thread alive TXX Find out if the thread XX is alive.
reply OK thread is still alive reply OK thread is still alive
@ -228,7 +229,8 @@ static void remote_open PARAMS ((char *name, int from_tty));
static void extended_remote_open PARAMS ((char *name, int from_tty)); static void extended_remote_open PARAMS ((char *name, int from_tty));
static void remote_open_1 PARAMS ((char *, int, struct target_ops *, int extended_p)); static void remote_open_1 PARAMS ((char *, int, struct target_ops *,
int extended_p));
static void remote_close PARAMS ((int quitting)); static void remote_close PARAMS ((int quitting));
@ -460,51 +462,42 @@ static char *
threadref * id)); threadref * id));
static int static int
remote_unpack_thread_info_response PARAMS (( remote_unpack_thread_info_response PARAMS ((char *pkt,
char *pkt,
threadref * expectedref, threadref * expectedref,
struct gdb_ext_thread_info * info)); struct gdb_ext_thread_info * info
));
int int
remote_get_threadinfo PARAMS (( remote_get_threadinfo PARAMS ((threadref * threadid,
threadref * threadid,
int fieldset, /* TAG mask */ int fieldset, /* TAG mask */
struct gdb_ext_thread_info * info)); struct gdb_ext_thread_info * info));
int int
adapt_remote_get_threadinfo PARAMS (( adapt_remote_get_threadinfo PARAMS ((gdb_threadref * ref,
gdb_threadref * ref,
int selection, int selection,
struct gdb_ext_thread_info * info)); struct gdb_ext_thread_info * info));
static char * static char *
pack_threadlist_request PARAMS (( pack_threadlist_request PARAMS ((char *pkt,
char *pkt,
int startflag, int startflag,
int threadcount, int threadcount,
threadref * nextthread)); threadref * nextthread));
static int static int
parse_threadlist_response PARAMS (( parse_threadlist_response PARAMS ((char *pkt,
char *pkt,
int result_limit, int result_limit,
threadref * original_echo, threadref * original_echo,
threadref * resultlist, threadref * resultlist,
int *doneflag)); int *doneflag));
static int static int
remote_get_threadlist PARAMS (( remote_get_threadlist PARAMS ((int startflag,
int startflag,
threadref * nextthread, threadref * nextthread,
int result_limit, int result_limit,
int *done, int *done,
int *result_count, int *result_count,
threadref * threadlist)); threadref * threadlist));
static int static int
remote_newthread_step PARAMS (( remote_newthread_step PARAMS ((threadref * ref,
threadref * ref,
void *context)); void *context));
int int
@ -547,8 +540,8 @@ threadlist_update_test_cmd PARAMS ((char *cmd,
static void static void
init_remote_threadtests PARAMS ((void)); init_remote_threadtests PARAMS ((void));
/* These are the threads which we last sent to the remote system. -1 for all /* These are the threads which we last sent to the remote system.
or -2 for not sent yet. */ -1 for all or -2 for not sent yet. */
int general_thread; int general_thread;
int cont_thread; int cont_thread;
@ -574,8 +567,10 @@ set_thread (th, gen)
{ {
char buf[PBUFSIZ]; char buf[PBUFSIZ];
int state = gen ? general_thread : cont_thread; int state = gen ? general_thread : cont_thread;
if (state == th) if (state == th)
return; return;
buf[0] = 'H'; buf[0] = 'H';
buf[1] = gen ? 'g' : 'c'; buf[1] = gen ? 'g' : 'c';
if (th == 42000) if (th == 42000)
@ -957,7 +952,8 @@ pack_threadinfo_request (pkt, mode, id)
fetch registers and its stack */ fetch registers and its stack */
#define TAG_DISPLAY 4 /* A short thing maybe to put on a window */ #define TAG_DISPLAY 4 /* A short thing maybe to put on a window */
#define TAG_THREADNAME 8 /* string, maps 1-to-1 with a thread is */ #define TAG_THREADNAME 8 /* string, maps 1-to-1 with a thread is */
#define TAG_MOREDISPLAY 16 /* Whatever the kernel wants to say about the process*/ #define TAG_MOREDISPLAY 16 /* Whatever the kernel wants to say about
the process*/
static int static int
@ -1068,7 +1064,8 @@ remote_get_threadinfo (threadid, fieldset, info)
pack_threadinfo_request (threadinfo_pkt, fieldset, threadid); pack_threadinfo_request (threadinfo_pkt, fieldset, threadid);
putpkt (threadinfo_pkt); putpkt (threadinfo_pkt);
getpkt (threadinfo_pkt, 0); getpkt (threadinfo_pkt, 0);
result = remote_unpack_thread_info_response (threadinfo_pkt + 2, threadid, info); result = remote_unpack_thread_info_response (threadinfo_pkt + 2,
threadid, info);
return result; return result;
} }
@ -1109,7 +1106,7 @@ pack_threadlist_request (pkt, startflag, threadcount, nextthread)
} }
/* ---------- PARSE_THREADLIST_RESPONSE ------------------------------------ */ /* ---------- PARSE_THREADLIST_RESPONSE -------------------------------- */
/* Encoding: 'q':8,'M':8,count:16,done:8,argthreadid:64,(threadid:64)* */ /* Encoding: 'q':8,'M':8,count:16,done:8,argthreadid:64,(threadid:64)* */
@ -1170,8 +1167,7 @@ remote_get_threadlist (startflag, nextthread, result_limit,
startflag, result_limit, nextthread); startflag, result_limit, nextthread);
putpkt (threadlist_packet); putpkt (threadlist_packet);
getpkt (t_response, 0); getpkt (t_response, 0);
*result_count = parse_threadlist_response ( *result_count = parse_threadlist_response (t_response + 2, /* strip header */
t_response + 2, /* strip header */
result_limit, result_limit,
&echo_nextthread, &echo_nextthread,
threadlist, threadlist,
@ -1222,7 +1218,8 @@ typedef int (*rmt_thread_action) (
void *context void *context
); );
#define MAXTHREADLISTRESULTS 32 /* About this many threadisds fit in a packet */ /* About this many threadisds fit in a packet */
#define MAXTHREADLISTRESULTS 32
static int static int
remote_threadlist_iterator PARAMS (( remote_threadlist_iterator PARAMS ((
@ -1280,9 +1277,7 @@ remote_threadlist_iterator (stepfunction, context, looplimit)
static int static int
remote_newthread_step (ref, context) remote_newthread_step (ref, context)
threadref *ref; threadref *ref;
void *context void *context;
;
{ {
int pid; int pid;
pid = threadref_to_int (ref); pid = threadref_to_int (ref);
@ -1293,11 +1288,14 @@ remote_newthread_step (ref, context)
#define CRAZY_MAX_THREADS 1000 #define CRAZY_MAX_THREADS 1000
int int
remote_find_new_threads (void) remote_find_new_threads (void)
{ {
return remote_threadlist_iterator (remote_newthread_step, 0, CRAZY_MAX_THREADS); int ret;
ret = remote_threadlist_iterator (remote_newthread_step, 0,
CRAZY_MAX_THREADS);
return ret;
} /* remote_find_new_threads */ } /* remote_find_new_threads */
int int
@ -1320,7 +1318,7 @@ void init_remote_threads ()
remote_thread_vec.get_thread_info = adapt_remote_get_threadinfo; remote_thread_vec.get_thread_info = adapt_remote_get_threadinfo;
} }
/* --------- UNIT_TEST for THREAD oriented PACKETS -------------------------- */ /* --------- UNIT_TEST for THREAD oriented PACKETS -------------------- */
#define SAMPLE_THREAD 0x05060708 /* Truncated 64 bit threadid */ #define SAMPLE_THREAD 0x05060708 /* Truncated 64 bit threadid */
@ -1515,8 +1513,8 @@ get_offsets ()
getpkt (buf, 0); getpkt (buf, 0);
if (buf[0] == '\000') if (buf[0] == '\000')
return; /* Return silently. Stub doesn't support this return; /* Return silently. Stub doesn't support
command. */ this command. */
if (buf[0] == 'E') if (buf[0] == 'E')
{ {
warning ("Remote failure reply: %s", buf); warning ("Remote failure reply: %s", buf);
@ -1641,8 +1639,8 @@ remote_open_1 (name, from_tty, target, extended_p)
int extended_p; int extended_p;
{ {
if (name == 0) if (name == 0)
error ("To open a remote debug connection, you need to specify what serial\n\ error ("To open a remote debug connection, you need to specify what\n\
device is attached to the remote system (e.g. /dev/ttya)."); serial device is attached to the remote system (e.g. /dev/ttya).");
target_preopen (from_tty); target_preopen (from_tty);
@ -1701,7 +1699,8 @@ device is attached to the remote system (e.g. /dev/ttya).");
In particular, if the user quits, be sure to discard it In particular, if the user quits, be sure to discard it
(we'd be in an inconsistent state otherwise). */ (we'd be in an inconsistent state otherwise). */
if (!catch_errors (remote_start_remote, (char *)0, if (!catch_errors (remote_start_remote, (char *)0,
"Couldn't establish connection to remote target\n", RETURN_MASK_ALL)) "Couldn't establish connection to remote target\n",
RETURN_MASK_ALL))
{ {
pop_target(); pop_target();
return; return;
@ -1938,7 +1937,8 @@ remote_wait (pid, status)
unsigned char *p1; unsigned char *p1;
char *p_temp; char *p_temp;
regno = strtol ((const char *) p, &p_temp, 16); /* Read the register number */ /* Read the register number */
regno = strtol ((const char *) p, &p_temp, 16);
p1 = (unsigned char *)p_temp; p1 = (unsigned char *)p_temp;
if (p1 == p) /* No register number present here */ if (p1 == p) /* No register number present here */
@ -2196,8 +2196,8 @@ remote_store_registers (regno)
} }
/* /*
Use of the data cache *used* to be disabled because it loses for looking at Use of the data cache *used* to be disabled because it loses for looking
and changing hardware I/O ports and the like. Accepting `volatile' at and changing hardware I/O ports and the like. Accepting `volatile'
would perhaps be one way to fix it. Another idea would be to use the would perhaps be one way to fix it. Another idea would be to use the
executable file for the text segment (for all SEC_CODE sections? executable file for the text segment (for all SEC_CODE sections?
For all SEC_READONLY sections?). This has problems if you want to For all SEC_READONLY sections?). This has problems if you want to
@ -2333,8 +2333,8 @@ remote_write_bytes (memaddr, myaddr, len)
*p++ = ':'; *p++ = ':';
*p = '\0'; *p = '\0';
/* We send target system values byte by byte, in increasing byte addresses, /* We send target system values byte by byte, in increasing byte
each byte encoded as two hex characters. */ addresses, each byte encoded as two hex characters. */
for (i = 0; i < todo; i++) for (i = 0; i < todo; i++)
{ {
@ -2425,8 +2425,8 @@ remote_read_bytes (memaddr, myaddr, len)
for (i = 0; i < todo; i++) for (i = 0; i < todo; i++)
{ {
if (p[0] == 0 || p[1] == 0) if (p[0] == 0 || p[1] == 0)
/* Reply is short. This means that we were able to read only part /* Reply is short. This means that we were able to read
of what we wanted to. */ only part of what we wanted to. */
return i + (origlen - len); return i + (origlen - len);
myaddr[i] = fromhex (p[0]) * 16 + fromhex (p[1]); myaddr[i] = fromhex (p[0]) * 16 + fromhex (p[1]);
p += 2; p += 2;
@ -2461,7 +2461,8 @@ remote_xfer_memory(memaddr, myaddr, len, should_write, target)
len = targlen; len = targlen;
#endif #endif
return dcache_xfer_memory (remote_dcache, memaddr, myaddr, len, should_write); return dcache_xfer_memory (remote_dcache, memaddr, myaddr,
len, should_write);
} }
@ -2684,8 +2685,8 @@ putpkt (buf)
{ {
char junkbuf[PBUFSIZ]; char junkbuf[PBUFSIZ];
/* It's probably an old response, and we're out of sync. Just /* It's probably an old response, and we're out of sync.
gobble up the packet and ignore it. */ Just gobble up the packet and ignore it. */
getpkt (junkbuf, 0); getpkt (junkbuf, 0);
continue; /* Now, go look for + */ continue; /* Now, go look for + */
} }
@ -2706,10 +2707,10 @@ putpkt (buf)
#if 0 #if 0
/* This is wrong. If doing a long backtrace, the user should be /* This is wrong. If doing a long backtrace, the user should be
able to get out next time we call QUIT, without anything as violent able to get out next time we call QUIT, without anything as
as interrupt_query. If we want to provide a way out of here violent as interrupt_query. If we want to provide a way out of
without getting to the next QUIT, it should be based on hitting here without getting to the next QUIT, it should be based on
^C twice as in remote_wait. */ hitting ^C twice as in remote_wait. */
if (quit_flag) if (quit_flag)
{ {
quit_flag = 0; quit_flag = 0;
@ -3190,7 +3191,8 @@ compare_sections_command (args, from_tty)
do_cleanups (old_chain); do_cleanups (old_chain);
} }
if (mismatched > 0) if (mismatched > 0)
warning ("One or more sections of the remote executable does not match\nthe loaded file\n"); warning ("One or more sections of the remote executable does not match\n\
the loaded file\n");
if (args && !matched) if (args && !matched)
printf_filtered ("No loaded section named '%s'.\n", args); printf_filtered ("No loaded section named '%s'.\n", args);
} }
@ -3224,7 +3226,8 @@ init_remote_ops ()
{ {
remote_ops.to_shortname = "remote"; remote_ops.to_shortname = "remote";
remote_ops.to_longname = "Remote serial target in gdb-specific protocol"; remote_ops.to_longname = "Remote serial target in gdb-specific protocol";
remote_ops.to_doc = "Use a remote computer via a serial line, using a gdb-specific protocol.\n\ remote_ops.to_doc =
"Use a remote computer via a serial line, using a gdb-specific protocol.\n\
Specify the serial device it is connected to (e.g. /dev/ttya)."; Specify the serial device it is connected to (e.g. /dev/ttya).";
remote_ops.to_open = remote_open; remote_ops.to_open = remote_open;
remote_ops.to_close = remote_close; remote_ops.to_close = remote_close;
@ -3258,8 +3261,10 @@ init_extended_remote_ops ()
extended_remote_ops = remote_ops; extended_remote_ops = remote_ops;
extended_remote_ops.to_shortname = "extended-remote"; extended_remote_ops.to_shortname = "extended-remote";
extended_remote_ops.to_longname = "Extended remote serial target in gdb-specific protocol"; extended_remote_ops.to_longname =
extended_remote_ops.to_doc = "Use a remote computer via a serial line, using a gdb-specific protocol.\n\ "Extended remote serial target in gdb-specific protocol";
extended_remote_ops.to_doc =
"Use a remote computer via a serial line, using a gdb-specific protocol.\n\
Specify the serial device it is connected to (e.g. /dev/ttya).", Specify the serial device it is connected to (e.g. /dev/ttya).",
extended_remote_ops.to_open = extended_remote_open; extended_remote_ops.to_open = extended_remote_open;
extended_remote_ops.to_create_inferior = extended_remote_create_inferior; extended_remote_ops.to_create_inferior = extended_remote_create_inferior;
@ -3291,30 +3296,35 @@ response packet. GDB supplies the initial `$' character, and the\n\
terminating `#' character and checksum.", terminating `#' character and checksum.",
&maintenancelist); &maintenancelist);
add_show_from_set (add_set_cmd ("remotetimeout", no_class, add_show_from_set
(add_set_cmd ("remotetimeout", no_class,
var_integer, (char *)&remote_timeout, var_integer, (char *)&remote_timeout,
"Set timeout value for remote read.\n", "Set timeout value for remote read.\n",
&setlist), &setlist),
&showlist); &showlist);
add_show_from_set (add_set_cmd ("remotebreak", no_class, add_show_from_set
(add_set_cmd ("remotebreak", no_class,
var_integer, (char *)&remote_break, var_integer, (char *)&remote_break,
"Set whether to send break if interrupted.\n", "Set whether to send break if interrupted.\n",
&setlist), &setlist),
&showlist); &showlist);
add_show_from_set (add_set_cmd ("remotewritesize", no_class, add_show_from_set
(add_set_cmd ("remotewritesize", no_class,
var_integer, (char *)&remote_write_size, var_integer, (char *)&remote_write_size,
"Set the maximum number of bytes in each memory write packet.\n", "Set the maximum number of bytes per memory write packet.\n",
&setlist), &setlist),
&showlist); &showlist);
remote_address_size = TARGET_PTR_BIT; remote_address_size = TARGET_PTR_BIT;
add_show_from_set (add_set_cmd ("remoteaddresssize", class_obscure, add_show_from_set
(add_set_cmd ("remoteaddresssize", class_obscure,
var_integer, (char *)&remote_address_size, var_integer, (char *)&remote_address_size,
"Set the maximum size of the address (in bits) in a memory packet.\n", "Set the maximum size of the address (in bits) \
in a memory packet.\n",
&setlist), &setlist),
&showlist); &showlist);
} }