aboutsummaryrefslogtreecommitdiffstats
path: root/driver
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-11-16 16:50:45 +0100
committerBernhard Schommer <bernhardschommer@gmail.com>2015-11-16 16:50:45 +0100
commit1f51841a41b98ecaed25d84c848fc161d8d18e2a (patch)
tree7cb05737e8edebd932c047a2948fe16ef3c4d8d2 /driver
parent20e3c4aee0332960b008ec7aaa5c8689fa0bd059 (diff)
downloadcompcert-1f51841a41b98ecaed25d84c848fc161d8d18e2a.tar.gz
compcert-1f51841a41b98ecaed25d84c848fc161d8d18e2a.zip
Added now option to control debug output.
The new option gdepth subumes the gonly-globals. The option allows it to control the level of information that is produced. This option allows it to generate debugging inforation for: -Only globals -Global and local variables but without location information for the local variable -Full information Bug 17638.
Diffstat (limited to 'driver')
-rw-r--r--driver/Clflags.ml2
-rw-r--r--driver/Driver.ml11
2 files changed, 10 insertions, 3 deletions
diff --git a/driver/Clflags.ml b/driver/Clflags.ml
index 1eaa5449..6c2cc661 100644
--- a/driver/Clflags.ml
+++ b/driver/Clflags.ml
@@ -47,7 +47,7 @@ let option_dasm = ref false
let option_sdump = ref false
let option_g = ref false
let option_gdwarf = ref 2
-let option_gglobal = ref false
+let option_gdepth = ref 3
let option_o = ref (None: string option)
let option_E = ref false
let option_S = ref false
diff --git a/driver/Driver.ml b/driver/Driver.ml
index 391af5e7..4a79d7e7 100644
--- a/driver/Driver.ml
+++ b/driver/Driver.ml
@@ -439,7 +439,9 @@ Language support options (use -fno-<opt> to turn off -f<opt>) :
Debugging options:
-g Generate debugging information
-gdwarf- (GCC only) Generate debug information in DWARF v2 or DWARF v3
- -gonly-global Generate debugging information only for globals
+ -gdepth <n> Control generation of debugging information
+ (<n>=0: none, <n>=1: only-globals, <n>=2: globals + locals
+ without locations, <n>=3: full;)
-frename-static Rename static functions and declarations
Optimization options: (use -fno-<opt> to turn off -f<opt>)
-O Optimize the compiled code [on by default]
@@ -552,7 +554,12 @@ let cmdline_actions =
Exact "-gdwarf-3", Self (fun s -> option_g := true;
option_gdwarf := 3);
Exact "-frename-static", Self (fun s -> option_rename_static:= true);
- Exact "-gonly-global", Self (fun s -> option_gglobal := true);
+ Exact "-gdepth", Integer (fun n -> if n = 0 || n <0 then begin
+ option_g := false
+ end else begin
+ option_g := true;
+ option_gdepth := if n > 3 then 3 else n
+ end);
(* Code generation options -- more below *)
Exact "-O0", Self (fun _ -> unset_all optimization_options);
Exact "-O", Self (fun _ -> set_all optimization_options);