File: 0003-SyntaxWarning.patch

package info (click to toggle)
voltron 0.1.7%2Bgit20200109-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 680 kB
  • sloc: python: 5,704; sh: 252; javascript: 118; ansic: 49; makefile: 5
file content (59 lines) | stat: -rw-r--r-- 2,836 bytes parent folder | download
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
--- a/voltron/entry.py
+++ b/voltron/entry.py
@@ -1,4 +1,4 @@
-"""
+r"""
 This is the main entry point for Voltron from the debugger host's perspective.
 This file is loaded into the debugger through whatever means the given host
 supports.
--- a/voltron/plugins/debugger/dbg_gdb.py
+++ b/voltron/plugins/debugger/dbg_gdb.py
@@ -420,7 +420,7 @@
                         output = gdb.execute('info addr {}'.format(b.location), to_string=True)
                         m = re.match('.*is at ([^ ]*) .*', output)
                         if not m:
-                            m = re.match('.*at address ([^ ]*)\..*', output)
+                            m = re.match(r'.*at address ([^ ]*)\..*', output)
                         if m:
                             addr = int(m.group(1), 16)
                         else:
@@ -588,7 +588,7 @@
             # the old way of doing this randomly crashed gdb or threw a python exception
             regs = {}
             for line in gdb.execute('info all-registers', to_string=True).split('\n'):
-                m = re.match('^([xyz]mm\d+)\s.*uint128 = (0x[0-9a-f]+)\}', line)
+                m = re.match(r'^([xyz]mm\d+)\s.*uint128 = (0x[0-9a-f]+)\}', line)
                 if m:
                     regs[m.group(1)] = int(m.group(2), 16)
             return regs
@@ -648,7 +648,7 @@
             try:
                 arch = gdb.selected_frame().architecture().name()
             except:
-                arch = re.search('\(currently (.*)\)', gdb.execute('show architecture', to_string=True)).group(1)
+                arch = re.search(r'\(currently (.*)\)', gdb.execute('show architecture', to_string=True)).group(1)
             return self.archs[arch]
 
         def get_addr_size(self):
--- a/voltron/plugins/view/memory.py
+++ b/voltron/plugins/view/memory.py
@@ -36,7 +36,7 @@
                            help='address (in hex or decimal) from which to start reading memory')
         group.add_argument('--command', '-c', action='store',
                            help='command to execute resulting in the address from which to start reading memory. '
-                                'voltron will do his almighty best to find an address. e.g. "print \$rip + 0x1234"',
+                                'voltron will do his almighty best to find an address. e.g. "print \\$rip + 0x1234"',
                            default=None)
         group.add_argument('--register', '-r', action='store',
                            help='register containing the address from which to start reading memory', default=None)
--- a/voltron/view.py
+++ b/voltron/view.py
@@ -110,7 +110,7 @@
         return len(self.chars)
 
     def clean(self):
-        return re.sub('\033\[.{1,2}m', '', str(self))
+        return re.sub(r'\033\[.{1,2}m', '', str(self))
 
 
 def requires_async(func):