Date: | Tue, 10 Mar 2015 21:26:55 -0400 |
---|---|
From: | Donghai <donghaitad@xxxxxxxxx> |
Subject: | [DynInst_API:] PatchFunction blocks() crash |
Hi, I use a very simple program to test the first example of PatchAPI.specifically, func->blocks() cause the system segment fault. Thanks. Best Hai ParseAPI::SymtabCodeSource *sts; ParseAPI::CodeObject *co; Address code_base = 0x8048000; sts = new ParseAPI::SymtabCodeSource( argv[1] ); co = new ParseAPI::CodeObject( sts ); PatchObject *obj = PatchObject::create(co, code_base); // Find all functions in the object std::vector<PatchFunction*> all; obj->funcs(back_inserter(all)); for (std::vector<PatchFunction*>::iterator fi = all.begin(); fi != all.end(); fi++) { // Print out each function's name PatchFunction* func = *fi; std::cout << func->name() << std::endl; const PatchFunction::Blockset& blks = func->blocks(); for (PatchFunction::BlockSet::iterator bi = blks.begin(); bi != blks.end(); bi++) { // Print out each block's size PatchBlock* blk = *bi; std::cout << "\tBlock size:" << blk->size() << std::endl; } } |
[← Prev in Thread] | Current Thread | [Next in Thread→] |
---|---|---|
|
Previous by Date: | [DynInst_API:] 2015 Scalable Tools Workshop: Registration and Lodging, Barton Miller |
---|---|
Next by Date: | Re: [DynInst_API:] PatchFunction blocks() crash, Bill Williams |
Previous by Thread: | [DynInst_API:] COMMIT: common: rewrite caching in Linux P_cplus_demangle(), Josh Stone |
Next by Thread: | Re: [DynInst_API:] PatchFunction blocks() crash, Bill Williams |
Indexes: | [Date] [Thread] |