I don’t think there is such a tool. It is expected that the team programmers are well aware of what they are doing.
However, if you are really after this, you can develop such a tool.
In it, you need to analyze the source code of the assembly and find out the instructions that change the registers that should be saved by the subroutine. The same goes for the instructions for saving / restoring these registers.
You will also need to find out where the routines start and end. The beginning can be recognized by noting that the label denoting the entry point into the subprogram is defined as public / global / whatever, basically that it should be visible from the outside by the linker. Another possible heuristic is that the label is used in call instructions or regardless of its equivalent. Likewise, you can determine the end of a routine by specifying instructions or sequences of them that return.
There are times when it is difficult to understand the beginning and the end, or whether the register was really destroyed or saved. Some of them can be solved using additional heuristics. The rest may lead to warnings by default. It is probably best to have false negatives, false alarms, then vice versa. If the code is small, figuring out whether the warning is significant or not should be easy.
For this task, you should consider some scripting or scripting languages that can process strings, support regular expressions and support the "standard" containers and the algorithms that work with them (search / sort / etc). Perl and Python could do the job well. I would not recommend doing this in C or C ++, because you will need to rewrite and discard many small fragments during the development process. Compilation is an additional obstacle, no matter how small it may be. Debugging low-level code or templates is not fun.
source share