How to make strace the print address of string arguments, and not just their values?

I am trying to use straceto understand how a binary program uses memory.

However, the default output strace, to be more convenient, prints any buffers char *as the corresponding lines.

read(3, "Tell me, Muse, of that man of ma"..., 4096) = 270

Can I tell you straceto print the actual address of a string next to its contents?

If it is not possible to have the fact that printing only the address of the line, and not its truncated content, will also be normal.

+3
source share
2 answers

You can download the sourcestrace and change all of these tprintf("%s", ...)to tprintf("%p", ...)and create a local copy strace.

+2

-e raw = read , . .

Broadway @creepspread: ~% strace -e raw = read ls 2 > & 1 | grep ^ read
read (0x3, 0x7fff5ea52e78, 0x340) = 0x340
read (0x3, 0x7fff5ea52e48, 0x340) = 0x340
read (0x3, 0x7fff5ea52e18, 0x340) = 0x340
read (0x3, 0x7fff5ea52de8, 0x340) = 0x340
read (0x3, 0x7fff5ea52ca8, 0x340) = 0x340
(0x3, 0x7fff5ea52c48, 0x340) = 0x340
read (0x3, 0x7fff5ea52c18, 0x340) = 0x340
(0x3, 0x7fef1433f000, 0x400) = 0x136
read (0x3, 0x7fef1433f000, 0x400) = 0

+12

All Articles