Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from zlandau/fixes
Browse files Browse the repository at this point in the history
Fixes and documentation for building under OSX
  • Loading branch information
LegNeato committed Nov 19, 2013
2 parents f5ed8ee + e3cf042 commit 822896b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
language: c
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq binutils-dev libdwarf-dev
script: make
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions atosl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions config.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 822896b

Please sign in to comment.