Skip to contentSkip to conversation

tools/gdbsx: define format strings for aarch64

PATCH In review Olaf Hering 3 participants 7 messages Feb 2, 2014 – Feb 7, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tools/gdbsx: define format strings for aarch64

gx_main.c: In function '_do_qRcmd_req':
gx_main.c:119:13: error: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Werror=format=]

             sprintf(buf1, "pgd3val set to: "XGF64"\n", pgd3val);
             ^
gx_main.c:121:13: error: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Werror=format=]
             sprintf(buf1, "Invalid  pgd3val "XGF64"\n", pgd3val);
---
 tools/debugger/gdbsx/xg/xg_public.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/debugger/gdbsx/xg/xg_public.h +1 -1
index 6236d08..046e21b 100644
@@ -23,7 +23,7 @@
 #define XGTRC1(...)  \
            do {(xgtrc_on==2) ? (xgtrc(__FUNCTION__,__VA_ARGS__)):0;} while (0)
 
-#if defined(__x86_64__)
+#if defined(__x86_64__) || defined(__aarch64__)
     #define  XGFM64  "%lx"
     #define  XGF64   "%016lx"
 #else
#1 lore raw
Quoted 8 lines · Olaf Hering

gx_main.c: In function '_do_qRcmd_req':
gx_main.c:119:13: error: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Werror=format=]

             sprintf(buf1, "pgd3val set to: "XGF64"\n", pgd3val);
             ^
gx_main.c:121:13: error: format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'uint64_t' [-Werror=format=]
             sprintf(buf1, "Invalid  pgd3val "XGF64"\n", pgd3val);

I suppose there is no harm in this, but is there any chance that gdbsx would actually work on arm64 without significant actual work going into it?

Also, you forgot to CC the gdbsx maintainer.

(why doesn't this code use stdint.h?)

Quoted 17 lines
---
 tools/debugger/gdbsx/xg/xg_public.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/debugger/gdbsx/xg/xg_public.h +1 -1
index 6236d08..046e21b 100644
@@ -23,7 +23,7 @@
 #define XGTRC1(...)  \
            do {(xgtrc_on==2) ? (xgtrc(__FUNCTION__,__VA_ARGS__)):0;} while (0)
 
-#if defined(__x86_64__)
+#if defined(__x86_64__) || defined(__aarch64__)
     #define  XGFM64  "%lx"
     #define  XGF64   "%016lx"
 #else
#2 lore raw
Quoted 3 lines · Ian Campbell

I suppose there is no harm in this, but is there any chance that gdbsx would actually work on arm64 without significant actual work going into it?

I have no idea. But I just noticed its built only due to this line in our xen.spec:

make -C tools/debugger/gdbsx

Perhaps this should be guarded by a %ifarch x86_64.

Olaf

#3 lore raw
Quoted 6 lines · Olaf Hering
Quoted 3 lines · Ian Campbell

I suppose there is no harm in this, but is there any chance that gdbsx would actually work on arm64 without significant actual work going into it?

Quoted 6 lines

I have no idea. But I just noticed its built only due to this line in our xen.spec:

make -C tools/debugger/gdbsx

Perhaps this should be guarded by a %ifarch x86_64.

I suspect that right now that this would be wise (maybe i386 too?) -- hopefully Mukesh can advise.

Ian.

#4 lore raw
Quoted 10 lines · On Sun, 2 Feb 2014 10:36:16 +0000 Ian Campbell <[email protected]> wrote:
Quoted 9 lines · Olaf Hering
Quoted 3 lines · Ian Campbell

I suppose there is no harm in this, but is there any chance that gdbsx would actually work on arm64 without significant actual work going into it?

I have no idea. But I just noticed its built only due to this line in our xen.spec:

Quoted 8 lines
Quoted 3 lines

make -C tools/debugger/gdbsx

Perhaps this should be guarded by a %ifarch x86_64.

I suspect that right now that this would be wise (maybe i386 too?) -- hopefully Mukesh can advise.

Ian.

It should just work if you can quickly implement arch/x86/debug.c for arm. If not, you'd need to "arch it out".

thanks
mukesh

#5 lore raw
Quoted 2 lines · Mukesh Rathor

It should just work if you can quickly implement arch/x86/debug.c for arm. If not, you'd need to "arch it out".

Some Makefile already has something like SUBDIR-$(ARCH), it was just the hard "make -C tools/gdbsx" in xen.spec which caused the error.

Olaf

#6 lore raw
In reply to Mukesh Rathor
Quoted 17 lines · Mukesh Rathor
Quoted 14 lines · On Sun, 2 Feb 2014 10:36:16 +0000 Ian Campbell <[email protected]> wrote:
Quoted 12 lines · Olaf Hering
Quoted 3 lines · Ian Campbell

I suppose there is no harm in this, but is there any chance that gdbsx would actually work on arm64 without significant actual work going into it?

I have no idea. But I just noticed its built only due to this line in our xen.spec:

make -C tools/debugger/gdbsx

Perhaps this should be guarded by a %ifarch x86_64.

Quoted 7 lines
Quoted 4 lines

I suspect that right now that this would be wise (maybe i386 too?) -- hopefully Mukesh can advise.

Ian.

It should just work if you can quickly implement
arch/x86/debug.c for arm.

Thanks.

Looks like we'd also need to make a bunch of arch/x86/domctl.c generic too, or implement the appropriate arm equivalents.

Not a 4.4 thing for sure, if someone wants gdbsx on arm then patches for 4.5 would be welcome as always.

Quoted 4 lines

If not, you'd need to "arch it out".

thanks
mukesh