Skip to content

Commit

Permalink
Merge pull request #10 from spectaclelabs/debug-option
Browse files Browse the repository at this point in the history
Add debug-info option
  • Loading branch information
emilmont committed Jul 3, 2013
2 parents df9e56f + bd7554f commit b85343e
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion workspace_tools/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 3 additions & 0 deletions workspace_tools/toolchains/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions workspace_tools/toolchains/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions workspace_tools/toolchains/iar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit b85343e

Please sign in to comment.