-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is both a good sanity check for PRs and can be used as a larger system-level parser for things like running through /usr/lib.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#include "CFG.h" | ||
#include "CodeObject.h" | ||
#include <iostream> | ||
|
||
namespace dp = Dyninst::ParseAPI; | ||
int main(int argc, char* argv[]) { | ||
if(argc < 2 || argc > 3) { | ||
std::cerr << "Usage: " << argv[0] << " file\n"; | ||
return -1; | ||
} | ||
|
||
try { | ||
auto* sts = new dp::SymtabCodeSource(argv[1]); | ||
auto* co = new dp::CodeObject(sts); | ||
co->parse(); | ||
} catch(std::exception &e) { | ||
std::cerr << e.what() << '\n'; | ||
return -1; | ||
} catch(...) { | ||
std::cerr << "unknown exception occurred\n"; | ||
return -1; | ||
} | ||
} |