Add simple main

This commit is contained in:
Théophile Bastian 2018-04-23 16:20:31 +02:00
parent f6e9b8ebd2
commit dc6072e991
3 changed files with 26 additions and 1 deletions

1
src/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
dwarf-assembly

View file

@ -4,7 +4,7 @@ CXXFLAGS=$(CXXLOCS) -Wall -Wextra -std=c++14 -O2 -g
CXXLIBS=-lelf -ldwarf -ldwarfpp -lsrk31c++ -lc++fileno
TARGET=dwarf-assembly
OBJS=DwarfReader.o SimpleDwarf.o
OBJS=DwarfReader.o SimpleDwarf.o main.o
###############################################################################

24
src/main.cpp Normal file
View 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;
}