From 122b3ee153775588fac64a8bd679c6fae265a9f7 Mon Sep 17 00:00:00 2001 From: "Lukacs T. Berki" Date: Tue, 2 Mar 2021 10:09:34 +0100 Subject: [PATCH] Make debugging easier: - Add the -N -l command line arguments to Microfactory - Pass the the Delve arguments to the primary builder on the command line Test: Manual. Change-Id: I4034f2d48b3e40d9863529053715183dc3dce1f5 --- bootstrap/bootstrap.go | 2 +- microfactory/microfactory.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap/bootstrap.go b/bootstrap/bootstrap.go index da9af90..0064c2d 100644 --- a/bootstrap/bootstrap.go +++ b/bootstrap/bootstrap.go @@ -128,7 +128,7 @@ var ( // TODO: it's kinda ugly that some parameters are computed from // environment variables and some from Ninja parameters, but it's probably // better to not to touch that while Blueprint and Soong are separate - Command: "cd $$(dirname $builder) && BUILDER=$$PWD/$$(basename $builder) && cd / && env -i $$BUILDER $extra --top \"$$TOP\" --out \"$$SOONG_OUTDIR\" -b $buildDir -n $ninjaBuildDir -d $out.d -globFile $globFile -o $out $in", + Command: "cd $$(dirname $builder) && BUILDER=$$PWD/$$(basename $builder) && cd / && env -i $$BUILDER $extra --top \"$$TOP\" --out \"$$SOONG_OUTDIR\" --delve_listen \"$$SOONG_DELVE\" --delve_path \"$$SOONG_DELVE_PATH\" -b $buildDir -n $ninjaBuildDir -d $out.d -globFile $globFile -o $out $in", CommandDeps: []string{"$builder"}, Description: "$builder $out", Deps: blueprint.DepsGCC, diff --git a/microfactory/microfactory.go b/microfactory/microfactory.go index a70d3c5..a0c9a14 100644 --- a/microfactory/microfactory.go +++ b/microfactory/microfactory.go @@ -397,6 +397,7 @@ func (p *GoPackage) Compile(config *Config, outDir string) error { fmt.Fprintln(hash, runtime.GOOS, runtime.GOARCH, goVersion) cmd := exec.Command(filepath.Join(goToolDir, "compile"), + "-N", "-l", // Disable optimization and inlining so that debugging works better "-o", p.output, "-p", p.Name, "-complete", "-pack", "-nolocalimports")