Changes in / [14388c1:1118b8b]


Ignore:
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/Makefile.am

    r14388c1 r1118b8b  
    2626VPATH += :../prelude
    2727
     28gdbwaittarget=""
     29
    2830# AM_CFLAGS for all cfa source
    2931# AM_CFAFLAGS for only cfa source
    3032# use -no-include-stdhdr to prevent rebuild cycles
    3133# The built sources must not depend on the installed headers
    32 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
     34AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)  @CONFIG_CFAFLAGS@
    3335AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    3436AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
  • libcfa/src/Makefile.in

    r14388c1 r1118b8b  
    435435am__v_UPP_1 =
    436436lib_LTLIBRARIES = libcfa.la libcfathread.la
     437gdbwaittarget = ""
    437438
    438439# AM_CFLAGS for all cfa source
     
    440441# use -no-include-stdhdr to prevent rebuild cycles
    441442# The built sources must not depend on the installed headers
    442 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@
     443AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb)  @CONFIG_CFAFLAGS@
    443444AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@
    444445AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@
  • src/ResolvExpr/AlternativeFinder.cc

    r14388c1 r1118b8b  
    11881188                assert( toType );
    11891189                toType = resolveTypeof( toType, indexer );
     1190                assert(!dynamic_cast<TypeofType *>(toType));
    11901191                SymTab::validateType( toType, &indexer );
    11911192                adjustExprType( toType, env, indexer );
  • src/main.cc

    r14388c1 r1118b8b  
    1717#include <execinfo.h>                       // for backtrace, backtrace_symbols
    1818#include <getopt.h>                         // for no_argument, optind, geto...
    19 #include <signal.h>                         // for signal, SIGABRT, SIGSEGV
    2019#include <cassert>                          // for assertf
    2120#include <cstdio>                           // for fopen, FILE, fclose, stdin
    2221#include <cstdlib>                          // for exit, free, abort, EXIT_F...
     22#include <csignal>                         // for signal, SIGABRT, SIGSEGV
    2323#include <cstring>                          // for index
    2424#include <fstream>                          // for ofstream
     
    9696DeclarationNode * parseTree = nullptr;                                  // program parse tree
    9797
     98static bool waiting_for_gdb = false; // flag to set cfa-cpp to wait for gdb on start
     99
    98100static std::string PreludeDirector = "";
    99101
     
    167169} // sigAbortHandler
    168170
    169 
    170171int main( int argc, char * argv[] ) {
    171172        FILE * input;                                                                           // use FILE rather than istream because yyin is FILE
     
    185186        parse_cmdline( argc, argv, filename );                          // process command-line arguments
    186187        CodeGen::FixMain::setReplaceMain( !nomainp );
     188
     189        if(waiting_for_gdb) {
     190                std::cerr << "Waiting for gdb" << std::endl;
     191                std::cerr << "run :" << std::endl;
     192                std::cerr << "  gdb attach " << getpid() << std::endl;
     193                raise(SIGSTOP);
     194        }
    187195
    188196        try {
     
    198206                } else {                                                                                // no input file name
    199207                        input = stdin;
     208                        std::cerr << "Input from stdin" << std::endl;
    200209                        // if running cfa-cpp directly, might forget to pass -F option. Since this takes from stdin, pass
    201210                        // a fake name along
     
    438447
    439448
    440 static const char optstring[] = ":hlLmNnpP:S:twW:D:F:";
     449static const char optstring[] = ":hlLmNnpP:S:tgwW:D:F:";
    441450
    442451enum { PreludeDir = 128 };
     
    453462        { "statistics", required_argument, nullptr, 'S' },
    454463        { "tree", no_argument, nullptr, 't' },
     464        { "gdb", no_argument, nullptr, 'g' },
    455465        { "", no_argument, nullptr, 0 },                                        // -w
    456466        { "", no_argument, nullptr, 0 },                                        // -W
     
    471481        "<directory> prelude directory for debug/nodebug",      // no flag
    472482        "<option-list> enable profiling information:\n          counters,heap,time,all,none", // -S
    473         "build in tree",                                                                        // -t
     483        "building cfa standard lib",                                                                    // -t
     484        "wait for gdb to attach",                                                                       // -g
    474485        "",                                                                                                     // -w
    475486        "",                                                                                                     // -W
     
    582593                        Stats::parse_params( optarg );
    583594                        break;
    584                   case 't':                                                                             // build in tree
     595                  case 't':                                                                             // building cfa stdlib
    585596                        treep = true;
     597                        break;
     598                  case 'g':                                                                             // wait for gdb
     599                        waiting_for_gdb = true;
    586600                        break;
    587601                  case 'w':                                                                             // suppress all warnings, hidden
Note: See TracChangeset for help on using the changeset viewer.