2017年1月10日 星期二

[Strace][Embedded] How to trace binary error

Using strace to trace

For example:
When I trace smbd by using strace.
Error log : strace smbd > /tmp/smbd.strace.txt
Full log : strace smbd 2&> /tmp/smbd.strace.txt

The log will like below. This log only have error log.

[1970/01/01 13:32:22,  0] ../lib/util/debug.c:595(reopen_logs_internal)
  Unable to open new log file '/home/freeman/test/Samba/EMBED/samba/OBJ/SAMBA_OBJ/var/log.smbd': No such file or directory
[1970/01/01 13:32:22,  0] ../source3/lib/dumpcore.c:249(dump_core_setup)
  Unable to setup corepath for smbd: No such file or directory
[1970/01/01 13:32:22,  0] ../lib/util/debug.c:595(reopen_logs_internal)
  Unable to open new log file '/home/freeman/test/Samba/EMBED/samba/OBJ/SAMBA_OBJ/var/log.smbd': No such file or directory
[1970/01/01 13:32:23,  0] ../source3/smbd/server.c:1198(main)
  smbd version 4.1.5 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2013
[1970/01/01 13:32:23,  0] ../source3/smbd/server.c:1213(main)
  error opening config file '/home/freeman/test/Samba/EMBED/samba/OBJ/SAMBA_OBJ/etc/smb.conf'

According this log I can debug binary file why can’t execute it.

The error message display server.c:1213 have error. So I can jump to server.c:1213, and see what happen about this place.
Maybe I can fix this bug by myself for embedded system.

Reference:

0 意見:

張貼留言