purify的API和提示信息代号

本文介绍了PurifyAPI的功能及使用方法,包括如何在代码中引入PurifyAPI库,以及常用API函数的说明。此外,还列举了Purify报告的各种消息及其严重性等级。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Purify API functions

To use Purify API functions, include <purifyhome>/purify.h in your code and link with <purifyhome>/purify_stubs.a.

 

In Makefile, you should write as follow for C++:

LINK_FLAGS = -L/usr/local/rational/releases/purify.i386_linux2.2003a.06.15/purify_staubs.a

LINK_PURIFY = purify –cache-dir=$(HOME)/.cache gcc $(LINK_FLAGS)

main.purify:$(OBJS)

       $(LINK_PURIFY) –lstdc++ -o main.purify $(OBJS)

 

Commonly used API functions

Description

int  purify_describe (char *addr)

Prints specific details about memory

int  purify_is_running (void)

Returns "TRUE" if the program is instrumented

int  purify_new_inuse (void)

Prints a message on all memory newly in use

int  purify_new_leaks (void)

Prints a message on all new leaks

int  purify_new_fds_inuse (void)

Lists the new open file descriptors

int  purify_printf (char *format, ...)

Prints formatted text to the Viewer or log-file

int  purify_watch (char *addr)

Watches for memory write, malloc, free

int  purify_watch_n (char *addr, int size, char *type)

Watches memory: type = "r", "w", "rw"

int  purify_watch_info (void)

Lists active watchpoints

int  purify_watch_remove (int watchno)

Removes a specified watchpoint

int  purify_what_colors (char *addr, int size)

Prints the color coding of memory

 

 

Purify messages

Purify reports the following messages. For detailed, platform-specific information, see the Purify online help system.

Message

Description

Severity*

Message

Description

Severity*

ABR

Array Bounds Read

W

NPR

Null Pointer Read

F

ABW

Array Bounds Write

C

NPW

Null Pointer Write

F

BRK

Misuse of Brk or Sbrk

C

PAR

Bad Parameter

W

BSR

Beyond Stack Read

W

PLK

Potential Leak(is memory that does not have a pointer to its beginning,but does have one to its interior)

W

BSW

Beyond Stack Write

W

PMR

Partial UMR

W

COR

Core Dump Imminent

F

SBR

Stack Array Bounds Read

W

FIU

File Descriptors In Use

I

SBW

Stack Array Bounds Write

C

FMM

Freeing Mismatched Memory

C

SIG

Signal

I

FMR

Free Memory Read

W

SOF

Stack Overflow

W

FMW

Free Memory Write

C

UMC

Uninitialized Memory Copy

W

FNH

Freeing Non Heap Memory

C

UMR

Uninitialized Memory Read

W

FUM

Freeing Unallocated Memory

C

WPF

Watchpoint Free

I

IPR

Invalid Pointer Read

F

WPM

Watchpoint Malloc

I

IPW

Invalid Pointer Write

F

WPN

Watchpoint Entry

I

MAF

Malloc Failure

I

WPR

Watchpoint Read

I

MIU

Memory In-Use

I

WPW

Watchpoint Write

I

MLK

Memory Leak

W

WPX

Watchpoint Exit

I

MRE

Malloc Reentrancy Error

C

ZPR

Zero Page Read

F

MSE

Memory Segment Error

W

ZPW

Zero Page Write

F

 

* Message severity: F=Fatal, C=Corrupting, W=Warning, I=Informational

 

 

                                         

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值