主权项 |
1. At a computer system, the computer system having a plurality of hardware memory storage locations used for storing values for variables during the execution of binary code, a method for debugging binary code, the method comprising:
executing a compiled binary code to a first breakpoint, the compiled binary code having been created from source code using a compiler, the binary code optimized to reuse the plurality of hardware memory storage locations for storing values for different variables used within the binary code at different times during execution; identifying a variable used within binary code, the variable having a variable name defined in the source code; at the first breakpoint, performing a static analysis on the compiled binary code, including:
performing a liveness analysis to determine that the identified variable is currently live, even when the variable is no longer used, the liveness analysis including:
determining that the identified variable has been set;determining a hardware memory storage location for the identified variable, from among the plurality of hardware memory storage locations, that stores a value for the identified variable, the hardware memory storage location configured to store values for different variables, from among a plurality of different variables including the identified variable, at different times during execution of the binary code; andchecking if the identified variable is live at the determined hardware memory storage location by determining that the stored value is current, including ensuring that the determined hardware memory storage location has not been overwritten with a value for another variable included in the plurality of different variables; retrieving the value from the hardware memory storage location in response to determining that the identified variable is live; and presenting the identified variable and the value on a user interface. |