2006-03-29 Daniel Jacobowitz <dan@codesourcery.com>

* NEWS: Mention the removal of NLM.

2006-03-29  Steve Ellcey  <sje@cup.hp.com>

	* Makefile.in (nlm): Remove target.
	* configure.tgt (i[34567]86-*-netware*): Do not set build_nlm.
	* configure.ac: Remove AC_CONFIG_SUBDIRS of nlm.
	* configure: Regenerate.
	* doc/gdb.texinfo: Remove gdbserve.nlm documentation.
	* nlm: Remove directory.
This commit is contained in:
Daniel Jacobowitz 2006-03-29 22:58:55 +00:00
parent 698ba9341e
commit f4267320e5
17 changed files with 16 additions and 3052 deletions

View File

@ -1,3 +1,16 @@
2006-03-29 Daniel Jacobowitz <dan@codesourcery.com>
* NEWS: Mention the removal of NLM.
2006-03-29 Steve Ellcey <sje@cup.hp.com>
* Makefile.in (nlm): Remove target.
* configure.tgt (i[34567]86-*-netware*): Do not set build_nlm.
* configure.ac: Remove AC_CONFIG_SUBDIRS of nlm.
* configure: Regenerate.
* doc/gdb.texinfo: Remove gdbserve.nlm documentation.
* nlm: Remove directory.
2006-03-29 Daniel Jacobowitz <dan@codesourcery.com>
* Makefile.in (utils.o): Update.

View File

@ -1206,9 +1206,6 @@ $(TUI)$(EXEEXT): tui-main.o libgdb.a $(ADD_DEPS) $(CDEPS) $(TDEPLIBS)
-o $(TUI)$(EXEEXT) tui-main.o libgdb.a \
$(TDEPLIBS) $(TUI_LIBRARY) $(CLIBS) $(LOADLIBES)
nlm: force
rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=all DODIRS=nlm subdir_do
# Create a library of the gdb object files and build GDB by linking
# against that.
#

View File

@ -51,6 +51,8 @@ network sockets or serial ports.
The ARM rdi-share module.
The Netware NLM debug server.
*** Changes in GDB 6.4
* New native configurations

10
gdb/configure vendored
View File

@ -313,7 +313,6 @@ ac_subdirs_all="$ac_subdirs_all doc testsuite"
ac_subdirs_all="$ac_subdirs_all gdbtk"
ac_subdirs_all="$ac_subdirs_all multi-ice"
ac_subdirs_all="$ac_subdirs_all gdbserver"
ac_subdirs_all="$ac_subdirs_all nlm"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os SET_MAKE RANLIB ac_ct_RANLIB ALLOCA USE_NLS MSGFMT GMSGFMT XGETTEXT USE_INCLUDED_LIBINTL CATALOGS CATOBJEXT DATADIRNAME GMOFILES INSTOBJEXT INTLDEPS INTLLIBS INTLOBJS POFILES POSUB INCLUDE_LOCALE_H GT_NO GT_YES MKINSTALLDIRS l localedir PACKAGE subdirs AWK INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LN_S YACC AR ac_ct_AR DLLTOOL ac_ct_DLLTOOL WINDRES ac_ct_WINDRES MIG ac_ct_MIG CONFIG_LDFLAGS TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS WERROR_CFLAGS SER_HARDWIRE WIN32LIBS LIBGUI GUI_CFLAGS_X WIN32LDAPP TCL_VERSION TCL_MAJOR_VERSION TCL_MINOR_VERSION TCL_CC TCL_DEFS TCL_SHLIB_CFLAGS TCL_SHLIB_LD TCL_SHLIB_LD_LIBS TCL_SHLIB_SUFFIX TCL_DL_LIBS TCL_LD_FLAGS TCL_LD_SEARCH_FLAGS TCL_CC_SEARCH_FLAGS TCL_COMPAT_OBJS TCL_RANLIB TCL_BUILD_LIB_SPEC TCL_LIB_SPEC TCL_LIB_VERSIONS_OK TK_VERSION TK_DEFS TK_BUILD_INCLUDES TK_XINCLUDES TK_XLIBSW TK_BUILD_LIB_SPEC TK_LIB_SPEC TCLHDIR TKHDIR ITCLHDIR ITKHDIR ITCL_VERSION ITCL_DEFS ITCL_BUILD_INCLUDES ITCL_BUILD_LIB_SPEC ITCL_LIB_SPEC ITK_VERSION ITK_DEFS ITK_BUILD_INCLUDES ITK_BUILD_LIB_SPEC ITK_LIB_SPEC X_CFLAGS X_LDFLAGS X_LIBS TCL_DEPS TK_DEPS ITCLLIB ITCL_DEPS ITKLIB ITK_DEPS GDBTKLIBS GDBTK_CFLAGS GDBTK_SRC_DIR IGNORE_SIM IGNORE_SIM_OBS ENABLE_CFLAGS PROFILE_CFLAGS CONFIG_OBS CONFIG_DEPS CONFIG_SRCS CONFIG_ALL CONFIG_CLEAN CONFIG_INSTALL CONFIG_UNINSTALL target_subdir frags xm_h tm_h nm_h LIBICONV LIBOBJS LTLIBOBJS'
ac_subst_files='host_makefile_frag target_makefile_frag'
@ -21638,15 +21637,6 @@ echo "${ECHO_T}no" >&6
fi
fi
# We configure the nlm subdirectory on netware targets, as instructed
# by configure.tgt.
if test "x$build_nlm" = xyes; then
subdirs="$subdirs nlm"
fi
# If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or
# nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
# to an empty version.

View File

@ -1513,12 +1513,6 @@ if test "x$target" = "x$host"; then
fi
fi
# We configure the nlm subdirectory on netware targets, as instructed
# by configure.tgt.
if test "x$build_nlm" = xyes; then
AC_CONFIG_SUBDIRS(nlm)
fi
# If hostfile (XM_FILE) and/or targetfile (DEPRECATED_TM_FILE) and/or
# nativefile (NAT_FILE) is not set in config/*/*.m[ht] files, we link
# to an empty version.

View File

@ -96,9 +96,7 @@ i[34567]86-*-linux*) gdb_target=linux
build_gdbserver=yes
;;
i[34567]86-*-gnu*) gdb_target=i386gnu ;;
i[34567]86-*-netware*) gdb_target=i386
build_nlm=yes
;;
i[34567]86-*-netware*) gdb_target=i386 ;;
i[34567]86-*-cygwin*) gdb_target=cygwin ;;
i[34567]86-*-*) gdb_target=i386 ;;

View File

@ -12139,7 +12139,6 @@ want to try.
@menu
* Connecting:: Connecting to a remote target
* Server:: Using the gdbserver program
* NetWare:: Using the gdbserve.nlm program
* Remote configuration:: Remote configuration
* remote stub:: Implementing a remote stub
@end menu
@ -12396,51 +12395,6 @@ program is considered running after the connection.
@end table
@node NetWare
@section Using the @code{gdbserve.nlm} program
@kindex gdbserve.nlm
@code{gdbserve.nlm} is a control program for NetWare systems, which
allows you to connect your program with a remote @value{GDBN} via
@code{target remote}.
@value{GDBN} and @code{gdbserve.nlm} communicate via a serial line,
using the standard @value{GDBN} remote serial protocol.
@table @emph
@item On the target machine,
you need to have a copy of the program you want to debug.
@code{gdbserve.nlm} does not need your program's symbol table, so you
can strip the program if necessary to save space. @value{GDBN} on the
host system does all the symbol handling.
To use the server, you must tell it how to communicate with
@value{GDBN}; the name of your program; and the arguments for your
program. The syntax is:
@smallexample
load gdbserve [ BOARD=@var{board} ] [ PORT=@var{port} ]
[ BAUD=@var{baud} ] @var{program} [ @var{args} @dots{} ]
@end smallexample
@var{board} and @var{port} specify the serial line; @var{baud} specifies
the baud rate used by the connection. @var{port} and @var{node} default
to 0, @var{baud} defaults to 9600@dmn{bps}.
For example, to debug Emacs with the argument @samp{foo.txt}and
communicate with @value{GDBN} over serial port number 2 or board 1
using a 19200@dmn{bps} connection:
@smallexample
load gdbserve BOARD=1 PORT=2 BAUD=19200 emacs foo.txt
@end smallexample
@item
On the @value{GDBN} host machine, connect to your target (@pxref{Connecting,,
Connecting to a remote target}).
@end table
@node Remote configuration
@section Remote configuration

View File

@ -1,176 +0,0 @@
#Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1999
#Free Software Foundation, Inc.
# This file is part of GDB.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
srcdir = @srcdir@
VPATH = @srcdir@
prefix = @prefix@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
target_alias = @target_alias@
program_transform_name = @program_transform_name@
bindir = @bindir@
libdir = @libdir@
tooldir = $(libdir)/$(target_alias)
datadir = @datadir@
mandir = @mandir@
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = @infodir@
htmldir = $(prefix)/html
includedir = @includedir@
SHELL = @SHELL@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
CC_FOR_TARGET = ` \
if [ -f ../../gcc/xgcc ] ; then \
echo ../../gcc/xgcc -B../../gcc/; \
else \
t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
fi`
NLMCONV_FOR_TARGET = ` \
if [ -f ../../binutils/nlmconv ] ; then \
echo ../../binutils/nlmconv; \
else \
t='$(program_transform_name)'; echo nlmconv | sed -e '' $$t; \
fi`
# All the includes used for CFLAGS and for lint.
INCLUDE_CFLAGS = -I. -I${srcdir}
# CFLAGS is specifically reserved for setting from the command line
# when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
CFLAGS = -g
# INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
INTERNAL_CFLAGS = ${CFLAGS} ${INCLUDE_CFLAGS} ${USER_CFLAGS}
LDFLAGS = $(CFLAGS)
# Perhaps should come from parent Makefile
VERSION = gdbserve-4.12
DIST=gdb
# target-dependent makefile fragment come in here.
@target_makefile_frag@
# End target-dependent makefile fragment
# All source files that go into linking GDB remote server.
DEPFILES = $(GDBSERVE_DEPFILES)
SOURCES = $(ALLDEPFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
# Prevent Sun make from putting in the machine type. Setting
# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
.c.o:
${CC_FOR_TARGET} -c ${INTERNAL_CFLAGS} $<
.S.o:
${CC_FOR_TARGET} -c ${INTERNAL_CFLAGS} $<
all: gdbserve.nlm
# Traditionally "install" depends on "all". But it may be useful
# not to; for example, if the user has made some trivial change to a
# source file and doesn't care about rebuilding or just wants to save the
# time it takes for make to check that all is up to date.
# install-only is intended to address that need.
install: all install-only
install-only:
$(INSTALL) gdbserve.nlm $(bindir)/gdbserve.nlm
uninstall: force
rm -f $(bindir)/gdbserve.nlm
installcheck:
check:
info dvi:
install-info:
clean-info:
html:
install-html:
gdbserve.nlm: gdbserve.O $(srcdir)/gdbserve.def
${NLMCONV_FOR_TARGET} -T $(srcdir)/gdbserve.def
gdbserve.O: prelude.o gdbserve.o $(TDEPFILES)
${CC_FOR_TARGET} $(LDFLAGS) -r -o gdbserve.O prelude.o gdbserve.o ${TDEPFILES}
# Put the proper machine-specific files first, so M-. on a machine
# specific routine gets the one for the correct machine.
# The xyzzy stuff below deals with empty DEPFILES
TAGS: ${TAGFILES}
etags `find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \
`find ${srcdir}/../config -name ${XM_FILE} -print` \
`find ${srcdir}/../config -name ${NAT_FILE} -print` \
`for i in yzzy ${DEPFILES}; do \
if [ x$$i != xyzzy ]; then \
echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
fi; \
done` \
${TAGFILES}
tags: TAGS
clean:
rm -f *.o ${ADD_FILES} *~
rm -f gdbserve.O gdbserve.nlm core make.log
distclean: clean TAGS
rm -f config.log config.cache config.status
rm -f Makefile
maintainer-clean realclean: clean
rm -f TAGS
rm -f config.log config.cache config.status
rm -f Makefile
Makefile: Makefile.in config.status @target_makefile_frag_path@
$(SHELL) config.status
config.status: configure
$(SHELL) config.status --recheck
force:
# GNU Make has an annoying habit of putting *all* the Makefile variables
# into the environment, unless you include this target as a circumvention.
# Rumor is that this will be fixed (and this target can be removed)
# in GNU Make 4.0.
.NOEXPORT:
# GNU Make 3.63 has a different problem: it keeps tacking command line
# overrides onto the definition of $(MAKE). This variable setting
# will remove them.
MAKEOVERRIDES=
# This is the end of "Makefile.in".

1089
gdb/nlm/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,55 +0,0 @@
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.12.1)dnl
AC_INIT(gdbserve.c)
AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/../..)
AC_CANONICAL_SYSTEM
AC_ARG_PROGRAM
AC_PROG_INSTALL
# Map target cpu into the config cpu subdirectory name.
# The default is $target_cpu.
changequote(,)dnl
case "${target_cpu}" in
alpha) gdb_target_cpu=alpha ;;
c[12]) gdb_target_cpu=convex ;;
hppa*) gdb_target_cpu=pa ;;
i[34567]86) gdb_target_cpu=i386 ;;
m68*) gdb_target_cpu=m68k ;;
np1) gdb_target_cpu=gould ;;
pn) gdb_target_cpu=gould ;;
pyramid) gdb_target_cpu=pyr ;;
sparc*) gdb_target_cpu=sparc ;;
*) gdb_target_cpu=$target_cpu ;;
esac
changequote([,])dnl
target_makefile_frag=${srcdir}/../config/${gdb_target_cpu}/gdbserve.mt
if [ ! -f ${target_makefile_frag} ]; then
AC_MSG_ERROR("*** GDBSERVE does not support target ${target}")
fi
dnl We have to assign the same value to other variables because autoconf
dnl doesn't provide a mechanism to substitute a replacement keyword with
dnl arbitrary data or pathnames.
dnl
target_makefile_frag_path=$target_makefile_frag
AC_SUBST(target_makefile_frag_path)
AC_SUBST_FILE(target_makefile_frag)
cpufile=`sed -n '
s/CPU_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
' ${target_makefile_frag}
files=
links=
rm -f cpu.h
if [ "${cpufile}" != "" ]; then
files="${files} ${cpufile}.h"
links="${links} cpu.h"
fi
AC_LINK_FILES($files, $links)
AC_OUTPUT(Makefile)

File diff suppressed because it is too large Load Diff

View File

@ -1,42 +0,0 @@
description "GDB debugger stub"
version 1,2
debug
module clib
screenname "System Console"
input gdbserve.O
output gdbserve.nlm
start _Prelude
exit _Stop
import
AllocateResourceTag
ConsolePrintf
GetCurrentScreen
GetNLMHandle
GetThreadID
KillMe
LoadModule
ReadByteAltDebugger
RegisterDebuggerRTag
ResumeThread
SuspendThread
UnRegisterDebugger
WriteByteAltDebugger
_GetCLibNLMLibHandle
_NWRegisterNLMLibraryUser
_SetupArgv
_StartNLM
_TerminateNLM
__GetScreenID
__get_errno_ptr
exit
fprintf
getcmd
memcmp
memcpy
memset
sprintf
strcmp
strcpy
strlen
strnicmp
strtol

View File

@ -1,100 +0,0 @@
#include <dfs.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include <conio.h>
#include <advanced.h>
#include <debugapi.h>
#include <process.h>
#include <errno.h>
#include "i386.h"
extern char *mem2hex (void *mem, char *buf, int count, int may_fault);
extern char *hex2mem (char *buf, void *mem, int count, int may_fault);
extern int computeSignal (int exceptionVector);
void
flush_i_cache (void)
{
}
/* Get the registers out of the frame information. */
void
frame_to_registers (struct StackFrame *frame, char *regs)
{
/* Copy EAX -> EDI */
mem2hex (&frame->ExceptionEAX, &regs[0 * 4 * 2], 4 * 8, 0);
/* Copy EIP & PS */
mem2hex (&frame->ExceptionPC, &regs[8 * 4 * 2], 4 * 2, 0);
/* Copy CS, SS, DS */
mem2hex (&frame->ExceptionCS, &regs[10 * 4 * 2], 4 * 3, 0);
/* Copy ES */
mem2hex (&frame->ExceptionES, &regs[13 * 4 * 2], 4 * 1, 0);
/* Copy FS & GS */
mem2hex (&frame->ExceptionFS, &regs[14 * 4 * 2], 4 * 2, 0);
}
/* Put the registers back into the frame information. */
void
registers_to_frame (char *regs, struct StackFrame *frame)
{
/* Copy EAX -> EDI */
hex2mem (&regs[0 * 4 * 2], &frame->ExceptionEAX, 4 * 8, 0);
/* Copy EIP & PS */
hex2mem (&regs[8 * 4 * 2], &frame->ExceptionPC, 4 * 2, 0);
/* Copy CS, SS, DS */
hex2mem (&regs[10 * 4 * 2], &frame->ExceptionCS, 4 * 3, 0);
/* Copy ES */
hex2mem (&regs[13 * 4 * 2], &frame->ExceptionES, 4 * 1, 0);
/* Copy FS & GS */
hex2mem (&regs[14 * 4 * 2], &frame->ExceptionFS, 4 * 2, 0);
}
void
set_step_traps (struct StackFrame *frame)
{
frame->ExceptionSystemFlags |= 0x100;
}
void
clear_step_traps (struct StackFrame *frame)
{
frame->ExceptionSystemFlags &= ~0x100;
}
void
do_status (char *ptr, struct StackFrame *frame)
{
int sigval;
sigval = computeSignal (frame->ExceptionNumber);
sprintf (ptr, "T%02x", sigval);
ptr += 3;
sprintf (ptr, "%02x:", PC_REGNUM);
ptr = mem2hex (&frame->ExceptionPC, ptr + 3, 4, 0);
*ptr++ = ';';
sprintf (ptr, "%02x:", SP_REGNUM);
ptr = mem2hex (&frame->ExceptionESP, ptr + 3, 4, 0);
*ptr++ = ';';
sprintf (ptr, "%02x:", DEPRECATED_FP_REGNUM);
ptr = mem2hex (&frame->ExceptionEBP, ptr + 3, 4, 0);
*ptr++ = ';';
*ptr = '\000';
}

View File

@ -1,13 +0,0 @@
/* Register values. All of these values *MUST* agree with tm.h */
#define SP_REGNUM 4 /* Contains address of top of stack */
#define PC_REGNUM 8 /* Contains program counter */
#define DEPRECATED_FP_REGNUM 5 /* Virtual frame pointer */
#define NUM_REGS 16 /* Number of machine registers */
#define REGISTER_BYTES (NUM_REGS * 4) /* Total size of registers array */
#define ExceptionPC ExceptionEIP
#define DECR_PC_AFTER_BREAK 1 /* int 3 leaves PC pointing after insn */
#define BREAKPOINT {0xcc}
#define BREAKPOINT_SIZE (sizeof breakpoint_insn)
#define StackFrame T_TSS_StackFrame

View File

@ -1,244 +0,0 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <errno.h>
#include <nwtypes.h>
#include <nwdfs.h>
#include <nwconio.h>
#include <nwadv.h>
#include <nwdbgapi.h>
#include <nwthread.h>
#include "ppc.h"
extern char *mem2hex (void *mem, char *buf, int count, int may_fault);
extern char *hex2mem (char *buf, void *mem, int count, int may_fault);
extern int computeSignal (int exceptionVector);
void
flush_i_cache (void)
{
}
/* Get the registers out of the frame information. */
void
frame_to_registers (struct StackFrame *frame, char *regs)
{
mem2hex (&frame->ExceptionState.CsavedRegs, &regs[GP0_REGNUM * 4 * 2], 4 * 32, 0);
mem2hex (&frame->ExceptionState.CSavedFPRegs, &regs[FP0_REGNUM * 4 * 2], 4 * 32, 0);
mem2hex (&frame->ExceptionPC, &regs[PC_REGNUM * 4 * 2], 4 * 1, 0);
mem2hex (&frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedSRR1, &regs[CR_REGNUM * 4 * 2], 4 * 1, 0);
mem2hex (&frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedLR, &regs[LR_REGNUM * 4 * 2], 4 * 1, 0);
mem2hex (&frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedCTR, &regs[CTR_REGNUM * 4 * 2], 4 * 1, 0);
mem2hex (&frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedXER, &regs[XER_REGNUM * 4 * 2], 4 * 1, 0);
mem2hex (&frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedMQ, &regs[MQ_REGNUM * 4 * 2], 4 * 1, 0);
}
/* Put the registers back into the frame information. */
void
registers_to_frame (char *regs, struct StackFrame *frame)
{
hex2mem (&regs[GP0_REGNUM * 4 * 2], &frame->ExceptionState.CsavedRegs, 4 * 32, 0);
hex2mem (&regs[FP0_REGNUM * 4 * 2], &frame->ExceptionState.CSavedFPRegs, 4 * 32, 0);
hex2mem (&regs[PC_REGNUM * 4 * 2], &frame->ExceptionPC, 4 * 1, 0);
hex2mem (&regs[CR_REGNUM * 4 * 2], &frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedSRR1, 4 * 1, 0);
hex2mem (&regs[LR_REGNUM * 4 * 2], &frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedLR, 4 * 1, 0);
hex2mem (&regs[CTR_REGNUM * 4 * 2], &frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedCTR, 4 * 1, 0);
hex2mem (&regs[XER_REGNUM * 4 * 2], &frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedXER, 4 * 1, 0);
hex2mem (&regs[MQ_REGNUM * 4 * 2], &frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedMQ, 4 * 1, 0);
}
extern volatile int mem_err;
#ifdef ALTERNATE_MEM_FUNCS
extern int ReadByteAltDebugger (char* addr, char *theByte);
extern int WriteByteAltDebugger (char* addr, char theByte);
int
get_char (char *addr)
{
char c;
if (!ReadByteAltDebugger (addr, &c))
mem_err = 1;
return c;
}
void
set_char (char *addr, int val)
{
if (!WriteByteAltDebugger (addr, val))
mem_err = 1;
}
#endif
int
mem_write (char *dst, char *src, int len)
{
while (len-- && !mem_err)
set_char (dst++, *src++);
return mem_err;
}
union inst
{
LONG l;
struct
{
union
{
struct /* Unconditional branch */
{
unsigned opcode : 6; /* 18 */
signed li : 24;
unsigned aa : 1;
unsigned lk : 1;
} b;
struct /* Conditional branch */
{
unsigned opcode : 6; /* 16 */
unsigned bo : 5;
unsigned bi : 5;
signed bd : 14;
unsigned aa : 1;
unsigned lk : 1;
} bc;
struct /* Conditional branch to ctr or lr reg */
{
unsigned opcode : 6; /* 19 */
unsigned bo : 5;
unsigned bi : 5;
unsigned type : 15; /* 528 = ctr, 16 = lr */
unsigned lk : 1;
} bclr;
} variant;
} inst;
};
static LONG saved_inst;
static LONG *saved_inst_pc = 0;
static LONG saved_target_inst;
static LONG *saved_target_inst_pc = 0;
void
set_step_traps (struct StackFrame *frame)
{
union inst inst;
LONG *target;
int opcode;
int ra, rb;
LONG *pc = (LONG *)frame->ExceptionPC;
inst.l = *pc++;
opcode = inst.inst.variant.b.opcode;
target = pc;
switch (opcode)
{
case 18: /* Unconditional branch */
if (inst.inst.variant.b.aa) /* Absolute? */
target = 0;
target += inst.inst.variant.b.li;
break;
case 16: /* Conditional branch */
if (!inst.inst.variant.bc.aa) /* Absolute? */
target = 0;
target += inst.inst.variant.bc.bd;
break;
case 19: /* Cond. branch via ctr or lr reg */
switch (inst.inst.variant.bclr.type)
{
case 528: /* ctr */
target = (LONG *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedCTR;
break;
case 16: /* lr */
target = (LONG *)frame->ExceptionState.u.SpecialRegistersEnumerated.CsavedLR;
break;
}
break;
}
saved_inst = *pc;
mem_write (pc, breakpoint_insn, BREAKPOINT_SIZE);
saved_inst_pc = pc;
if (target != pc)
{
saved_target_inst = *target;
mem_write (target, breakpoint_insn, BREAKPOINT_SIZE);
saved_target_inst_pc = target;
}
}
/* Remove step breakpoints. Returns non-zero if pc was at a step breakpoint,
zero otherwise. This routine works even if there were no step breakpoints
set. */
int
clear_step_traps (struct StackFrame *frame)
{
int retcode;
LONG *pc = (LONG *)frame->ExceptionPC;
if (saved_inst_pc == pc || saved_target_inst_pc == pc)
retcode = 1;
else
retcode = 0;
if (saved_inst_pc)
{
mem_write (saved_inst_pc, saved_inst, BREAKPOINT_SIZE);
saved_inst_pc = 0;
}
if (saved_target_inst_pc)
{
mem_write (saved_target_inst_pc, saved_target_inst, BREAKPOINT_SIZE);
saved_target_inst_pc = 0;
}
return retcode;
}
void
do_status (char *ptr, struct StackFrame *frame)
{
int sigval;
sigval = computeSignal (frame->ExceptionNumber);
sprintf (ptr, "T%02x", sigval);
ptr += 3;
sprintf (ptr, "%02x:", PC_REGNUM);
ptr = mem2hex (&frame->ExceptionPC, ptr + 3, 4, 0);
*ptr++ = ';';
sprintf (ptr, "%02x:", SP_REGNUM);
ptr = mem2hex (&frame->ExceptionState.CsavedRegs[SP_REGNUM], ptr + 3, 4, 0);
*ptr++ = ';';
sprintf (ptr, "%02x:", LR_REGNUM);
ptr = mem2hex (&frame->ExceptionState.CsavedRegs[LR_REGNUM], ptr + 3, 4, 0);
*ptr++ = ';';
*ptr = '\000';
}

View File

@ -1,165 +0,0 @@
typedef long Long;
/* The following enum is used to access the special registers in
the saved machine state. */
typedef enum
{
kDc_SavedPC = 0, /* really SRR0 */
kDc_SavedMSR = 1, /* really SRR1 */
kDc_SavedCR = 2,
kDc_SavedLR = 3,
kDc_SavedDSISR = 4,
kDc_SavedDAR = 5,
kDc_SavedXER = 6,
kDc_SavedCTR = 7,
kDc_SavedSDR1 = 8,
kDc_SavedRTCU = 9,
kDc_SavedRTCL = 10,
kDc_SavedDEC = 11,
kDc_SavedSR00 = 12, /* The Segement Registers are consecutive */
kDc_SavedSR01 = 13, /* kDc_SavedSR00 + n is supported */
kDc_SavedSR02 = 14,
kDc_SavedSR03 = 15,
kDc_SavedSR04 = 16,
kDc_SavedSR05 = 17,
kDc_SavedSR06 = 18,
kDc_SavedSR07 = 19,
kDc_SavedSR08 = 20,
kDc_SavedSR09 = 21,
kDc_SavedSR10 = 22,
kDc_SavedSR11 = 23,
kDc_SavedSR12 = 24,
kDc_SavedSR13 = 25,
kDc_SavedSR14 = 26,
kDc_SavedSR15 = 27,
kDc_SavedFPSCR = 29,
kDc_SavedMQ = 30,
kDc_SavedBAT0U = 31,
kDc_SavedBAT0L = 32,
kDc_SavedBAT1U = 33,
kDc_SavedBAT1L = 34,
kDc_SavedBAT2U = 35,
kDc_SavedBAT2L = 36,
kDc_SavedBAT3U = 37,
kDc_SavedBAT3L = 38,
kNumberSpecialRegisters = 39
} Dc_SavedRegisterName;
/* Access to floating points is not very easy. This allows the number to be
accessed both as a floating number and as a pair of Longs. */
typedef union
{
double asfloat; /* access the variable as a floating number */
struct
{
Long high;
Long low;
}
asLONG; /* access the variable as two Longs */
} FloatingPoints;
/* The following is the standard record for Saving a machine state */
struct SavedMachineState
{
FloatingPoints CSavedFPRegs[32]; /* The floating point registers [0->31] */
/* ***32bit assumption*** */
Long CsavedRegs[32]; /* space to save the General Registers */
/* These are saved 0->31 */
Long CexReason;
Long SavedDomainID;
union
{ /* must be 8-byte aligned, so doubleFPSCR is 8-byte aligned */
struct
{
Long CsavedSRR0; /* Index 0 - The saved PC */
Long CsavedSRR1; /* 1 saved MSR */
Long CsavedCR; /* 2 */
Long CsavedLR; /* 3 */
Long CsavedDSISR; /* 4 */
Long CsavedDAR; /* 5 */
Long CsavedXER; /* 6 */
Long CsavedCTR; /* 7 */
Long CsavedSDR1; /* 8 */
Long CsavedRTCU; /* 9 */
Long CsavedRTCL; /* 10 */
Long CsavedDEC; /* 11 */
Long CsavedSR0; /* 12 */
Long CsavedSR1; /* 13 */
Long CsavedSR2; /* 14 */
Long CsavedSR3; /* 15 */
Long CsavedSR4; /* 16 */
Long CsavedSR5; /* 17 */
Long CsavedSR6; /* 18 */
Long CsavedSR7; /* 19 */
Long CsavedSR8; /* 20 */
Long CsavedSR9; /* 21 */
Long CsavedSR10; /* 22 */
Long CsavedSR11; /* 23 */
Long CsavedSR12; /* 24 */
Long CsavedSR13; /* 25 */
Long CsavedSR14; /* 26 */
Long CsavedSR15; /* 27 */
/* CdoubleFPSCR must be double word aligned */
Long CdoubleFPSCR; /* 28 this is the upper part of the store and has
no meaning */
Long CsavedFPSCR; /* 29 */
Long CsavedMQ; /* 30 */
Long CsavedBAT0U; /* 31 */
Long CsavedBAT0L; /* 32 */
Long CsavedBAT1U; /* 33 */
Long CsavedBAT1L; /* 34 */
Long CsavedBAT2U; /* 35 */
Long CsavedBAT2L; /* 36 */
Long CsavedBAT3U; /* 37 */
Long CsavedBAT3L; /* 38 */
}
SpecialRegistersEnumerated;
Long SpecialRegistersIndexed[kNumberSpecialRegisters];
} u;
Long Padding[3]; /* Needed for quad-word alignment */
};
struct StackFrame
{
LONG *ExceptionDomainID;
/*ProcessorStructure*/ int *ExceptionProcessorID;
BYTE *ExceptionDescription;
LONG ExceptionFlags;
LONG ExceptionErrorCode;
LONG ExceptionNumber;
struct SavedMachineState ExceptionState;
};
/* Register values. All of these values *MUST* agree with tm.h */
#define GP0_REGNUM 0 /* GPR register 0 */
#define SP_REGNUM 1 /* Contains address of top of stack */
#define FP0_REGNUM 32 /* FPR (Floating point) register 0 */
#define PC_REGNUM 64 /* Contains program counter */
#define PS_REGNUM 65 /* Processor (or machine) status (%msr) */
#define CR_REGNUM 66 /* Condition register */
#define LR_REGNUM 67 /* Link register */
#define CTR_REGNUM 68 /* Count register */
#define XER_REGNUM 69 /* Fixed point exception registers */
#define MQ_REGNUM 70 /* Multiply/quotient register */
#define NUM_REGS 71 /* Number of machine registers */
#define REGISTER_BYTES (420) /* Total size of registers array */
#define ExceptionPC ExceptionState.u.SpecialRegistersEnumerated.CsavedSRR0
#define DECR_PC_AFTER_BREAK 0 /* PPCs get this right! */
#define BREAKPOINT {0x7d, 0x82, 0x10, 0x08}
extern unsigned char breakpoint_insn[];
#define BREAKPOINT_SIZE 4
#if 0
#define ALTERNATE_MEM_FUNCS /* We need our own get_char/set_char */
#endif
extern int get_char (char *addr);
extern void set_char (char *addr, int val);

View File

@ -1,67 +0,0 @@
/*===========================================================================
= Novell Standard C Library for NetWare Loadable Modules
=
= Unpublished Copyright (C) 1993 by Novell, Inc. All rights reserved.
=
= No part of this file may be duplicated, revised, translated, localized or
= modified in any manner or compiled, linked or uploaded or downloaded to or
= from any computer system without the prior written consent of Novell, Inc.
==============================================================================
= The object produced by compiling this file is for use by the client of this
= library and is not linked in; Prelude.Obj is therefore one of the files to
= be distributed with CLib.NLM and its headers.
==============================================================================
*/
#include <stddef.h>
#if defined(__netware__) && defined(__i386__)
#define TERMINATE_BY_UNLOAD 5
#else
#include <nwpre.h>
#endif
/*#include "libhooks.h"*/
extern int main (int, char **);
static int NLMID;
void _Stop( void )
{
_TerminateNLM(NLMID, NULL, TERMINATE_BY_UNLOAD);
}
int _cstart_( void )
{
return _SetupArgv(main);
}
int _Prelude
(
int NLMHandle,
int initErrorScreenID,
char *commandLine,
char *loadDirectoryPath,
int uninitializedDataLength,
int NLMFileHandle,
int (*readRoutineP)(),
int customDataOffset,
int customDataSize
)
{
int rc;
rc = _StartNLM(NLMHandle,
initErrorScreenID,
commandLine,
loadDirectoryPath,
uninitializedDataLength,
NLMFileHandle,
readRoutineP,
customDataOffset,
customDataSize,
&NLMID,
_cstart_);
return rc;
}