Change "dev_t gdbdev" to "void *gdb_arg", some possible paths for GDB
will not have a dev_t.
This commit is contained in:
parent
25ef827219
commit
029f0b69a4
@ -153,18 +153,18 @@ strcpy (char *dst, const char *src)
|
||||
static int
|
||||
putDebugChar (int c) /* write a single character */
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return 0;
|
||||
(*gdb_putc)(gdbdev, c);
|
||||
(*gdb_putc)(gdb_arg, c);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
getDebugChar (void) /* read and return a single char */
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return -1;
|
||||
return (*gdb_getc)(gdbdev);
|
||||
return (*gdb_getc)(gdb_arg);
|
||||
}
|
||||
|
||||
static const char hexchars[]="0123456789abcdef";
|
||||
@ -625,7 +625,7 @@ gdb_handle_exception (db_regs_t *raw_regs, int type, int code)
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (gdbdev == NODEV) /* somebody's removed it */
|
||||
if (gdb_arg == NULL) /* somebody's removed it */
|
||||
return; /* get out of here */
|
||||
remcomOutBuffer[0] = 0;
|
||||
|
||||
|
@ -146,18 +146,18 @@ strcpy (char *dst, const char *src)
|
||||
static int
|
||||
putDebugChar (int c) /* write a single character */
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return 0;
|
||||
(*gdb_putc)(gdbdev, c);
|
||||
(*gdb_putc)(gdb_arg, c);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
getDebugChar (void) /* read and return a single char */
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return -1;
|
||||
return (*gdb_getc)(gdbdev);
|
||||
return (*gdb_getc)(gdb_arg);
|
||||
}
|
||||
|
||||
static const char hexchars[]="0123456789abcdef";
|
||||
@ -487,7 +487,7 @@ gdb_handle_exception (db_regs_t *raw_regs, int type, int code)
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return 1; /* somebody has removed the gdb device */
|
||||
remcomOutBuffer[0] = 0;
|
||||
|
||||
|
@ -550,7 +550,7 @@ db_fncall(dummy1, dummy2, dummy3, dummy4)
|
||||
|
||||
/* Enter GDB remote protocol debugger on the next trap. */
|
||||
|
||||
dev_t gdbdev = NODEV;
|
||||
void *gdb_arg = NULL;
|
||||
cn_getc_t *gdb_getc;
|
||||
cn_putc_t *gdb_putc;
|
||||
|
||||
@ -562,7 +562,7 @@ db_gdb (dummy1, dummy2, dummy3, dummy4)
|
||||
char * dummy4;
|
||||
{
|
||||
|
||||
if (gdbdev == NODEV) {
|
||||
if (gdb_arg == NULL) {
|
||||
db_printf("No gdb port enabled. Set flag 0x80 on desired port\n");
|
||||
db_printf("in your configuration file (currently sio only).\n");
|
||||
return;
|
||||
|
@ -161,7 +161,7 @@ struct command {
|
||||
/*
|
||||
* Routines to support GDB on an sio port.
|
||||
*/
|
||||
extern dev_t gdbdev;
|
||||
extern void *gdb_arg;
|
||||
extern cn_getc_t *gdb_getc;
|
||||
extern cn_putc_t *gdb_putc;
|
||||
#endif
|
||||
|
@ -2982,7 +2982,7 @@ siocnprobe(cp)
|
||||
siogdbiobase = iobase;
|
||||
siogdbunit = unit;
|
||||
#if DDB > 0
|
||||
gdbdev = makedev(CDEV_MAJOR, unit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, unit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
#endif
|
||||
@ -2996,14 +2996,14 @@ siocnprobe(cp)
|
||||
* If no gdb port has been specified, set it to be the console
|
||||
* as some configuration files don't specify the gdb port.
|
||||
*/
|
||||
if (gdbdev == NODEV && (boothowto & RB_GDB)) {
|
||||
if (gdb_arg == NULL && (boothowto & RB_GDB)) {
|
||||
printf("Warning: no GDB port specified. Defaulting to sio%d.\n",
|
||||
siocnunit);
|
||||
printf("Set flag 0x80 on desired GDB port in your\n");
|
||||
printf("configuration file (currently sio only).\n");
|
||||
siogdbiobase = siocniobase;
|
||||
siogdbunit = siocnunit;
|
||||
gdbdev = makedev(CDEV_MAJOR, siocnunit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, siocnunit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
}
|
||||
@ -3090,7 +3090,7 @@ siogdbattach(port, speed)
|
||||
printf("sio%d: gdb debugging port\n", unit);
|
||||
siogdbunit = unit;
|
||||
#if DDB > 0
|
||||
gdbdev = makedev(CDEV_MAJOR, unit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, unit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
#endif
|
||||
|
@ -146,18 +146,18 @@ strcpy (char *dst, const char *src)
|
||||
static int
|
||||
putDebugChar (int c) /* write a single character */
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return 0;
|
||||
(*gdb_putc)(gdbdev, c);
|
||||
(*gdb_putc)(gdb_arg, c);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
getDebugChar (void) /* read and return a single char */
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return -1;
|
||||
return (*gdb_getc)(gdbdev);
|
||||
return (*gdb_getc)(gdb_arg);
|
||||
}
|
||||
|
||||
static const char hexchars[]="0123456789abcdef";
|
||||
@ -487,7 +487,7 @@ gdb_handle_exception (db_regs_t *raw_regs, int type, int code)
|
||||
|
||||
while (1)
|
||||
{
|
||||
if (gdbdev == NODEV)
|
||||
if (gdb_arg == NULL)
|
||||
return 1; /* somebody has removed the gdb device */
|
||||
remcomOutBuffer[0] = 0;
|
||||
|
||||
|
@ -4212,7 +4212,7 @@ siocnprobe(cp)
|
||||
siogdbiobase = iobase;
|
||||
siogdbunit = unit;
|
||||
#if DDB > 0
|
||||
gdbdev = makedev(CDEV_MAJOR, unit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, unit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
#endif
|
||||
@ -4226,14 +4226,14 @@ siocnprobe(cp)
|
||||
* If no gdb port has been specified, set it to be the console
|
||||
* as some configuration files don't specify the gdb port.
|
||||
*/
|
||||
if (gdbdev == NODEV && (boothowto & RB_GDB)) {
|
||||
if (gdb_arg == NULL && (boothowto & RB_GDB)) {
|
||||
printf("Warning: no GDB port specified. Defaulting to sio%d.\n",
|
||||
siocnunit);
|
||||
printf("Set flag 0x80 on desired GDB port in your\n");
|
||||
printf("configuration file (currently sio only).\n");
|
||||
siogdbiobase = siocniobase;
|
||||
siogdbunit = siocnunit;
|
||||
gdbdev = makedev(CDEV_MAJOR, siocnunit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, siocnunit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
}
|
||||
@ -4320,7 +4320,7 @@ siogdbattach(port, speed)
|
||||
printf("sio%d: gdb debugging port\n", unit);
|
||||
siogdbunit = unit;
|
||||
#if DDB > 0
|
||||
gdbdev = makedev(CDEV_MAJOR, unit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, unit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
#endif
|
||||
|
@ -4212,7 +4212,7 @@ siocnprobe(cp)
|
||||
siogdbiobase = iobase;
|
||||
siogdbunit = unit;
|
||||
#if DDB > 0
|
||||
gdbdev = makedev(CDEV_MAJOR, unit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, unit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
#endif
|
||||
@ -4226,14 +4226,14 @@ siocnprobe(cp)
|
||||
* If no gdb port has been specified, set it to be the console
|
||||
* as some configuration files don't specify the gdb port.
|
||||
*/
|
||||
if (gdbdev == NODEV && (boothowto & RB_GDB)) {
|
||||
if (gdb_arg == NULL && (boothowto & RB_GDB)) {
|
||||
printf("Warning: no GDB port specified. Defaulting to sio%d.\n",
|
||||
siocnunit);
|
||||
printf("Set flag 0x80 on desired GDB port in your\n");
|
||||
printf("configuration file (currently sio only).\n");
|
||||
siogdbiobase = siocniobase;
|
||||
siogdbunit = siocnunit;
|
||||
gdbdev = makedev(CDEV_MAJOR, siocnunit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, siocnunit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
}
|
||||
@ -4320,7 +4320,7 @@ siogdbattach(port, speed)
|
||||
printf("sio%d: gdb debugging port\n", unit);
|
||||
siogdbunit = unit;
|
||||
#if DDB > 0
|
||||
gdbdev = makedev(CDEV_MAJOR, unit);
|
||||
gdb_arg = makedev(CDEV_MAJOR, unit);
|
||||
gdb_getc = siocngetc;
|
||||
gdb_putc = siocnputc;
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user