summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1995-04-26 01:01:20 +0000
committerjkh <jkh@FreeBSD.org>1995-04-26 01:01:20 +0000
commit81c312becc7e7697e225878f561b49ef3fb42d9a (patch)
tree894508bfcd15f76a563c25b24364a689d5f54ee4
parent27a554f1ab79fda61d1661cdcb1b207e57c315d1 (diff)
downloadFreeBSD-src-81c312becc7e7697e225878f561b49ef3fb42d9a.zip
FreeBSD-src-81c312becc7e7697e225878f561b49ef3fb42d9a.tar.gz
Gary J's patches to make gdb -w work properly.
Submitted by: gj
-rw-r--r--gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c6
-rw-r--r--gnu/usr.bin/gdb/gdb/defs.h1
-rw-r--r--gnu/usr.bin/gdb/gdb/freebsd-nat.c6
-rw-r--r--gnu/usr.bin/gdb/gdb/kcorelow.c4
-rw-r--r--gnu/usr.bin/gdb/gdb/main.c12
-rw-r--r--gnu/usr.bin/gdb/gdb/top.c1
6 files changed, 22 insertions, 8 deletions
diff --git a/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c b/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c
index bc58924..6679060 100644
--- a/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c
+++ b/gnu/usr.bin/binutils/gdb/i386/freebsd-nat.c
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: freebsd-nat.c,v 1.3 1994/12/31 17:00:09 bde Exp $
+ $Id: freebsd-nat.c,v 1.1.1.1 1995/04/23 18:35:38 garyj Exp $
*/
#include <sys/types.h>
@@ -344,9 +344,9 @@ extern CORE_ADDR ksym_lookup(const char *);
kvm_open (efile, cfile, sfile, perm, errout)
char *efile;
char *cfile;
-void *sfile;
+char *sfile; /* makes this kvm_open more compatible to the one in libkvm */
int perm;
-int errout;
+char *errout; /* makes this kvm_open more compatible to the one in libkvm */
{
struct stat stb;
CORE_ADDR addr;
diff --git a/gnu/usr.bin/gdb/gdb/defs.h b/gnu/usr.bin/gdb/gdb/defs.h
index 37631ba..00043ee 100644
--- a/gnu/usr.bin/gdb/gdb/defs.h
+++ b/gnu/usr.bin/gdb/gdb/defs.h
@@ -434,6 +434,7 @@ enum val_prettyprint
#ifdef KERNEL_DEBUG
extern int kernel_debugging;
+extern int kernel_writablecore;
#endif
/* If the xm.h file did not define the mode string used to open the
diff --git a/gnu/usr.bin/gdb/gdb/freebsd-nat.c b/gnu/usr.bin/gdb/gdb/freebsd-nat.c
index bc58924..6679060 100644
--- a/gnu/usr.bin/gdb/gdb/freebsd-nat.c
+++ b/gnu/usr.bin/gdb/gdb/freebsd-nat.c
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: freebsd-nat.c,v 1.3 1994/12/31 17:00:09 bde Exp $
+ $Id: freebsd-nat.c,v 1.1.1.1 1995/04/23 18:35:38 garyj Exp $
*/
#include <sys/types.h>
@@ -344,9 +344,9 @@ extern CORE_ADDR ksym_lookup(const char *);
kvm_open (efile, cfile, sfile, perm, errout)
char *efile;
char *cfile;
-void *sfile;
+char *sfile; /* makes this kvm_open more compatible to the one in libkvm */
int perm;
-int errout;
+char *errout; /* makes this kvm_open more compatible to the one in libkvm */
{
struct stat stb;
CORE_ADDR addr;
diff --git a/gnu/usr.bin/gdb/gdb/kcorelow.c b/gnu/usr.bin/gdb/gdb/kcorelow.c
index debd7d6..ccf27c9 100644
--- a/gnu/usr.bin/gdb/gdb/kcorelow.c
+++ b/gnu/usr.bin/gdb/gdb/kcorelow.c
@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: kcorelow.c,v 1.1 1994/12/30 23:32:56 jkh Exp $
+ $Id: kcorelow.c,v 1.1.1.1 1995/04/23 18:35:48 garyj Exp $
*/
#include "defs.h"
@@ -181,7 +181,7 @@ kcore_open (filename, from_tty)
error ("kgdb could not open the exec-file, please check the name you used !");
core_kd = kvm_open (exec_bfd->filename, filename, NULL,
- write_files? O_RDWR: O_RDONLY, "kgdb: ");
+ kernel_writablecore? O_RDWR: O_RDONLY, "kgdb: ");
if (core_kd < 0)
perror_with_name (filename);
diff --git a/gnu/usr.bin/gdb/gdb/main.c b/gnu/usr.bin/gdb/gdb/main.c
index 5b5b10a..8445b3a 100644
--- a/gnu/usr.bin/gdb/gdb/main.c
+++ b/gnu/usr.bin/gdb/gdb/main.c
@@ -173,6 +173,8 @@ main (argc, argv)
#ifdef KERNEL_DEBUG
{"kernel", no_argument, &kernel_debugging, 1},
{"k", no_argument, &kernel_debugging, 1},
+ {"wcore", no_argument, &kernel_writablecore, 1},
+ {"w", no_argument, &kernel_writablecore, 1},
#endif
/* Allow machine descriptions to add more options... */
#ifdef ADDITIONAL_OPTIONS
@@ -268,6 +270,9 @@ main (argc, argv)
case 'k':
kernel_debugging = 1;
break;
+ case 'w':
+ kernel_writablecore = 1;
+ break;
#endif
#ifdef ADDITIONAL_OPTION_CASES
@@ -350,6 +355,13 @@ Options:\n\
--mapped Use mapped symbol files if supported on this system.\n\
--readnow Fully read symbol files on first access.\n\
", gdb_stdout);
+#ifdef KERNEL_DEBUG
+ fputs_unfiltered ("\
+ --kernel Enable kernel debugging.\n\
+ --wcore Make core file writable (only works for /dev/mem).\n\
+ This option only works while debugging a kernel !!\n\
+", gdb_stdout);
+#endif /* KERNEL_DEBUGGING */
#ifdef ADDITIONAL_OPTION_HELP
fputs_unfiltered (ADDITIONAL_OPTION_HELP, gdb_stdout);
#endif
diff --git a/gnu/usr.bin/gdb/gdb/top.c b/gnu/usr.bin/gdb/gdb/top.c
index 0c693fe..a38e639 100644
--- a/gnu/usr.bin/gdb/gdb/top.c
+++ b/gnu/usr.bin/gdb/gdb/top.c
@@ -322,6 +322,7 @@ jmp_buf quit_return;
#ifdef KERNEL_DEBUG
/* Non-zero means we are debugging a kernel core file */
int kernel_debugging = 0;
+int kernel_writablecore = 0;
#endif
/* Return for reason REASON. This generally gets back to the command
OpenPOWER on IntegriCloud