public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
@ 2021-09-20 13:28 vries at gcc dot gnu.org
  2021-09-20 13:28 ` [Bug tdep/28355] " vries at gcc dot gnu.org
                   ` (34 more replies)
  0 siblings, 35 replies; 36+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-20 13:28 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

            Bug ID: 28355
           Summary: [aarch64] regcache.cc:257: A problem internal to
                    GDBserver has been detected. Unknown register tag_ctl
                    requested
           Product: gdb
           Version: 11.1
            Status: NEW
          Severity: normal
          Priority: P2
         Component: tdep
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

With gdb 11.1, I run into:
...
(gdb) target remote localhost:2346^M
Remote debugging using localhost:2346^M
Remote connection closed^M
(gdb) PASS: gdb.server/multi-ui-errors.exp: connect to gdbserver
Remote debugging from host 127.0.0.1, port 36588^M
../../gdbserver/regcache.cc:257: A problem internal to GDBserver has been
detected.^M
Unknown register tag_ctl requested^M
ERROR: GDB process no longer exists
GDB process exited with wait status 29567 exp12 0 1
UNRESOLVED: gdb.server/multi-ui-errors.exp: ensure inferior is running
testcase
/home/abuild/rpmbuild/BUILD/gdb-11.1/gdb/testsuite/gdb.server/multi-ui-errors.exp
...

Triggers a fair amount of times in the entire test suite:
...
$ grep -a -c "Unknown register tag_ctl requested"
binaries-testsuite.openSUSE_Factory_ARM.aarch64/gdb-testresults/*.log
binaries-testsuite.openSUSE_Factory_ARM.aarch64/gdb-testresults/gdb-aarch64-suse-linux.-fno-PIE.-no-pie.log:63
binaries-testsuite.openSUSE_Factory_ARM.aarch64/gdb-testresults/gdb-aarch64-suse-linux.log:63
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
@ 2021-09-20 13:28 ` vries at gcc dot gnu.org
  2021-09-20 14:00 ` luis.machado at linaro dot org
                   ` (33 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-20 13:28 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alan.hayward at arm dot com,
                   |                            |luis.machado at linaro dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
  2021-09-20 13:28 ` [Bug tdep/28355] " vries at gcc dot gnu.org
@ 2021-09-20 14:00 ` luis.machado at linaro dot org
  2021-09-20 14:27 ` luis.machado at linaro dot org
                   ` (32 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-09-20 14:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #1 from Luis Machado <luis.machado at linaro dot org> ---
I'm assuming your test environment doesn't support MTE.

I find it odd that find_regno crashes gdbserver. It seems best to not return
anything when it isn't found.

PAC has the same code. I'm assuming it might run into the same situation on a
machine that doesn't support PAC.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
  2021-09-20 13:28 ` [Bug tdep/28355] " vries at gcc dot gnu.org
  2021-09-20 14:00 ` luis.machado at linaro dot org
@ 2021-09-20 14:27 ` luis.machado at linaro dot org
  2021-09-20 14:30 ` luis.machado at linaro dot org
                   ` (31 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-09-20 14:27 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #2 from Luis Machado <luis.machado at linaro dot org> ---
I can't reproduce this, even on a machine without MTE support. Could you please
provide more detailed information about the environment in which you ran into
this?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-09-20 14:27 ` luis.machado at linaro dot org
@ 2021-09-20 14:30 ` luis.machado at linaro dot org
  2021-09-21 12:48 ` luis.machado at linaro dot org
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-09-20 14:30 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |luis.machado at linaro dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-09-20 14:30 ` luis.machado at linaro dot org
@ 2021-09-21 12:48 ` luis.machado at linaro dot org
  2021-09-27 10:00 ` vries at gcc dot gnu.org
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-09-21 12:48 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-09-21 12:48 ` luis.machado at linaro dot org
@ 2021-09-27 10:00 ` vries at gcc dot gnu.org
  2021-10-01 11:44 ` luis.machado at linaro dot org
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: vries at gcc dot gnu.org @ 2021-09-27 10:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Luis Machado from comment #2)
> I can't reproduce this, even on a machine without MTE support. Could you
> please provide more detailed information about the environment in which you
> ran into this?

This triggered in OBS (Open Build Service). 

The log did indicate that this was on a machine without MTE support.

I've tried to reproduce it outside of OBS, but have not managed sofar,
unfortunately.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2021-09-27 10:00 ` vries at gcc dot gnu.org
@ 2021-10-01 11:44 ` luis.machado at linaro dot org
  2021-10-06 12:04 ` vries at gcc dot gnu.org
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-01 11:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #4 from Luis Machado <luis.machado at linaro dot org> ---
Would it be possible to have more logs from the OBS run?

If the machine doesn't have MTE support (and thus no HWCAP bit set), we
shouldn't be generating target descriptions with the tag_ctl register.

I'll keep trying to reproduce this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2021-10-01 11:44 ` luis.machado at linaro dot org
@ 2021-10-06 12:04 ` vries at gcc dot gnu.org
  2021-10-06 12:06 ` vries at gcc dot gnu.org
                   ` (26 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: vries at gcc dot gnu.org @ 2021-10-06 12:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #5 from Tom de Vries <vries at gcc dot gnu.org> ---
Build log:
-
https://build.opensuse.org/public/build/home:tomdevries:branches:devel:gcc-gdb-gdb-11-branch/openSUSE_Factory_ARM/aarch64/gdb:testsuite/_log

Testlogs:
-
https://build.opensuse.org/package/binary/download/home:tomdevries:branches:devel:gcc-gdb-gdb-11-branch/gdb:testsuite/openSUSE_Factory_ARM/aarch64/gdb-testresults-11.1-321.15.aarch64.rpm

You may have to create an account on obs to be able to access this, I'm not
sure.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2021-10-06 12:04 ` vries at gcc dot gnu.org
@ 2021-10-06 12:06 ` vries at gcc dot gnu.org
  2021-10-06 12:07 ` luis.machado at linaro dot org
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: vries at gcc dot gnu.org @ 2021-10-06 12:06 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #6 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 13707
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13707&action=edit
gdb-aarch64-suse-linux.log.gz

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2021-10-06 12:06 ` vries at gcc dot gnu.org
@ 2021-10-06 12:07 ` luis.machado at linaro dot org
  2021-10-06 12:07 ` vries at gcc dot gnu.org
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-06 12:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #7 from Luis Machado <luis.machado at linaro dot org> ---
Thanks. I'll take a look.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2021-10-06 12:07 ` luis.machado at linaro dot org
@ 2021-10-06 12:07 ` vries at gcc dot gnu.org
  2021-10-28 17:05 ` sourceware at johnea dot net
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: vries at gcc dot gnu.org @ 2021-10-06 12:07 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #8 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 13708
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13708&action=edit
build log

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2021-10-06 12:07 ` vries at gcc dot gnu.org
@ 2021-10-28 17:05 ` sourceware at johnea dot net
  2021-10-28 17:10 ` luis.machado at linaro dot org
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-10-28 17:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

sourceware at johnea dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sourceware at johnea dot net

--- Comment #9 from sourceware at johnea dot net ---
Me Too!

I'm running gdbserver on archlinuxarm generic aarch64 rootfs:
$ gdbserver --version
GNU gdbserver (GDB) 11.1

And aarch64-linux-gnu-gdb on x86 archlinux host:
$ aarch64-linux-gnu-gdb --version
GNU gdb (GDB) 11.1

The command on aarch64 target:
$ gdbserver :1234 ./hello
Process ./hello created; pid = 1942
Listening on port 1234

The commands on x86 host:
$ aarch64-linux-gnu-gdb hello    <-- ARM executable 'hello' in pwd 
Reading symbols from hello...
(gdb) target remote zcu102-arch:1234
Remote debugging using zcu102-arch:1234
Remote connection closed

This leads to immediate crash on aarch64 target:
Remote debugging from host ::ffff:192.168.1.201, port 44372
../../gdbserver/regcache.cc:257: A problem internal to GDBserver has been
detected.
Unknown register tag_ctl requested

If it's meaningful, the aarch64 target does have MTE enabled in kernel:
$ zcat /proc/config.gz | grep -i mte
CONFIG_ARM64_AS_HAS_MTE=y
CONFIG_ARM64_MTE=y

This is 100% reproducible for me. (and 100% impeding my development)

If I may offer patch or other testing, I am happy to do so.

The aarch64 application under debug is built "native" on the ARM target:
$ gcc -g -o hello hello.c

The aarch64 kernel: 
Linux zcu102-arch 5.10.0-xilinx-v2021.1 #1 SMP Fri Jun 4 15:57:16 UTC 2021
aarch64 GNU/Linux

The x86 host kernel:
Linux host 5.14.2-arch1-2 #1 SMP PREEMPT Thu, 09 Sep 2021 09:42:35 +0000 x86_64
GNU/Linux

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2021-10-28 17:05 ` sourceware at johnea dot net
@ 2021-10-28 17:10 ` luis.machado at linaro dot org
  2021-10-28 17:24 ` luis.machado at linaro dot org
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-28 17:10 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #10 from Luis Machado <luis.machado at linaro dot org> ---
Hi,

Thanks. It's good to know this is reproducible reliably. Is this system running
within QEMU?

I have a fix in mind for this, but was postponing it until I could reproduce
this reliably.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2021-10-28 17:10 ` luis.machado at linaro dot org
@ 2021-10-28 17:24 ` luis.machado at linaro dot org
  2021-10-28 17:31 ` sourceware at johnea dot net
                   ` (20 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-28 17:24 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #11 from Luis Machado <luis.machado at linaro dot org> ---
Also, when you mentioned the hello ARM executable, you meant AArch64 executable
and not a 32-bit ARM executable. Is that correct?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2021-10-28 17:24 ` luis.machado at linaro dot org
@ 2021-10-28 17:31 ` sourceware at johnea dot net
  2021-10-28 17:59 ` luis.machado at linaro dot org
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-10-28 17:31 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #12 from sourceware at johnea dot net ---
Thank you Luis!

I'm glad to hear you have a patch in mind.

I'm currently working on actual hardware, a xilinx zcu102 dev board.

I'll try now in QEMU and report results.

And Yes, the 'hello' executable on the x86 host is aarch64.
file command executed on the x86 host:
$ file hello
hello: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV),
dynamically linked, interpreter /lib/ld-linux-aarch64.so.1,
BuildID[sha1]=4ee6eadc116d54aff8c7e180f8622bbdfaad4ad6, for GNU/Linux 3.7.0,
with debug_info, not stripped

I built this on the aarch64 target, and copied the 'hello' executable to the
x86 host for access to symbols.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2021-10-28 17:31 ` sourceware at johnea dot net
@ 2021-10-28 17:59 ` luis.machado at linaro dot org
  2021-10-28 17:59 ` luis.machado at linaro dot org
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-28 17:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #13 from Luis Machado <luis.machado at linaro dot org> ---
Thanks. That's great information. Let me try a cross-debugging scenario since I
can't reproduce this under a native debugging one with QEMU.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2021-10-28 17:59 ` luis.machado at linaro dot org
@ 2021-10-28 17:59 ` luis.machado at linaro dot org
  2021-10-28 19:46 ` luis.machado at linaro dot org
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-28 17:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2021-10-28 17:59 ` luis.machado at linaro dot org
@ 2021-10-28 19:46 ` luis.machado at linaro dot org
  2021-10-28 19:46 ` luis.machado at linaro dot org
                   ` (16 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-28 19:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #14 from Luis Machado <luis.machado at linaro dot org> ---
Could you please share what you see with the following command on your target?

LD_SHOW_AUXV=1 /bin/true

Also, could you please share all the output you see when connecting GDB to
GDBserver using the following switches?

set debug remote 1
set debug remote-packet-max-chars -1

Please pack the output and attach it to the ticket.

I'm guessing something between detecting MTE and sending the target description
is going off the rails. But I haven't managed to reproduce it on my end,
neither with a native setup nor with the cross setup.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2021-10-28 19:46 ` luis.machado at linaro dot org
@ 2021-10-28 19:46 ` luis.machado at linaro dot org
  2021-10-28 22:04 ` sourceware at johnea dot net
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-28 19:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2021-10-28 19:46 ` luis.machado at linaro dot org
@ 2021-10-28 22:04 ` sourceware at johnea dot net
  2021-10-28 22:06 ` sourceware at johnea dot net
                   ` (14 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-10-28 22:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #15 from sourceware at johnea dot net ---
Created attachment 13740
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13740&action=edit
aarch64-linux-gnu-gdb output capture for archlinuxarm gdbserver 11.1 remote
target FAILED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2021-10-28 22:04 ` sourceware at johnea dot net
@ 2021-10-28 22:06 ` sourceware at johnea dot net
  2021-10-28 22:09 ` sourceware at johnea dot net
                   ` (13 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-10-28 22:06 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #16 from sourceware at johnea dot net ---
Created attachment 13741
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13741&action=edit
aarch64-linux-gnu-gdb output capture for petalinux gdbserver 9.2 remote target
PASSED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2021-10-28 22:06 ` sourceware at johnea dot net
@ 2021-10-28 22:09 ` sourceware at johnea dot net
  2021-10-29  0:34 ` luis.machado at linaro dot org
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-10-28 22:09 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #17 from sourceware at johnea dot net ---
OK, one slight twist. The failure occurs on an archlinuxarm rootfs, with
gdbserver 11.1.

When I boot into Xilinx's petalinux rootfs, remote debug works correctly, with
gdbserver 9.2.

In both cases the x86 host runs aarch64-linux-gnu-gdb 11.1.

The data asked for, from both platforms:

>From aarch64 petalinux command line:
# LD_SHOW_AUXV=1 /bin/true
AT_SYSINFO_EHDR:      0xffffaf62c000
AT_??? (0x33): 0x1270
AT_HWCAP:             8fb
AT_PAGESZ:            4096
AT_CLKTCK:            100
AT_PHDR:              0xaaaaddbb0040
AT_PHENT:             56
AT_PHNUM:             9
AT_BASE:              0xffffaf5fb000
AT_FLAGS:             0x0
AT_ENTRY:             0xaaaaddbb1740
AT_UID:               0
AT_EUID:              0
AT_GID:               0
AT_EGID:              0
AT_SECURE:            0
AT_RANDOM:            0xffffd9b84c38
AT_HWCAP2:            0x0
AT_EXECFN:            /bin/true
AT_PLATFORM:          aarch64


>From aaarch64 archlinuxarm command line:
# LD_SHOW_AUXV=1 /bin/true
AT_SYSINFO_EHDR:      0xffffa2f68000
AT_??? (0x33): 0x1270
AT_HWCAP:             8fb
AT_PAGESZ:            4096
AT_CLKTCK:            100
AT_PHDR:              0xaaaae9850040
AT_PHENT:             56
AT_PHNUM:             9
AT_BASE:              0xffffa2f37000
AT_FLAGS:             0x0
AT_ENTRY:             0xaaaae98516c8
AT_UID:               0
AT_EUID:              0
AT_GID:               0
AT_EGID:              0
AT_SECURE:            0
AT_RANDOM:            0xffffc9115218
AT_HWCAP2:            0x0
AT_EXECFN:            /bin/true
AT_PLATFORM:          aarch64

The gdb output was captured by setting:
(gdb) set logging debugredirect on
(gdb) set logging on
(gdb) set debug remote 1
(gdb) set debug remote-packet-max-chars -1
(gdb) target remote zcu102:1234

When using the archlinuxarm rootfs, gdbserver 11.1, the (gdb) target remote
command led to immediate crash of gdbserver on the target. Data attached as:
gdbserver-11.1-archlinuxarm-failed.txt.gz

When using the petalinux rootfs, gdbserver 9.2, files and libraries were read
as expected, and I continued to set breakpoints, single step, and the hello
application ran and terminated successfully. Data attached as:
gdbserver-9.2-petalinux-pass.txt.gz

Don't be fooled by the filenames, both of these captures occurred on the same
x86 host, running aarch64-linux-gnu-gdb 11.1. The names represent the rootfs
and gdbserver version on the remote target.

Don't know if it's related, but I was also unable to get tcf-agent working on
the archlinuxarm rootfs, whereas it works on the petalinux rootfs.

I'd actually prefer to run the archlinux aarch64 rootfs, and I hope this data
capture can help illuminate the bug, and lead to a fix.

Please let me know if I can capture more data, or test updates...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2021-10-28 22:09 ` sourceware at johnea dot net
@ 2021-10-29  0:34 ` luis.machado at linaro dot org
  2021-10-29  0:34 ` luis.machado at linaro dot org
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-29  0:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #18 from Luis Machado <luis.machado at linaro dot org> ---
Thanks for the data.

Some clarifications. I expect any gdbserver that is not 11.1 to work correctly
on any of the rootfs'. The failure for gdbserver 11.1 is related to new code to
support MTE.

So if you don't need MTE support, you can replace gdbserver 11.1 with another
older gdbserver and have a working setup while we address this particular
problem.

With that said, I noticed a couple funny things in your AUXV output so far. The
HWCAP2 value is 0x0 on both dumps. The presence of MTE is determined by the
HWCAP2 values from the AUXV.

Here's what I see in system QEMU, for example:

AT_HWCAP2:       0x75fff

The MTE bit is number 18.

So that might be related to the problem you're seeing.

I'll go through the logs next.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2021-10-29  0:34 ` luis.machado at linaro dot org
@ 2021-10-29  0:34 ` luis.machado at linaro dot org
  2021-10-29  2:12 ` luis.machado at linaro dot org
                   ` (10 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-29  0:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2021-10-29  0:34 ` luis.machado at linaro dot org
@ 2021-10-29  2:12 ` luis.machado at linaro dot org
  2021-10-29  6:25 ` sourceware at johnea dot net
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-29  2:12 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #19 from Luis Machado <luis.machado at linaro dot org> ---
Ok. I finally managed to reproduce this. I'll share more details soon.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (24 preceding siblings ...)
  2021-10-29  2:12 ` luis.machado at linaro dot org
@ 2021-10-29  6:25 ` sourceware at johnea dot net
  2021-10-29 12:47 ` luis.machado at linaro dot org
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-10-29  6:25 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #20 from sourceware at johnea dot net ---
Just confirming that gdbserver 9.2 on archlinux aarch64 rootfs does work
correctly, and the problem is reproducible on gdbserver 11.1.

Thanks for that tip!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (25 preceding siblings ...)
  2021-10-29  6:25 ` sourceware at johnea dot net
@ 2021-10-29 12:47 ` luis.machado at linaro dot org
  2021-10-29 18:00 ` luis.machado at linaro dot org
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-29 12:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #21 from Luis Machado <luis.machado at linaro dot org> ---
So, if one has a kernel new enough that it has MTE awareness, and use a new
enough gdbserver that knows about the tag_ctl register, it will run into this
situation.

The catch being that the Linux kernel doesn't error out when you request the
tag_ctl register without MTE support. Some bits are not MTE-specific.

I'm working on a fix for this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (26 preceding siblings ...)
  2021-10-29 12:47 ` luis.machado at linaro dot org
@ 2021-10-29 18:00 ` luis.machado at linaro dot org
  2021-10-29 18:00 ` luis.machado at linaro dot org
                   ` (6 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-29 18:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #22 from Luis Machado <luis.machado at linaro dot org> ---
Created attachment 13747
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13747&action=edit
Tentative patch

I've attached a tentative patch. Could you please try it (it is based on
current binutils-gdb-master, but should apply cleanly to gdb-11) and let us
know how that works?

I've tried it myself and it fixes the crash for my environment.

If the patch works fine, I'll pursue it upstream.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (27 preceding siblings ...)
  2021-10-29 18:00 ` luis.machado at linaro dot org
@ 2021-10-29 18:00 ` luis.machado at linaro dot org
  2021-10-29 21:45 ` sourceware at johnea dot net
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-10-29 18:00 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (28 preceding siblings ...)
  2021-10-29 18:00 ` luis.machado at linaro dot org
@ 2021-10-29 21:45 ` sourceware at johnea dot net
  2021-11-01 13:34 ` luis.machado at linaro dot org
                   ` (4 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-10-29 21:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #23 from sourceware at johnea dot net ---
OK, took a while to build on the target.

I modified the ArchLinux gdb PKGBUILD file to apply the patch:

patching file gdb/arch/aarch64.h
patching file gdbserver/linux-aarch64-low.cc

After compilation and testing I can confirm that the patch does correct the
error.

Looks good here on gdbserver 11.1!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (29 preceding siblings ...)
  2021-10-29 21:45 ` sourceware at johnea dot net
@ 2021-11-01 13:34 ` luis.machado at linaro dot org
  2021-11-01 13:34 ` luis.machado at linaro dot org
                   ` (3 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-11-01 13:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED

--- Comment #24 from Luis Machado <luis.machado at linaro dot org> ---
Patch submitted to the mailing list for review. My plan is to fix this on both
master and gdb 11 branches.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (30 preceding siblings ...)
  2021-11-01 13:34 ` luis.machado at linaro dot org
@ 2021-11-01 13:34 ` luis.machado at linaro dot org
  2021-11-03 13:04 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-11-01 13:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #25 from Luis Machado <luis.machado at linaro dot org> ---
https://sourceware.org/pipermail/gdb-patches/2021-November/182985.html

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (31 preceding siblings ...)
  2021-11-01 13:34 ` luis.machado at linaro dot org
@ 2021-11-03 13:04 ` cvs-commit at gcc dot gnu.org
  2021-11-03 13:05 ` luis.machado at linaro dot org
  2021-11-03 14:46 ` sourceware at johnea dot net
  34 siblings, 0 replies; 36+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-11-03 13:04 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #26 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The gdb-11-branch branch has been updated by Luis Machado
<luisgpm@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=eb79b2318066cafb75ffdce310e3bbd44f7c79e3

commit eb79b2318066cafb75ffdce310e3bbd44f7c79e3
Author: Luis Machado <luis.machado@linaro.org>
Date:   Fri Oct 29 14:54:36 2021 -0300

    [AArch64] Make gdbserver register set selection dynamic

    The current register set selection mechanism for AArch64 is static, based
    on a pre-populated array of register sets.

    This means that we might potentially probe register sets that are not
    available. This is OK if the kernel errors out during ptrace, but probing
the
    tag_ctl register, for example, does not result in a ptrace error if the
kernel
    supports the tagged address ABI but not MTE (PR 28355).

    Making the register set selection dynamic, based on feature checks, solves
    this and simplifies the code a bit. It allows us to list all of the
register
    sets only once, and pick and choose based on HWCAP/HWCAP2 or other
properties.

    gdb/ChangeLog:

    2021-11-03  Luis Machado  <luis.machado@linaro.org>

            PR gdb/28355

            * arch/aarch64.h (struct aarch64_features): New struct.

    gdbserver/ChangeLog:

    2021-11-03  Luis Machado  <luis.machado@linaro.org>

            PR gdb/28355

            * linux-aarch64-low.cc (is_sve_tdesc): Remove.
            (aarch64_target::low_arch_setup): Rework to adjust the register
sets.
            (aarch64_regsets): Update to list all register sets.
            (aarch64_regsets_info, regs_info_aarch64): Replace NULL with
nullptr.
            (aarch64_sve_regsets, aarch64_sve_regsets_info)
            (regs_info_aarch64_sve): Remove.
            (aarch64_adjust_register_sets): New.
            (aarch64_target::get_regs_info): Remove references to removed
structs.
            (initialize_low_arch): Likewise.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (32 preceding siblings ...)
  2021-11-03 13:04 ` cvs-commit at gcc dot gnu.org
@ 2021-11-03 13:05 ` luis.machado at linaro dot org
  2021-11-03 14:46 ` sourceware at johnea dot net
  34 siblings, 0 replies; 36+ messages in thread
From: luis.machado at linaro dot org @ 2021-11-03 13:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

Luis Machado <luis.machado at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #27 from Luis Machado <luis.machado at linaro dot org> ---
Fix pushed to both binutils-gdb-master and gdb-11.

Thanks for the reproducer!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug tdep/28355] [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested
  2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
                   ` (33 preceding siblings ...)
  2021-11-03 13:05 ` luis.machado at linaro dot org
@ 2021-11-03 14:46 ` sourceware at johnea dot net
  34 siblings, 0 replies; 36+ messages in thread
From: sourceware at johnea dot net @ 2021-11-03 14:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=28355

--- Comment #28 from sourceware at johnea dot net ---
Thank you for the quick fix Luis!

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2021-11-03 14:46 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 13:28 [Bug tdep/28355] New: [aarch64] regcache.cc:257: A problem internal to GDBserver has been detected. Unknown register tag_ctl requested vries at gcc dot gnu.org
2021-09-20 13:28 ` [Bug tdep/28355] " vries at gcc dot gnu.org
2021-09-20 14:00 ` luis.machado at linaro dot org
2021-09-20 14:27 ` luis.machado at linaro dot org
2021-09-20 14:30 ` luis.machado at linaro dot org
2021-09-21 12:48 ` luis.machado at linaro dot org
2021-09-27 10:00 ` vries at gcc dot gnu.org
2021-10-01 11:44 ` luis.machado at linaro dot org
2021-10-06 12:04 ` vries at gcc dot gnu.org
2021-10-06 12:06 ` vries at gcc dot gnu.org
2021-10-06 12:07 ` luis.machado at linaro dot org
2021-10-06 12:07 ` vries at gcc dot gnu.org
2021-10-28 17:05 ` sourceware at johnea dot net
2021-10-28 17:10 ` luis.machado at linaro dot org
2021-10-28 17:24 ` luis.machado at linaro dot org
2021-10-28 17:31 ` sourceware at johnea dot net
2021-10-28 17:59 ` luis.machado at linaro dot org
2021-10-28 17:59 ` luis.machado at linaro dot org
2021-10-28 19:46 ` luis.machado at linaro dot org
2021-10-28 19:46 ` luis.machado at linaro dot org
2021-10-28 22:04 ` sourceware at johnea dot net
2021-10-28 22:06 ` sourceware at johnea dot net
2021-10-28 22:09 ` sourceware at johnea dot net
2021-10-29  0:34 ` luis.machado at linaro dot org
2021-10-29  0:34 ` luis.machado at linaro dot org
2021-10-29  2:12 ` luis.machado at linaro dot org
2021-10-29  6:25 ` sourceware at johnea dot net
2021-10-29 12:47 ` luis.machado at linaro dot org
2021-10-29 18:00 ` luis.machado at linaro dot org
2021-10-29 18:00 ` luis.machado at linaro dot org
2021-10-29 21:45 ` sourceware at johnea dot net
2021-11-01 13:34 ` luis.machado at linaro dot org
2021-11-01 13:34 ` luis.machado at linaro dot org
2021-11-03 13:04 ` cvs-commit at gcc dot gnu.org
2021-11-03 13:05 ` luis.machado at linaro dot org
2021-11-03 14:46 ` sourceware at johnea dot net

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).