根据ptrace手册页:
跟踪器无法区分Syscall-enter-stop和syscall-exit-stop.跟踪器需要跟踪ptrace-stops的顺序,以便不会将syscall-enter-stop错误解释为syscall-exit-stop,反之亦然.
当我附加到使用的进程时PTRACE_ATTACH,如何知道tracee当前是否在系统调用中?换句话说,如果我重新使用tracee PTRACE_SYSCALL,我怎么知道下一个系统调用是否是a syscall-enter-stop或者syscall-exit-stop?
我正在开发一个允许用户管理帐户的应用程序.所以,假设我有一个Account类,代表用户的一个帐户:
class Account
{
public int id;
public String accountName;
public String accountIdentifier;
public String server;
public String notes;
}
Run Code Online (Sandbox Code Playgroud)
我的equals方法看起来像这样:
public boolean equals(Object o)
{
if (this == o)
return true;
if (o == null || !(o instanceof Account))
return false;
Account other = (Account) o;
if (!accountIdentifier.equals(other.accountIdentifier))
return false;
if (!server.equals(other.server))
return false;
return true;
}
Run Code Online (Sandbox Code Playgroud)
如你所见,我只是比较accountIdentifier和server其他领域,而不是其他领域.我选择这种方法有几个原因.
List.当用户更新帐户时,通过更改帐户名称(这只是用户指定的名称来识别帐户)或备注,我可以accountList.set(accountList.indexOf(account), account);更新列表中的帐户.如果equals比较所有属性,这种方法将不起作用,我必须解决它(例如通过迭代列表并手动检查这些属性).Account是唯一被标识accountIdentifier和 …