diff options
author | Jordan K. Hubbard <jkh@FreeBSD.org> | 1995-04-26 01:01:20 +0000 |
---|---|---|
committer | Jordan K. Hubbard <jkh@FreeBSD.org> | 1995-04-26 01:01:20 +0000 |
commit | 38f4846ec58a54cd980398707558803ff33c63ff (patch) | |
tree | 894508bfcd15f76a563c25b24364a689d5f54ee4 /gnu/usr.bin/gdb | |
parent | 1067217d5d6b6f2356596dc736a433c13af4be72 (diff) | |
download | src-38f4846ec58a54cd980398707558803ff33c63ff.tar.gz src-38f4846ec58a54cd980398707558803ff33c63ff.zip |
Gary J's patches to make gdb -w work properly.
Submitted by: gj
Notes
Notes:
svn path=/head/; revision=8072
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r-- | gnu/usr.bin/gdb/gdb/defs.h | 1 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/gdb/freebsd-nat.c | 6 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/gdb/kcorelow.c | 4 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/gdb/main.c | 12 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/gdb/top.c | 1 |
5 files changed, 19 insertions, 5 deletions
diff --git a/gnu/usr.bin/gdb/gdb/defs.h b/gnu/usr.bin/gdb/gdb/defs.h index 37631ba1ed33..00043ee2e928 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 bc58924996dc..6679060cfa64 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 debd7d6114b2..ccf27c978f64 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 5b5b10a580a5..8445b3a06813 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 0c693feff3cb..a38e639661ff 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 |