Gary J's patches to make gdb -w work properly.

Submitted by:	gj
This commit is contained in:
Jordan K. Hubbard 1995-04-26 01:01:20 +00:00
parent 1067217d5d
commit 38f4846ec5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=8072
6 changed files with 22 additions and 8 deletions

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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);

View file

@ -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

View file

@ -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