1
0

Source code upload

This commit is contained in:
calmsacibis995
2022-09-29 17:59:04 +03:00
parent 72fa9da3d7
commit 8fc8fa8089
33399 changed files with 11964078 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
#!smake
########
# Defs...
#
HFILES = \
dmalloc.h \
stacktrace.h \
$(NULL)
CFILES = \
dmalloc.c \
dmalloc_q.c \
stacktrace.c \
$(NULL)
ASFILES = \
stacktrace_s.s \
$(NULL)
#
# Note, due to bug #308776, everything must be
# in the very first member of _RLD_LIST,
# so we can't just let the subdir make its own .so.
#
#OSPATCHES = ospatches/dmalloc_patches.a
# but there aren't any currently, and ld doesn't like an empty archive...
#OSPATCHES =
LLDLIBS = $(OSPATCHES) -lmpc -lexc $(LIBMLD) -lmangle
# -init is not understood by cc, so encode it with -Wl to get it to ld
LLDOPTS = -Wl,-init,_malloc_init
LCDEFS = -DRELEASE_MAJOR=$(RELEASE_MAJOR)
TARGETS = \
libdmalloc.a \
libdmalloc.so \
libdmalloc.-g.a \
libdmalloc.-g.so \
$(NULL)
LDIRT = main *.bak tags
# -mips2 is the default on 6.2 systems, but we want
# to be able to run on R3000 5.3 systems, so make mips1 the default
include $(ROOT)/usr/include/make/releasedefs
include versiondefs
# Keep commondefs from including releasedefs again...
# NO_RELEASEDEFS=
include $(ROOT)/usr/include/make/commondefs
#if !defined(LIBBITSUF) || empty(LIBBITSUF)
#LIBMLD = -lmld
#else
LIBMLD =
#endif
########
# Rules...
#
libdmalloc.a: $@($(OBJECTS) ) MAKELIB
libdmalloc.-g.a: $@($(OBJECTS:.o=.-g.o)) MAKELIB
.SUFFIXES: .-g.o .a .so
#
# Rule for making a -g.o from a .c or .s
#
.c.-g.o .s.-g.o:
$(CCF:N-O*) -g -c $< -o $@
#
# Rule for making a .so from a .c, .s, .o, or .a
#
.c.so .s.so .o.so .a.so:
$(CCF) $(LDOPTS) $(LDDSOOPTS) $< $(LDLIBS) $(ENDIAN) -o $@
# ARGH! to keep it from trying to make libc.so from libc.a...
$(ROOT)/usr/lib$(LIBBITSUF)/libc.so:
just make sure there's a command here, it need not make sense
#
# The links to libmutex (the smallest DSO I could find)
# serves as stubs so that N32 and N64 programs can run
# when _RLD_LIST is set, since there is no N32 or N64 libdmalloc.
#
$(COMMONPREF)install! $(COMMONPREF)default
$(INSTALL) -idb dmalloc.eoe.dsos -F /usr/lib$(LIBBITSUF) -m 444 -O $(TARGETS:M*.so)
$(INSTALL) -idb dmalloc.dev.static -F /usr/lib$(LIBBITSUF) -m 444 $(TARGETS:M*.a)
#if !defined(LIBBITSUF) || empty(LIBBITSUF)
$(INSTALL) -idb dmalloc.dev.headers -F /usr/include -m 444 $(HFILES)
$(INSTALL) -idb dmalloc.src.dmalloc -m 755 -dir /usr/share/src/dmalloc/src
$(INSTALL) -idb dmalloc.src.dmalloc -f /usr/share/src/dmalloc/src -m 644 $(SOURCES) Makefile versiondefs
#endif
include $(COMMONRULES)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,68 @@
/*
* Copyright 1996, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that (i) the above copyright notices and this
* permission notice appear in all copies of the software and related
* documentation, and (ii) the name of Silicon Graphics may not be
* used in any advertising or publicity relating to the software
* without the specific, prior written permission of Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL,
* INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY
* THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* dmalloc.h
*/
#ifndef __dmalloc_h_
#define __dmalloc_h_
# ifdef __cplusplus
extern "C" {
# endif
extern void malloc_reset();
extern void malloc_info(int show_nonleaks, int stacktrace_depth);
extern void malloc_info_cleanup();
extern void malloc_failed();
extern void malloc_init_function();
extern int malloc_stacktrace_get_depth;
extern int malloc_fillarea;
extern int malloc_check();
extern int malloc_check_during(char *during);
extern int malloc_isgoodblock(void *);
extern int malloc_isgoodblock_during(void *, char *during);
extern void malloc_of_interest();
extern void malloc_bad();
# ifdef __cplusplus
};
# endif
#endif /* __dmalloc_h_ */

View File

@@ -0,0 +1,52 @@
/*
* Copyright 1996, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that (i) the above copyright notices and this
* permission notice appear in all copies of the software and related
* documentation, and (ii) the name of Silicon Graphics may not be
* used in any advertising or publicity relating to the software
* without the specific, prior written permission of Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL,
* INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY
* THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* dmalloc_q.c
*
* Function that gets called right before the first malloc.
* We quarantine this function so that the application
* can redefine it without getting a warning from the linker.
*/
#include "dmalloc.h"
extern void
malloc_init_function()
{
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,75 @@
/*
* Copyright 1996, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that (i) the above copyright notices and this
* permission notice appear in all copies of the software and related
* documentation, and (ii) the name of Silicon Graphics may not be
* used in any advertising or publicity relating to the software
* without the specific, prior written permission of Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL,
* INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY
* THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* stacktrace.h
*/
#ifndef __stacktrace_h_
#define __stacktrace_h_
# ifdef __cplusplus
extern "C" {
# endif
/* XXX some of this is defunct */
extern void initstacktrace(char **argv);
extern int stacktrace (char *filename, int startpc, int startsp,
int regs[], int (*getword)(unsigned));
extern int stacktrace_print(int skip);
extern int stacktrace_get(int skip, int n, void *trace[]);
extern int simple_stacktrace_write(int fd, char *fmt, char *executable,
int n, void *trace[]);
extern int simple_stacktrace_print(int fd, char *fmt, int skip, int n);
extern void stacktrace_cleanup();
extern char *stacktrace_get_argv0();
extern void stacktrace_set_argv0(const char *);
extern char *stacktrace_get_executable();
extern void stacktrace_set_executable(const char *);
extern void stacktrace_get_ffl(void *pc,
char *fun, char *file, int *line,
int funbufsiz, int filebufsiz);
# ifdef __cplusplus
}
# endif
#endif /* __stacktrace_h_ */

View File

@@ -0,0 +1,101 @@
/*
* Copyright 1996, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
*
* UNPUBLISHED -- Rights reserved under the copyright laws of the United
* States. Use of a copyright notice is precautionary only and does not
* imply publication or disclosure.
*
* U.S. GOVERNMENT RESTRICTED RIGHTS LEGEND:
* Use, duplication or disclosure by the Government is subject to restrictions
* as set forth in FAR 52.227.19(c)(2) or subparagraph (c)(1)(ii) of the Rights
* in Technical Data and Computer Software clause at DFARS 252.227-7013 and/or
* in similar or successor clauses in the FAR, or the DOD or NASA FAR
* Supplement. Contractor/manufacturer is Silicon Graphics, Inc.,
* 2011 N. Shoreline Blvd. Mountain View, CA 94039-7311.
*
* Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without
* fee, provided that (i) the above copyright notices and this
* permission notice appear in all copies of the software and related
* documentation, and (ii) the name of Silicon Graphics may not be
* used in any advertising or publicity relating to the software
* without the specific, prior written permission of Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SILICON GRAPHICS BE LIABLE FOR ANY SPECIAL,
* INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY
* DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY
* THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE
* OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* stacktrace_s.s
*/
#include <sys/regdef.h>
#include <sys/asm.h>
/*
void *_stacktrace_get_pc();
*/
LEAF(_stacktrace_get_pc)
move v0,ra /* our ra is pc of the caller, I hope */
j ra
END(_stacktrace_get_pc)
/*
void *_stacktrace_get_sp();
*/
LEAF(_stacktrace_get_sp)
move v0,sp /* this is a leaf so sp doesn't change, I hope */
j ra
END(_stacktrace_get_sp)
/*
void _stacktrace_get_regs(void *regs[32]);
*/
LEAF(_stacktrace_get_regs)
sw $31, 31*4(a0) /* XXX not right, but this app doesn't care */
sw $30, 30*4(a0)
sw $29, 29*4(a0)
sw $28, 28*4(a0)
sw $27, 27*4(a0)
sw $26, 26*4(a0)
sw $25, 25*4(a0)
sw $24, 24*4(a0)
sw $23, 23*4(a0)
sw $22, 22*4(a0)
sw $21, 21*4(a0)
sw $20, 20*4(a0)
sw $19, 19*4(a0)
sw $18, 18*4(a0)
sw $17, 17*4(a0)
sw $16, 16*4(a0)
sw $15, 15*4(a0)
sw $14, 14*4(a0)
sw $13, 13*4(a0)
sw $12, 12*4(a0)
sw $11, 11*4(a0)
sw $10, 10*4(a0)
sw $9, 9*4(a0)
sw $8, 8*4(a0)
sw $7, 7*4(a0)
sw $6, 6*4(a0)
sw $5, 5*4(a0)
sw $4, 4*4(a0)
sw $3, 3*4(a0)
sw $2, 2*4(a0)
/* sw $1, 1*4(a0) */
sw $0, 0*4(a0)
j ra
END(_stacktrace_get_regs)

View File

@@ -0,0 +1,6 @@
# -mips2 is the default on 6.2 systems, but we want
# to be able to run on R3000 5.3 systems, so make mips1 the default
DEF_OBJECT_STYLE=32_M1
# and since commondefs doesn't know about mips1 any more...
DEF_CSTYLE=$(CSTYLE_32_M2:S/-mips2/-mips1/)
DEF_GLDOPTS=$(GLDOPTS_32_M2:S/-mips2/-mips1/)