Skip to content

Commit b85343e

Browse files
committed
Merge pull request #10 from spectaclelabs/debug-option
Add debug-info option
2 parents df9e56f + bd7554f commit b85343e

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

workspace_tools/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ def get_default_options_parser():
1919
help="clean the build directory")
2020

2121
parser.add_option("-o", "--options", action="append",
22-
help='Add a build option ("save-asm": save the asm generated by the compiler)')
22+
help='Add a build option ("save-asm": save the asm generated by the compiler, "debug-info": generate debugging information)')
2323

2424
return parser

workspace_tools/toolchains/arm.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def __init__(self, target, options=None, notify=None):
3131

3232
if "save-asm" in self.options:
3333
common.extend(["--asm", "--interleave"])
34+
35+
if "debug-info" in self.options:
36+
common.append("-g")
3437

3538
common_c = [
3639
"--md", "--no_depend_system_headers",

workspace_tools/toolchains/gcc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ def __init__(self, target, options=None, notify=None, tool_path=""):
3939

4040
if "save-asm" in self.options:
4141
common_flags.append("-save-temps")
42+
43+
if "debug-info" in self.options:
44+
common_flags.append("-g")
4245

4346
self.asm = [join(tool_path, "arm-none-eabi-as")] + self.cpu
4447

workspace_tools/toolchains/iar.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ def __init__(self, target, options=None, notify=None):
2828
# Pa082: Operation involving two values from two registers (ie: (float)(*obj->MR)/(float)(LPC_PWM1->MR0))
2929
"--diag_suppress=Pa050,Pa084,Pa093,Pa082",
3030
]
31+
32+
if "debug-info" in self.options:
33+
c_flags.append("-r")
3134

3235
IAR_BIN = join(IAR_PATH, "bin")
3336
self.asm = [join(IAR_BIN, "iasmarm")] + ["--cpu", target.core]

0 commit comments

Comments
 (0)