Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply gcc -Wpedantic linting #19

Merged
merged 1 commit into from Sep 9, 2019
Merged

Apply gcc -Wpedantic linting #19

merged 1 commit into from Sep 9, 2019

Conversation

jonringer
Copy link
Contributor

I know you mention using clang to compile the project, but this PR will allow for compilation with gcc7 without any warnings.

Also, removed some extra whitespace.

Note: I only tested the AMD64 version. (i couldn't get arm or x86 to work, even on master)

Output before changes
[nix-shell:/home/jon/projects/rappel]$ CC=gcc make > make.output.txt
exedir.c: In function ‘init_rappel_dir’:
exedir.c:84:34: warning: ‘%s’ directive output may be truncated writing 3 bytes into a region of size between 0 and 4095 [-Wformat-truncation=]
  snprintf(path, sizeof path, "%s/%s", options.rappel_dir, "exe");
                                  ^~                       ~~~~~
In file included from /nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/stdio.h:862:0,
                 from exedir.c:7:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 5 and 4100 bytes into a destination of size 4096
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exedir.c:40:34: warning: ‘/exe’ directive output may be truncated writing 4 bytes into a region of size between 1 and 4096 [-Wformat-truncation=]
  snprintf(path, sizeof(path), "%s/exe", options.rappel_dir);
                                  ^~~~
In file included from /nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/stdio.h:862:0,
                 from exedir.c:7:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 5 and 4100 bytes into a destination of size 4096
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exedir.c:54:35: warning: ‘/exe/’ directive output may be truncated writing 5 bytes into a region of size between 1 and 4096 [-Wformat-truncation=]
   snprintf(path, sizeof(path), "%s/exe/%s", options.rappel_dir, f->d_name);
                                   ^~~~~
In file included from /nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/stdio.h:862:0,
                 from exedir.c:7:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 6 and 4356 bytes into a destination of size 4096
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exedir.c: In function ‘write_tmp_file’:
exedir.c:127:34: warning: ‘/exe/rappel-exe.XXXXXX’ directive output may be truncated writing 22 bytes into a region of size between 1 and 4096 [-Wformat-truncation=]
  snprintf(path, sizeof(path), "%s/exe/rappel-exe.XXXXXX", options.rappel_dir);
                                  ^~~~~~~~~~~~~~~~~~~~~~
In file included from /nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/stdio.h:862:0,
                 from exedir.c:7:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 23 and 4118 bytes into a destination of size 4096
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
exedir.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-gnu-empty-initializer’
In file included from common.c:8:0:
common.c: In function ‘dump’:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
<command-line>:0:8: note: in expansion of macro ‘REGFMT64’
common.c:130:26: note: in expansion of macro ‘REGFMT’
   if (base != -1) printf(REGFMT ": ", base + i);
                          ^~~~~~
In file included from include/common.h:6:0,
                 from common.c:8:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
common.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-gnu-empty-initializer’
ui.c: In function ‘interact’:
ui.c:170:28: warning: ISO C forbids empty initializer braces [-Wpedantic]
  struct proc_info_t info = {};
                            ^
ui.c:154:43: warning: ‘/history’ directive output may be truncated writing 8 bytes into a region of size between 1 and 4096 [-Wformat-truncation=]
  snprintf(hist_path, sizeof hist_path, "%s/history", options.rappel_dir);
                                           ^~~~~~~~
In file included from /nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/stdio.h:862:0,
                 from /nix/store/1xis4m31zjwy2zyass4sb8y5vmax4a4p-libedit-20190324-3.1-dev/include/histedit.h:47,
                 from ui.c:10:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/bits/stdio2.h:64:10: note: ‘__builtin___snprintf_chk’ output between 9 and 4104 bytes into a destination of size 4096
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ui.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-gnu-empty-initializer’
pipe.c: In function ‘pipe_mode’:
pipe.c:125:29: warning: ISO C forbids empty initializer braces [-Wpedantic]
   struct proc_info_t info = {};
                             ^
pipe.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-gnu-empty-initializer’
arch/amd64/ptrace_amd64.c: In function ‘ptrace_reset_amd64’:
arch/amd64/ptrace_amd64.c:29:46: warning: ISO C forbids empty initializer braces [-Wpedantic]
  struct user_regs_struct_amd64 regs_struct = {};
                                              ^
arch/amd64/ptrace_amd64.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-gnu-empty-initializer’
In file included from arch/amd64/display_amd64.c:3:0:
arch/amd64/display_amd64.c: In function ‘display_amd64’:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:22:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rax=", rax, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:22:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rax=", rax, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:23:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rbx=", rbx, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:23:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rbx=", rbx, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:24:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rcx=", rcx, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:24:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rcx=", rcx, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:26:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rdx=", rdx, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:26:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rdx=", rdx, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:27:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rsi=", rsi, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:27:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rsi=", rsi, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:28:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rdi=", rdi, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:28:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rdi=", rdi, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:30:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rip=", rip, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:30:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rip=", rip, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:31:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rsp=", rsp, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:31:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rsp=", rsp, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:32:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rbp=", rbp, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:32:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("rbp=", rbp, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:34:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64(" r8=", r8 , regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:34:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64(" r8=", r8 , regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:35:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64(" r9=", r9 , regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:35:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64(" r9=", r9 , regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:36:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r10=", r10, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:36:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r10=", r10, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:38:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r11=", r11, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:38:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r11=", r11, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:39:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r12=", r12, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:39:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r12=", r12, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:40:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r13=", r13, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:40:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r13=", r13, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:42:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r14=", r14, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:42:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r14=", r14, regs, old_regs, " ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:43:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r15=", r15, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:43:2: note: in expansion of macro ‘PRINTREG64’
  PRINTREG64("r15=", r15, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:29:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT16 "%04"  PRIx16
                  ^
include/printfmt.h:41:10: note: in expansion of macro ‘REGFMT16’
   printf(REGFMT16, y->x); \
          ^~~~~~~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:76:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("cs=", cs, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:43:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT16 RST, y->x); \
          ^~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:76:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("cs=", cs, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:29:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT16 "%04"  PRIx16
                  ^
include/printfmt.h:41:10: note: in expansion of macro ‘REGFMT16’
   printf(REGFMT16, y->x); \
          ^~~~~~~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:77:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("ss=", ss, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:43:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT16 RST, y->x); \
          ^~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:77:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("ss=", ss, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:29:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT16 "%04"  PRIx16
                  ^
include/printfmt.h:41:10: note: in expansion of macro ‘REGFMT16’
   printf(REGFMT16, y->x); \
          ^~~~~~~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:78:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("ds=", ds, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:43:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT16 RST, y->x); \
          ^~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:78:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("ds=", ds, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:29:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT16 "%04"  PRIx16
                  ^
include/printfmt.h:41:10: note: in expansion of macro ‘REGFMT16’
   printf(REGFMT16, y->x); \
          ^~~~~~~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:80:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("es=", es, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:43:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT16 RST, y->x); \
          ^~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:80:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("es=", es, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:29:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT16 "%04"  PRIx16
                  ^
include/printfmt.h:41:10: note: in expansion of macro ‘REGFMT16’
   printf(REGFMT16, y->x); \
          ^~~~~~~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:81:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("fs=", fs, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:43:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT16 RST, y->x); \
          ^~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:81:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("fs=", fs, regs, old_regs, "  ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:29:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT16 "%04"  PRIx16
                  ^
include/printfmt.h:41:10: note: in expansion of macro ‘REGFMT16’
   printf(REGFMT16, y->x); \
          ^~~~~~~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:82:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("gs=", gs, regs, old_regs, "            ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:43:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT16 RST, y->x); \
          ^~~
include/printfmt.h:49:3: note: in expansion of macro ‘DUMPREG16’
   DUMPREG16(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:82:2: note: in expansion of macro ‘PRINTREG16’
  PRINTREG16("gs=", gs, regs, old_regs, "            ");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:119:19: note: format string is defined here
 # define PRIx16  "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:28:18: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT32 "%08"  PRIx32
                  ^
include/printfmt.h:26:10: note: in expansion of macro ‘REGFMT32’
   printf(REGFMT32, y->x); \
          ^~~~~~~~
include/printfmt.h:34:3: note: in expansion of macro ‘DUMPREG32’
   DUMPREG32(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:83:2: note: in expansion of macro ‘PRINTREG32’
  PRINTREG32("efl=", eflags, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:120:19: note: format string is defined here
 # define PRIx32  "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:28:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT32 RST, y->x); \
          ^~~
include/printfmt.h:34:3: note: in expansion of macro ‘DUMPREG32’
   DUMPREG32(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:83:2: note: in expansion of macro ‘PRINTREG32’
  PRINTREG32("efl=", eflags, regs, old_regs, "\n");
  ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:120:19: note: format string is defined here
 # define PRIx32  "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:87:3: note: in expansion of macro ‘PRINTREG64’
   PRINTREG64("rip: ", rip, fpregs, old_fpregs, "\t");
   ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:87:3: note: in expansion of macro ‘PRINTREG64’
   PRINTREG64("rip: ", rip, fpregs, old_fpregs, "\t");
   ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:3:0:
include/common.h:27:18: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define REGFMT64 "%016" PRIx64
                  ^
include/printfmt.h:11:10: note: in expansion of macro ‘REGFMT64’
   printf(REGFMT64, y->x); \
          ^~~~~~~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:88:3: note: in expansion of macro ‘PRINTREG64’
   PRINTREG64("rdp: ", rdp, fpregs, old_fpregs, "\t");
   ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
In file included from arch/amd64/display_amd64.c:7:0:
include/printfmt.h:5:13: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
 #define RED "\x1b[0;31m"
             ^
include/printfmt.h:13:10: note: in expansion of macro ‘RED’
   printf(RED REGFMT64 RST, y->x); \
          ^~~
include/printfmt.h:19:3: note: in expansion of macro ‘DUMPREG64’
   DUMPREG64(x, y, z); \
   ^~~~~~~~~
arch/amd64/display_amd64.c:88:3: note: in expansion of macro ‘PRINTREG64’
   PRINTREG64("rdp: ", rdp, fpregs, old_fpregs, "\t");
   ^~~~~~~~~~
In file included from include/common.h:6:0,
                 from arch/amd64/display_amd64.c:3:
/nix/store/bniand9afisrgrsfi7kr093334iv3ibv-glibc-2.27-dev/include/inttypes.h:121:34: note: format string is defined here
 # define PRIx64  __PRI64_PREFIX "x"
arch/amd64/display_amd64.c: At top level:
cc1: warning: unrecognized command line option ‘-Wno-gnu-empty-initializer’
Output after changes
[nix-shell:/home/jon/projects/rappel]$ CC=gcc make
mkdir -p obj
mkdir -p obj/arch/amd64
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c rappel.c  -o obj/rappel.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c exedir.c  -o obj/exedir.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c common.c  -o obj/common.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c ptrace.c  -o obj/ptrace.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c ui.c  -o obj/ui.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c pipe.c  -o obj/pipe.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c arch/amd64/assemble_intel.c  -o obj/arch/amd64/assemble_intel.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c arch/amd64/ptrace_amd64.c  -o obj/arch/amd64/ptrace_amd64.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c arch/amd64/dump_amd64.c  -o obj/arch/amd64/dump_amd64.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c arch/amd64/elf_amd64.c  -o obj/arch/amd64/elf_amd64.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -Iinclude/ -Iarch/amd64/include -c arch/amd64/display_amd64.c  -o obj/arch/amd64/display_amd64.o
gcc -std=c11 -Wall -pedantic -Ddisplay=display_amd64 -Dgen_elf=gen_elf_amd64 -Dptrace_reset=ptrace_reset_amd64 -Ddump_state=dump_state_amd64 -Dptrace_reset=ptrace_reset_amd64 -Dptrace_collect_regs=ptrace_collect_regs_amd64 -Dassemble=assemble_intel -DREGFMT=REGFMT64 -DARCH_INIT_PROC_INFO=AMD64_INIT_PROC_INFO -O2 -fPIE -D_FORTIFY_SOURCE=2 -o bin/rappel  obj/rappel.o  obj/exedir.o  obj/common.o  obj/ptrace.o  obj/ui.o  obj/pipe.o  obj/arch/amd64/assemble_intel.o  obj/arch/amd64/ptrace_amd64.o  obj/arch/amd64/dump_amd64.o  obj/arch/amd64/elf_amd64.o  obj/arch/amd64/display_amd64.o  -ledit
Done.

@yrp604
Copy link
Owner

yrp604 commented Sep 9, 2019

Hey, thanks for the PR. The lingering issues with arm and x86 due to lack of testing motivated me to finally set up some CI on this project. However, at least x86 seems to be working ok? What sort of issues did you run into on those, and were you running them on their native archs?

@jonringer
Copy link
Contributor Author

jonringer commented Sep 9, 2019

Hey, thanks for the PR. The lingering issues with arm and x86 due to lack of testing motivated me to finally set up some CI on this project.

nice

However, at least x86 seems to be working ok?

I actually couldn't get this to run with clang or gcc. When I'm home, ill have to check.

What sort of issues did you run into on those, and were you running them on their native archs?

I wasn't running them on their native arch (so i didn't expect arm to work), but i did expect the x86 to compile and run, as the documentation makes it seem like that's a supported use case.

@yrp604
Copy link
Owner

yrp604 commented Sep 9, 2019

Sounds good. Yes, x86 is supported in that context, however it depends on libedit-dev:i386 packages to exist, which Im guessing was causing problems. Either way, that's unrelated to the this PR, but please do let me know if x86 is broken for some other reason.

@yrp604 yrp604 merged commit 31a0676 into yrp604:master Sep 9, 2019
@jonringer
Copy link
Contributor Author

jonringer commented Sep 9, 2019

ah, yes, that was most likely it, libedit was x86-64, that makes sense. I'll let you know if i find x86 to be broken for other reasons.

Anyway, cool little project you got here, and a very nice interactive experience :)

@jonringer
Copy link
Contributor Author

Also, I confirmed that it does work for x86 as well:

[13:45:16] jon@jon-workstation ~/projects/nixpkgs (bump-rappel)
$ nix-shell -p "with import ./. {}; pkgs.pkgsi686Linux.rappel" --run "echo 'inc eax' | rappel"
eax=00000001 ebx=00000000 ecx=00000000 edx=00000000 esi=00000000 edi=00000000
eip=00400002 esp=ff8e53a0 ebp=00000000 [cf:0, zf:0, of:0, sf:0, pf:0, af:0, df:0]
cs=0023  ss=002b  ds=002b  es=002b  fs=0000  gs=0000            efl=00000202
[13:45:26] jon@jon-workstation ~/projects/nixpkgs (bump-rappel)
$ nix-shell -p "with import ./. {}; pkgs.rappel" --run "echo 'inc eax' | rappel" --show-trace
rax=0000000000000001 rbx=0000000000000000 rcx=0000000000000000
rdx=0000000000000000 rsi=0000000000000000 rdi=0000000000000000
rip=0000000000400003 rsp=0000000000000033 rbp=0000000000000000
 r8=0000000000000000  r9=0000000000000000 r10=0000000000000000
r11=0000000000000000 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
[cf=0, zf=0, of=0, sf=0, pf=0, af=0, df=0]
cs=002b  ss=0000  ds=0000  es=0000  fs=0000  gs=0000            efl=00000202

@yrp604
Copy link
Owner

yrp604 commented Sep 9, 2019

Awesome, thanks for checking that out and also for working on the nixos packaging, kinda cool to see it being packaged up for easy install :)

@jonringer
Copy link
Contributor Author

yea, one of the things I like about nix is that it makes is very easy to bundle runtime and buildtime dependencies without interfering with your system install.

so if someone wants to test out rappel:

$ nix-shell -p rappel
$ rappel
rax=0000000000000000 rbx=0000000000000000 rcx=0000000000000000
rdx=0000000000000000 rsi=0000000000000000 rdi=0000000000000000
rip=0000000000400001 rsp=00007ffe8f976bf0 rbp=0000000000000000
 r8=0000000000000000  r9=0000000000000000 r10=0000000000000000
r11=0000000000000000 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
[cf:0, zf:0, of:0, sf:0, pf:0, af:0, df:0]
cs=0033  ss=002b  ds=0000  es=0000  fs=0000  gs=0000            efl=00000202
>
[nix-shell:~/projects/nixpkgs]$ exit
exit
[14:13:20] jon@jon-workstation ~/projects/nixpkgs (master)
$ rappel
rappel: command not found

it will download (or build) all the needed dependencies for the package, and the nix-shell command will drop you into a new shell session with your packages available to you.

plus it good at only exposing what you really want, for example I don't have nasm installed:

[nix-shell:~/projects/nixpkgs]$ nasm
The program ‘nasm’ is currently not installed. You can install it by typing:
  nix-env -iA nixos.nasm

[nix-shell:~/projects/nixpkgs]$ echo 'inc rax' | rappel
rax=0000000000000001 rbx=0000000000000000 rcx=0000000000000000
rdx=0000000000000000 rsi=0000000000000000 rdi=0000000000000000
rip=0000000000400004 rsp=00007ffdf0942770 rbp=0000000000000000
 r8=0000000000000000  r9=0000000000000000 r10=0000000000000000
r11=0000000000000000 r12=0000000000000000 r13=0000000000000000
r14=0000000000000000 r15=0000000000000000
[cf:0, zf:0, of:0, sf:0, pf:0, af:0, df:0]
cs=0033  ss=002b  ds=0000  es=0000  fs=0000  gs=0000            efl=00000202

Since the nasm utility is wrapped around your binary, it gets called with nasm on it's PATH, but my environment doesn't need it.

[nix-shell:~/projects/nixpkgs]$ cat ./result/bin/rappel
#! /nix/store/l6h4ya0wzb4b8mr0y58k2gh2nhfql4sn-bash-4.4-p23/bin/bash -e
export PATH='/nix/store/kyimp8r18jj88zx32xax50vvnxfkskg0-nasm-2.14.02/bin'${PATH:+':'}$PATH
exec -a "$0" "/nix/store/qg4szna1xqydaxn2vxd7yjl0hggh84hz-rappel-unstable-2019-07-08/bin/.rappel-wrapped"  "${extraFlagsArray[@]}" "$@"

.rappel-wrapped is your actual binary

ldd ./result/bin/.rappel-wrapped
        linux-vdso.so.1 (0x00007ffd2f3a8000)
        libedit.so.0 => /nix/store/f5pm5ysh8a8j4d7swf1mf95n69hid62y-libedit-20190324-3.1/lib/libedit.so.0 (0x00007f5fd4f64000)
        libc.so.6 => /nix/store/6yaj6n8l925xxfbcd65gzqx3dz7idrnn-glibc-2.27/lib/libc.so.6 (0x00007f5fd4dae000)
        libncursesw.so.6 => /nix/store/kvia4rwy9y4wis4v2kb9y758gj071p5v-ncurses-6.1-20190112/lib/libncursesw.so.6 (0x00007f5fd4d3c000)
        /nix/store/6yaj6n8l925xxfbcd65gzqx3dz7idrnn-glibc-2.27/lib/ld-linux-x86-64.so.2 => /nix/store/iykxb0bmfjmi7s53kfg6pjbfpd8jmza6-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f5fd4fa0000)

@yrp604
Copy link
Owner

yrp604 commented Sep 10, 2019

That's pretty slick. I don't actually use linux too much these days, but if I started again I might give nixos a shot 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants