File: ignore-windows-debug-tools

package info (click to toggle)
valinor 1.1.4-7
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 320 kB
  • sloc: python: 428; makefile: 24; sh: 7
file content (133 lines) | stat: -rw-r--r-- 4,440 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
Description: Drop Windows debugging tools
 Drop uVision from list of candidate debugging tools
Author: Nick Morrott <knowledgejunkie@gmail.com>
Forwarded: not-needed
Last-Update: 2018-12-28
---
--- a/valinor/ide_detection.py
+++ b/valinor/ide_detection.py
@@ -25,43 +25,12 @@
 
 # preferred order of IDEs if multiple are available
 IDE_Preference = [
-    'uvision', 'uvision5', 'arm_none_eabi_gdb', 'gdb'
+    'arm_none_eabi_gdb', 'gdb'
 ]
 
 
 logger = logging.getLogger('ide_detect')
 
-def _read_hklm_reg_value(key_path, value_name):
-    ''' read a value from a registry key under HKEY_LOCAL_MACHINE '''
-    if os.name != 'nt':
-        return None
-    import _winreg as winreg
-
-    k = None
-    value = None
-    try:
-        k = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, key_path)
-        v = winreg.QueryValueEx(k, value_name)
-        return v[0]
-    except WindowsError:
-        if k:
-            winreg.CloseKey(k)
-    return value
-
-def _find_uvision():
-    found = find_executable('UV4')
-    if found: return found
-    if os.name == 'nt':
-        found_pathdir = _read_hklm_reg_value(r'Software\Keil\Products\MDK', 'Path')
-        if not found_pathdir:
-            found_pathdir = _read_hklm_reg_value(r'Software\Wow6432Node\Keil\Products\MDK', 'Path')
-        if found_pathdir:
-            found = os.path.join(found_pathdir, '..', 'UV4', 'UV4.exe')
-            if os.path.isfile(found):
-                return os.path.normpath(found)
-    return None
-
-
 def _find_generic_gdb():
     return find_executable('gdb')
 
@@ -69,24 +38,7 @@
 def _find_arm_none_eabi_gdb():
     return find_executable('gdb')
 
-
-def _uvision_launcher(uvision_exe):
-    def launch_uvision(projectfiles, executable):
-        uvproj = [
-            x for x in projectfiles if x.endswith('.uvproj') or x.endswith('.uvprojx')
-        ]
-        if len(uvproj) != 1:
-            raise Exception('Exactly one project file must be provided')
-        logger.info("launching uvision: %s %s", uvision_exe, uvproj[0])
-        child = subprocess.Popen(
-            [uvision_exe, uvproj[0]],
-        )
-        child.wait()
-    return launch_uvision
-
 IDE_Scanners = {
-              'uvision': (_find_uvision, _uvision_launcher),
-             'uvision5': (_find_uvision, _uvision_launcher),
                   'gdb': (_find_generic_gdb, gdb_launcher),
     'arm_none_eabi_gdb': (_find_arm_none_eabi_gdb, arm_none_eabi_gdb_launcher),
 }
--- a/valinor/main.py
+++ b/valinor/main.py
@@ -124,14 +124,7 @@
     project = Project(file_base_name, [project_data], project_settings)
     project.generate(ide_tool)
 
-    # perform any modifications to the executable itself that are necessary to
-    # debug it (for example, to debug an ELF with Keil uVision, it must be
-    # renamed to have the .axf extension)
     executable = args.executable
-    if ide_tool in ('uvision', 'uvision5'):
-        new_exe_path = args.executable + '.axf'
-        shutil.copy(args.executable, new_exe_path)
-        executable = new_exe_path
     projectfiles = project.get_generated_project_files(ide_tool)
     if not projectfiles:
         logging.error("failed to generate project files")
--- a/valinor/test/test_outputdir.py
+++ b/valinor/test/test_outputdir.py
@@ -33,27 +33,6 @@
         self.assertEqual(status, 0)
         return err or out
 
-    def testUVision(self):
-        def runWithDir(d=None):
-            args = [
-                '--tool', 'uvision',
-                '--target', 'K64F',
-                os.path.relpath(self.exe_path, self.workingdir),
-                '-n'
-            ]
-            if d:
-                args += ['-d', d]
-            out = self.runCheck(args)
-
-        runWithDir()
-        self.assertTrue(os.path.isfile(self.exe_path + '.uvproj'))
-
-        runWithDir('somesubdir')
-        self.assertTrue(os.path.isfile(os.path.join(self.workingdir, 'somesubdir', 'myexe.uvproj')))
-
-        runWithDir(os.path.join('somesubdir','anotherdir') + os.path.sep)
-        self.assertTrue(os.path.isfile(os.path.join(self.workingdir, 'somesubdir', 'anotherdir', 'myexe.uvproj')))
-
     def testARMNoneEABIGDB(self):
         def runWithDir(d=None):
             args = [
@@ -74,7 +53,3 @@
 
         runWithDir(os.path.join('somesubdir','anotherdir') + os.path.sep)
         self.assertTrue(os.path.isfile(os.path.join(self.workingdir, 'somesubdir', 'anotherdir', 'myexe.gdbstartup')))
-
-
-
-