Add simple main
This commit is contained in:
parent
f6e9b8ebd2
commit
dc6072e991
3 changed files with 26 additions and 1 deletions
1
src/.gitignore
vendored
Normal file
1
src/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
dwarf-assembly
|
|
@ -4,7 +4,7 @@ CXXFLAGS=$(CXXLOCS) -Wall -Wextra -std=c++14 -O2 -g
|
||||||
CXXLIBS=-lelf -ldwarf -ldwarfpp -lsrk31c++ -lc++fileno
|
CXXLIBS=-lelf -ldwarf -ldwarfpp -lsrk31c++ -lc++fileno
|
||||||
|
|
||||||
TARGET=dwarf-assembly
|
TARGET=dwarf-assembly
|
||||||
OBJS=DwarfReader.o SimpleDwarf.o
|
OBJS=DwarfReader.o SimpleDwarf.o main.o
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
|
24
src/main.cpp
Normal file
24
src/main.cpp
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
/** Entry point */
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <cstdlib>
|
||||||
|
|
||||||
|
#include "SimpleDwarf.hpp"
|
||||||
|
#include "DwarfReader.hpp"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
if(argc < 2) {
|
||||||
|
cerr << "Error: missing input file. Usage:" << endl
|
||||||
|
<< argv[0] << " path/to/binary.elf" << endl;
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
SimpleDwarf parsed_dwarf = DwarfReader(argv[1]).read();
|
||||||
|
|
||||||
|
cout << parsed_dwarf;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue