diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..69b94b4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: c +before_install: + - sudo apt-get update -qq + - sudo apt-get install -qq binutils-dev libdwarf-dev +script: make diff --git a/README.md b/README.md index 348df89..dc0faea 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,27 @@ libdwarf is available for. does the heavily lifting of parsing the DWARF debugging data within the binaries. +### Install Dependencies on OS X + +#### Install Homebrew + +```sh +ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" +``` + +#### Install Dependencies + +```sh +brew install binutils +brew install https://gist.github.com/zlandau/7550479/raw/b084adb5506b186b520783bd69f92996cf2dada8/libdwarf.rb +``` + +#### Update config.mk.local + +```sh +echo "DWARFLDFLAGS += -L$(dirname $(brew list binutils| grep libiberty.a))" >> config.mk.local +``` + ## Usage atosl currently supports debug (DSYM) files and DYLIB with debug symbols diff --git a/atosl.c b/atosl.c index 58114a0..72ee5d5 100644 --- a/atosl.c +++ b/atosl.c @@ -1165,14 +1165,16 @@ int main(int argc, char *argv[]) { int found = 0; uint32_t magic; cpu_subtype_t st = -1; + long address; while ((c = getopt_long(argc, argv, shortopts, longopts, &option_index)) >= 0) { switch (c) { case 'l': - options.load_address = strtol(optarg, (char **)NULL, 16); - if (options.load_address < 0) + address = strtol(optarg, (char **)NULL, 16); + if (address < 0) fatal("unable to parse load address: `%s'", optarg); + options.load_address = address; break; case 'o': options.dsym_filename = optarg; diff --git a/config.mk b/config.mk index f022266..34c7bac 100644 --- a/config.mk +++ b/config.mk @@ -2,11 +2,11 @@ VERSION = 1.0 PREFIX = /usr/local -DWARFINC = -DWARFLIB = +DWARFCFLAGS = +DWARFLDFLAGS = -CFLAGS = -Wall -Werror -O2 -I${DWARFINC} -DATOSL_VERSION=\"${VERSION}\" -LDFLAGS = -L${DWARFLIB} -ldwarf -liberty +CFLAGS = -Wall -Werror -O2 ${DWARFCFLAGS} -DATOSL_VERSION=\"${VERSION}\" +LDFLAGS = ${DWARFLDFLAGS} -ldwarf -liberty CC = cc