Created
March 4, 2021 03:13
-
-
Save ariscop/5c2089d7d1922f36d67e2b02f0556404 to your computer and use it in GitHub Desktop.
awful gdb script to measure pathfinder cost by train in factorio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file factorio | |
set $train_id = (int)0 | |
set $start = (unsigned long long)0 | |
set $end = (unsigned long long)0 | |
# for 1.1.26, linux build | |
break _ZN5Train11requestPathEPK4Rail13RailDirectionPK20InChainSignalSection | |
commands | |
set $train_id = *(int*)((void*)$rdi + 0x30) | |
# location of the train pathfinder time used counter | |
set $start = *(unsigned long long*)(*(void**)0x2a2b740 + 0x1e98) | |
continue | |
end | |
# return instruction | |
break *_ZN5Train11requestPathEPK4Rail13RailDirectionPK20InChainSignalSection + 367 | |
commands | |
set $end= *(unsigned long long*)(*(void**)0x2a2b740 + 0x1e98) | |
printf "id: %d delta: %d", $train_id, $end - $start | |
continue | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment