Patent ID: 9064042
Filing Date: 2015-06-23
Classification: G06F

Abstract:
1. A method for instrumenting software code, comprising: converting a target method comprising a first byte sequence into a first linked list of corresponding first pseudo instructions and converting a template method comprising a second byte sequence into a second linked list of corresponding second pseudo instructions; replacing a first branch target offset in the first linked list with a first pointer and a second branch target offset in the second linked list with a second pointer; merging, by computer, the first linked list with the second linked list to form a merged linked list that is stored on a tangible computer-readable storage medium; assigning a new offset to each of the corresponding first and second pseudo instructions and replacing the first pointer and the second pointer with modified branch target offsets reflecting the new offset to each of the corresponding first and second pseudo instructions; converting a target exception block into a first pseudo exception block and converting a template exception block into a second pseudo exception block; replacing a first start or end offset of the target exception block with a third pointer, the third pointer pointing to instructions corresponding to a target of the first start or end offset; replacing a second start or end offset of the template exception block with a fourth pointer, the fourth pointer pointing to instructions corresponding to a target of the second start or end offset; merging the first pseudo exception block with the second pseudo exception block to form a merged exception block, wherein the second pseudo exception block is appended to the first pseudo exception block; assigning new offsets to corresponding pseudo instructions in the merged exception block; and replacing the third pointer and the fourth pointer with modified start or end offsets reflecting the new offsets to the corresponding pseudo instructions in the merged exception block.