Files
mercury/trace/mercury_trace_util.c
Simon Taylor b7c4a317e9 Add MR_ prefixes to the remaining non-prefixed symbols.
Estimated hours taken: 4
Branches: main

Add MR_ prefixes to the remaining non-prefixed symbols.

This change will require all workspaces to be updated
The compiler will start generating references to MR_TRUE,
MR_bool, etc., which are not defined in the old runtime
header files.

runtime/mercury_std.h:
	Add MR_ prefixes to bool, TRUE, FALSE, max, min,
	streq, strdiff, strtest, strntest, strneq, strndiff,
	strntest, NO_RETURN.

	Delete a commented out definition of `reg'.

runtime/mercury_tags.h:
	Add an MR_ prefix to TAGBITS.

configure.in:
runtime/mercury_goto.h:
runtime/machdeps/i386_regs.h/mercury_goto.h:
	Add an MR_ prefix to PIC.

runtime/mercury_conf_param.h:
	Allow non-prefixed PIC and HIGHTAGS to be defined on
	the command line.

runtime/mercury_bootstrap.h:
	Add backwards compatibility definitions.

RESERVED_MACRO_NAMES:
	Remove the renamed macros.

compiler/export.m:
compiler/ml_code_gen.m:
	Use MR_bool rather than MR_Bool (MR_Bool is
	meant to be for references to the Mercury type
	bool__bool).

runtime/mercury_types.h:
	Add a comment the MR_Bool is for references to
	bool__bool.

*/*.c:
*/*.h:
*/*.m:
	Add MR_ prefixes.
2002-02-18 07:01:33 +00:00

115 lines
2.7 KiB
C

/*
** Copyright (C) 2000-2002 The University of Melbourne.
** This file may only be copied under the terms of the GNU Library General
** Public License - see the file COPYING.LIB in the Mercury distribution.
*/
/*
** This file contains utility functions that can be used by any or all
** of the various kinds of Mercury debuggers.
**
** Author: zs.
*/
#include "mercury_imp.h"
#include "mercury_trace_util.h"
#include "mercury_file.h"
#include <ctype.h>
void
MR_c_file_to_mercury_file(FILE *c_file, MercuryFile *mercury_file)
{
MR_mercuryfile_init(c_file, 1, mercury_file);
}
MR_bool
MR_trace_is_number(const char *word, int *value)
{
if (MR_isdigit(*word)) {
*value = *word - '0';
word++;
while (MR_isdigit(*word)) {
*value = (*value * 10) + *word - '0';
word++;
}
if (*word == '\0') {
return MR_TRUE;
}
}
return MR_FALSE;
}
void
MR_print_stack_regs(FILE *fp, MR_Word *saved_regs)
{
#ifndef MR_HIGHLEVEL_CODE
fprintf(fp, "sp = ");
MR_print_detstackptr(fp, MR_saved_sp(saved_regs));
fprintf(fp, "\ncurfr = ");
MR_print_nondstackptr(fp, MR_saved_curfr(saved_regs));
fprintf(fp, "\nmaxfr = ");
MR_print_nondstackptr(fp, MR_saved_maxfr(saved_regs));
fprintf(fp, "\n");
#endif
}
void
MR_print_heap_regs(FILE *fp, MR_Word *saved_regs)
{
#ifndef MR_CONSERVATIVE_GC
fprintf(fp, "hp = ");
MR_print_heapptr(fp, MR_saved_hp(saved_regs));
fprintf(fp, "\nsol_hp = ");
MR_print_heapptr(fp, MR_saved_sol_hp(saved_regs));
fprintf(fp, "\nmin_hp_rec = ");
MR_print_heapptr(fp, MR_saved_min_hp_rec(saved_regs));
fprintf(fp, "\nglobal_hp = ");
MR_print_heapptr(fp, MR_saved_global_hp(saved_regs));
fprintf(fp, "\n");
#endif
}
void
MR_print_tabling_regs(FILE *fp, MR_Word *saved_regs)
{
#ifdef MR_USE_MINIMAL_MODEL
fprintf(fp, "gen_next = %ld\n", (long) MR_saved_gen_next(saved_regs));
fprintf(fp, "cut_next = %ld\n", (long) MR_saved_cut_next(saved_regs));
#endif
}
void
MR_print_succip_reg(FILE *fp, MR_Word *saved_regs)
{
#ifndef MR_HIGHLEVEL_CODE
fprintf(fp, "succip = ");
MR_print_label(fp, MR_saved_succip(saved_regs));
fprintf(fp, "\n");
#endif
}
void
MR_print_r_regs(FILE *fp, MR_Word *saved_regs)
{
#ifndef MR_HIGHLEVEL_CODE
fprintf(fp, "r1 = %ld (%lx)\n",
(long) MR_saved_reg(saved_regs, 1),
(long) MR_saved_reg(saved_regs, 1));
fprintf(fp, "r2 = %ld (%lx)\n",
(long) MR_saved_reg(saved_regs, 2),
(long) MR_saved_reg(saved_regs, 2));
fprintf(fp, "r3 = %ld (%lx)\n",
(long) MR_saved_reg(saved_regs, 3),
(long) MR_saved_reg(saved_regs, 3));
fprintf(fp, "r4 = %ld (%lx)\n",
(long) MR_saved_reg(saved_regs, 4),
(long) MR_saved_reg(saved_regs, 4));
fprintf(fp, "r5 = %ld (%lx)\n",
(long) MR_saved_reg(saved_regs, 5),
(long) MR_saved_reg(saved_regs, 5));
#endif
}