Changeset dee1f89
- Timestamp:
- Aug 13, 2019, 2:35:54 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 1118b8b
- Parents:
- b3976bf
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/Makefile.am
rb3976bf rdee1f89 26 26 VPATH += :../prelude 27 27 28 gdbwaittarget="" 29 28 30 # AM_CFLAGS for all cfa source 29 31 # AM_CFAFLAGS for only cfa source 30 32 # use -no-include-stdhdr to prevent rebuild cycles 31 33 # The built sources must not depend on the installed headers 32 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@34 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ 33 35 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 34 36 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ -
libcfa/src/Makefile.in
rb3976bf rdee1f89 435 435 am__v_UPP_1 = 436 436 lib_LTLIBRARIES = libcfa.la libcfathread.la 437 gdbwaittarget = "" 437 438 438 439 # AM_CFLAGS for all cfa source … … 440 441 # use -no-include-stdhdr to prevent rebuild cycles 441 442 # The built sources must not depend on the installed headers 442 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr @CONFIG_CFAFLAGS@443 AM_CFAFLAGS = -quiet -in-tree -I$(srcdir)/stdhdr $(if $(findstring ${gdbwaittarget}, ${@}), -XCFA --gdb) @CONFIG_CFAFLAGS@ 443 444 AM_CFLAGS = -g -Wall -Wno-unused-function -fPIC @ARCH_FLAGS@ @CONFIG_CFLAGS@ 444 445 AM_CCASFLAGS = -g -Wall -Wno-unused-function @ARCH_FLAGS@ @CONFIG_CFLAGS@ -
src/main.cc
rb3976bf rdee1f89 17 17 #include <execinfo.h> // for backtrace, backtrace_symbols 18 18 #include <getopt.h> // for no_argument, optind, geto... 19 #include <signal.h> // for signal, SIGABRT, SIGSEGV20 19 #include <cassert> // for assertf 21 20 #include <cstdio> // for fopen, FILE, fclose, stdin 22 21 #include <cstdlib> // for exit, free, abort, EXIT_F... 22 #include <csignal> // for signal, SIGABRT, SIGSEGV 23 23 #include <cstring> // for index 24 24 #include <fstream> // for ofstream … … 96 96 DeclarationNode * parseTree = nullptr; // program parse tree 97 97 98 static bool waiting_for_gdb = false; // flag to set cfa-cpp to wait for gdb on start 99 98 100 static std::string PreludeDirector = ""; 99 101 … … 167 169 } // sigAbortHandler 168 170 169 170 171 int main( int argc, char * argv[] ) { 171 172 FILE * input; // use FILE rather than istream because yyin is FILE … … 185 186 parse_cmdline( argc, argv, filename ); // process command-line arguments 186 187 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 } 187 195 188 196 try { … … 198 206 } else { // no input file name 199 207 input = stdin; 208 std::cerr << "Input from stdin" << std::endl; 200 209 // if running cfa-cpp directly, might forget to pass -F option. Since this takes from stdin, pass 201 210 // a fake name along … … 438 447 439 448 440 static const char optstring[] = ":hlLmNnpP:S:t wW:D:F:";449 static const char optstring[] = ":hlLmNnpP:S:tgwW:D:F:"; 441 450 442 451 enum { PreludeDir = 128 }; … … 453 462 { "statistics", required_argument, nullptr, 'S' }, 454 463 { "tree", no_argument, nullptr, 't' }, 464 { "gdb", no_argument, nullptr, 'g' }, 455 465 { "", no_argument, nullptr, 0 }, // -w 456 466 { "", no_argument, nullptr, 0 }, // -W … … 471 481 "<directory> prelude directory for debug/nodebug", // no flag 472 482 "<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 474 485 "", // -w 475 486 "", // -W … … 582 593 Stats::parse_params( optarg ); 583 594 break; 584 case 't': // build in tree595 case 't': // building cfa stdlib 585 596 treep = true; 597 break; 598 case 'g': // wait for gdb 599 waiting_for_gdb = true; 586 600 break; 587 601 case 'w': // suppress all warnings, hidden
Note: See TracChangeset
for help on using the changeset viewer.