Malloc调试

public class MallocDebug
extends Object implements AutoCloseable

java.lang.Object
com.android.sts.common.MallocDebug


用于在进程上设置 malloc 调试选项、检查 malloc 调试错误并随后进行清理的实用程序。

概括

公共方法

void close ()
static AutoCloseable withLibcMallocDebugOnAllNewProcesses (ITestDevice device, String mallocDebugOptions)

开始将 libc malloc 调试附加到此调用后启动的所有进程,并在关闭时断言没有 malloc 调试错误。

static AutoCloseable withLibcMallocDebugOnNewProcess (ITestDevice device, String mallocDebugOptions, String processName)

设置为将 malloc 调试附加到给定的 processName,并在关闭时断言没有 malloc 调试错误。

static AutoCloseable withLibcMallocDebugOnService (ITestDevice device, String mallocDebugOptions, String processName)

重新启动给定的服务并对其启用 malloc 调试,在关闭时断言没有 malloc 调试错误。

公共方法

关闭

public void close ()

投掷
Exception

withLibcMallocDebugOnAllNewProcesses

public static AutoCloseable withLibcMallocDebugOnAllNewProcesses (ITestDevice device, 
                String mallocDebugOptions)

开始将 libc malloc 调试附加到此调用后启动的所有进程,并在关闭时断言没有 malloc 调试错误。

参数
device ITestDevice :要使用的设备

mallocDebugOptions String :要设置 libc.debug.malloc.options 的值。

退货
AutoCloseable AutoCloseable 对象将禁用 libc malloc 调试并在关闭时检查 malloc 调试错误。

投掷
DeviceNotAvailableException
TimeoutException
ProcessUtil.KillException

withLibcMallocDebugOnNewProcess

public static AutoCloseable withLibcMallocDebugOnNewProcess (ITestDevice device, 
                String mallocDebugOptions, 
                String processName)

设置为将 malloc 调试附加到给定的 processName,并在关闭时断言没有 malloc 调试错误。请注意,在此调用之后需要手动启动 processName。

参数
device ITestDevice :要使用的设备

mallocDebugOptions String :要设置 libc.debug.malloc.options 的值。

processName String :附加 libc malloc 调试的进程。应该还没有运行。

退货
AutoCloseable AutoCloseable 对象将禁用 libc malloc 调试并在关闭时检查 malloc 调试错误。

投掷
DeviceNotAvailableException
IllegalArgumentException
TimeoutException
ProcessUtil.KillException

withLibcMallocDebugOnService

public static AutoCloseable withLibcMallocDebugOnService (ITestDevice device, 
                String mallocDebugOptions, 
                String processName)

重新启动给定的服务并对其启用 malloc 调试,在关闭时断言没有 malloc 调试错误。

参数
device ITestDevice :要使用的设备

mallocDebugOptions String :要设置 libc.debug.malloc.options 的值。

processName String :附加 libc malloc 调试的服务进程。应该正在运行。

退货
AutoCloseable AutoCloseable 对象将重新启动/取消附加服务、禁用 libc malloc 调试以及在关闭时检查 malloc 调试错误。

投掷
DeviceNotAvailableException
IllegalArgumentException
TimeoutException
ProcessUtil.KillException