Post Scarcity
A prototype for a post scarcity programming environment
Loading...
Searching...
No Matches
debug.c File Reference
#include <ctype.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wchar.h>
#include <wctype.h>
#include "memory/consspaceobject.h"
#include "debug.h"
#include "memory/dump.h"
#include "io/io.h"
#include "io/print.h"
Include dependency graph for debug.c:

Go to the source code of this file.

Functions

void debug_dump_object (struct cons_pointer pointer, int level)
 Like dump_object, q.v., but protected by the verbosity mechanism.
 
void debug_print (wchar_t *message, int level)
 print this debug message to stderr, if verbosity matches level.
 
void debug_print_128bit (__int128_t n, int level)
 print a 128 bit integer value to stderr, if verbosity matches level.
 
void debug_print_object (struct cons_pointer pointer, int level)
 print the object indicated by this pointer to stderr, if verbosity matches level.
 
void debug_printf (int level, wchar_t *format,...)
 wprintf adapted for the debug logging system.
 
void debug_println (int level)
 print a line feed to stderr, if verbosity matches level.
 

Variables

int verbosity = 0
 the controlling flags for debug_print; set in init.c, q.v.
 

Function Documentation

◆ debug_dump_object()

void debug_dump_object ( struct cons_pointer  pointer,
int  level 
)

Like dump_object, q.v., but protected by the verbosity mechanism.

verbosity is a set of flags, see debug_print.h; so you can turn debugging on for only one part of the system.

Definition at line 136 of file debug.c.

References dump_object(), file_to_url_file(), and verbosity.

Referenced by add_2(), add_integers(), compose_body(), free_cell(), lisp_apply(), lisp_cond(), lisp_eval(), lisp_inspect(), lisp_mapcar(), lisp_metadata(), lisp_print(), lisp_read(), lisp_slurp(), log_binding(), main(), make_empty_frame(), make_integer(), make_real(), make_special_frame(), make_stack_frame(), make_vec_pointer(), make_vso(), read_continuation(), read_number(), read_symbol_or_key(), set(), throw_exception(), and zerop().

◆ debug_print()

◆ debug_print_128bit()

void debug_print_128bit ( __int128_t  n,
int  level 
)

print a 128 bit integer value to stderr, if verbosity matches level.

verbosity is a set of flags, see debug_print.h; so you can turn debugging on for only one part of the system.

stolen from https://stackoverflow.com/questions/11656241/how-to-print-uint128-t-number-using-gcc

Definition at line 58 of file debug.c.

References verbosity.

Referenced by add_integers(), cell_value(), and integer_to_string().

◆ debug_print_object()

◆ debug_printf()

◆ debug_println()

void debug_println ( int  level)

print a line feed to stderr, if verbosity matches level.

verbosity is a set of flags, see debug_print.h; so you can turn debugging on for only one part of the system.

Definition at line 85 of file debug.c.

References verbosity.

Referenced by add_integers(), c_apply(), c_assoc(), cell_value(), deep_bind(), eval_form(), eval_lambda(), integer_to_string(), integer_to_string_add_digit(), lisp_mapcar(), lisp_multiply(), lisp_repl(), lisp_slurp(), make_ratio(), multiply_integers(), set(), and set_reg().

Variable Documentation

◆ verbosity

int verbosity = 0

the controlling flags for debug_print; set in init.c, q.v.

Interpreted as a set o binary flags. The values are controlled by macros with names 'DEBUG_[A_Z]*' in debug.h, q.v.

Definition at line 33 of file debug.c.

Referenced by debug_dump_object(), debug_print(), debug_print_128bit(), debug_print_object(), debug_printf(), debug_println(), and main().