From bd7554f6aacce772db8297d405f91f4ef0eda420 Mon Sep 17 00:00:00 2001 From: Joe Turner Date: Wed, 3 Jul 2013 13:20:08 +0100 Subject: [PATCH] Add debug-info option --- workspace_tools/options.py | 2 +- workspace_tools/toolchains/arm.py | 3 +++ workspace_tools/toolchains/gcc.py | 3 +++ workspace_tools/toolchains/iar.py | 3 +++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/workspace_tools/options.py b/workspace_tools/options.py index 502f72a0dfa..752aecd9e69 100644 --- a/workspace_tools/options.py +++ b/workspace_tools/options.py @@ -19,6 +19,6 @@ def get_default_options_parser(): help="clean the build directory") parser.add_option("-o", "--options", action="append", - help='Add a build option ("save-asm": save the asm generated by the compiler)') + help='Add a build option ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information)') return parser diff --git a/workspace_tools/toolchains/arm.py b/workspace_tools/toolchains/arm.py index 00f3e2f9bd1..6d80d7d0251 100644 --- a/workspace_tools/toolchains/arm.py +++ b/workspace_tools/toolchains/arm.py @@ -31,6 +31,9 @@ def __init__(self, target, options=None, notify=None): if "save-asm" in self.options: common.extend(["--asm", "--interleave"]) + + if "debug-info" in self.options: + common.append("-g") common_c = [ "--md", "--no_depend_system_headers", diff --git a/workspace_tools/toolchains/gcc.py b/workspace_tools/toolchains/gcc.py index ac54ca67379..e33455421d4 100644 --- a/workspace_tools/toolchains/gcc.py +++ b/workspace_tools/toolchains/gcc.py @@ -39,6 +39,9 @@ def __init__(self, target, options=None, notify=None, tool_path=""): if "save-asm" in self.options: common_flags.append("-save-temps") + + if "debug-info" in self.options: + common_flags.append("-g") self.asm = [join(tool_path, "arm-none-eabi-as")] + self.cpu diff --git a/workspace_tools/toolchains/iar.py b/workspace_tools/toolchains/iar.py index 7cb553a9668..1ea2a2a41ec 100644 --- a/workspace_tools/toolchains/iar.py +++ b/workspace_tools/toolchains/iar.py @@ -28,6 +28,9 @@ def __init__(self, target, options=None, notify=None): # Pa082: Operation involving two values from two registers (ie: (float)(*obj->MR)/(float)(LPC_PWM1->MR0)) "--diag_suppress=Pa050,Pa084,Pa093,Pa082", ] + + if "debug-info" in self.options: + c_flags.append("-r") IAR_BIN = join(IAR_PATH, "bin") self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", target.core]