You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2016/04/28 02:09:35 UTC

[08/32] incubator-mynewt-newt git commit: Also output of compiler.path.objsize when running 'newt size'.

Also output of compiler.path.objsize when running 'newt size'.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/commit/a6ae7a81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/tree/a6ae7a81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/diff/a6ae7a81

Branch: refs/heads/master
Commit: a6ae7a81a0c9ec34ed3314ded048ff6485e1c20e
Parents: 56cb7e8
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Tue Mar 29 14:25:11 2016 -0700
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Tue Mar 29 14:25:11 2016 -0700

----------------------------------------------------------------------
 newt/builder/size.go       | 13 +++++++++++++
 newt/toolchain/compiler.go |  9 +++++++++
 2 files changed, 22 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/a6ae7a81/newt/builder/size.go
----------------------------------------------------------------------
diff --git a/newt/builder/size.go b/newt/builder/size.go
index 8c79f42..cc2061e 100644
--- a/newt/builder/size.go
+++ b/newt/builder/size.go
@@ -339,5 +339,18 @@ func (b *Builder) Size() error {
 		return err
 	}
 	fmt.Printf("%s", output)
+
+	c, err := b.newCompiler(b.appPkg, b.PkgBinDir(b.AppElfPath()))
+	if err != nil {
+		return err
+	}
+
+	fmt.Printf("\nobjsize\n")
+	output, err = c.PrintSize(b.AppElfPath())
+	if err != nil {
+		return err
+	}
+	fmt.Printf("%s", output)
+
 	return nil
 }

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-newt/blob/a6ae7a81/newt/toolchain/compiler.go
----------------------------------------------------------------------
diff --git a/newt/toolchain/compiler.go b/newt/toolchain/compiler.go
index 28be423..6cc6b3b 100644
--- a/newt/toolchain/compiler.go
+++ b/newt/toolchain/compiler.go
@@ -618,6 +618,15 @@ func (c *Compiler) generateExtras(elfFilename string,
 	return nil
 }
 
+func (c *Compiler) PrintSize(elfFilename string) (string, error) {
+	cmd := c.osPath + " " + elfFilename
+	rsp, err := util.ShellCommand(cmd)
+	if err != nil {
+		return "", err
+	}
+	return string(rsp), nil
+}
+
 // Links the specified elf file and generates some associated artifacts (lst,
 // bin, and map files).
 //