1 : /*
2 : * Copyright 2009 The Native Client Authors. All rights reserved.
3 : * Use of this source code is governed by a BSD-style license that can be
4 : * found in the LICENSE file.
5 : */
6 :
7 : #include <stdio.h>
8 :
9 : #include "native_client/src/include/portability.h"
10 :
11 : #include "native_client/src/shared/platform/nacl_check.h"
12 : #include "native_client/src/shared/platform/nacl_log.h"
13 : #include "native_client/src/shared/platform/nacl_log_intern.h"
14 :
15 1 : void MyAbort(void) {
16 1 : exit(17);
17 : }
18 :
19 : int main(int ac,
20 1 : char **av) {
21 : int opt;
22 :
23 :
24 1 : NaClLogModuleInit();
25 1 : gNaClLogAbortBehavior = MyAbort;
26 :
27 1 : while (-1 != (opt = getopt(ac, av, "cds:CD"))) {
28 1 : switch (opt) {
29 : case 'c':
30 1 : CHECK(0);
31 0 : break;
32 : case 'd':
33 1 : DCHECK(0);
34 1 : break;
35 : case 's':
36 1 : NaClCheckSetDebugMode(strtol(optarg, (char **) 0, 0));
37 1 : break;
38 : case 'C':
39 1 : CHECK(1);
40 1 : break;
41 : case 'D':
42 0 : DCHECK(1);
43 : break;
44 : }
45 1 : }
46 1 : NaClLogModuleFini();
47 1 : return 0;
48 1 : }
|