@@ -905,6 +905,7 @@ func main() {
905
905
printAllocsString := flag .String ("print-allocs" , "" , "regular expression of functions for which heap allocations should be printed" )
906
906
printCommands := flag .Bool ("x" , false , "Print commands" )
907
907
nodebug := flag .Bool ("no-debug" , false , "disable DWARF debug symbol generation" )
908
+ ocdCommandsString := flag .String ("ocd-commands" , "" , "OpenOCD commands, overriding target spec (can specify multiple separated by commas)" )
908
909
ocdOutput := flag .Bool ("ocd-output" , false , "print OCD daemon output during debug" )
909
910
port := flag .String ("port" , "" , "flash port (can specify multiple candidates separated by commas)" )
910
911
programmer := flag .String ("programmer" , "" , "which hardware programmer to use" )
@@ -943,6 +944,7 @@ func main() {
943
944
fmt .Fprintln (os .Stderr , err )
944
945
os .Exit (1 )
945
946
}
947
+
946
948
var printAllocs * regexp.Regexp
947
949
if * printAllocsString != "" {
948
950
printAllocs , err = regexp .Compile (* printAllocsString )
@@ -951,24 +953,31 @@ func main() {
951
953
os .Exit (1 )
952
954
}
953
955
}
956
+
957
+ var ocdCommands []string
958
+ if * ocdCommandsString != "" {
959
+ ocdCommands = strings .Split (* ocdCommandsString , "," )
960
+ }
961
+
954
962
options := & compileopts.Options {
955
- Target : * target ,
956
- Opt : * opt ,
957
- GC : * gc ,
958
- PanicStrategy : * panicStrategy ,
959
- Scheduler : * scheduler ,
960
- PrintIR : * printIR ,
961
- DumpSSA : * dumpSSA ,
962
- VerifyIR : * verifyIR ,
963
- Debug : ! * nodebug ,
964
- PrintSizes : * printSize ,
965
- PrintStacks : * printStacks ,
966
- PrintAllocs : printAllocs ,
967
- PrintCommands : * printCommands ,
968
- Tags : * tags ,
969
- GlobalValues : globalVarValues ,
970
- WasmAbi : * wasmAbi ,
971
- Programmer : * programmer ,
963
+ Target : * target ,
964
+ Opt : * opt ,
965
+ GC : * gc ,
966
+ PanicStrategy : * panicStrategy ,
967
+ Scheduler : * scheduler ,
968
+ PrintIR : * printIR ,
969
+ DumpSSA : * dumpSSA ,
970
+ VerifyIR : * verifyIR ,
971
+ Debug : ! * nodebug ,
972
+ PrintSizes : * printSize ,
973
+ PrintStacks : * printStacks ,
974
+ PrintAllocs : printAllocs ,
975
+ PrintCommands : * printCommands ,
976
+ Tags : * tags ,
977
+ GlobalValues : globalVarValues ,
978
+ WasmAbi : * wasmAbi ,
979
+ Programmer : * programmer ,
980
+ OpenOCDCommands : ocdCommands ,
972
981
}
973
982
974
983
os .Setenv ("CC" , "clang -target=" + * target )
0 commit comments