1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

testsc: print the address of main().

As explained in the comment in the code, this makes it easier to map
addresses in the log files back to addresses in the code, if the
testsc image is built as a position-independent executable.
This commit is contained in:
Simon Tatham 2019-12-15 20:39:01 +00:00
parent bac0a4dba7
commit 2804789be8

View File

@ -1450,6 +1450,15 @@ int main(int argc, char **argv)
if (is_dry_run) {
printf("Dry run (DynamoRIO instrumentation not detected)\n");
} else {
/* Print the address of main() in this run. The idea is that
* if this image is compiled to be position-independent, then
* PC values in the logs won't match the ones you get if you
* disassemble the binary, so it'll be harder to match up the
* log messages to the code. But if you know the address of a
* fixed (and not inlined) function in both worlds, you can
* find out the offset between them. */
printf("Live run, main = %p\n", (void *)main);
if (!outdir) {
fprintf(stderr, "expected -O <outdir> option\n");
return 1;