~ubuntu-branches/ubuntu/trusty/golang/trusty

« back to all changes in this revision

Viewing changes to src/cmd/addr2line/main.c

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2013-08-20 14:06:23 UTC
  • mfrom: (14.1.23 saucy-proposed)
  • Revision ID: package-import@ubuntu.com-20130820140623-b414jfxi3m0qkmrq
Tags: 2:1.1.2-2ubuntu1
* Merge from Debian unstable (LP: #1211749, #1202027). Remaining changes:
  - 016-armhf-elf-header.patch: Use correct ELF header for armhf binaries.
  - d/control,control.cross: Update Breaks/Replaces for Ubuntu
    versions to ensure smooth upgrades, regenerate control file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include <mach.h>
13
13
 
14
14
void
 
15
printusage(int fd)
 
16
{
 
17
        fprint(fd, "usage: addr2line binary\n");
 
18
        fprint(fd, "reads addresses from standard input and writes two lines for each:\n");
 
19
        fprint(fd, "\tfunction name\n");
 
20
        fprint(fd, "\tfile:line\n");
 
21
}
 
22
 
 
23
void
15
24
usage(void)
16
25
{
17
 
        fprint(2, "usage: addr2line binary\n");
18
 
        fprint(2, "reads addresses from standard input and writes two lines for each:\n");
19
 
        fprint(2, "\tfunction name\n");
20
 
        fprint(2, "\tfile:line\n");
 
26
        printusage(2);
21
27
        exits("usage");
22
28
}
23
29
 
32
38
        Biobuf bin, bout;
33
39
        char file[1024];
34
40
 
 
41
        if(argc > 1 && strcmp(argv[1], "--help") == 0) {
 
42
                printusage(1);
 
43
                exits(0);
 
44
        }
 
45
 
35
46
        ARGBEGIN{
36
47
        default:
37
48
                usage();