Generating a directed graph representing application program execution flow from an execution trace
Abstract
An execution trace of an application program comprises a sequence of ordered programming instructions generated during execution of the application program indicating an execution flow of the application program. The sequence of ordered programming instructions is partitioned into a plurality of linked code segments comprising first and second code segments. The first code segment comprises a terminating programming instruction that terminates the first code segment and links the first code segment to an initial programming instruction of the second code segment. A directed graph representing the execution flow of the application program between the plurality of linked code segments is generated. The directed graph comprises a plurality of linked nodes representing the plurality of linked code segments. The directed graph is output to a graphical user interface (GUI) for display.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A computer-implemented method comprising:
obtaining an execution trace of an application program, wherein the execution trace comprises a sequence of ordered programming instructions generated during execution of the application program indicating an execution flow of the application program; partitioning the sequence of ordered programming instructions into a plurality of linked code segments comprising first and second code segments, wherein the first code segment comprises a terminating programming instruction that terminates the first code segment and links the first code segment to an initial programming instruction of the second code segment; generating a directed graph representing the execution flow of the application program between the plurality of linked code segments, wherein the directed graph comprises a plurality of linked nodes representing the plurality of linked code segments; outputting the directed graph to a graphical user interface (GUI); responsive to a user selecting a node of the plurality of linked nodes within the GUI, outputting, to the GUI, source code of the application program from which the ordered programming instructions in the linked code segment corresponding to the selected node was generated; converting the directed graph into a document formatted according to a document markup language; and storing the document in memory circuitry for subsequent recreation of the directed graph with the GUI.
2 . The computer-implemented method of claim 1 , wherein the partitioning comprises responsive to detecting the terminating programming instruction and a label identifying the initial programming instruction, identifying the first and second code segments.
3 . The computer-implemented method of claim 2 :
wherein the plurality of linked nodes representing the plurality of linked code segments comprises one node that represents both:
the second code segment; and
a third code segment comprising an initial programming instruction that is an additional instance of the initial programming instruction of the second code segment; and
wherein the partitioning further comprises responsive to detecting an additional instance of the label identifying the additional instance of the initial programming instruction, identifying the third code segment.
4 . The computer-implemented method of claim 2 , wherein the terminating programming instruction comprises a jump command that designates the label as a target of the jump command.
5 . The computer-implemented method of claim 2 , further comprising responsive to receiving text that comprises the label from a user, notifying the GUI to highlight a node that corresponds to the second code segment.
6 . The computer-implemented method of claim 1 , further comprising:
incrementing a counter each time the sequence of ordered programming instructions indicates that the execution flow transitioned directly from the first code segment to the second code segment; and notifying the GUI to display the counter adjacent to first and second nodes corresponding to the first and second code segments, respectively.
7 . The computer-implemented method of claim 1 , further comprising:
calculating a rank for each of the plurality of linked nodes, wherein the rank of each node is based on the ranks of the nodes linking to the node; and responsive to receiving a rank indication corresponding to the rank of a linked node from a user, notifying the GUI to highlight the linked node within the GUI.
8 . The computer-implemented method of claim 1 , wherein the directed graph represents the execution flow of the application program between the plurality of linked code segments upon reaching a first breakpoint in the execution of the application program, the method further comprising:
generating a second directed graph representing the execution flow of the application program between the plurality of linked code segments upon reaching a subsequent second breakpoint in the execution of the application program, wherein the directed graph and the second directed graph collectively represent a change in the execution flow of the application program over time.
9 . The computer-implemented method of claim 1 wherein generating a directed graph representing the execution flow of the application program between the plurality of linked code segments comprises:
generating a respective directed graph for each of a plurality of breakpoints set by the user in the execution of the application program, wherein each directed graph:
comprises a plurality of linked nodes representing the plurality of linked code segments; and
represents the execution flow of the application program between the plurality of linked code segments as of a time a corresponding breakpoint is reached; and
wherein the directed graphs, collectively, indicate a change in the execution flow over time.
10 . A computing device comprising:
a computer processing circuit; a computer memory storing instructions that when executed by the computer processing circuit cause the computing device to perform operations comprising:
obtaining an execution trace of an application program, wherein the execution trace comprises a sequence of ordered programming instructions generated during execution of the application program and indicating an execution flow of the application program;
identifying a plurality of linked code segments within the sequence of ordered programming instructions, the plurality of linked code segments comprising:
a first code segment comprising a terminating programming instruction that terminates the first code segment; and
a second code segment comprising an initial programming instruction to which the terminating programming instruction of the first code segment is linked;
generating a directed graph representing the execution flow of the application program between the plurality of linked code segments, wherein the directed graph comprises a plurality of linked nodes representing the plurality of linked code segments;
outputting the directed graph to a graphical user interface (GUI) for display;
responsive to a user selecting a node of the plurality of linked nodes within the GUI, outputting, to the GUI, source code of the application program from which the ordered programming instructions in the linked code segment corresponding to the selected node was generated;
converting the directed graph into a document formatted according to a document markup language; and
storing the document in the computer memory for subsequent recreation of the directed graph with the GUI.
11 . The computing device of claim 10 , identifying the plurality of linked code segments includes identifying the first and second code segments responsive to detecting the terminating programming instruction and a label identifying the initial programming instruction.
12 . The computing device of claim 11 :
wherein the plurality of linked nodes representing the plurality of linked code segments comprises one node that represents both:
the second code segment; and
a third code segment comprising an initial programming instruction that is an additional instance of the initial programming instruction of the second code segment; and
wherein identifying the plurality of linked code segments includes identifying the third code segment responsive to detecting an additional instance of the label identifying the additional instance of the initial programming instruction.
13 . The computing device of claim 11 , wherein the terminating programming instruction comprises a jump command that designates the label as a target of the jump command.
14 . The computing device of claim 11 , the operations further comprising:
receiving text that comprises the label from a user, and in response, notifying the GUI to highlight a node that corresponds to the second code segment.
15 . The computing device of claim 10 , the operations further comprising:
incrementing a counter each time the sequence of ordered programming instructions indicates that the execution flow transitioned directly from the first code segment to the second code segment; and notifying the GUI to display the counter adjacent to first and second nodes corresponding to the first and second code segments, respectively.
16 . The computing device of claim 10 , the operations further comprising:
calculating a rank for each of the plurality of linked nodes, wherein the rank of each node is based on the ranks of the nodes linking to the node; and responsive to receiving a rank indication corresponding to the rank of a linked node from a user, notifying the GUI to highlight the linked node within the GUI.
17 . A non-transitory, computer-readable medium storing executable instructions that when executed by a computing device, cause the computing device to perform operations comprising:
obtaining an execution trace of an application program, wherein the execution trace comprises a sequence of ordered programming instructions generated during execution of the application program and indicating an execution flow of the application program; partitioning the sequence of ordered programming instructions into a plurality of linked code segments comprising first and second code segments, wherein the first code segment comprises a terminating programming instruction that terminates the first code segment and links the first code segment to an initial programming instruction of the second code segment; increment a counter each time the sequence of ordered programming instructions indicates that the execution flow transitioned directly from the first code segment to the second code segment; generate a directed graph representing the execution flow of the application program between the plurality of linked code segments, wherein the directed graph comprises a plurality of linked nodes representing the plurality of linked code segments; output the directed graph to a graphical user interface (GUI) for display; notify the GUI to display the counter adjacent to first and second nodes corresponding to the first and second code segments, respectively; responsive to a user selecting a node of the plurality of linked nodes within the GUI, output, to the GUI, source code of the application program from which the ordered programming instructions in the linked code segment corresponding to the selected node was generated; convert the directed graph into a document formatted according to a document markup language; and store the document in memory circuitry for subsequent recreation of the directed graph with the GUI.
18 . The non-transitory, computer-readable medium of claim 17 :
wherein the plurality of linked nodes representing the plurality of linked code segments comprises one node that represents both:
the second code segment; and
a third code segment comprising an initial programming instruction that is an additional instance of the initial programming instruction of the second code segment; and
wherein partitioning the sequence of ordered programming instructions includes:
identifying the first and second code segments responsive to detecting the terminating programming instruction and a label identifying the initial programming instruction; and
identifying the third code segment responsive to detecting an additional instance of the label identifying the additional instance of the initial programming instruction.
19 . The non-transitory, computer-readable medium of claim 17 , wherein the operations further comprise:
incrementing a counter each time the sequence of ordered programming instructions indicates that the execution flow transitioned directly from the first code segment to the second code segment; and notifying the GUI to display the counter adjacent to first and second nodes corresponding to the first and second code segments, respectively.
20 . The non-transitory, computer-readable medium of claim 17 , wherein obtaining an execution trace of the application program includes receiving the execution trace from a remote computing device that executed the application program.Join the waitlist — get patent alerts
Track US2019018756A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.