* [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output
@ 2016-12-05 23:46 Ivo Raisr
2016-12-06 3:04 ` Luis Machado
0 siblings, 1 reply; 6+ messages in thread
From: Ivo Raisr @ 2016-12-05 23:46 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 776 bytes --]
Please find attached a patch which fixes PR tdep/20928.
Register %ccr on sparcv9 (called sparc64 in gdb's speak) contains
several flags
{icc,xcc}.{cnvz}. They should be properly decoded such as %fprs, %pstate
and %fsr is done currently.
While at it, decode also properly one-bit flags of %fsr - accrued and
current
exception flags were mixed up.
Regression test suite was run successfully with gdb 7.11 on Solaris/sparcv9.
gdb's commands 'info registers' and 'info all-registers' show %ccr with
correctly decoded flags.
ChangeLog entry:
2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
PR tdep/20928
Decode %ccr into individual flags in sparcv9 register output.
* sparc-tdep.h: Declare %ccr type.
* sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
[-- Attachment #2: ccr_decoding.patch --]
[-- Type: text/x-patch, Size: 3740 bytes --]
diff -upr a/ChangeLog b/ChangeLog
--- a/ChangeLog 2016-02-24 01:55:15.000000000 +0000
+++ b/ChangeLog 2016-12-05 15:38:46.962931312 +0000
@@ -1,3 +1,10 @@
+2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
+
+ PR tdep/20928
+ Decode %ccr into individual flags in sparcv9 register output.
+ * sparc-tdep.h: Declare %ccr type.
+ * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
+
2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
Sync with GCC
diff -upr a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
--- a/gdb/sparc-tdep.h 2016-02-09 19:19:39.000000000 +0000
+++ b/gdb/sparc-tdep.h 2016-12-05 15:25:55.187764842 +0000
@@ -76,6 +76,7 @@ struct gdbarch_tdep
/* ISA-specific data types. */
struct type *sparc_psr_type;
struct type *sparc_fsr_type;
+ struct type *sparc64_ccr_type;
struct type *sparc64_pstate_type;
struct type *sparc64_fsr_type;
struct type *sparc64_fprs_type;
diff -upr a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
--- a/gdb/sparc64-tdep.c 2016-02-09 19:19:39.000000000 +0000
+++ b/gdb/sparc64-tdep.c 2016-12-05 15:26:04.242830444 +0000
@@ -172,6 +172,31 @@ sparc64_pstate_type (struct gdbarch *gdb
}
static struct type *
+sparc64_ccr_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (tdep->sparc64_ccr_type == NULL)
+ {
+ struct type *type;
+
+ type = arch_flags_type (gdbarch, "builtin_type_sparc64_ccr", 8);
+ append_flags_type_flag (type, 0, "icc.c");
+ append_flags_type_flag (type, 1, "icc.v");
+ append_flags_type_flag (type, 2, "icc.z");
+ append_flags_type_flag (type, 3, "icc.n");
+ append_flags_type_flag (type, 4, "xcc.c");
+ append_flags_type_flag (type, 5, "xcc.v");
+ append_flags_type_flag (type, 6, "xcc.z");
+ append_flags_type_flag (type, 7, "xcc.n");
+
+ tdep->sparc64_ccr_type = type;
+ }
+
+ return tdep->sparc64_ccr_type;
+}
+
+static struct type *
sparc64_fsr_type (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -181,16 +206,16 @@ sparc64_fsr_type (struct gdbarch *gdbarc
struct type *type;
type = arch_flags_type (gdbarch, "builtin_type_sparc64_fsr", 8);
- append_flags_type_flag (type, 0, "NXA");
- append_flags_type_flag (type, 1, "DZA");
- append_flags_type_flag (type, 2, "UFA");
- append_flags_type_flag (type, 3, "OFA");
- append_flags_type_flag (type, 4, "NVA");
- append_flags_type_flag (type, 5, "NXC");
- append_flags_type_flag (type, 6, "DZC");
- append_flags_type_flag (type, 7, "UFC");
- append_flags_type_flag (type, 8, "OFC");
- append_flags_type_flag (type, 9, "NVC");
+ append_flags_type_flag (type, 0, "NXC");
+ append_flags_type_flag (type, 1, "DZC");
+ append_flags_type_flag (type, 2, "UFC");
+ append_flags_type_flag (type, 3, "OFC");
+ append_flags_type_flag (type, 4, "NVC");
+ append_flags_type_flag (type, 5, "NXA");
+ append_flags_type_flag (type, 6, "DZA");
+ append_flags_type_flag (type, 7, "UFA");
+ append_flags_type_flag (type, 8, "OFA");
+ append_flags_type_flag (type, 9, "NVA");
append_flags_type_flag (type, 22, "NS");
append_flags_type_flag (type, 23, "NXM");
append_flags_type_flag (type, 24, "DZM");
@@ -327,7 +352,7 @@ sparc64_register_type (struct gdbarch *g
if (regnum == SPARC64_ASI_REGNUM)
return builtin_type (gdbarch)->builtin_int64;
if (regnum == SPARC64_CCR_REGNUM)
- return builtin_type (gdbarch)->builtin_int64;
+ return sparc64_ccr_type (gdbarch);
if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D62_REGNUM)
return builtin_type (gdbarch)->builtin_double;
if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q60_REGNUM)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output
2016-12-05 23:46 [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output Ivo Raisr
@ 2016-12-06 3:04 ` Luis Machado
2016-12-06 8:26 ` Ivo Raisr
0 siblings, 1 reply; 6+ messages in thread
From: Luis Machado @ 2016-12-06 3:04 UTC (permalink / raw)
To: Ivo Raisr, gdb-patches
On 12/05/2016 05:45 PM, Ivo Raisr wrote:
> Please find attached a patch which fixes PR tdep/20928.
>
> Register %ccr on sparcv9 (called sparc64 in gdb's speak) contains
> several flags
> {icc,xcc}.{cnvz}. They should be properly decoded such as %fprs, %pstate
> and %fsr is done currently.
>
> While at it, decode also properly one-bit flags of %fsr - accrued and
> current
> exception flags were mixed up.
>
> Regression test suite was run successfully with gdb 7.11 on
> Solaris/sparcv9.
> gdb's commands 'info registers' and 'info all-registers' show %ccr with
> correctly decoded flags.
>
>
> ChangeLog entry:
> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>
> PR tdep/20928
> Decode %ccr into individual flags in sparcv9 register output.
> * sparc-tdep.h: Declare %ccr type.
> * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
You need to mention the new sparc64_ccr_type field and the new function
in the ChangeLog. Also, you need to add the function where you fixed the
fsr decoding.
>
>
>
> ccr_decoding.patch
>
>
> diff -upr a/ChangeLog b/ChangeLog
> --- a/ChangeLog 2016-02-24 01:55:15.000000000 +0000
> +++ b/ChangeLog 2016-12-05 15:38:46.962931312 +0000
> @@ -1,3 +1,10 @@
> +2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
> +
> + PR tdep/20928
> + Decode %ccr into individual flags in sparcv9 register output.
> + * sparc-tdep.h: Declare %ccr type.
> + * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
> +
> 2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
>
> Sync with GCC
> diff -upr a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
> --- a/gdb/sparc-tdep.h 2016-02-09 19:19:39.000000000 +0000
> +++ b/gdb/sparc-tdep.h 2016-12-05 15:25:55.187764842 +0000
> @@ -76,6 +76,7 @@ struct gdbarch_tdep
> /* ISA-specific data types. */
> struct type *sparc_psr_type;
> struct type *sparc_fsr_type;
> + struct type *sparc64_ccr_type;
> struct type *sparc64_pstate_type;
> struct type *sparc64_fsr_type;
> struct type *sparc64_fprs_type;
> diff -upr a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
> --- a/gdb/sparc64-tdep.c 2016-02-09 19:19:39.000000000 +0000
> +++ b/gdb/sparc64-tdep.c 2016-12-05 15:26:04.242830444 +0000
> @@ -172,6 +172,31 @@ sparc64_pstate_type (struct gdbarch *gdb
> }
>
> static struct type *
> +sparc64_ccr_type (struct gdbarch *gdbarch)
> +{
> + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> +
> + if (tdep->sparc64_ccr_type == NULL)
> + {
> + struct type *type;
> +
> + type = arch_flags_type (gdbarch, "builtin_type_sparc64_ccr", 8);
> + append_flags_type_flag (type, 0, "icc.c");
> + append_flags_type_flag (type, 1, "icc.v");
> + append_flags_type_flag (type, 2, "icc.z");
> + append_flags_type_flag (type, 3, "icc.n");
> + append_flags_type_flag (type, 4, "xcc.c");
> + append_flags_type_flag (type, 5, "xcc.v");
> + append_flags_type_flag (type, 6, "xcc.z");
> + append_flags_type_flag (type, 7, "xcc.n");
> +
> + tdep->sparc64_ccr_type = type;
> + }
> +
> + return tdep->sparc64_ccr_type;
> +}
> +
> +static struct type *
> sparc64_fsr_type (struct gdbarch *gdbarch)
> {
> struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> @@ -181,16 +206,16 @@ sparc64_fsr_type (struct gdbarch *gdbarc
> struct type *type;
>
> type = arch_flags_type (gdbarch, "builtin_type_sparc64_fsr", 8);
> - append_flags_type_flag (type, 0, "NXA");
> - append_flags_type_flag (type, 1, "DZA");
> - append_flags_type_flag (type, 2, "UFA");
> - append_flags_type_flag (type, 3, "OFA");
> - append_flags_type_flag (type, 4, "NVA");
> - append_flags_type_flag (type, 5, "NXC");
> - append_flags_type_flag (type, 6, "DZC");
> - append_flags_type_flag (type, 7, "UFC");
> - append_flags_type_flag (type, 8, "OFC");
> - append_flags_type_flag (type, 9, "NVC");
> + append_flags_type_flag (type, 0, "NXC");
> + append_flags_type_flag (type, 1, "DZC");
> + append_flags_type_flag (type, 2, "UFC");
> + append_flags_type_flag (type, 3, "OFC");
> + append_flags_type_flag (type, 4, "NVC");
> + append_flags_type_flag (type, 5, "NXA");
> + append_flags_type_flag (type, 6, "DZA");
> + append_flags_type_flag (type, 7, "UFA");
> + append_flags_type_flag (type, 8, "OFA");
> + append_flags_type_flag (type, 9, "NVA");
> append_flags_type_flag (type, 22, "NS");
> append_flags_type_flag (type, 23, "NXM");
> append_flags_type_flag (type, 24, "DZM");
> @@ -327,7 +352,7 @@ sparc64_register_type (struct gdbarch *g
> if (regnum == SPARC64_ASI_REGNUM)
> return builtin_type (gdbarch)->builtin_int64;
> if (regnum == SPARC64_CCR_REGNUM)
> - return builtin_type (gdbarch)->builtin_int64;
> + return sparc64_ccr_type (gdbarch);
> if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D62_REGNUM)
> return builtin_type (gdbarch)->builtin_double;
> if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q60_REGNUM)
>
Otherwise looks good to me.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output
2016-12-06 3:04 ` Luis Machado
@ 2016-12-06 8:26 ` Ivo Raisr
2016-12-11 17:22 ` Ivo Raisr
2016-12-20 6:35 ` Ivo Raisr
0 siblings, 2 replies; 6+ messages in thread
From: Ivo Raisr @ 2016-12-06 8:26 UTC (permalink / raw)
To: Luis Machado; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
On 6.12.2016 03:03, Luis Machado wrote:
> On 12/05/2016 05:45 PM, Ivo Raisr wrote:
>>
>>
>> ChangeLog entry:
>> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>>
>> PR tdep/20928
>> Decode %ccr into individual flags in sparcv9 register output.
>> * sparc-tdep.h: Declare %ccr type.
>> * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
>
> You need to mention the new sparc64_ccr_type field and the new
> function in the ChangeLog. Also, you need to add the function where
> you fixed the fsr decoding.
Here is the fixed ChangeLog entry (and attached new version of patch):
2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
PR tdep/20928
Decode %ccr into individual flags in sparcv9 register output.
* sparc-tdep.h: Declare sparc64_ccr_type.
* sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type().
Fix %fsr decoding in sparc64_fsr_type().
[-- Attachment #2: ccr_decoding.patch --]
[-- Type: text/x-patch, Size: 3808 bytes --]
diff -upr a/ChangeLog b/ChangeLog
--- a/ChangeLog 2016-02-24 01:55:15.000000000 +0000
+++ b/ChangeLog 2016-12-05 15:38:46.962931312 +0000
@@ -1,3 +1,11 @@
+2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
+
+ PR tdep/20928
+ Decode %ccr into individual flags in sparcv9 register output.
+ * sparc-tdep.h: Declare sparc64_ccr_type.
+ * sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type().
+ Fix %fsr decoding in sparc64_fsr_type().
+
2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
Sync with GCC
diff -upr a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
--- a/gdb/sparc-tdep.h 2016-02-09 19:19:39.000000000 +0000
+++ b/gdb/sparc-tdep.h 2016-12-05 15:25:55.187764842 +0000
@@ -76,6 +76,7 @@ struct gdbarch_tdep
/* ISA-specific data types. */
struct type *sparc_psr_type;
struct type *sparc_fsr_type;
+ struct type *sparc64_ccr_type;
struct type *sparc64_pstate_type;
struct type *sparc64_fsr_type;
struct type *sparc64_fprs_type;
diff -upr a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
--- a/gdb/sparc64-tdep.c 2016-02-09 19:19:39.000000000 +0000
+++ b/gdb/sparc64-tdep.c 2016-12-05 15:26:04.242830444 +0000
@@ -172,6 +172,31 @@ sparc64_pstate_type (struct gdbarch *gdb
}
static struct type *
+sparc64_ccr_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (tdep->sparc64_ccr_type == NULL)
+ {
+ struct type *type;
+
+ type = arch_flags_type (gdbarch, "builtin_type_sparc64_ccr", 8);
+ append_flags_type_flag (type, 0, "icc.c");
+ append_flags_type_flag (type, 1, "icc.v");
+ append_flags_type_flag (type, 2, "icc.z");
+ append_flags_type_flag (type, 3, "icc.n");
+ append_flags_type_flag (type, 4, "xcc.c");
+ append_flags_type_flag (type, 5, "xcc.v");
+ append_flags_type_flag (type, 6, "xcc.z");
+ append_flags_type_flag (type, 7, "xcc.n");
+
+ tdep->sparc64_ccr_type = type;
+ }
+
+ return tdep->sparc64_ccr_type;
+}
+
+static struct type *
sparc64_fsr_type (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -181,16 +206,16 @@ sparc64_fsr_type (struct gdbarch *gdbarc
struct type *type;
type = arch_flags_type (gdbarch, "builtin_type_sparc64_fsr", 8);
- append_flags_type_flag (type, 0, "NXA");
- append_flags_type_flag (type, 1, "DZA");
- append_flags_type_flag (type, 2, "UFA");
- append_flags_type_flag (type, 3, "OFA");
- append_flags_type_flag (type, 4, "NVA");
- append_flags_type_flag (type, 5, "NXC");
- append_flags_type_flag (type, 6, "DZC");
- append_flags_type_flag (type, 7, "UFC");
- append_flags_type_flag (type, 8, "OFC");
- append_flags_type_flag (type, 9, "NVC");
+ append_flags_type_flag (type, 0, "NXC");
+ append_flags_type_flag (type, 1, "DZC");
+ append_flags_type_flag (type, 2, "UFC");
+ append_flags_type_flag (type, 3, "OFC");
+ append_flags_type_flag (type, 4, "NVC");
+ append_flags_type_flag (type, 5, "NXA");
+ append_flags_type_flag (type, 6, "DZA");
+ append_flags_type_flag (type, 7, "UFA");
+ append_flags_type_flag (type, 8, "OFA");
+ append_flags_type_flag (type, 9, "NVA");
append_flags_type_flag (type, 22, "NS");
append_flags_type_flag (type, 23, "NXM");
append_flags_type_flag (type, 24, "DZM");
@@ -327,7 +352,7 @@ sparc64_register_type (struct gdbarch *g
if (regnum == SPARC64_ASI_REGNUM)
return builtin_type (gdbarch)->builtin_int64;
if (regnum == SPARC64_CCR_REGNUM)
- return builtin_type (gdbarch)->builtin_int64;
+ return sparc64_ccr_type (gdbarch);
if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D62_REGNUM)
return builtin_type (gdbarch)->builtin_double;
if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q60_REGNUM)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output
2016-12-06 8:26 ` Ivo Raisr
@ 2016-12-11 17:22 ` Ivo Raisr
2016-12-20 6:35 ` Ivo Raisr
1 sibling, 0 replies; 6+ messages in thread
From: Ivo Raisr @ 2016-12-11 17:22 UTC (permalink / raw)
To: Luis Machado; +Cc: gdb-patches
Any news here?
Thanks,
I.
On 6.12.2016 09:26, Ivo Raisr wrote:
>
>
> On 6.12.2016 03:03, Luis Machado wrote:
>> On 12/05/2016 05:45 PM, Ivo Raisr wrote:
>>>
>>>
>>> ChangeLog entry:
>>> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>>>
>>> PR tdep/20928
>>> Decode %ccr into individual flags in sparcv9 register output.
>>> * sparc-tdep.h: Declare %ccr type.
>>> * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
>>
>> You need to mention the new sparc64_ccr_type field and the new
>> function in the ChangeLog. Also, you need to add the function where
>> you fixed the fsr decoding.
>
> Here is the fixed ChangeLog entry (and attached new version of patch):
>
> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>
> PR tdep/20928
> Decode %ccr into individual flags in sparcv9 register output.
> * sparc-tdep.h: Declare sparc64_ccr_type.
> * sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type().
> Fix %fsr decoding in sparc64_fsr_type().
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output
2016-12-06 8:26 ` Ivo Raisr
2016-12-11 17:22 ` Ivo Raisr
@ 2016-12-20 6:35 ` Ivo Raisr
2016-12-23 16:06 ` Luis Machado
1 sibling, 1 reply; 6+ messages in thread
From: Ivo Raisr @ 2016-12-20 6:35 UTC (permalink / raw)
To: Luis Machado; +Cc: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 992 bytes --]
Any news here?
Thanks, I.
On 6.12.2016 09:26, Ivo Raisr wrote:
>
>
> On 6.12.2016 03:03, Luis Machado wrote:
>> On 12/05/2016 05:45 PM, Ivo Raisr wrote:
>>>
>>>
>>> ChangeLog entry:
>>> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>>>
>>> PR tdep/20928
>>> Decode %ccr into individual flags in sparcv9 register output.
>>> * sparc-tdep.h: Declare %ccr type.
>>> * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
>>
>> You need to mention the new sparc64_ccr_type field and the new
>> function in the ChangeLog. Also, you need to add the function where
>> you fixed the fsr decoding.
>
> Here is the fixed ChangeLog entry (and attached new version of patch):
>
> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>
> PR tdep/20928
> Decode %ccr into individual flags in sparcv9 register output.
> * sparc-tdep.h: Declare sparc64_ccr_type.
> * sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type().
> Fix %fsr decoding in sparc64_fsr_type().
>
>
[-- Attachment #2: ccr_decoding.patch --]
[-- Type: text/x-patch, Size: 3808 bytes --]
diff -upr a/ChangeLog b/ChangeLog
--- a/ChangeLog 2016-02-24 01:55:15.000000000 +0000
+++ b/ChangeLog 2016-12-05 15:38:46.962931312 +0000
@@ -1,3 +1,11 @@
+2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
+
+ PR tdep/20928
+ Decode %ccr into individual flags in sparcv9 register output.
+ * sparc-tdep.h: Declare sparc64_ccr_type.
+ * sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type().
+ Fix %fsr decoding in sparc64_fsr_type().
+
2016-01-12 H.J. Lu <hongjiu.lu@intel.com>
Sync with GCC
diff -upr a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
--- a/gdb/sparc-tdep.h 2016-02-09 19:19:39.000000000 +0000
+++ b/gdb/sparc-tdep.h 2016-12-05 15:25:55.187764842 +0000
@@ -76,6 +76,7 @@ struct gdbarch_tdep
/* ISA-specific data types. */
struct type *sparc_psr_type;
struct type *sparc_fsr_type;
+ struct type *sparc64_ccr_type;
struct type *sparc64_pstate_type;
struct type *sparc64_fsr_type;
struct type *sparc64_fprs_type;
diff -upr a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c
--- a/gdb/sparc64-tdep.c 2016-02-09 19:19:39.000000000 +0000
+++ b/gdb/sparc64-tdep.c 2016-12-05 15:26:04.242830444 +0000
@@ -172,6 +172,31 @@ sparc64_pstate_type (struct gdbarch *gdb
}
static struct type *
+sparc64_ccr_type (struct gdbarch *gdbarch)
+{
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+
+ if (tdep->sparc64_ccr_type == NULL)
+ {
+ struct type *type;
+
+ type = arch_flags_type (gdbarch, "builtin_type_sparc64_ccr", 8);
+ append_flags_type_flag (type, 0, "icc.c");
+ append_flags_type_flag (type, 1, "icc.v");
+ append_flags_type_flag (type, 2, "icc.z");
+ append_flags_type_flag (type, 3, "icc.n");
+ append_flags_type_flag (type, 4, "xcc.c");
+ append_flags_type_flag (type, 5, "xcc.v");
+ append_flags_type_flag (type, 6, "xcc.z");
+ append_flags_type_flag (type, 7, "xcc.n");
+
+ tdep->sparc64_ccr_type = type;
+ }
+
+ return tdep->sparc64_ccr_type;
+}
+
+static struct type *
sparc64_fsr_type (struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -181,16 +206,16 @@ sparc64_fsr_type (struct gdbarch *gdbarc
struct type *type;
type = arch_flags_type (gdbarch, "builtin_type_sparc64_fsr", 8);
- append_flags_type_flag (type, 0, "NXA");
- append_flags_type_flag (type, 1, "DZA");
- append_flags_type_flag (type, 2, "UFA");
- append_flags_type_flag (type, 3, "OFA");
- append_flags_type_flag (type, 4, "NVA");
- append_flags_type_flag (type, 5, "NXC");
- append_flags_type_flag (type, 6, "DZC");
- append_flags_type_flag (type, 7, "UFC");
- append_flags_type_flag (type, 8, "OFC");
- append_flags_type_flag (type, 9, "NVC");
+ append_flags_type_flag (type, 0, "NXC");
+ append_flags_type_flag (type, 1, "DZC");
+ append_flags_type_flag (type, 2, "UFC");
+ append_flags_type_flag (type, 3, "OFC");
+ append_flags_type_flag (type, 4, "NVC");
+ append_flags_type_flag (type, 5, "NXA");
+ append_flags_type_flag (type, 6, "DZA");
+ append_flags_type_flag (type, 7, "UFA");
+ append_flags_type_flag (type, 8, "OFA");
+ append_flags_type_flag (type, 9, "NVA");
append_flags_type_flag (type, 22, "NS");
append_flags_type_flag (type, 23, "NXM");
append_flags_type_flag (type, 24, "DZM");
@@ -327,7 +352,7 @@ sparc64_register_type (struct gdbarch *g
if (regnum == SPARC64_ASI_REGNUM)
return builtin_type (gdbarch)->builtin_int64;
if (regnum == SPARC64_CCR_REGNUM)
- return builtin_type (gdbarch)->builtin_int64;
+ return sparc64_ccr_type (gdbarch);
if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D62_REGNUM)
return builtin_type (gdbarch)->builtin_double;
if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q60_REGNUM)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output
2016-12-20 6:35 ` Ivo Raisr
@ 2016-12-23 16:06 ` Luis Machado
0 siblings, 0 replies; 6+ messages in thread
From: Luis Machado @ 2016-12-23 16:06 UTC (permalink / raw)
To: Ivo Raisr; +Cc: gdb-patches
Sorry, i've been out on vacation. I suppose people are out until
January, so you may have to wait until them for an OK.
On 12/20/2016 12:35 AM, Ivo Raisr wrote:
> Any news here?
> Thanks, I.
>
> On 6.12.2016 09:26, Ivo Raisr wrote:
>>
>>
>> On 6.12.2016 03:03, Luis Machado wrote:
>>> On 12/05/2016 05:45 PM, Ivo Raisr wrote:
>>>>
>>>>
>>>> ChangeLog entry:
>>>> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>>>>
>>>> PR tdep/20928
>>>> Decode %ccr into individual flags in sparcv9 register output.
>>>> * sparc-tdep.h: Declare %ccr type.
>>>> * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding.
>>>
>>> You need to mention the new sparc64_ccr_type field and the new
>>> function in the ChangeLog. Also, you need to add the function where
>>> you fixed the fsr decoding.
>>
>> Here is the fixed ChangeLog entry (and attached new version of patch):
>>
>> 2016-12-05 Ivo Raisr <ivo.raisr@oracle.com>
>>
>> PR tdep/20928
>> Decode %ccr into individual flags in sparcv9 register output.
>> * sparc-tdep.h: Declare sparc64_ccr_type.
>> * sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type().
>> Fix %fsr decoding in sparc64_fsr_type().
>>
>>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-12-23 16:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-05 23:46 [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output Ivo Raisr
2016-12-06 3:04 ` Luis Machado
2016-12-06 8:26 ` Ivo Raisr
2016-12-11 17:22 ` Ivo Raisr
2016-12-20 6:35 ` Ivo Raisr
2016-12-23 16:06 ` Luis Machado
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 read-only IMAP folder(s) and NNTP newsgroup(s).