* [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
@ 2018-07-31 2:30 Marek Marczykowski-Górecki
2018-07-31 8:01 ` Jan Beulich
2018-07-31 9:00 ` Wei Liu
0 siblings, 2 replies; 11+ messages in thread
From: Marek Marczykowski-Górecki @ 2018-07-31 2:30 UTC (permalink / raw)
To: xen-devel
Cc: Elena Ufimtseva, Wei Liu, Ian Jackson,
Marek Marczykowski-Górecki, xen-devel
gdb 8.0 fixed bounds checking for 'g' packet (commit
9dc193c3be85aafa60ceff57d3b0430af607b4ce "Check for truncated
registers in process_g_packet"). This revealed that gdbsx did
not properly formatted 'g' packet - segment registers and eflags are
expected to be 32-bit fields in the response (according to
gdb/features/i386/64bit-core.xml in gdb sources). Specific error is:
Truncated register 26 in remote 'g' packet
instead of silently truncating part of register.
Additionally, it looks like segment registers of 64bit guests were never
reported correctly, because of type mismatch.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
---
tools/debugger/gdbsx/gx/gx_local.c | 6 +++---
tools/debugger/gdbsx/xg/xg_main.c | 20 ++++++++++----------
tools/debugger/gdbsx/xg/xg_public.h | 18 +++++++++---------
3 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/tools/debugger/gdbsx/gx/gx_local.c b/tools/debugger/gdbsx/gx/gx_local.c
index 1bec03d49c..33556a582d 100644
--- a/tools/debugger/gdbsx/gx/gx_local.c
+++ b/tools/debugger/gdbsx/gx/gx_local.c
@@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
static void
prnt_64regs(struct xg_gdb_regs64 *r64p)
{
- printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
- r64p->rflags);
+ printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
+ r64p->eflags);
printf("rax:"XGF64" rbx:"XGF64" rcx:"XGF64"\n", r64p->rax, r64p->rbx,
r64p->rcx);
printf("rdx:"XGF64" rsi:"XGF64" rdi:"XGF64"\n", r64p->rdx, r64p->rsi,
@@ -57,7 +57,7 @@ prnt_64regs(struct xg_gdb_regs64 *r64p)
r64p->r13);
printf("r14:"XGF64" r15:"XGF64" rbp:"XGF64"\n", r64p->r14, r64p->r15,
r64p->rbp);
- printf("cs:"XGF64" ds:"XGF64" fs:"XGF64" gs:"XGF64"\n", r64p->cs,
+ printf("cs:%08x ds:%08x fs:%08x gs:%08x\n", r64p->cs,
r64p->ds, r64p->fs, r64p->gs);
printf("\n");
}
diff --git a/tools/debugger/gdbsx/xg/xg_main.c b/tools/debugger/gdbsx/xg/xg_main.c
index cc640d1d82..a4e8653168 100644
--- a/tools/debugger/gdbsx/xg/xg_main.c
+++ b/tools/debugger/gdbsx/xg/xg_main.c
@@ -580,14 +580,14 @@ _cp_64ctxt_to_64gdb(struct cpu_user_regs_x86_64 *cp, struct xg_gdb_regs64 *rp)
rp->rax = cp->rax;
rp->rip = cp->rip;
rp->rsp = cp->rsp;
- rp->rflags = cp->rflags;
-
- rp->cs = (uint64_t)cp->cs;
- rp->ss = (uint64_t)cp->ss;
- rp->es = (uint64_t)cp->es;
- rp->ds = (uint64_t)cp->ds;
- rp->fs = (uint64_t)cp->fs;
- rp->gs = (uint64_t)cp->gs;
+ rp->eflags = cp->rflags;
+
+ rp->cs = cp->cs;
+ rp->ss = cp->ss;
+ rp->es = cp->es;
+ rp->ds = cp->ds;
+ rp->fs = cp->fs;
+ rp->gs = cp->gs;
#if 0
printf("cp:%llx bp:%llx rip:%llx\n", rp->rsp, rp->rbp, rp->rip);
printf("rax:%llx rbx:%llx\n", rp->rax, rp->rbx);
@@ -635,7 +635,7 @@ _cp_32gdb_to_64ctxt(struct xg_gdb_regs32 *rp, struct cpu_user_regs_x86_64 *cp)
cp->ds = rp->ds;
cp->fs = rp->fs;
cp->gs = rp->gs;
- cp->rflags = rp->eflags;
+ cp->eflags = rp->eflags;
}
static void
@@ -658,7 +658,7 @@ _cp_64gdb_to_64ctxt(struct xg_gdb_regs64 *rp, struct cpu_user_regs_x86_64 *cp)
cp->rax = rp->rax;
cp->rip = rp->rip;
cp->rsp = rp->rsp;
- cp->rflags = rp->rflags;
+ cp->rflags = rp->eflags;
cp->cs = (uint16_t)rp->cs;
cp->ss = (uint16_t)rp->ss;
diff --git a/tools/debugger/gdbsx/xg/xg_public.h b/tools/debugger/gdbsx/xg/xg_public.h
index 3f905a2f0d..cffb2f7532 100644
--- a/tools/debugger/gdbsx/xg/xg_public.h
+++ b/tools/debugger/gdbsx/xg/xg_public.h
@@ -61,7 +61,7 @@ struct xg_gdb_regs32 {
uint32_t gs;
};
-/* this from: regformats/reg-x86-64.dat in gdbserver */
+/* based on gdb/features/i386/64bit-core.xml in gdb */
struct xg_gdb_regs64 {
uint64_t rax;
uint64_t rbx;
@@ -80,14 +80,14 @@ struct xg_gdb_regs64 {
uint64_t r14;
uint64_t r15;
uint64_t rip;
- uint64_t rflags;
- uint64_t cs;
- uint64_t ss;
- uint64_t ds;
- uint64_t es;
- uint64_t fs;
- uint64_t gs;
-};
+ uint32_t eflags;
+ uint32_t cs;
+ uint32_t ss;
+ uint32_t ds;
+ uint32_t es;
+ uint32_t fs;
+ uint32_t gs;
+} __attribute__((__packed__));
union xg_gdb_regs {
struct xg_gdb_regs32 gregs_32;
--
2.17.1
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 2:30 [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests Marek Marczykowski-Górecki
@ 2018-07-31 8:01 ` Jan Beulich
2018-07-31 8:09 ` Andrew Cooper
2018-07-31 16:04 ` Marek Marczykowski
2018-07-31 9:00 ` Wei Liu
1 sibling, 2 replies; 11+ messages in thread
From: Jan Beulich @ 2018-07-31 8:01 UTC (permalink / raw)
To: Marek Marczykowski; +Cc: Elena Ufimtseva, Ian Jackson, Wei Liu, xen-devel
>>> On 31.07.18 at 04:30, <marmarek@invisiblethingslab.com> wrote:
Marek,
looks like all of the patches you've sent early this morning local time
here came through twice on xen-devel: Would you please avoid
having xen-devel on both the To and the Cc lists (just with different
domains)?
Thanks, Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 8:01 ` Jan Beulich
@ 2018-07-31 8:09 ` Andrew Cooper
2018-07-31 8:35 ` Jan Beulich
2018-07-31 16:04 ` Marek Marczykowski
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Cooper @ 2018-07-31 8:09 UTC (permalink / raw)
To: Jan Beulich, Marek Marczykowski
Cc: Elena Ufimtseva, Wei Liu, Ian Jackson, xen-devel
On 31/07/2018 09:01, Jan Beulich wrote:
>>>> On 31.07.18 at 04:30, <marmarek@invisiblethingslab.com> wrote:
> Marek,
>
> looks like all of the patches you've sent early this morning local time
> here came through twice on xen-devel: Would you please avoid
> having xen-devel on both the To and the Cc lists (just with different
> domains)?
I've only got a single copy, and the list archives only show a single copy.
Are you sure that's not just something local to you?
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 8:09 ` Andrew Cooper
@ 2018-07-31 8:35 ` Jan Beulich
0 siblings, 0 replies; 11+ messages in thread
From: Jan Beulich @ 2018-07-31 8:35 UTC (permalink / raw)
To: Andrew Cooper
Cc: Elena Ufimtseva, Ian Jackson, Wei Liu, Marek Marczykowski,
xen-devel
>>> On 31.07.18 at 10:09, <andrew.cooper3@citrix.com> wrote:
> On 31/07/2018 09:01, Jan Beulich wrote:
>>>>> On 31.07.18 at 04:30, <marmarek@invisiblethingslab.com> wrote:
>> Marek,
>>
>> looks like all of the patches you've sent early this morning local time
>> here came through twice on xen-devel: Would you please avoid
>> having xen-devel on both the To and the Cc lists (just with different
>> domains)?
>
> I've only got a single copy, and the list archives only show a single copy.
>
> Are you sure that's not just something local to you?
Well, I don't see how there can be only a single copy with
xen-devel on both the To and Cc lists, unless de-duplication
happens at the receiver end (which I could imagine happens
in list archiving).
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 2:30 [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests Marek Marczykowski-Górecki
2018-07-31 8:01 ` Jan Beulich
@ 2018-07-31 9:00 ` Wei Liu
2018-07-31 9:08 ` Andrew Cooper
2018-07-31 16:10 ` Marek Marczykowski-Górecki
1 sibling, 2 replies; 11+ messages in thread
From: Wei Liu @ 2018-07-31 9:00 UTC (permalink / raw)
To: Marek Marczykowski-Górecki
Cc: Elena Ufimtseva, Wei Liu, Ian Jackson, xen-devel, xen-devel
On Tue, Jul 31, 2018 at 04:30:42AM +0200, Marek Marczykowski-Górecki wrote:
> gdb 8.0 fixed bounds checking for 'g' packet (commit
> 9dc193c3be85aafa60ceff57d3b0430af607b4ce "Check for truncated
> registers in process_g_packet"). This revealed that gdbsx did
> not properly formatted 'g' packet - segment registers and eflags are
> expected to be 32-bit fields in the response (according to
> gdb/features/i386/64bit-core.xml in gdb sources). Specific error is:
>
> Truncated register 26 in remote 'g' packet
>
> instead of silently truncating part of register.
>
> Additionally, it looks like segment registers of 64bit guests were never
> reported correctly, because of type mismatch.
>
> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> ---
> tools/debugger/gdbsx/gx/gx_local.c | 6 +++---
> tools/debugger/gdbsx/xg/xg_main.c | 20 ++++++++++----------
> tools/debugger/gdbsx/xg/xg_public.h | 18 +++++++++---------
> 3 files changed, 22 insertions(+), 22 deletions(-)
>
> diff --git a/tools/debugger/gdbsx/gx/gx_local.c b/tools/debugger/gdbsx/gx/gx_local.c
> index 1bec03d49c..33556a582d 100644
> --- a/tools/debugger/gdbsx/gx/gx_local.c
> +++ b/tools/debugger/gdbsx/gx/gx_local.c
> @@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
> static void
> prnt_64regs(struct xg_gdb_regs64 *r64p)
> {
> - printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
> - r64p->rflags);
> + printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
> + r64p->eflags);
I think it would be better to introduce XGF32 and XGFM32 in the header.
The rest looks good to me.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 9:00 ` Wei Liu
@ 2018-07-31 9:08 ` Andrew Cooper
2018-07-31 9:12 ` Wei Liu
2018-07-31 16:10 ` Marek Marczykowski-Górecki
1 sibling, 1 reply; 11+ messages in thread
From: Andrew Cooper @ 2018-07-31 9:08 UTC (permalink / raw)
To: Wei Liu, Marek Marczykowski-Górecki
Cc: Elena Ufimtseva, xen-devel, Ian Jackson, xen-devel
On 31/07/18 10:00, Wei Liu wrote:
> On Tue, Jul 31, 2018 at 04:30:42AM +0200, Marek Marczykowski-Górecki wrote:
>> gdb 8.0 fixed bounds checking for 'g' packet (commit
>> 9dc193c3be85aafa60ceff57d3b0430af607b4ce "Check for truncated
>> registers in process_g_packet"). This revealed that gdbsx did
>> not properly formatted 'g' packet - segment registers and eflags are
>> expected to be 32-bit fields in the response (according to
>> gdb/features/i386/64bit-core.xml in gdb sources). Specific error is:
>>
>> Truncated register 26 in remote 'g' packet
>>
>> instead of silently truncating part of register.
>>
>> Additionally, it looks like segment registers of 64bit guests were never
>> reported correctly, because of type mismatch.
>>
>> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
>> ---
>> tools/debugger/gdbsx/gx/gx_local.c | 6 +++---
>> tools/debugger/gdbsx/xg/xg_main.c | 20 ++++++++++----------
>> tools/debugger/gdbsx/xg/xg_public.h | 18 +++++++++---------
>> 3 files changed, 22 insertions(+), 22 deletions(-)
>>
>> diff --git a/tools/debugger/gdbsx/gx/gx_local.c b/tools/debugger/gdbsx/gx/gx_local.c
>> index 1bec03d49c..33556a582d 100644
>> --- a/tools/debugger/gdbsx/gx/gx_local.c
>> +++ b/tools/debugger/gdbsx/gx/gx_local.c
>> @@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
>> static void
>> prnt_64regs(struct xg_gdb_regs64 *r64p)
>> {
>> - printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
>> - r64p->rflags);
>> + printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
>> + r64p->eflags);
> I think it would be better to introduce XGF32 and XGFM32 in the header.
??? inttypes.h is a standard header for a reason...
I'd suggest instead that, if cleanup were being done, purging these
nonstandard PRIx64's would be a much better option.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 9:08 ` Andrew Cooper
@ 2018-07-31 9:12 ` Wei Liu
0 siblings, 0 replies; 11+ messages in thread
From: Wei Liu @ 2018-07-31 9:12 UTC (permalink / raw)
To: Andrew Cooper
Cc: Elena Ufimtseva, Wei Liu, Ian Jackson,
Marek Marczykowski-Górecki, xen-devel, xen-devel
On Tue, Jul 31, 2018 at 10:08:06AM +0100, Andrew Cooper wrote:
> On 31/07/18 10:00, Wei Liu wrote:
> > On Tue, Jul 31, 2018 at 04:30:42AM +0200, Marek Marczykowski-Górecki wrote:
> >> gdb 8.0 fixed bounds checking for 'g' packet (commit
> >> 9dc193c3be85aafa60ceff57d3b0430af607b4ce "Check for truncated
> >> registers in process_g_packet"). This revealed that gdbsx did
> >> not properly formatted 'g' packet - segment registers and eflags are
> >> expected to be 32-bit fields in the response (according to
> >> gdb/features/i386/64bit-core.xml in gdb sources). Specific error is:
> >>
> >> Truncated register 26 in remote 'g' packet
> >>
> >> instead of silently truncating part of register.
> >>
> >> Additionally, it looks like segment registers of 64bit guests were never
> >> reported correctly, because of type mismatch.
> >>
> >> Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
> >> ---
> >> tools/debugger/gdbsx/gx/gx_local.c | 6 +++---
> >> tools/debugger/gdbsx/xg/xg_main.c | 20 ++++++++++----------
> >> tools/debugger/gdbsx/xg/xg_public.h | 18 +++++++++---------
> >> 3 files changed, 22 insertions(+), 22 deletions(-)
> >>
> >> diff --git a/tools/debugger/gdbsx/gx/gx_local.c b/tools/debugger/gdbsx/gx/gx_local.c
> >> index 1bec03d49c..33556a582d 100644
> >> --- a/tools/debugger/gdbsx/gx/gx_local.c
> >> +++ b/tools/debugger/gdbsx/gx/gx_local.c
> >> @@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
> >> static void
> >> prnt_64regs(struct xg_gdb_regs64 *r64p)
> >> {
> >> - printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
> >> - r64p->rflags);
> >> + printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
> >> + r64p->eflags);
> > I think it would be better to introduce XGF32 and XGFM32 in the header.
>
> ??? inttypes.h is a standard header for a reason...
>
> I'd suggest instead that, if cleanup were being done, purging these
> nonstandard PRIx64's would be a much better option.
>
This works too.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 8:01 ` Jan Beulich
2018-07-31 8:09 ` Andrew Cooper
@ 2018-07-31 16:04 ` Marek Marczykowski
1 sibling, 0 replies; 11+ messages in thread
From: Marek Marczykowski @ 2018-07-31 16:04 UTC (permalink / raw)
To: Jan Beulich; +Cc: Elena Ufimtseva, Ian Jackson, Wei Liu, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 601 bytes --]
On Tue, Jul 31, 2018 at 02:01:39AM -0600, Jan Beulich wrote:
> >>> On 31.07.18 at 04:30, <marmarek@invisiblethingslab.com> wrote:
>
> Marek,
>
> looks like all of the patches you've sent early this morning local time
> here came through twice on xen-devel: Would you please avoid
> having xen-devel on both the To and the Cc lists (just with different
> domains)?
Sorry about that, now fixed my setup.
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 9:00 ` Wei Liu
2018-07-31 9:08 ` Andrew Cooper
@ 2018-07-31 16:10 ` Marek Marczykowski-Górecki
2018-07-31 16:28 ` Wei Liu
2018-07-31 16:29 ` Andrew Cooper
1 sibling, 2 replies; 11+ messages in thread
From: Marek Marczykowski-Górecki @ 2018-07-31 16:10 UTC (permalink / raw)
To: Wei Liu; +Cc: Elena Ufimtseva, xen-devel, Ian Jackson, xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 1053 bytes --]
On Tue, Jul 31, 2018 at 10:00:24AM +0100, Wei Liu wrote:
> On Tue, Jul 31, 2018 at 04:30:42AM +0200, Marek Marczykowski-Górecki wrote:
> > --- a/tools/debugger/gdbsx/gx/gx_local.c
> > +++ b/tools/debugger/gdbsx/gx/gx_local.c
> > @@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
> > static void
> > prnt_64regs(struct xg_gdb_regs64 *r64p)
> > {
> > - printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
> > - r64p->rflags);
> > + printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
> > + r64p->eflags);
>
> I think it would be better to introduce XGF32 and XGFM32 in the header.
I was inspired by prnt_32regs function, which use explicit %08x. Should
it be changed there too (to PRIx32)? Otherwise that would be
inconsistent (and maybe warrant a totally separate cleanup).
--
Best Regards,
Marek Marczykowski-Górecki
Invisible Things Lab
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
[-- Attachment #2: Type: text/plain, Size: 157 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 16:10 ` Marek Marczykowski-Górecki
@ 2018-07-31 16:28 ` Wei Liu
2018-07-31 16:29 ` Andrew Cooper
1 sibling, 0 replies; 11+ messages in thread
From: Wei Liu @ 2018-07-31 16:28 UTC (permalink / raw)
To: Marek Marczykowski-Górecki
Cc: Elena Ufimtseva, Ian Jackson, Wei Liu, xen-devel, xen-devel
On Tue, Jul 31, 2018 at 06:10:07PM +0200, Marek Marczykowski-Górecki wrote:
> On Tue, Jul 31, 2018 at 10:00:24AM +0100, Wei Liu wrote:
> > On Tue, Jul 31, 2018 at 04:30:42AM +0200, Marek Marczykowski-Górecki wrote:
> > > --- a/tools/debugger/gdbsx/gx/gx_local.c
> > > +++ b/tools/debugger/gdbsx/gx/gx_local.c
> > > @@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
> > > static void
> > > prnt_64regs(struct xg_gdb_regs64 *r64p)
> > > {
> > > - printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
> > > - r64p->rflags);
> > > + printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
> > > + r64p->eflags);
> >
> > I think it would be better to introduce XGF32 and XGFM32 in the header.
>
> I was inspired by prnt_32regs function, which use explicit %08x. Should
> it be changed there too (to PRIx32)? Otherwise that would be
> inconsistent (and maybe warrant a totally separate cleanup).
See Andrew's suggestion to switch to PRIx*.
Wei.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests
2018-07-31 16:10 ` Marek Marczykowski-Górecki
2018-07-31 16:28 ` Wei Liu
@ 2018-07-31 16:29 ` Andrew Cooper
1 sibling, 0 replies; 11+ messages in thread
From: Andrew Cooper @ 2018-07-31 16:29 UTC (permalink / raw)
To: Marek Marczykowski-Górecki, Wei Liu
Cc: Elena Ufimtseva, xen-devel, Ian Jackson, xen-devel
On 31/07/18 17:10, Marek Marczykowski-Górecki wrote:
> On Tue, Jul 31, 2018 at 10:00:24AM +0100, Wei Liu wrote:
>> On Tue, Jul 31, 2018 at 04:30:42AM +0200, Marek Marczykowski-Górecki wrote:
>>> --- a/tools/debugger/gdbsx/gx/gx_local.c
>>> +++ b/tools/debugger/gdbsx/gx/gx_local.c
>>> @@ -45,8 +45,8 @@ prnt_32regs(struct xg_gdb_regs32 *r32p)
>>> static void
>>> prnt_64regs(struct xg_gdb_regs64 *r64p)
>>> {
>>> - printf("rip:"XGF64" rsp:"XGF64" flags:"XGF64"\n", r64p->rip, r64p->rsp,
>>> - r64p->rflags);
>>> + printf("rip:"XGF64" rsp:"XGF64" flags:%08x\n", r64p->rip, r64p->rsp,
>>> + r64p->eflags);
>> I think it would be better to introduce XGF32 and XGFM32 in the header.
> I was inspired by prnt_32regs function, which use explicit %08x. Should
> it be changed there too (to PRIx32)? Otherwise that would be
> inconsistent (and maybe warrant a totally separate cleanup).
Tbh, I'd stick with %08x because that's what we'd expect in the
hypervisor. If you'd like clean things up then please do, but it would
be rude to block this bugfix on cleanup.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2018-07-31 16:29 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-31 2:30 [PATCH] tools/gdbsx: fix 'g' packet response for 64bit guests Marek Marczykowski-Górecki
2018-07-31 8:01 ` Jan Beulich
2018-07-31 8:09 ` Andrew Cooper
2018-07-31 8:35 ` Jan Beulich
2018-07-31 16:04 ` Marek Marczykowski
2018-07-31 9:00 ` Wei Liu
2018-07-31 9:08 ` Andrew Cooper
2018-07-31 9:12 ` Wei Liu
2018-07-31 16:10 ` Marek Marczykowski-Górecki
2018-07-31 16:28 ` Wei Liu
2018-07-31 16:29 ` Andrew Cooper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).