|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T u
Length: 2248 (0x8c8) Types: TextFile Names: »utrace.c«
└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89 └─⟦ff23ba0e6⟧ »./ghostscript-1.3.tar.Z« └─⟦a24a58cd3⟧ └─⟦this⟧ »utrace.c«
/* Copyright (C) 1989 Aladdin Enterprises. All rights reserved. Distributed by Free Software Foundation, Inc. This file is part of Ghostscript. Ghostscript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the Ghostscript General Public License for full details. Everyone is granted permission to copy, modify and redistribute Ghostscript, but only under the conditions described in the Ghostscript General Public License. A copy of this license is supposed to have been given to you along with Ghostscript so you can know your rights and responsibilities. It should be in a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. */ /* utrace.c */ /* Dummy tracing package for Unix C */ #include <stdio.h> #include <setjmp.h> #include "std.h" /* This file replaces trace.c for Unix. */ /* It has only the stack parsing functionality of trace.c -- */ /* the tracing procedures are stubs. */ char * strupr(char *str) { return str; } /* Enumerate a symbol file */ char * trace_next_symbol(char **paddr, FILE *mapf) { return NULL; } /* Look up a symbol in a file */ char * trace_find_symbol(char *name, FILE *mapf) { return NULL; } int trace_flush_flag; /* Trace a named procedure */ int trace_name(char *name, FILE *mapf, char *arg_format, int retsize) { return -1; } /* Trace a procedure */ int trace(void (*proc)(), char *name, char *arg_format, int retsize) { return -1; } /* ------ Stack parsing ------ */ /* Forward declarations */ char *stack_next_frame(P1(char *)); /* Get the address of the caller's frame */ char * stack_top_frame() { jmp_buf buf; setjmp(buf); /* acquire registers */ return stack_next_frame((char *)buf[0]); } /* Get the return address of a frame. */ unsigned long stack_return(char *bp) { return *(unsigned long *)(bp + 16); } /* Get the address of the next higher frame, */ /* or 0 if there is none. */ char * stack_next_frame(char *bp) { char *nbp = *(char **)(bp + 12); if ( nbp < bp ) return 0; return nbp; }