I have two sets of disassembly listings, produced with objdump -S- so the original C source is interleaved with the asm output.
What I want to do is compare only those assembly lines for which the C source has changed, in other words if a change is detected in the C source then compare the following lines of disassembly. The object of the exercise is to find what effect patches (carried out to meet a coding standard) are having on the generated object code.
typical output of the disassembly listing is this
Obviously regex's can be written to match the C source and disassembled lines, and as a start I created a regex which allows the C source lines to be marked as "unimportant text". The trouble is the logic I really want is shown in the pseudo code below
I feel this could well be doable, but am quite at a loss as to how! Therefore if anyone knows how this might be acheived I would be most grateful.
What I want to do is compare only those assembly lines for which the C source has changed, in other words if a change is detected in the C source then compare the following lines of disassembly. The object of the exercise is to find what effect patches (carried out to meet a coding standard) are having on the generated object code.
typical output of the disassembly listing is this
Code:
for (i = LCD_WIDTH * LCD_HEIGHT * 2 / 4; i < LCD_WIDTH * LCD_HEIGHT * 3 / 4; i++) fc: 697b ldr r3, [r7, #20] fe: 3301 adds r3, #1 100: 617b str r3, [r7, #20]
Code:
if((line.type == Csource) && (line.this != line.that)) { while(1) { line = getNextLine(); if(line.type == Disassembly { if(line.this != line.other) { writeToDiffLog(line); } } else if(line.type == Csource) { break; } } }
Comment