* core.c (dis_asm_read_memory), defs.h, gdbtk.c (gdb_disassemble),

top.c :  Get rid of dis_asm_read_memory_hook.  We can now call the
	disassemblers directly and have no need for this hook anymore.
	* defs.h, printcmd.c:  Make print_insn be static.

	* ser-go32.c (dos_comisr):  Make this 8 bit clean.
	* (dos_open dos_close):  Allow multiple opens to the same device.
	Use a ref count to prevent unwanted deallocations.
	* sparcl-tdep.c:  Put #ifdefs around all socket stuff to make GO32
	happy.
	* (sparclite_ops):  Switch to download_stratum.
	* target.h (enum strata):  Move download_stratum before
	process_stratum so that executable targets get pushed on top of
	download targets.
This commit is contained in:
Stu Grossman 1995-02-03 19:35:54 +00:00
parent 1b552670ac
commit a76ef70a14
7 changed files with 160 additions and 108 deletions

View File

@ -1,3 +1,20 @@
Fri Feb 3 11:19:20 1995 Stu Grossman (grossman@cygnus.com)
* core.c (dis_asm_read_memory), defs.h, gdbtk.c (gdb_disassemble),
top.c : Get rid of dis_asm_read_memory_hook. We can now call the
disassemblers directly and have no need for this hook anymore.
* defs.h, printcmd.c: Make print_insn be static.
* ser-go32.c (dos_comisr): Make this 8 bit clean.
* (dos_open dos_close): Allow multiple opens to the same device.
Use a ref count to prevent unwanted deallocations.
* sparcl-tdep.c: Put #ifdefs around all socket stuff to make GO32
happy.
* (sparclite_ops): Switch to download_stratum.
* target.h (enum strata): Move download_stratum before
process_stratum so that executable targets get pushed on top of
download targets.
Thu Feb 2 19:02:45 1995 Rob Savoye <rob@darkstar.cygnus.com> Thu Feb 2 19:02:45 1995 Rob Savoye <rob@darkstar.cygnus.com>
* array-rom.c: Remove the non GDB remote protocol config stuff. * array-rom.c: Remove the non GDB remote protocol config stuff.

View File

@ -181,9 +181,6 @@ dis_asm_read_memory (memaddr, myaddr, len, info)
int len; int len;
disassemble_info *info; disassemble_info *info;
{ {
if (dis_asm_read_memory_hook)
return dis_asm_read_memory_hook (memaddr, myaddr, len, info);
return target_read_memory (memaddr, (char *) myaddr, len); return target_read_memory (memaddr, (char *) myaddr, len);
} }

View File

@ -667,8 +667,6 @@ call_wrapper (clientData, interp, argc, argv)
finish_saving_output (); /* Restore stdout to normal */ finish_saving_output (); /* Restore stdout to normal */
dis_asm_read_memory_hook = 0; /* Restore disassembly hook */
gdb_flush (gdb_stderr); /* Flush error output */ gdb_flush (gdb_stderr); /* Flush error output */
gdb_flush (gdb_stdout); /* Sometimes error output comes here as well */ gdb_flush (gdb_stdout); /* Sometimes error output comes here as well */
@ -783,6 +781,16 @@ gdb_disassemble (clientData, interp, argc, argv)
{ {
CORE_ADDR pc, low, high; CORE_ADDR pc, low, high;
int mixed_source_and_assembly; int mixed_source_and_assembly;
static disassemble_info di = {
(fprintf_ftype) fprintf_filtered, /* fprintf_func */
gdb_stdout, /* stream */
NULL, /* application_data */
0, /* flags */
NULL, /* private_data */
NULL, /* read_memory_func */
dis_asm_memory_error, /* memory_error_func */
dis_asm_print_address /* print_address_func */
};
if (argc != 3 && argc != 4) if (argc != 3 && argc != 4)
{ {
@ -836,7 +844,9 @@ gdb_disassemble (clientData, interp, argc, argv)
disassemble_from_exec = 1; /* It's remote, read the exec file */ disassemble_from_exec = 1; /* It's remote, read the exec file */
if (disassemble_from_exec) if (disassemble_from_exec)
dis_asm_read_memory_hook = gdbtk_dis_asm_read_memory; di.read_memory_func = gdbtk_dis_asm_read_memory;
else
di.read_memory_func = dis_asm_read_memory;
/* If just doing straight assembly, all we need to do is disassemble /* If just doing straight assembly, all we need to do is disassemble
everything between low and high. If doing mixed source/assembly, we've everything between low and high. If doing mixed source/assembly, we've
@ -940,7 +950,7 @@ gdb_disassemble (clientData, interp, argc, argv)
fputs_unfiltered (" ", gdb_stdout); fputs_unfiltered (" ", gdb_stdout);
print_address (pc, gdb_stdout); print_address (pc, gdb_stdout);
fputs_unfiltered (":\t ", gdb_stdout); fputs_unfiltered (":\t ", gdb_stdout);
pc += print_insn (pc, gdb_stdout); pc += tm_print_insn (pc, &di);
fputs_unfiltered ("\n", gdb_stdout); fputs_unfiltered ("\n", gdb_stdout);
} }
} }
@ -954,13 +964,11 @@ assembly_only:
fputs_unfiltered (" ", gdb_stdout); fputs_unfiltered (" ", gdb_stdout);
print_address (pc, gdb_stdout); print_address (pc, gdb_stdout);
fputs_unfiltered (":\t ", gdb_stdout); fputs_unfiltered (":\t ", gdb_stdout);
pc += print_insn (pc, gdb_stdout); pc += tm_print_insn (pc, &di);
fputs_unfiltered ("\n", gdb_stdout); fputs_unfiltered ("\n", gdb_stdout);
} }
} }
dis_asm_read_memory_hook = 0;
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
return TCL_OK; return TCL_OK;

View File

@ -1,5 +1,5 @@
/* Print values for GNU debugger GDB. /* Print values for GNU debugger GDB.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994 Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1995
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -111,77 +111,60 @@ static struct display *display_chain;
static int display_number; static int display_number;
/* Prototypes for local functions */ /* Pointer to the target-dependent disassembly function. */
static void int (*tm_print_insn) PARAMS ((bfd_vma, disassemble_info *));
delete_display PARAMS ((int));
static void /* Prototypes for local functions. */
enable_display PARAMS ((char *, int));
static void static void delete_display PARAMS ((int));
disable_display_command PARAMS ((char *, int));
static void static void enable_display PARAMS ((char *, int));
disassemble_command PARAMS ((char *, int));
static void static void disable_display_command PARAMS ((char *, int));
printf_command PARAMS ((char *, int));
static void static void disassemble_command PARAMS ((char *, int));
print_frame_nameless_args PARAMS ((struct frame_info *, long, int, int,
GDB_FILE *));
static void static void printf_command PARAMS ((char *, int));
display_info PARAMS ((char *, int));
static void static void print_frame_nameless_args PARAMS ((struct frame_info *, long,
do_one_display PARAMS ((struct display *)); int, int, GDB_FILE *));
static void static void display_info PARAMS ((char *, int));
undisplay_command PARAMS ((char *, int));
static void static void do_one_display PARAMS ((struct display *));
free_display PARAMS ((struct display *));
static void static void undisplay_command PARAMS ((char *, int));
display_command PARAMS ((char *, int));
static void static void free_display PARAMS ((struct display *));
x_command PARAMS ((char *, int));
static void static void display_command PARAMS ((char *, int));
address_info PARAMS ((char *, int));
static void static void x_command PARAMS ((char *, int));
set_command PARAMS ((char *, int));
static void static void address_info PARAMS ((char *, int));
output_command PARAMS ((char *, int));
static void static void set_command PARAMS ((char *, int));
call_command PARAMS ((char *, int));
static void static void output_command PARAMS ((char *, int));
inspect_command PARAMS ((char *, int));
static void static void call_command PARAMS ((char *, int));
print_command PARAMS ((char *, int));
static void static void inspect_command PARAMS ((char *, int));
print_command_1 PARAMS ((char *, int, int));
static void static void print_command PARAMS ((char *, int));
validate_format PARAMS ((struct format_data, char *));
static void static void print_command_1 PARAMS ((char *, int, int));
do_examine PARAMS ((struct format_data, CORE_ADDR));
static void static void validate_format PARAMS ((struct format_data, char *));
print_formatted PARAMS ((value_ptr, int, int));
static struct format_data static void do_examine PARAMS ((struct format_data, CORE_ADDR));
decode_format PARAMS ((char **, int, int));
static void print_formatted PARAMS ((value_ptr, int, int));
static struct format_data decode_format PARAMS ((char **, int, int));
static int print_insn PARAMS ((CORE_ADDR, GDB_FILE *));
/* Decode a format specification. *STRING_PTR should point to it. /* Decode a format specification. *STRING_PTR should point to it.
@ -246,22 +229,15 @@ decode_format (string_ptr, oformat, osize)
case 'a': case 'a':
case 's': case 's':
/* Pick the appropriate size for an address. */ /* Pick the appropriate size for an address. */
#if TARGET_PTR_BIT == 64 if (TARGET_PTR_BIT == 64)
val.size = osize ? 'g' : osize; val.size = osize ? 'g' : osize;
break; else if (TARGET_PTR_BIT == 32)
#else /* Not 64 */
#if TARGET_PTR_BIT == 32
val.size = osize ? 'w' : osize; val.size = osize ? 'w' : osize;
break; else if (TARGET_PTR_BIT == 16)
#else /* Not 32 */
#if TARGET_PTR_BIT == 16
val.size = osize ? 'h' : osize; val.size = osize ? 'h' : osize;
break; else
#else /* Not 16 */ /* Bad value for TARGET_PTR_BIT */
#error Bad value for TARGET_PTR_BIT abort ();
#endif /* Not 16 */
#endif /* Not 32 */
#endif /* Not 64 */
break; break;
case 'f': case 'f':
/* Floating point has to be word or giantword. */ /* Floating point has to be word or giantword. */
@ -305,7 +281,7 @@ print_formatted (val, format, size)
{ {
case 's': case 's':
next_address = VALUE_ADDRESS (val) next_address = VALUE_ADDRESS (val)
+ value_print (value_addr (val), gdb_stdout, format, Val_pretty_default); + val_print_string (VALUE_ADDRESS (val), 0, gdb_stdout);
break; break;
case 'i': case 'i':
@ -1500,10 +1476,11 @@ disable_display_command (args, from_tty)
void void
print_variable_value (var, frame, stream) print_variable_value (var, frame, stream)
struct symbol *var; struct symbol *var;
FRAME frame; struct frame_info *frame;
GDB_FILE *stream; GDB_FILE *stream;
{ {
value_ptr val = read_var_value (var, frame); value_ptr val = read_var_value (var, frame);
value_print (val, stream, 0, Val_pretty_default); value_print (val, stream, 0, Val_pretty_default);
} }
@ -1656,7 +1633,7 @@ print_frame_args (func, fi, num, stream)
we do not know. We pass 2 as "recurse" to val_print because our we do not know. We pass 2 as "recurse" to val_print because our
standard indentation here is 4 spaces, and val_print indents standard indentation here is 4 spaces, and val_print indents
2 for each recurse. */ 2 for each recurse. */
val = read_var_value (sym, FRAME_INFO_ID (fi)); val = read_var_value (sym, fi);
annotate_arg_value (val == NULL ? NULL : VALUE_TYPE (val)); annotate_arg_value (val == NULL ? NULL : VALUE_TYPE (val));
@ -1692,6 +1669,7 @@ print_frame_args (func, fi, num, stream)
of the first nameless arg, and NUM is the number of nameless args to of the first nameless arg, and NUM is the number of nameless args to
print. FIRST is nonzero if this is the first argument (not just print. FIRST is nonzero if this is the first argument (not just
the first nameless arg). */ the first nameless arg). */
static void static void
print_frame_nameless_args (fi, start, num, first, stream) print_frame_nameless_args (fi, start, num, first, stream)
struct frame_info *fi; struct frame_info *fi;
@ -2074,6 +2052,33 @@ disassemble_command (arg, from_tty)
gdb_flush (gdb_stdout); gdb_flush (gdb_stdout);
} }
/* Print the instruction at address MEMADDR in debugged memory,
on STREAM. Returns length of the instruction, in bytes. */
static int
print_insn (memaddr, stream)
CORE_ADDR memaddr;
GDB_FILE *stream;
{
disassemble_info info;
#define GDB_INIT_DISASSEMBLE_INFO(INFO, STREAM) \
(INFO).fprintf_func = (fprintf_ftype)fprintf_filtered, \
(INFO).stream = (STREAM), \
(INFO).read_memory_func = dis_asm_read_memory, \
(INFO).memory_error_func = dis_asm_memory_error, \
(INFO).print_address_func = dis_asm_print_address, \
(INFO).insn_info_valid = 0
GDB_INIT_DISASSEMBLE_INFO(info, stream);
/* If there's no disassembler, something is very wrong. */
if (tm_print_insn == NULL)
abort ();
return (*tm_print_insn) (memaddr, &info);
}
void void
_initialize_printcmd () _initialize_printcmd ()
@ -2084,17 +2089,17 @@ _initialize_printcmd ()
"Describe where variable VAR is stored."); "Describe where variable VAR is stored.");
add_com ("x", class_vars, x_command, add_com ("x", class_vars, x_command,
"Examine memory: x/FMT ADDRESS.\n\ concat ("Examine memory: x/FMT ADDRESS.\n\
ADDRESS is an expression for the memory address to examine.\n\ ADDRESS is an expression for the memory address to examine.\n\
FMT is a repeat count followed by a format letter and a size letter.\n\ FMT is a repeat count followed by a format letter and a size letter.\n\
Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),\n\ Format letters are o(octal), x(hex), d(decimal), u(unsigned decimal),\n\
t(binary), f(float), a(address), i(instruction), c(char) and s(string).\n\ t(binary), f(float), a(address), i(instruction), c(char) and s(string).\n",
Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).\n\ "Size letters are b(byte), h(halfword), w(word), g(giant, 8 bytes).\n\
The specified number of objects of the specified size are printed\n\ The specified number of objects of the specified size are printed\n\
according to the format.\n\n\ according to the format.\n\n\
Defaults for format and size letters are those previously used.\n\ Defaults for format and size letters are those previously used.\n\
Default count is 1. Default address is following last thing printed\n\ Default count is 1. Default address is following last thing printed\n\
with this command or \"print\"."); with this command or \"print\".", NULL));
add_com ("disassemble", class_vars, disassemble_command, add_com ("disassemble", class_vars, disassemble_command,
"Disassemble a specified section of memory.\n\ "Disassemble a specified section of memory.\n\
@ -2125,7 +2130,8 @@ Do \"info display\" to see current list of code numbers.",
as in the \"x\" command, and then EXP is used to get the address to examine\n\ as in the \"x\" command, and then EXP is used to get the address to examine\n\
and examining is done as in the \"x\" command.\n\n\ and examining is done as in the \"x\" command.\n\n\
With no argument, display all currently requested auto-display expressions.\n\ With no argument, display all currently requested auto-display expressions.\n\
Use \"undisplay\" to cancel display requests previously made."); Use \"undisplay\" to cancel display requests previously made."
);
add_cmd ("display", class_vars, enable_display, add_cmd ("display", class_vars, enable_display,
"Enable some expressions to be displayed when program stops.\n\ "Enable some expressions to be displayed when program stops.\n\
@ -2148,19 +2154,20 @@ Do \"info display\" to see current list of code numbers.", &deletelist);
add_com ("printf", class_vars, printf_command, add_com ("printf", class_vars, printf_command,
"printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\ "printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\
This is useful for formatted output in user-defined commands."); This is useful for formatted output in user-defined commands.");
add_com ("output", class_vars, output_command, add_com ("output", class_vars, output_command,
"Like \"print\" but don't put in value history and don't print newline.\n\ "Like \"print\" but don't put in value history and don't print newline.\n\
This is useful in user-defined commands."); This is useful in user-defined commands.");
add_prefix_cmd ("set", class_vars, set_command, add_prefix_cmd ("set", class_vars, set_command,
"Evaluate expression EXP and assign result to variable VAR, using assignment\n\ concat ("Evaluate expression EXP and assign result to variable VAR, using assignment\n\
syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n\ syntax appropriate for the current language (VAR = EXP or VAR := EXP for\n\
example). VAR may be a debugger \"convenience\" variable (names starting\n\ example). VAR may be a debugger \"convenience\" variable (names starting\n\
with $), a register (a few standard names starting with $), or an actual\n\ with $), a register (a few standard names starting with $), or an actual\n\
variable in the program being debugged. EXP is any valid expression.\n\ variable in the program being debugged. EXP is any valid expression.\n",
Use \"set variable\" for variables with names identical to set subcommands.\n\ "Use \"set variable\" for variables with names identical to set subcommands.\n\
\nWith a subcommand, this command modifies parts of the gdb environment.\n\ \nWith a subcommand, this command modifies parts of the gdb environment.\n\
You can see these environment settings with the \"show\" command.", You can see these environment settings with the \"show\" command.", NULL),
&setlist, "set ", 1, &cmdlist); &setlist, "set ", 1, &cmdlist);
/* "call" is the same as "set", but handy for dbx users to call fns. */ /* "call" is the same as "set", but handy for dbx users to call fns. */
@ -2186,8 +2193,8 @@ stack frame, plus all those whose scope is global or an entire file.\n\
\n\ \n\
$NUM gets previous value number NUM. $ and $$ are the last two values.\n\ $NUM gets previous value number NUM. $ and $$ are the last two values.\n\
$$NUM refers to NUM'th value back from the last one.\n\ $$NUM refers to NUM'th value back from the last one.\n\
Names starting with $ refer to registers (with the values they would have\n\ Names starting with $ refer to registers (with the values they would have\n",
if the program were to return to the stack frame now selected, restoring\n\ "if the program were to return to the stack frame now selected, restoring\n\
all registers saved by frames farther in) or else to debugger\n\ all registers saved by frames farther in) or else to debugger\n\
\"convenience\" variables (any such name not a known register).\n\ \"convenience\" variables (any such name not a known register).\n\
Use assignment expressions to give values to convenience variables.\n", Use assignment expressions to give values to convenience variables.\n",
@ -2220,8 +2227,8 @@ environment, the value is printed in its own window.");
&setprintlist), &setprintlist),
&showprintlist); &showprintlist);
examine_b_type = init_type (TYPE_CODE_INT, 1, 0, NULL, NULL); examine_b_type = init_type (TYPE_CODE_INT, 1, 0, "examine_b_type", NULL);
examine_h_type = init_type (TYPE_CODE_INT, 2, 0, NULL, NULL); examine_h_type = init_type (TYPE_CODE_INT, 2, 0, "examine_h_type", NULL);
examine_w_type = init_type (TYPE_CODE_INT, 4, 0, NULL, NULL); examine_w_type = init_type (TYPE_CODE_INT, 4, 0, "examine_w_type", NULL);
examine_g_type = init_type (TYPE_CODE_INT, 8, 0, NULL, NULL); examine_g_type = init_type (TYPE_CODE_INT, 8, 0, "examine_g_type", NULL);
} }

View File

@ -196,6 +196,7 @@ static struct dos_ttystate
{ {
int base; int base;
int irq; int irq;
int refcnt;
struct intrupt *intrupt; struct intrupt *intrupt;
int fifo; int fifo;
int baudrate; int baudrate;
@ -311,7 +312,7 @@ dos_comisr (irq)
port->oflo++; port->oflo++;
} }
if (dos_putc (c & 0x7f, port) < 0) if (dos_putc (c, port) < 0)
{ {
COUNT (CNT_ORUN); COUNT (CNT_ORUN);
} }
@ -474,11 +475,11 @@ dos_open (scb, name)
fd = name[3] - '1'; fd = name[3] - '1';
port = &ports[fd]; port = &ports[fd];
if (port->intrupt) if (port->refcnt++ > 0)
{ {
/* already open (EBUSY not defined!) */ /* Device already opened another user. Just point at it. */
errno = EACCES; scb->fd = fd;
return -1; return 0;
} }
/* force access to ID reg */ /* force access to ID reg */
@ -559,6 +560,10 @@ dos_close (scb)
return; return;
port = &ports[scb->fd]; port = &ports[scb->fd];
if (port->refcnt-- > 1)
return;
if (!(intrupt = port->intrupt)) if (!(intrupt = port->intrupt))
return; return;

View File

@ -24,24 +24,30 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "serial.h" #include "serial.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
#include <unistd.h>
#ifndef __GO32__
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>
#include <netdb.h> #include <netdb.h>
#include <unistd.h> #endif
extern struct target_ops sparclite_ops; /* Forward decl */ extern struct target_ops sparclite_ops; /* Forward decl */
extern struct target_ops remote_ops; extern struct target_ops remote_ops;
static char *remote_target_name = NULL; static char *remote_target_name = NULL;
static serial_t remote_desc = NULL; static serial_t remote_desc = NULL;
static int udp_fd = -1;
static int serial_flag; static int serial_flag;
#ifndef __GO32__
static int udp_fd = -1;
#endif
static serial_t open_tty PARAMS ((char *name)); static serial_t open_tty PARAMS ((char *name));
static int send_resp PARAMS ((serial_t desc, char c)); static int send_resp PARAMS ((serial_t desc, char c));
static void close_tty PARAMS ((int ignore)); static void close_tty PARAMS ((int ignore));
#ifndef __GO32__
static int recv_udp_buf PARAMS ((int fd, unsigned char *buf, int len, int timeout)); static int recv_udp_buf PARAMS ((int fd, unsigned char *buf, int len, int timeout));
static int send_udp_buf PARAMS ((int fd, unsigned char *buf, int len)); static int send_udp_buf PARAMS ((int fd, unsigned char *buf, int len));
#endif
static void sparclite_open PARAMS ((char *name, int from_tty)); static void sparclite_open PARAMS ((char *name, int from_tty));
static void sparclite_close PARAMS ((int quitting)); static void sparclite_close PARAMS ((int quitting));
static void download PARAMS ((char *target_name, char *args, int from_tty, static void download PARAMS ((char *target_name, char *args, int from_tty,
@ -54,12 +60,14 @@ static void sparclite_serial_start PARAMS ((bfd_vma entry));
static void sparclite_serial_write PARAMS ((bfd *from_bfd, asection *from_sec, static void sparclite_serial_write PARAMS ((bfd *from_bfd, asection *from_sec,
file_ptr from_addr, file_ptr from_addr,
bfd_vma to_addr, int len)); bfd_vma to_addr, int len));
#ifndef __GO32__
static unsigned short calc_checksum PARAMS ((unsigned char *buffer, static unsigned short calc_checksum PARAMS ((unsigned char *buffer,
int count)); int count));
static void sparclite_udp_start PARAMS ((bfd_vma entry)); static void sparclite_udp_start PARAMS ((bfd_vma entry));
static void sparclite_udp_write PARAMS ((bfd *from_bfd, asection *from_sec, static void sparclite_udp_write PARAMS ((bfd *from_bfd, asection *from_sec,
file_ptr from_addr, bfd_vma to_addr, file_ptr from_addr, bfd_vma to_addr,
int len)); int len));
#endif
static void sparclite_download PARAMS ((char *filename, int from_tty)); static void sparclite_download PARAMS ((char *filename, int from_tty));
#define DDA2_SUP_ASI 0xb000000 #define DDA2_SUP_ASI 0xb000000
@ -316,6 +324,7 @@ close_tty (ignore)
remote_desc = NULL; remote_desc = NULL;
} }
#ifndef __GO32__
static int static int
recv_udp_buf (fd, buf, len, timeout) recv_udp_buf (fd, buf, len, timeout)
int fd, len; int fd, len;
@ -368,6 +377,7 @@ send_udp_buf (fd, buf, len)
error ("Short count in send: tried %d, sent %d\n", len, cc); error ("Short count in send: tried %d, sent %d\n", len, cc);
} }
#endif /* __GO32__ */
static void static void
sparclite_open (name, from_tty) sparclite_open (name, from_tty)
@ -439,6 +449,7 @@ or: target sparclite udp host");
} }
else else
{ {
#ifndef __GO32__
struct hostent *he; struct hostent *he;
struct sockaddr_in sockaddr; struct sockaddr_in sockaddr;
unsigned char buffer[100]; unsigned char buffer[100];
@ -472,6 +483,9 @@ or: target sparclite udp host");
if (cc < 3) if (cc < 3)
error ("SPARClite appears to be ill."); error ("SPARClite appears to be ill.");
#else
error ("UDP downloading is not supported for DOS hosts.");
#endif /* __GO32__ */
} }
printf_unfiltered ("[SPARClite appears to be alive]\n"); printf_unfiltered ("[SPARClite appears to be alive]\n");
@ -489,9 +503,11 @@ sparclite_close (quitting)
{ {
if (serial_flag) if (serial_flag)
close_tty (0); close_tty (0);
#ifndef __GO32__
else else
if (udp_fd != -1) if (udp_fd != -1)
close (udp_fd); close (udp_fd);
#endif
} }
#define LOAD_ADDRESS 0x40000000 #define LOAD_ADDRESS 0x40000000
@ -668,6 +684,8 @@ sparclite_serial_write (from_bfd, from_sec, from_addr, to_addr, len)
error ("Bad checksum from load command (0x%x)", i); error ("Bad checksum from load command (0x%x)", i);
} }
#ifndef __GO32__
static unsigned short static unsigned short
calc_checksum (buffer, count) calc_checksum (buffer, count)
unsigned char *buffer; unsigned char *buffer;
@ -780,14 +798,20 @@ sparclite_udp_write (from_bfd, from_sec, from_addr, to_addr, len)
} }
} }
#endif /* __GO32__ */
static void static void
sparclite_download (filename, from_tty) sparclite_download (filename, from_tty)
char *filename; char *filename;
int from_tty; int from_tty;
{ {
if (!serial_flag) if (!serial_flag)
#ifndef __GO32__
download (remote_target_name, filename, from_tty, sparclite_udp_write, download (remote_target_name, filename, from_tty, sparclite_udp_write,
sparclite_udp_start); sparclite_udp_start);
#else
abort (); /* sparclite_open should prevent this! */
#endif
else else
download (remote_target_name, filename, from_tty, sparclite_serial_write, download (remote_target_name, filename, from_tty, sparclite_serial_write,
sparclite_serial_start); sparclite_serial_start);
@ -827,7 +851,7 @@ Specify the serial device it is connected to (e.g. /dev/ttya).", /* to_doc */
0, /* to_can_run */ 0, /* to_can_run */
0, /* to_notice_signals */ 0, /* to_notice_signals */
0, /* to_stop */ 0, /* to_stop */
process_stratum, /* to_stratum */ download_stratum, /* to_stratum */
0, /* to_next */ 0, /* to_next */
0, /* to_has_all_memory */ 0, /* to_has_all_memory */
0, /* to_has_memory */ 0, /* to_has_memory */

View File

@ -419,12 +419,6 @@ int (*target_wait_hook) PARAMS ((int pid, struct target_waitstatus *status));
void (*call_command_hook) PARAMS ((struct cmd_list_element *c, char *cmd, void (*call_command_hook) PARAMS ((struct cmd_list_element *c, char *cmd,
int from_tty)); int from_tty));
/* An alternate way to read memory for disassembly. This is used to provide a
switch that allows disassembly to come from an exec file rather than a
remote target. This is a speed hack. */
int (*dis_asm_read_memory_hook) PARAMS ((bfd_vma memaddr, bfd_byte *myaddr,
int len, disassemble_info *info));
/* Takes control from error (). Typically used to prevent longjmps out of the /* Takes control from error (). Typically used to prevent longjmps out of the
middle of the GUI. Usually used in conjunction with a catch routine. */ middle of the GUI. Usually used in conjunction with a catch routine. */