Skip to content

Commit 9fa2c75

Browse files
author
Andriy.Lishchynskyi
committed
added support for debug and program launch configurations
1 parent aff2bee commit 9fa2c75

File tree

3 files changed

+153
-4
lines changed

3 files changed

+153
-4
lines changed

tools/export/cdt/__init__.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from os.path import join, exists
44
from os import makedirs, remove
55
import shutil
6+
from jinja2.exceptions import TemplateNotFound
67

78
from tools.export.makefile import Makefile, GccArm, Armc5, IAR
89

@@ -29,11 +30,19 @@ def generate(self):
2930
if not exists(join(self.export_dir,'eclipse-extras')):
3031
makedirs(join(self.export_dir,'eclipse-extras'))
3132

33+
templates = ['%s.tmpl' % (self.target.lower())] + \
34+
['%s.tmpl' % (label.lower()) for label
35+
in self.toolchain.target.extra_labels] + \
36+
['%s.tmpl' % 'pyocd_settings']
37+
38+
for templatefile in templates:
39+
try:
40+
self.gen_file('cdt/%s' % templatefile, ctx, join('eclipse-extras',
41+
'{target}_{project}_{launch}.launch'.format(target=self.target,
42+
project=self.project_name, launch=templatefile)))
43+
except TemplateNotFound:
44+
pass
3245

33-
self.gen_file('cdt/pyocd_settings.tmpl', ctx,
34-
join('eclipse-extras',
35-
'{target}_pyocd_{project}_settings.launch'.format(target=self.target,
36-
project=self.project_name)))
3746
self.gen_file('cdt/necessary_software.tmpl', ctx,
3847
join('eclipse-extras','necessary_software.p2f'))
3948

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.launchConfigurationType">
3+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doContinue" value="true"/>
4+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doDebugInRam" value="false"/>
5+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doFirstReset" value="false"/>
6+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doGdbServerAllocateConsole" value="true"/>
7+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doGdbServerAllocateSemihostingConsole" value="false"/>
8+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doSecondReset" value="true"/>
9+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doStartGdbServer" value="true"/>
10+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.enableSemihosting" value="false"/>
11+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.firstResetType" value=""/>
12+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off"/>
13+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbClientOtherOptions" value=""/>
14+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerBoardId" value=""/>
15+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerBusSpeed" value="1000000"/>
16+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerConnectionAddress" value=""/>
17+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerEnableSemihosting" value="false"/>
18+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerExecutable" value="${pyocd_path}/${pyocd_executable}"/>
19+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerFlashFastVerify" value="false"/>
20+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerFlashMode" value="2"/>
21+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerGdbPortNumber" value="3334"/>
22+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerHaltAtHardFault" value="false"/>
23+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerLog" value=""/>
24+
<!-- Remove target name(-t cy8c6xxa) once we have DAPLink support in KP3 -->
25+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerOther" value="-t cy8c6xxa&#13;&#10;-p 3333&#13;&#10;--no-deprecation-warning"/>
26+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerOverrideTarget" value="false"/>
27+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerStepIntoInterrutps" value="false"/>
28+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerTargetName" value=""/>
29+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerTelnetPortNumber" value="4444"/>
30+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerUseGdbSyscalls" value="false"/>
31+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.otherInitCommands" value=""/>
32+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.otherRunCommands" value=""/>
33+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.secondResetType" value=""/>
34+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
35+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
36+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
37+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU ARM PyOCD"/>
38+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="{{load_exe}}"/>
39+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="{{load_exe}}"/>
40+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
41+
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3334"/>
42+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
43+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
44+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="true"/>
45+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
46+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
47+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
48+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
49+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
50+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
51+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
52+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
53+
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_sufix}"/>
54+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
55+
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
56+
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
57+
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
58+
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="{{elf_location}}"/>
59+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="{{name}}"/>
60+
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
61+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
62+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
63+
<listEntry value="/{{name}}"/>
64+
</listAttribute>
65+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
66+
<listEntry value="4"/>
67+
</listAttribute>
68+
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#13;&#10;"/>
69+
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
70+
</launchConfiguration>
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<launchConfiguration type="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.launchConfigurationType">
3+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doContinue" value="false"/>
4+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doDebugInRam" value="false"/>
5+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doFirstReset" value="false"/>
6+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doGdbServerAllocateConsole" value="true"/>
7+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doGdbServerAllocateSemihostingConsole" value="false"/>
8+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doSecondReset" value="false"/>
9+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.doStartGdbServer" value="true"/>
10+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.enableSemihosting" value="false"/>
11+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.firstResetType" value=""/>
12+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbClientOtherCommands" value="set mem inaccessible-by-default off&#13;&#10;target remote localhost:3334&#13;&#10;mon reset halt&#13;&#10;load&#13;&#10;mon reset&#13;&#10;quit"/>
13+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbClientOtherOptions" value="{{elf_location}}"/>
14+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerBoardId" value=""/>
15+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerBusSpeed" value="1000000"/>
16+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerConnectionAddress" value=""/>
17+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerEnableSemihosting" value="false"/>
18+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerExecutable" value="${pyocd_path}/${pyocd_executable}"/>
19+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerFlashFastVerify" value="false"/>
20+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerFlashMode" value="2"/>
21+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerGdbPortNumber" value="3334"/>
22+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerHaltAtHardFault" value="false"/>
23+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerLog" value=""/>
24+
<!-- Remove target name(-t cy8c6xxa) once we have DAPLink support in KP3 -->
25+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerOther" value="-p 3333&#13;&#10;-t cy8c6xxa&#13;&#10;--no-deprecation-warning"/>
26+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerOverrideTarget" value="false"/>
27+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerStepIntoInterrutps" value="false"/>
28+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerTargetName" value=""/>
29+
<intAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerTelnetPortNumber" value="4444"/>
30+
<booleanAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.gdbServerUseGdbSyscalls" value="false"/>
31+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.otherInitCommands" value=""/>
32+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.otherRunCommands" value=""/>
33+
<stringAttribute key="ilg.gnuarmeclipse.debug.gdbjtag.pyocd.secondResetType" value=""/>
34+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageFileName" value=""/>
35+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.imageOffset" value=""/>
36+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.ipAddress" value="localhost"/>
37+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.jtagDevice" value="GNU ARM PyOCD"/>
38+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadImage" value="false"/>
39+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.loadSymbols" value="false"/>
40+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.pcRegister" value=""/>
41+
<intAttribute key="org.eclipse.cdt.debug.gdbjtag.core.portNumber" value="3334"/>
42+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setPcRegister" value="false"/>
43+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setResume" value="false"/>
44+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.setStopAt" value="false"/>
45+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.stopAt" value="main"/>
46+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsFileName" value=""/>
47+
<stringAttribute key="org.eclipse.cdt.debug.gdbjtag.core.symbolsOffset" value=""/>
48+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForImage" value="false"/>
49+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useFileForSymbols" value="false"/>
50+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForImage" value="true"/>
51+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useProjBinaryForSymbols" value="true"/>
52+
<booleanAttribute key="org.eclipse.cdt.debug.gdbjtag.core.useRemoteTarget" value="true"/>
53+
<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${cross_prefix}gdb${cross_sufix}"/>
54+
<booleanAttribute key="org.eclipse.cdt.dsf.gdb.UPDATE_THREADLIST_ON_SUSPEND" value="false"/>
55+
<intAttribute key="org.eclipse.cdt.launch.ATTR_BUILD_BEFORE_LAUNCH_ATTR" value="2"/>
56+
<stringAttribute key="org.eclipse.cdt.launch.COREFILE_PATH" value=""/>
57+
<stringAttribute key="org.eclipse.cdt.launch.DEBUGGER_REGISTER_GROUPS" value=""/>
58+
<stringAttribute key="org.eclipse.cdt.launch.PROGRAM_NAME" value="{{elf_location}}"/>
59+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_ATTR" value="{{name}}"/>
60+
<booleanAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_AUTO_ATTR" value="false"/>
61+
<stringAttribute key="org.eclipse.cdt.launch.PROJECT_BUILD_CONFIG_ID_ATTR" value=""/>
62+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
63+
<listEntry value="/{{name}}"/>
64+
</listAttribute>
65+
<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
66+
<listEntry value="4"/>
67+
</listAttribute>
68+
<stringAttribute key="org.eclipse.dsf.launch.MEMORY_BLOCKS" value="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;memoryBlockExpressionList context=&quot;Context string&quot;/&gt;&#13;&#10;"/>
69+
<stringAttribute key="process_factory_id" value="org.eclipse.cdt.dsf.gdb.GdbProcessFactory"/>
70+
</launchConfiguration>

0 commit comments

Comments
 (0)