Changes in / [44aad8f:038be32]


Ignore:
Files:
1 deleted
13 edited

Legend:

Unmodified
Added
Removed
  • driver/cfa.cc

    r44aad8f r038be32  
    385385        } // if
    386386
    387         string preludedir;
    388387        switch(path) {
    389         case Installed   : preludedir = libdir; break;
    390         case BuildTree   : preludedir = libdir + "/prelude"; break;
    391         case Distributed : preludedir = dir(argv[0]); break;
     388        case Installed   : Putenv( argv, "--prelude-dir=" + libdir ); break;
     389        case BuildTree   : Putenv( argv, "--prelude-dir=" + libdir + "/prelude" ); break;
     390        case Distributed : Putenv( argv, "--prelude-dir=" + dir(argv[0]) ); break;
    392391        }
    393 
    394         Putenv( argv, "--prelude-dir=" + preludedir );
    395         args[nargs++] = "-include";
    396         args[nargs++] = (*new string(preludedir + "/defines.hfa")).c_str();
    397392
    398393        for ( int i = 0; i < nlibs; i += 1 ) {                          // copy non-user libraries after all user libraries
  • libcfa/Makefile.in

    r44aad8f r038be32  
    106106 configure.lineno config.status.lineno
    107107mkinstalldirs = $(install_sh) -d
    108 CONFIG_HEADER = $(top_builddir)/prelude/defines.hfa
    109108CONFIG_CLEAN_FILES =
    110109CONFIG_CLEAN_VPATH_FILES =
  • libcfa/configure

    r44aad8f r038be32  
    1696616966
    1696716967
    16968 ac_config_headers="$ac_config_headers prelude/defines.hfa"
    16969 
    16970 
    1697116968cat >confcache <<\_ACEOF
    1697216969# This file is a shell script that caches the results of configure
     
    1705917056test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
    1706017057
    17061 DEFS=-DHAVE_CONFIG_H
     17058# Transform confdefs.h into DEFS.
     17059# Protect against shell expansion while executing Makefile rules.
     17060# Protect against Makefile macro expansion.
     17061#
     17062# If the first sed substitution is executed (which looks for macros that
     17063# take arguments), then branch to the quote section.  Otherwise,
     17064# look for a macro that doesn't take arguments.
     17065ac_script='
     17066:mline
     17067/\\$/{
     17068 N
     17069 s,\\\n,,
     17070 b mline
     17071}
     17072t clear
     17073:clear
     17074s/^[     ]*#[    ]*define[       ][      ]*\([^  (][^    (]*([^)]*)\)[   ]*\(.*\)/-D\1=\2/g
     17075t quote
     17076s/^[     ]*#[    ]*define[       ][      ]*\([^  ][^     ]*\)[   ]*\(.*\)/-D\1=\2/g
     17077t quote
     17078b any
     17079:quote
     17080s/[      `~#$^&*(){}\\|;'\''"<>?]/\\&/g
     17081s/\[/\\&/g
     17082s/\]/\\&/g
     17083s/\$/$$/g
     17084H
     17085:any
     17086${
     17087        g
     17088        s/^\n//
     17089        s/\n/ /g
     17090        p
     17091}
     17092'
     17093DEFS=`sed -n "$ac_script" confdefs.h`
     17094
    1706217095
    1706317096ac_libobjs=
     
    1753717570esac
    1753817571
    17539 case $ac_config_headers in *"
    17540 "*) set x $ac_config_headers; shift; ac_config_headers=$*;;
    17541 esac
    1754217572
    1754317573
     
    1754517575# Files that config.status was made for.
    1754617576config_files="$ac_config_files"
    17547 config_headers="$ac_config_headers"
    1754817577config_commands="$ac_config_commands"
    1754917578
     
    1756717596      --file=FILE[:TEMPLATE]
    1756817597                   instantiate the configuration file FILE
    17569       --header=FILE[:TEMPLATE]
    17570                    instantiate the configuration header FILE
    1757117598
    1757217599Configuration files:
    1757317600$config_files
    17574 
    17575 Configuration headers:
    17576 $config_headers
    1757717601
    1757817602Configuration commands:
     
    1764217666    as_fn_append CONFIG_FILES " '$ac_optarg'"
    1764317667    ac_need_defaults=false;;
    17644   --header | --heade | --head | --hea )
    17645     $ac_shift
    17646     case $ac_optarg in
    17647     *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
    17648     esac
    17649     as_fn_append CONFIG_HEADERS " '$ac_optarg'"
    17650     ac_need_defaults=false;;
    17651   --he | --h)
    17652     # Conflict between --help and --header
    17653     as_fn_error $? "ambiguous option: \`$1'
    17654 Try \`$0 --help' for more information.";;
    17655   --help | --hel | -h )
     17668  --he | --h |  --help | --hel | -h )
    1765617669    $as_echo "$ac_cs_usage"; exit ;;
    1765717670  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
     
    1810018113    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
    1810118114    "prelude/Makefile") CONFIG_FILES="$CONFIG_FILES prelude/Makefile" ;;
    18102     "prelude/defines.hfa") CONFIG_HEADERS="$CONFIG_HEADERS prelude/defines.hfa" ;;
    1810318115
    1810418116  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
     
    1811318125if $ac_need_defaults; then
    1811418126  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
    18115   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
    1811618127  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
    1811718128fi
     
    1830218313fi # test -n "$CONFIG_FILES"
    1830318314
    18304 # Set up the scripts for CONFIG_HEADERS section.
    18305 # No need to generate them if there are no CONFIG_HEADERS.
    18306 # This happens for instance with `./config.status Makefile'.
    18307 if test -n "$CONFIG_HEADERS"; then
    18308 cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
    18309 BEGIN {
    18310 _ACEOF
    18311 
    18312 # Transform confdefs.h into an awk script `defines.awk', embedded as
    18313 # here-document in config.status, that substitutes the proper values into
    18314 # config.h.in to produce config.h.
    18315 
    18316 # Create a delimiter string that does not exist in confdefs.h, to ease
    18317 # handling of long lines.
    18318 ac_delim='%!_!# '
    18319 for ac_last_try in false false :; do
    18320   ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
    18321   if test -z "$ac_tt"; then
    18322     break
    18323   elif $ac_last_try; then
    18324     as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
    18325   else
    18326     ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
    18327   fi
    18328 done
    18329 
    18330 # For the awk script, D is an array of macro values keyed by name,
    18331 # likewise P contains macro parameters if any.  Preserve backslash
    18332 # newline sequences.
    18333 
    18334 ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
    18335 sed -n '
    18336 s/.\{148\}/&'"$ac_delim"'/g
    18337 t rset
    18338 :rset
    18339 s/^[     ]*#[    ]*define[       ][      ]*/ /
    18340 t def
    18341 d
    18342 :def
    18343 s/\\$//
    18344 t bsnl
    18345 s/["\\]/\\&/g
    18346 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
    18347 D["\1"]=" \3"/p
    18348 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2"/p
    18349 d
    18350 :bsnl
    18351 s/["\\]/\\&/g
    18352 s/^ \('"$ac_word_re"'\)\(([^()]*)\)[     ]*\(.*\)/P["\1"]="\2"\
    18353 D["\1"]=" \3\\\\\\n"\\/p
    18354 t cont
    18355 s/^ \('"$ac_word_re"'\)[         ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
    18356 t cont
    18357 d
    18358 :cont
    18359 n
    18360 s/.\{148\}/&'"$ac_delim"'/g
    18361 t clear
    18362 :clear
    18363 s/\\$//
    18364 t bsnlc
    18365 s/["\\]/\\&/g; s/^/"/; s/$/"/p
    18366 d
    18367 :bsnlc
    18368 s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
    18369 b cont
    18370 ' <confdefs.h | sed '
    18371 s/'"$ac_delim"'/"\\\
    18372 "/g' >>$CONFIG_STATUS || ac_write_fail=1
    18373 
    18374 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
    18375   for (key in D) D_is_set[key] = 1
    18376   FS = ""
    18377 }
    18378 /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
    18379   line = \$ 0
    18380   split(line, arg, " ")
    18381   if (arg[1] == "#") {
    18382     defundef = arg[2]
    18383     mac1 = arg[3]
    18384   } else {
    18385     defundef = substr(arg[1], 2)
    18386     mac1 = arg[2]
    18387   }
    18388   split(mac1, mac2, "(") #)
    18389   macro = mac2[1]
    18390   prefix = substr(line, 1, index(line, defundef) - 1)
    18391   if (D_is_set[macro]) {
    18392     # Preserve the white space surrounding the "#".
    18393     print prefix "define", macro P[macro] D[macro]
    18394     next
    18395   } else {
    18396     # Replace #undef with comments.  This is necessary, for example,
    18397     # in the case of _POSIX_SOURCE, which is predefined and required
    18398     # on some systems where configure will not decide to define it.
    18399     if (defundef == "undef") {
    18400       print "/*", prefix defundef, macro, "*/"
    18401       next
    18402     }
    18403   }
    18404 }
    18405 { print }
    18406 _ACAWK
    18407 _ACEOF
    18408 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
    18409   as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
    18410 fi # test -n "$CONFIG_HEADERS"
    18411 
    18412 
    18413 eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
     18315
     18316eval set X "  :F $CONFIG_FILES      :C $CONFIG_COMMANDS"
    1841418317shift
    1841518318for ac_tag
     
    1863018533  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    1863118534 ;;
    18632   :H)
    18633   #
    18634   # CONFIG_HEADER
    18635   #
    18636   if test x"$ac_file" != x-; then
    18637     {
    18638       $as_echo "/* $configure_input  */" \
    18639       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
    18640     } >"$ac_tmp/config.h" \
    18641       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    18642     if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
    18643       { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
    18644 $as_echo "$as_me: $ac_file is unchanged" >&6;}
    18645     else
    18646       rm -f "$ac_file"
    18647       mv "$ac_tmp/config.h" "$ac_file" \
    18648         || as_fn_error $? "could not create $ac_file" "$LINENO" 5
    18649     fi
    18650   else
    18651     $as_echo "/* $configure_input  */" \
    18652       && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
    18653       || as_fn_error $? "could not create -" "$LINENO" 5
    18654   fi
    18655 # Compute "$ac_file"'s index in $config_headers.
    18656 _am_arg="$ac_file"
    18657 _am_stamp_count=1
    18658 for _am_header in $config_headers :; do
    18659   case $_am_header in
    18660     $_am_arg | $_am_arg:* )
    18661       break ;;
    18662     * )
    18663       _am_stamp_count=`expr $_am_stamp_count + 1` ;;
    18664   esac
    18665 done
    18666 echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
    18667 $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
    18668          X"$_am_arg" : 'X\(//\)[^/]' \| \
    18669          X"$_am_arg" : 'X\(//\)$' \| \
    18670          X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
    18671 $as_echo X"$_am_arg" |
    18672     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
    18673             s//\1/
    18674             q
    18675           }
    18676           /^X\(\/\/\)[^/].*/{
    18677             s//\1/
    18678             q
    18679           }
    18680           /^X\(\/\/\)$/{
    18681             s//\1/
    18682             q
    18683           }
    18684           /^X\(\/\).*/{
    18685             s//\1/
    18686             q
    18687           }
    18688           s/.*/./; q'`/stamp-h$_am_stamp_count
    18689  ;;
     18535
    1869018536
    1869118537  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
  • libcfa/configure.ac

    r44aad8f r038be32  
    126126        ])
    127127
    128 AC_CONFIG_HEADERS(prelude/defines.hfa)
    129 
    130128AC_OUTPUT()
    131129
  • libcfa/prelude/Makefile.am

    r44aad8f r038be32  
    2121# put into lib for now
    2222cfalibdir = ${CFA_LIBDIR}
    23 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c defines.hfa
     23cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c
    2424
    2525CC = @LOCAL_CFACC@
  • libcfa/prelude/Makefile.in

    r44aad8f r038be32  
    104104DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
    105105mkinstalldirs = $(install_sh) -d
    106 CONFIG_HEADER = defines.hfa
    107106CONFIG_CLEAN_FILES =
    108107CONFIG_CLEAN_VPATH_FILES =
     
    155154am__installdirs = "$(DESTDIR)$(cfalibdir)"
    156155DATA = $(cfalib_DATA)
    157 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
    158         $(LISP)defines.hfa.in
    159 # Read a list of newline-separated strings from the standard input,
    160 # and print each of them once, without duplicates.  Input order is
    161 # *not* preserved.
    162 am__uniquify_input = $(AWK) '\
    163   BEGIN { nonempty = 0; } \
    164   { items[$$0] = 1; nonempty = 1; } \
    165   END { if (nonempty) { for (i in items) print i; }; } \
    166 '
    167 # Make sure the list of sources is unique.  This is necessary because,
    168 # e.g., the same source file might be shared among _SOURCES variables
    169 # for different programs/libraries.
    170 am__define_uniq_tagged_files = \
    171   list='$(am__tagged_files)'; \
    172   unique=`for i in $$list; do \
    173     if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
    174   done | $(am__uniquify_input)`
    175 ETAGS = etags
    176 CTAGS = ctags
    177 am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/defines.hfa.in
     156am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
     157am__DIST_COMMON = $(srcdir)/Makefile.in
    178158DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    179159ACLOCAL = @ACLOCAL@
     
    326306# put into lib for now
    327307cfalibdir = ${CFA_LIBDIR}
    328 cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c defines.hfa
     308cfalib_DATA = gcc-builtins.cf builtins.cf extras.cf prelude.cfa bootloader.c
    329309AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    330310AM_CFAFLAGS = @CONFIG_CFAFLAGS@
    331311MOSTLYCLEANFILES = bootloader.c builtins.cf extras.cf gcc-builtins.c gcc-builtins.cf prelude.cfa
    332312MAINTAINERCLEANFILES = ${addprefix ${libdir}/,${cfalib_DATA}} ${addprefix ${libdir}/,${lib_LIBRARIES}}
    333 all: defines.hfa
    334         $(MAKE) $(AM_MAKEFLAGS) all-am
     313all: all-am
    335314
    336315.SUFFIXES:
     
    365344$(am__aclocal_m4_deps):
    366345
    367 defines.hfa: stamp-h1
    368         @test -f $@ || rm -f stamp-h1
    369         @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
    370 
    371 stamp-h1: $(srcdir)/defines.hfa.in $(top_builddir)/config.status
    372         @rm -f stamp-h1
    373         cd $(top_builddir) && $(SHELL) ./config.status prelude/defines.hfa
    374 $(srcdir)/defines.hfa.in:  $(am__configure_deps)
    375         ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
    376         rm -f stamp-h1
    377         touch $@
    378 
    379 distclean-hdr:
    380         -rm -f defines.hfa stamp-h1
    381 
    382346mostlyclean-libtool:
    383347        -rm -f *.lo
     
    406370        files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
    407371        dir='$(DESTDIR)$(cfalibdir)'; $(am__uninstall_files_from_dir)
    408 
    409 ID: $(am__tagged_files)
    410         $(am__define_uniq_tagged_files); mkid -fID $$unique
    411 tags: tags-am
    412 TAGS: tags
    413 
    414 tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    415         set x; \
    416         here=`pwd`; \
    417         $(am__define_uniq_tagged_files); \
    418         shift; \
    419         if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
    420           test -n "$$unique" || unique=$$empty_fix; \
    421           if test $$# -gt 0; then \
    422             $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    423               "$$@" $$unique; \
    424           else \
    425             $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
    426               $$unique; \
    427           fi; \
    428         fi
    429 ctags: ctags-am
    430 
    431 CTAGS: ctags
    432 ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
    433         $(am__define_uniq_tagged_files); \
    434         test -z "$(CTAGS_ARGS)$$unique" \
    435           || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
    436              $$unique
    437 
    438 GTAGS:
    439         here=`$(am__cd) $(top_builddir) && pwd` \
    440           && $(am__cd) $(top_srcdir) \
    441           && gtags -i $(GTAGS_ARGS) "$$here"
    442 cscopelist: cscopelist-am
    443 
    444 cscopelist-am: $(am__tagged_files)
    445         list='$(am__tagged_files)'; \
    446         case "$(srcdir)" in \
    447           [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
    448           *) sdir=$(subdir)/$(srcdir) ;; \
    449         esac; \
    450         for i in $$list; do \
    451           if test -f "$$i"; then \
    452             echo "$(subdir)/$$i"; \
    453           else \
    454             echo "$$sdir/$$i"; \
    455           fi; \
    456         done >> $(top_builddir)/cscope.files
    457 
    458 distclean-tags:
    459         -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
     372tags TAGS:
     373
     374ctags CTAGS:
     375
     376cscope cscopelist:
     377
    460378
    461379distdir: $(DISTFILES)
     
    491409check-am: all-am
    492410check: check-am
    493 all-am: Makefile $(DATA) defines.hfa
     411all-am: Makefile $(DATA)
    494412installdirs:
    495413        for dir in "$(DESTDIR)$(cfalibdir)"; do \
     
    534452distclean: distclean-am
    535453        -rm -f Makefile
    536 distclean-am: clean-am distclean-generic distclean-hdr distclean-tags
     454distclean-am: clean-am distclean-generic
    537455
    538456dvi: dvi-am
     
    595513uninstall-am: uninstall-cfalibDATA
    596514
    597 .MAKE: all install-am install-strip
    598 
    599 .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
    600         clean-libtool cscopelist-am ctags ctags-am distclean \
    601         distclean-generic distclean-hdr distclean-libtool \
    602         distclean-tags distdir dvi dvi-am html html-am info info-am \
     515.MAKE: install-am install-strip
     516
     517.PHONY: all all-am check check-am clean clean-generic clean-libtool \
     518        cscopelist-am ctags-am distclean distclean-generic \
     519        distclean-libtool distdir dvi dvi-am html html-am info info-am \
    603520        install install-am install-cfalibDATA install-data \
    604521        install-data-am install-dvi install-dvi-am install-exec \
     
    609526        maintainer-clean-generic maintainer-clean-local mostlyclean \
    610527        mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
    611         tags tags-am uninstall uninstall-am uninstall-cfalibDATA
     528        tags-am uninstall uninstall-am uninstall-cfalibDATA
    612529
    613530.PRECIOUS: Makefile
  • libcfa/src/Makefile.in

    r44aad8f r038be32  
    105105        $(am__nobase_cfa_include_HEADERS_DIST) $(am__DIST_COMMON)
    106106mkinstalldirs = $(install_sh) -d
    107 CONFIG_HEADER = $(top_builddir)/prelude/defines.hfa
    108107CONFIG_CLEAN_FILES =
    109108CONFIG_CLEAN_VPATH_FILES =
     
    195194am__v_at_0 = @
    196195am__v_at_1 =
    197 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/prelude
     196DEFAULT_INCLUDES = -I.@am__isrc@
    198197depcomp = $(SHELL) $(top_srcdir)/automake/depcomp
    199198am__depfiles_maybe = depfiles
  • libcfa/src/bits/debug.hfa

    r44aad8f r038be32  
    99// Author           : Thierry Delisle
    1010// Created On       : Mon Nov 28 12:27:26 2016
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Apr 27 10:15:00 2020
    13 // Update Count     : 10
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Tue Feb  4 12:29:21 2020
     13// Update Count     : 9
    1414//
    1515
     
    4040#endif
    4141        #include <stdarg.h>
     42        #include <stdio.h>
    4243
    4344        extern void __cfaabi_bits_write( int fd, const char buffer[], int len );
     
    4849        extern void __cfaabi_bits_print_vararg( int fd, const char fmt[], va_list arg );
    4950        extern void __cfaabi_bits_print_buffer( int fd, char buffer[], int buffer_size, const char fmt[], ... ) __attribute__(( format(printf, 4, 5) ));
    50 
    51 #if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_IO__) \
    52                 || defined(__CFA_DEBUG_PRINT_MONITOR__) || defined(__CFA_DEBUG_PRINT_PREEMPTION__) \
    53                 || defined(__CFA_DEBUG_PRINT_RUNTIME_CORE__) || defined(__CFA_DEBUG_PRINT_EXCEPTION__)
    54         #include <stdio.h>
    55         #include <unistd.h>
    56 #endif
    5751#ifdef __cforall
    5852}
    5953#endif
    6054
    61 // Deprecated: Use the versions with the new module names.
    6255#ifdef __CFA_DEBUG_PRINT__
    6356        #define __cfaabi_dbg_write( buffer, len )         __cfaabi_bits_write( STDERR_FILENO, buffer, len )
    6457        #define __cfaabi_dbg_acquire()                    __cfaabi_bits_acquire()
    6558        #define __cfaabi_dbg_release()                    __cfaabi_bits_release()
    66         #define __cfaabi_dbg_print_safe(...)              __cfaabi_bits_print_safe   ( STDERR_FILENO, __VA_ARGS__ )
    67         #define __cfaabi_dbg_print_nolock(...)            __cfaabi_bits_print_nolock ( STDERR_FILENO, __VA_ARGS__ )
    68         #define __cfaabi_dbg_print_buffer(...)            __cfaabi_bits_print_buffer ( STDERR_FILENO, __VA_ARGS__ )
    69         #define __cfaabi_dbg_print_buffer_decl(...)       char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_bits_write( STDERR_FILENO, __dbg_text, __dbg_len );
    70         #define __cfaabi_dbg_print_buffer_local(...)      __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_dbg_write( STDERR_FILENO, __dbg_text, __dbg_len );
     59        #define __cfaabi_dbg_print_safe(...)              __cfaabi_bits_print_safe   (__VA_ARGS__)
     60        #define __cfaabi_dbg_print_nolock(...)            __cfaabi_bits_print_nolock (__VA_ARGS__)
     61        #define __cfaabi_dbg_print_buffer(...)            __cfaabi_bits_print_buffer (__VA_ARGS__)
     62        #define __cfaabi_dbg_print_buffer_decl(...)       char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_bits_write( __dbg_text, __dbg_len );
     63        #define __cfaabi_dbg_print_buffer_local(...)      __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_dbg_write( __dbg_text, __dbg_len );
    7164#else
    7265        #define __cfaabi_dbg_write(...)               ((void)0)
     
    8073#endif
    8174
    82 // Debug print functions and statements:
    83 // Most are wrappers around the bits printing function but are not always used.
    84 // If they are used depends if the group (first argument) is active or not. The group must be one
    85 // defined belowe. The other arguments depend on the wrapped function.
    86 #define __cfadbg_write(group, buffer, len) \
    87         __CFADBG_PRINT_GROUP_##group(__cfaabi_bits_write(STDERR_FILENO, buffer, len))
    88 #define __cfadbg_acquire(group) \
    89         __CFADBG_PRINT_GROUP_##group(__cfaabi_bits_acquire())
    90 #define __cfadbg_release(group) \
    91         __CFADBG_PRINT_GROUP_##group(__cfaabi_bits_release())
    92 #define __cfadbg_print_safe(group, ...) \
    93         __CFADBG_PRINT_GROUP_##group(__cfaabi_bits_print_safe(STDERR_FILENO, __VA_ARGS__))
    94 #define __cfadbg_print_nolock(group, ...) \
    95         __CFADBG_PRINT_GROUP_##group(__cfaabi_bits_print_nolock(STDERR_FILENO, __VA_ARGS__))
    96 #define __cfadbg_print_buffer(group, ...) \
    97         __CFADBG_PRINT_GROUP_##group(__cfaabi_bits_print_buffer(STDERR_FILENO, __VA_ARGS__))
    98 #define __cfadbg_print_buffer_decl(group, ...) \
    99         __CFADBG_PRINT_GROUP_##group(char __dbg_text[256]; int __dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_bits_write( __dbg_text, __dbg_len ))
    100 #define __cfadbg_print_buffer_local(group, ...) \
    101         __CFADBG_PRINT_GROUP_##group(__dbg_len = snprintf( __dbg_text, 256, __VA_ARGS__ ); __cfaabi_bits_write(STDERR_FILENO, __dbg_text, __dbg_len))
    102 
    103 // The debug print groups:
    104 #if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_IO__)
    105 #       define __CFADBG_PRINT_GROUP_io(...) __VA_ARGS__
    106 #else
    107 #       define __CFADBG_PRINT_GROUP_io(...) ((void)0)
    108 #endif
    109 #if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_MONITOR__)
    110 #       define __CFADBG_PRINT_GROUP_monitor(...) __VA_ARGS__
    111 #else
    112 #       define __CFADBG_PRINT_GROUP_monitor(...) ((void)0)
    113 #endif
    114 #if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_PREEMPTION__)
    115 #       define __CFADBG_PRINT_GROUP_preemption(...) __VA_ARGS__
    116 #else
    117 #       define __CFADBG_PRINT_GROUP_preemption(...) ((void)0)
    118 #endif
    119 #if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_RUNTIME_CORE__)
    120 #       define __CFADBG_PRINT_GROUP_runtime_core(...) __VA_ARGS__
    121 #else
    122 #       define __CFADBG_PRINT_GROUP_runtime_core(...) ((void)0)
    123 #endif
    124 #if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_READY_QUEUE__)
    125 #       define __CFADBG_PRINT_GROUP_ready_queue(...) __VA_ARGS__
    126 #else
    127 #       define __CFADBG_PRINT_GROUP_ready_queue(...) ((void)0)
    128 #endif
    129 #if defined(__CFA_DEBUG_PRINT__) || defined(__CFA_DEBUG_PRINT_EXCEPTION__)
    130 #       define __CFADBG_PRINT_GROUP_exception(...) __VA_ARGS__
    131 #else
    132 #       define __CFADBG_PRINT_GROUP_exception(...) ((void)0)
    133 #endif
    134 
    13575// Local Variables: //
    13676// mode: c //
  • libcfa/src/exception.c

    r44aad8f r038be32  
    8383        struct exception_context_t * context = this_exception_context();
    8484
    85         __cfadbg_print_safe(exception, "Throwing resumption exception\n");
     85        __cfaabi_dbg_print_safe("Throwing resumption exception\n");
    8686
    8787        __attribute__((cleanup(reset_top_resume)))
     
    9696        }
    9797
    98         __cfadbg_print_safe(exception, "Unhandled exception\n");
     98        __cfaabi_dbg_print_safe("Unhandled exception\n");
    9999
    100100        // Fall back to termination:
     
    180180        struct exception_context_t * context = this_exception_context();
    181181
    182         __cfadbg_print_safe(exception, "Deleting Exception\n");
     182        __cfaabi_dbg_print_safe("Deleting Exception\n");
    183183
    184184        // Remove the exception from the list.
     
    218218                void * stop_param) {
    219219        // Verify actions follow the rules we expect.
    220         verify((actions & _UA_CLEANUP_PHASE) && (actions & _UA_FORCE_UNWIND));
     220        verify((actions & _UA_CLEANUP_PHASE) && actions & (_UA_FORCE_UNWIND));
    221221        verify(!(actions & (_UA_SEARCH_PHASE | _UA_HANDER_FRAME)));
    222222
     
    261261
    262262void __cfaehm_throw_terminate( exception_t * val ) {
    263         __cfadbg_print_safe(exception, "Throwing termination exception\n");
     263        __cfaabi_dbg_print_safe("Throwing termination exception\n");
    264264
    265265        __cfaehm_allocate_exception( val );
     
    268268
    269269void __cfaehm_rethrow_terminate(void) {
    270         __cfadbg_print_safe(exception, "Rethrowing termination exception\n");
     270        __cfaabi_dbg_print_safe("Rethrowing termination exception\n");
    271271
    272272        __cfaehm_begin_unwind();
     
    284284{
    285285
    286         //__cfadbg_print_safe(exception, "CFA: 0x%lx\n", _Unwind_GetCFA(context));
    287         __cfadbg_print_safe(exception, "Personality function (%d, %x, %llu, %p, %p):",
     286        //__cfaabi_dbg_print_safe("CFA: 0x%lx\n", _Unwind_GetCFA(context));
     287        __cfaabi_dbg_print_safe("Personality function (%d, %x, %llu, %p, %p):",
    288288                        version, actions, exception_class, unwind_exception, unwind_context);
    289289
     
    294294        if (actions & _UA_SEARCH_PHASE) {
    295295                verify(actions == _UA_SEARCH_PHASE);
    296                 __cfadbg_print_safe(exception, " lookup phase");
     296                __cfaabi_dbg_print_safe(" lookup phase");
    297297        // ... we are in clean-up phase.
    298298        } else {
    299299                verify(actions & _UA_CLEANUP_PHASE);
    300                 __cfadbg_print_safe(exception, " cleanup phase");
     300                __cfaabi_dbg_print_safe(" cleanup phase");
    301301                // We shouldn't be the handler frame during forced unwind.
    302302                if (actions & _UA_HANDLER_FRAME) {
    303303                        verify(!(actions & _UA_FORCE_UNWIND));
    304                         __cfadbg_print_safe(exception, " (handler frame)");
     304                        __cfaabi_dbg_print_safe(" (handler frame)");
    305305                } else if (actions & _UA_FORCE_UNWIND) {
    306                         __cfadbg_print_safe(exception, " (force unwind)");
     306                        __cfaabi_dbg_print_safe(" (force unwind)");
    307307                }
    308308        }
     
    345345                        void * ep = (void*)lsd_info.Start + callsite_start + callsite_len;
    346346                        void * ip = (void*)instruction_ptr;
    347                         __cfadbg_print_safe(exception, "\nfound %p - %p (%p, %p, %p), looking for %p\n",
     347                        __cfaabi_dbg_print_safe("\nfound %p - %p (%p, %p, %p), looking for %p\n",
    348348                                        bp, ep, ls, cs, cl, ip);
    349349#endif // __CFA_DEBUG_PRINT__
     
    360360                if ( 0 == callsite_landing_pad ) {
    361361                        // Nothing to do, move along
    362                         __cfadbg_print_safe(exception, " no landing pad");
     362                        __cfaabi_dbg_print_safe(" no landing pad");
    363363                } else if (actions & _UA_SEARCH_PHASE) {
    364364                        // In search phase, these means we found a potential handler we must check.
     
    398398                                // Based on the return value, check if we matched the exception
    399399                                if (ret == _URC_HANDLER_FOUND) {
    400                                         __cfadbg_print_safe(exception, " handler found\n");
     400                                        __cfaabi_dbg_print_safe(" handler found\n");
    401401                                } else {
    402                                         __cfadbg_print_safe(exception, " no handler\n");
     402                                        __cfaabi_dbg_print_safe(" no handler\n");
    403403                                }
    404404                                return ret;
     
    406406
    407407                        // This is only a cleanup handler, ignore it
    408                         __cfadbg_print_safe(exception, " no action");
     408                        __cfaabi_dbg_print_safe(" no action");
    409409                } else {
    410410                        // In clean-up phase, no destructors here but this could be the handler.
     
    428428                        _Unwind_SetIP( unwind_context, ((lsd_info.LPStart) + (callsite_landing_pad)) );
    429429
    430                         __cfadbg_print_safe(exception, " action\n");
     430                        __cfaabi_dbg_print_safe(" action\n");
    431431
    432432                        // Return have some action to run
     
    435435        }
    436436        // No handling found
    437         __cfadbg_print_safe(exception, " table end reached");
     437        __cfaabi_dbg_print_safe(" table end reached\n");
    438438
    439439        UNWIND:
    440         __cfadbg_print_safe(exception, " unwind\n");
     440        __cfaabi_dbg_print_safe(" unwind\n");
    441441
    442442        // Keep unwinding the stack
  • libcfa/src/interpose.cfa

    r44aad8f r038be32  
    1515
    1616#include <stdarg.h>                                                                             // va_start, va_end
    17 #include <stdio.h>
    1817#include <string.h>                                                                             // strlen
    1918#include <unistd.h>                                                                             // _exit, getpid
  • libcfa/src/iostream.cfa

    r44aad8f r038be32  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Apr 26 20:31:36 2020
    13 // Update Count     : 985
     12// Last Modified On : Wed Apr 22 10:50:46 2020
     13// Update Count     : 933
    1414//
    1515
     
    565565                                fmt2.flags.pad0 = fmt2.flags.nobsdp = true;     \
    566566                                if ( f.base == 'b' | f.base == 'B' ) { \
    567                                         if ( fmt.flags.pc && fmt.pc > 64 ) fmt.pc -= 64; else { fmt.flags.pc = false; fmt.pc = 0; } \
     567                                        if ( fmt.flags.pc && fmt.pc > 64 ) fmt.pc -= 64; \
    568568                                        if ( fmt.flags.left ) { \
    569569                                                fmt2.wd = fmt.wd; \
     
    584584                                                printf( "left %d %d %x\n", fmt.wd, fmt.pc, fmt.all ); \
    585585                                        } else { \
     586                                                fmt2.wd = 64; \
    586587                                                if ( fmt.wd > 64 ) fmt.wd -= 64; \
    587                                                 /* if ( ! fmt.flags.nobsdp && fmt.pc < fmt.wd ) fmt.wd -= 1; */ \
    588                                                 fmt2.wd = 64; \
    589                                                 /* printf( "R %llo %llo %llo %llo %d %d '%c' %x\n", msig, lsig, fmt.val, fmt2.val, fmt.wd, fmt.pc, fmt.base, fmt.all ); */ \
     588                                                printf( "left %d %d %x\n", f.wd, f.pc, f.all ); \
     589                                                printf( "left %d %d %x\n", fmt.wd, fmt.pc, fmt.all ); \
    590590                                        } /* if */ \
    591                                         /* printf( "\nC %llo %d %d '%c' %x\n", fmt2.val, fmt2.wd, fmt2.pc, fmt2.base, fmt2.all ); */ \
     591                                        fmt2.pc = 64; fmt2.flags.pc = true;     \
     592                                        printf( "left %d %d %x\n", fmt2.wd, fmt2.pc, fmt2.all ); \
    592593                                        (ostype &)(os | fmt | "" | fmt2); \
    593594                                } else if ( f.base == 'o' ) { \
    594                                         if ( fmt.flags.pc && fmt.pc > 22 ) fmt.pc -= 22; else { fmt.flags.pc = false; fmt.pc = 0; } \
    595                                         fmt.val = (unsigned long long int)fmt.val >> 2; \
    596                                         fmt2.val = ((msig & 0x3) << 1) + ((lsig & 0x8000000000000000U) != 0); \
     595                                        if ( fmt.flags.pc && fmt.pc > 21 ) fmt.pc -= 21; \
    597596                                        if ( fmt.flags.left ) { \
    598597                                                fmt.flags.left = false; \
    599                                                 fmt.wd = 0; \
    600                                                 /* if ( fmt2.val > 1 && fmt.flags.pc && fmt.pc > 0 ) fmt.pc -= 1; */ \
    601                                                 /* printf( "L %llo %llo %llo %llo %d %d '%c' %x\n", msig, lsig, fmt.val, fmt2.val, fmt.wd, fmt.pc, fmt.base, fmt.all ); */ \
     598                                                fmt.wd = 1; \
     599                                                fmt.val = (unsigned long long int)fmt.val >> 2; \
     600                                                fmt2.wd = 1; \
     601                                                fmt2.val = ((msig & 0x3) << 1) + 1; \
    602602                                                (ostype &)(os | fmt | "" | fmt2); \
    603603                                                sepOff( os ); \
    604604                                                fmt2.flags.left = true; \
    605                                                 int msigd = ceiling( high1( fmt.val ), 3 ) + 1; \
    606                                                 fmt2.wd = f.wd - (fmt.pc > msigd ? fmt.pc : msigd) - 1; \
    607                                                 if ( fmt2.wd < 21 ) fmt2.wd = 21; \
     605                                                fmt2.wd = f.wd - ( ceiling( high1( fmt.val ), 3 ) + 1 ); \
    608606                                                fmt2.flags.pc = true; fmt2.pc = 21; \
     607                                                if ( ! fmt.flags.nobsdp ) { fmt2.wd -= 1; } \
     608                                                fmt2.val = lsig & 0x7fffffffffffffff; \
     609                                                (ostype &)(os | fmt2); \
    609610                                        } else { \
    610                                                 if ( fmt.wd > 22 ) fmt.wd -= 22; \
    611                                                 /* compensate for leading 0 */ \
    612                                                 /*if ( ! fmt.flags.nobsdp && fmt.pc < fmt.wd ) fmt.wd -= 1;*/ \
     611                                                fmt.val = (unsigned long long int)fmt.val >> 2; \
     612                                                if ( fmt.wd > 21 ) fmt.wd -= 21; \
     613                                                if ( ! fmt.flags.nobsdp ) { if ( fmt.pc < fmt.wd ) fmt.wd -= 1; else fmt.pc -= 1; } \
    613614                                                fmt2.wd = 1; \
    614                                                 /* printf( "R %llo %llo %llo %llo %d %d '%c' %x\n", msig, lsig, fmt.val, fmt2.val, fmt.wd, fmt.pc, fmt.base, fmt.all ); */ \
     615                                                fmt2.val = ((msig & 0x3) << 1) + 1; \
    615616                                                (ostype &)(os | fmt | "" | fmt2); \
    616617                                                sepOff( os ); \
    617618                                                fmt2.wd = 21; \
     619                                                fmt2.val = lsig & 0x7fffffffffffffff; \
     620                                                (ostype &)(os | fmt2); \
    618621                                        } /* if */ \
    619                                         fmt2.val = lsig & 0x7fffffffffffffffU; \
    620                                         /* printf( "\nC %llo %d %d '%c' %x\n", fmt2.val, fmt2.wd, fmt2.pc, fmt2.base, fmt2.all ); */ \
    621                                         (ostype &)(os | fmt2); \
    622622                                } else { \
    623623                                        if ( fmt.flags.pc && fmt.pc > 16 ) fmt.pc -= 16; \
  • tests/manipulatorsOutput3.cfa

    r44aad8f r038be32  
    11#include <fstream.hfa>
    22int main() {
    3     int128 x = 0xffff, y = 0x2;
    4     x <<= 64;
     3    int128 x = 0xffff;
     4    x <<= 64;;
    55    x += 0xffff;
    6     y <<= 64;
    7     y += 0123;
    8     y |= 0x8000000000000000;
    96    x = -x;
    107    sout | x;
     
    2219    sout | nl;
    2320
    24     printf( "%#.10o\n", 0123 );
    25     sout | wd( 1,10, oct(0123) );
    2621    sout | oct(x);
    2722    sout | nobase(oct(x));
    28     sout | wd( 45, oct(0123) );
    29     sout | wd( 45,40, oct(0123) );
    30     sout | wd( 40,45, oct(0123) );
    31     sout | wd( 45, oct(x) );
    32     sout | wd( 45,40, oct(x) );
    33     sout | wd( 40,45, oct(x) );
    34 
    35     sout | left(wd( 45, oct(0123) )) | 'X';
    36     sout | left(wd( 45, oct(x) )) | 'X';
    37     sout | left(wd( 45, oct(y) )) | 'X';
    38     sout | left(wd( 45,40, oct(0123) )) | 'X';
    39     sout | left(wd( 45,40, oct(x) )) | 'X';
    40     sout | left(wd( 45,40, oct(y) )) | 'X';
    41     sout | left(wd( 40,45, oct(0123) )) | 'X';
    42     sout | left(wd( 40,45, oct(x) )) | 'X';
    43     sout | left(wd( 40,45, oct(y) )) | 'X';
    44     printf( "%#-1.10oX\n", 0123 );
    45     sout | left(wd( 1,10, oct(0123) )) | 'X';
    46     printf( "%#-40.10oX\n", 0123 );
    47     sout | left(wd( 40,10, oct(0123) )) | 'X';
    48     sout | left(wd( 40,10, oct(x) )) | 'X';
    49     sout | left(wd( 40,10, oct(y) )) | 'X';
    50     sout | left(wd( 10,40, oct(0123) )) | 'X';
    51     sout | left(wd( 10,40, oct(x) )) | 'X';
    52     sout | left(wd( 10,40, oct(y) )) | 'X';
    53 
    54     y = 123456789;
    55     sout | left(wd( 45, 49, oct(y) )) | 'X';
     23    sout | wd( 45, upcase(oct(123)) );
     24    sout | wd( 45,40, upcase(oct(123)) );
     25    sout | wd( 40,45, upcase(oct(123)) );
     26    sout | wd( 45, upcase(oct(x)) );
     27    sout | wd( 45,40, upcase(oct(x)) );
     28    sout | wd( 40,45, upcase(oct(x)) );
     29    sout | left(wd( 45, upcase(oct(x)) )) | 'X';
     30    int128 y = 123456789;
     31    sout | left(wd( 45, 49, upcase(oct(y)) )) | 'X';
    5632    sout | nl;
    5733
  • tools/build/push2dist.sh

    r44aad8f r038be32  
    1919# echo "Copying to machines : ${hosts} (hash=${hash})"
    2020
    21 files="../../../driver/cfa ../../../driver/cfa-cpp ../../../driver/cc1 ../../../driver/as defines.hfa $(find . -name '*.c*' | tr '\n' ' ')"
     21files="../../../driver/cfa ../../../driver/cfa-cpp ../../../driver/cc1 ../../../driver/as $(find . -name '*.c*' | tr '\n' ' ')"
    2222# echo "Files ${files}"
    2323
Note: See TracChangeset for help on using the changeset viewer.