Get rid of extern declarations on gdb stuff so systems compiled without

DDB will compile. Warn users that try to use GDB without specifying a GDB
port in their configuration file.
This commit is contained in:
Kirk McKusick 1999-05-07 23:08:23 +00:00
parent ac065b7037
commit 5c92a5b353
3 changed files with 27 additions and 13 deletions

View File

@ -23,7 +23,7 @@
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*
* $Id: db_command.c,v 1.28 1998/07/08 10:53:45 bde Exp $
* $Id: db_command.c,v 1.29 1999/01/14 06:22:01 jdp Exp $
*/
/*
@ -535,6 +535,8 @@ db_fncall(dummy1, dummy2, dummy3, dummy4)
/* Enter GDB remote protocol debugger on the next trap. */
dev_t gdbdev;
static void
db_gdb (dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy1;
@ -542,6 +544,12 @@ db_gdb (dummy1, dummy2, dummy3, dummy4)
db_expr_t dummy3;
char * dummy4;
{
if (gdbdev == -1) {
db_printf("No gdb port enabled. Set flag 0x80 on desired port\n");
db_printf("in your configuration file (currently sio only).\n");
return;
}
boothowto ^= RB_GDB;
db_printf("Next trap will enter %s\n",

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sio.c,v 1.231 1999/05/07 10:10:42 phk Exp $
* $Id: sio.c,v 1.232 1999/05/07 17:52:01 mjacob Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@ -2646,9 +2646,9 @@ CONS_DRIVER(sio, siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc);
/*
* Routines to support GDB on an sio port.
*/
extern dev_t gdbdev;
extern cn_getc_t *gdb_getc;
extern cn_putc_t *gdb_putc;
dev_t gdbdev;
cn_getc_t *gdb_getc;
cn_putc_t *gdb_putc;
#endif
@ -2865,8 +2865,11 @@ 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 == -1) {
printf("sio%d: gdb debugging port\n", siocnunit);
if (gdbdev == -1 && (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);

View File

@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sio.c,v 1.231 1999/05/07 10:10:42 phk Exp $
* $Id: sio.c,v 1.232 1999/05/07 17:52:01 mjacob Exp $
* from: @(#)com.c 7.5 (Berkeley) 5/16/91
* from: i386/isa sio.c,v 1.234
*/
@ -2646,9 +2646,9 @@ CONS_DRIVER(sio, siocnprobe, siocninit, siocngetc, siocncheckc, siocnputc);
/*
* Routines to support GDB on an sio port.
*/
extern dev_t gdbdev;
extern cn_getc_t *gdb_getc;
extern cn_putc_t *gdb_putc;
dev_t gdbdev;
cn_getc_t *gdb_getc;
cn_putc_t *gdb_putc;
#endif
@ -2865,8 +2865,11 @@ 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 == -1) {
printf("sio%d: gdb debugging port\n", siocnunit);
if (gdbdev == -1 && (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);