mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
Register and add among JT reasons FunctionSymbol
The symbol handling has been extended to register whether a symbol represents a function or not. This information is then used to register, during the global data harvesting phase, all the function symbols and explicitly mark them through the "FunctionSymbol" `JTReason`. We use this information during the CFEP harvesting phase to integrate the information produced by the function boundaries detection with potential unidentified CFEPs. This option can be enabled with the `--use-debug-symbols`, which supersedes `--use-sections`.
This commit is contained in:
committed by
Alessandro Di Federico
parent
6e642ea6f9
commit
500d77f43e
+7
-3
@@ -89,7 +89,8 @@ CodeGenerator::CodeGenerator(BinaryFile &Binary,
|
||||
bool EnableOSRA,
|
||||
bool DetectFunctionBoundaries,
|
||||
bool EnableLinking,
|
||||
bool ExternalCSVs) :
|
||||
bool ExternalCSVs,
|
||||
bool UseDebugSymbols) :
|
||||
TargetArchitecture(Target),
|
||||
Context(getGlobalContext()),
|
||||
TheModule((new Module("top", Context))),
|
||||
@@ -99,7 +100,8 @@ CodeGenerator::CodeGenerator(BinaryFile &Binary,
|
||||
EnableOSRA(EnableOSRA),
|
||||
DetectFunctionBoundaries(DetectFunctionBoundaries),
|
||||
EnableLinking(EnableLinking),
|
||||
ExternalCSVs(ExternalCSVs)
|
||||
ExternalCSVs(ExternalCSVs),
|
||||
UseDebugSymbols(UseDebugSymbols)
|
||||
{
|
||||
OriginalInstrMDKind = Context.getMDKindID("oi");
|
||||
PTCInstrMDKind = Context.getMDKindID("pi");
|
||||
@@ -964,7 +966,9 @@ void CodeGenerator::translate(uint64_t VirtualAddress) {
|
||||
|
||||
if (DetectFunctionBoundaries) {
|
||||
legacy::FunctionPassManager FPM(&*TheModule);
|
||||
FPM.add(new FunctionBoundariesDetectionPass(&JumpTargets, ""));
|
||||
FPM.add(new FunctionBoundariesDetectionPass(&JumpTargets,
|
||||
"",
|
||||
UseDebugSymbols));
|
||||
FPM.run(*MainFunction);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user