Skip to contentSkip to conversation

target/xtensa: drop num_[core_]regs from dc232b/dc233c configs

PATCH Superseded Max Filippov 3 participants 4 messages Oct 31, 2018 – Nov 12, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target/xtensa: drop num_[core_]regs from dc232b/dc233c configs

gdb_regmap::num_core_regs field is initialized incorrectly in the dc232b and dc233c configurations. As a result the following message is displayed when attaching to an xtensa linux-user process:

"Register 105 is not available",

and gdb is unable to control the inferior.

Now that xtensa_count_regs does the right thing, remove manual initialization of these fields from the affected configurations and let xtensa_finalize_config initialize them.

---
 target/xtensa/core-dc232b.c | 2 --
 target/xtensa/core-dc233c.c | 2 --
 2 files changed, 4 deletions(-)
target/xtensa/core-dc232b.c +0 -2
index 71313378409e..7851bcb63687 100644
@@ -40,8 +40,6 @@
 static XtensaConfig dc232b __attribute__((unused)) = {
     .name = "dc232b",
     .gdb_regmap = {
-        .num_regs = 120,
-        .num_core_regs = 52,
         .reg = {
 #include "core-dc232b/gdb-config.inc.c"
         }
target/xtensa/core-dc233c.c +0 -2
index d701e3f5de07..8853bfd4d08f 100644
@@ -40,8 +40,6 @@
 static XtensaConfig dc233c __attribute__((unused)) = {
     .name = "dc233c",
     .gdb_regmap = {
-        .num_regs = 121,
-        .num_core_regs = 52,
         .reg = {
 #include "core-dc233c/gdb-config.inc.c"
         }
Signature · 1 line
2.11.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 12 lines · Max Filippov

gdb_regmap::num_core_regs field is initialized incorrectly in the dc232b and dc233c configurations. As a result the following message is displayed when attaching to an xtensa linux-user process:

"Register 105 is not available",

and gdb is unable to control the inferior.

Now that xtensa_count_regs does the right thing, remove manual initialization of these fields from the affected configurations and let xtensa_finalize_config initialize them.

Quoted 6 lines
---
 target/xtensa/core-dc232b.c | 2 --
 target/xtensa/core-dc233c.c | 2 --
 2 files changed, 4 deletions(-)

r~

#2 lore raw

Hi Max,

Quoted 14 lines · Richard Henderson
Quoted 12 lines · Max Filippov

gdb_regmap::num_core_regs field is initialized incorrectly in the dc232b and dc233c configurations. As a result the following message is displayed when attaching to an xtensa linux-user process:

"Register 105 is not available",

and gdb is unable to control the inferior.

Now that xtensa_count_regs does the right thing, remove manual initialization of these fields from the affected configurations and let xtensa_finalize_config initialize them.

Quoted 8 lines
Quoted 6 lines
---
 target/xtensa/core-dc232b.c | 2 --
 target/xtensa/core-dc233c.c | 2 --
 2 files changed, 4 deletions(-)

Can we include this patch for the 3.2 release?

Thanks,

Phil.

#3 lore raw
Quoted 26 lines · Philippe Mathieu-Daudé

Hi Max,

Quoted 21 lines · Richard Henderson
Quoted 18 lines · Max Filippov

gdb_regmap::num_core_regs field is initialized incorrectly in the dc232b and dc233c configurations. As a result the following message is displayed when attaching to an xtensa linux-user process:

"Register 105 is not available",

and gdb is unable to control the inferior.

Now that xtensa_count_regs does the right thing, remove manual initialization of these fields from the affected configurations and let xtensa_finalize_config initialize them.

---
 target/xtensa/core-dc232b.c | 2 --
 target/xtensa/core-dc233c.c | 2 --
 2 files changed, 4 deletions(-)
Quoted 3 lines
Quoted 1 line

Can we include this patch for the 3.2 release?

I've found that this version is wrong (register lists are not terminated for these
two cores), so I sent v2. After that I've found that it's still wrong, i.e. the register
105 is still not available with v2. I dug a bit deeper and it looks like register
handling should probably be the same for both system and linux-user cases. I'll post v3 after some more testing in a few days.

Signature · 2 lines
Thanks.
-- Max