Cosmetic changes
authorEli Bendersky <eliben@gmail.com>
Tue, 25 Aug 2015 12:18:45 +0000 (05:18 -0700)
committerEli Bendersky <eliben@gmail.com>
Tue, 25 Aug 2015 12:18:45 +0000 (05:18 -0700)
elftools/dwarf/lineprogram.py
elftools/dwarf/structs.py
test/test_dwarf_lineprogram.py

index 51cfdb7f26ecc56a94a8171311132d4674d540d1..8996b5caf365908a57b31bd1b219585edd87ac35 100644 (file)
@@ -153,24 +153,18 @@ class LineProgram(object):
             if opcode >= self.header['opcode_base']:
                 # Special opcode (follow the recipe in 6.2.5.1)
                 maximum_operations_per_instruction = self['maximum_operations_per_instruction']
-                
-                
                 adjusted_opcode = opcode - self['opcode_base']
                 operation_advance = adjusted_opcode // self['line_range']
-                
-                address_addend = self['minimum_instruction_length'] * ((state.op_index + operation_advance) // maximum_operations_per_instruction)
-                
+                address_addend = (
+                    self['minimum_instruction_length'] * 
+                        ((state.op_index + operation_advance) //
+                          maximum_operations_per_instruction))
                 state.address += address_addend
-                
                 state.op_index = (state.op_index + operation_advance) % maximum_operations_per_instruction
-                
                 line_addend = self['line_base'] + (adjusted_opcode % self['line_range'])
-                
                 state.line += line_addend
-                
-                add_entry_new_state(opcode, [line_addend, address_addend, state.op_index])
-                
-                
+                add_entry_new_state(
+                    opcode, [line_addend, address_addend, state.op_index])
             elif opcode == 0:
                 # Extended opcode: start with a zero byte, followed by
                 # instruction size and the instruction itself.
index 49ffd52a4afbcc3e923e44c39397ffd19866fcc0..f90a80af09e9f43d5d673360de252d22616fdda7 100644 (file)
@@ -226,11 +226,9 @@ class DWARFStructs(object):
             self.Dwarf_uint16('version'),
             self.Dwarf_offset('header_length'),
             self.Dwarf_uint8('minimum_instruction_length'),
-                       
-                       If(lambda ctx: ctx['version'] >= 4, 
-                               self.Dwarf_uint8("maximum_operations_per_instruction"),
-                               1),
-                               
+            If(lambda ctx: ctx['version'] >= 4, 
+                self.Dwarf_uint8("maximum_operations_per_instruction"),
+                1),
             self.Dwarf_uint8('default_is_stmt'),
             self.Dwarf_int8('line_base'),
             self.Dwarf_uint8('line_range'),
index e592a829edafd15e8ad77288722d9a46305f7d41..0466926c1e01905032234cca0d26bb1892d59fe4 100644 (file)
@@ -107,4 +107,3 @@ class TestLineProgram(unittest.TestCase):
 
 if __name__ == '__main__':
     unittest.main()
-