LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   obtaining program execution trace? (https://www.linuxquestions.org/questions/programming-9/obtaining-program-execution-trace-292521/)

arjunsub 02-20-2005 03:19 AM

obtaining program execution trace?
 
hey

I need to obtain address traces for specific applications (like gcc...or any other user specified application for that matter) . I'm working on a page replacement algorithm simulator. Need to get a sequence of addresses in Hex format and the modified bit value i.e. read/write, which i can use for my simulator, to test the algorithms.

i've tried looking up stuff on ptrace, strace, etc..not quite sure as to how I can use it. If there's anything else I can use or if you could point me to source codes for any of the above, would be great.

Is there any tool/software I can use on Windows?...again for tracing the addresses for an application.

Thanks
Arjun

sigsegv 02-20-2005 08:20 AM

I assume you tried the man pages? It really couldn't be much easier ... strace <processname>.

I have no idea if there are similar utilities for Windows, though it would surprise me to find out there is not.

arjunsub 02-20-2005 09:17 AM

re : strace
 
The problem I'm having with strace is that I get the sequence of system calls, but how do I get the hex addresses? some of the system calls have the addresses in either their arguments or in the return value, like stat64, old_mmap...but what about the others? Need the sequential address trace for all system calls.

for example...

Some of the lines obtained after using strace with echo..


open("/opt/gnome2/lib/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory)
stat64("/opt/gnome2/lib", {st_mode=S_IFDIR|0755, st_size=20480, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=65928, ...}) = 0
old_mmap(NULL, 65928, PROT_READ, MAP_PRIVATE, 3, 0) = 0xbf596000
close(3) = 0
open("/lib/tls/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0`ht\000"..., 512) = 512


What can I do with this?

Thanks
Arjun


All times are GMT -5. The time now is 02:55 PM.