diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 14:42:41 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 14:42:41 +0000 |
commit | e9ca65afea8f700c99014d32bca0d48911817cf8 (patch) | |
tree | 45a5f697f89ff4523f949c1033996fc09a65ca7a | |
parent | 841ae5884be4af07785a35eff4afc1a031fcde43 (diff) | |
download | perl-MDK-Common-e9ca65afea8f700c99014d32bca0d48911817cf8.tar perl-MDK-Common-e9ca65afea8f700c99014d32bca0d48911817cf8.tar.gz perl-MDK-Common-e9ca65afea8f700c99014d32bca0d48911817cf8.tar.bz2 perl-MDK-Common-e9ca65afea8f700c99014d32bca0d48911817cf8.tar.xz perl-MDK-Common-e9ca65afea8f700c99014d32bca0d48911817cf8.zip |
have a special debugging build
(esp. to disable closing pipe which disallow debugging back in time)
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | perl_checker.src/Makefile | 2 | ||||
-rw-r--r-- | perl_checker.src/build.mli | 1 | ||||
-rw-r--r-- | perl_checker.src/perl_checker.ml | 4 | ||||
-rw-r--r-- | perl_checker.src/tree.ml | 2 |
5 files changed, 7 insertions, 4 deletions
@@ -21,7 +21,7 @@ MDK/Common.pm: %: %.pl perl $< > $@ perl_checker.src/perl_checker: - $(MAKE) -C perl_checker.src build_ml $(PERL_CHECKER_TARGET) VENDORLIB=$(VENDORLIB) + $(MAKE) -C perl_checker.src build_ml $(PERL_CHECKER_TARGET) VENDORLIB=$(VENDORLIB) DEBUG=0 test: perl_checker.src/perl_checker perl_checker.src/perl_checker MDK/Common/*.pm diff --git a/perl_checker.src/Makefile b/perl_checker.src/Makefile index 37a562b..91a79bd 100644 --- a/perl_checker.src/Makefile +++ b/perl_checker.src/Makefile @@ -7,6 +7,7 @@ BCSUFFIX = _debug SOURCES = build.ml common.ml flags.ml config_file.ml types.mli info.ml parser_helper.ml parser.mly lexer.mll tree.ml global_checks.ml perl_checker.ml LIBS = unix VENDORLIB = $(shell dirname `pwd`) +DEBUG = 1 NAME = shyant @@ -19,6 +20,7 @@ build_ml: build.ml: date '+let date = %s' > $@ echo 'let fake_packages_dir = "'$(VENDORLIB)'/perl_checker_fake_packages"' >> $@ + echo 'let debugging = $(DEBUG) > 0' >> $@ tags: ocamltags *.ml diff --git a/perl_checker.src/build.mli b/perl_checker.src/build.mli index 49acf6e..3c6641d 100644 --- a/perl_checker.src/build.mli +++ b/perl_checker.src/build.mli @@ -1,2 +1,3 @@ val date : int val fake_packages_dir : string +val debugging : bool diff --git a/perl_checker.src/perl_checker.ml b/perl_checker.src/perl_checker.ml index 761d7e5..48e9a2d 100644 --- a/perl_checker.src/perl_checker.ml +++ b/perl_checker.src/perl_checker.ml @@ -33,7 +33,7 @@ let rec parse_file from_basedir require_name per_files file = try Info.start_a_new_file file ; let tokens = Lexer.get_token Lexer.token lexbuf in - let _ = Unix.close_process_in channel in + if not Build.debugging then ignore (Unix.close_process_in channel) ; let t = Parser_helper.parse_tokens Parser.prog tokens (Some lexbuf) in let per_file = get_global_info_from_package from_basedir require_name build_time t in set_basedir per_files per_file ; @@ -102,7 +102,7 @@ let parse_options = let usage = "Usage: perl_checker [-v] [-q] <files>\nOptions are:" in Arg.parse options (lpush args_r) usage; - let files = if !args_r = [] then ["../t.pl"] else !args_r in + let files = if !args_r = [] && Build.debugging then ["../t.pl"] else !args_r in let files = List.map Info.file_to_absolute_file files in let required_packages, per_files = collect_withenv (parse_file true None) (default_per_files()) files in diff --git a/perl_checker.src/tree.ml b/perl_checker.src/tree.ml index ea61876..7e1488d 100644 --- a/perl_checker.src/tree.ml +++ b/perl_checker.src/tree.ml @@ -257,7 +257,7 @@ let read_xs_extension_from_so global_vars_declared package pos = let fq, name = find_package_name [] 0 in Hashtbl.replace global_vars_declared (I_func, String.concat "::" fq, name) (pos, None) ) () channel; - let _ = Unix.close_process_in channel in + if not Build.debugging then ignore (Unix.close_process_in channel) ; true with Not_found -> false |