GDBArch_RV64.st
author Jan Vrany <jan.vrany@labware.com>
Thu, 14 Oct 2021 00:21:40 +0200
changeset 241 286aa6020b9e
parent 206 3d4aca3ff608
child 259 651864c2aa29
permissions -rw-r--r--
Update only "displayed" registers ...even if -data-list-changed-registers returns more. On some buggy architectures and/or simulators (e.g., RISC-V on QEMU as of today), -data-list-changed-registers return registers that fail to be subsequently fetched by -data-list-register-values. This commit workarounds it by filtering out all registers not found in `#registerNumbersToDisplayUsing:` introduced in commit 3d4aca3ff608.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
205
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     1
"
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     2
jv:libgdbs - GNU Debugger Interface Library
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     3
Copyright (C) 2015-now Jan Vrany
241
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
     4
Copyright (C) 2021 LabWare
205
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     5
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     6
This library is free software; you can redistribute it and/or
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     7
modify it under the terms of the GNU Lesser General Public
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     8
License as published by the Free Software Foundation; either
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
     9
version 2.1 of the License. 
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    10
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    11
This library is distributed in the hope that it will be useful,
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    12
but WITHOUT ANY WARRANTY; without even the implied warranty of
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    14
Lesser General Public License for more details.
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    15
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    16
You should have received a copy of the GNU Lesser General Public
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    17
License along with this library; if not, write to the Free Software
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    19
"
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    20
"{ Package: 'jv:libgdbs' }"
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    21
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    22
"{ NameSpace: Smalltalk }"
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    23
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    24
GDBArchitecture subclass:#GDBArch_RV64
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    25
	instanceVariableNames:''
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    26
	classVariableNames:''
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    27
	poolDictionaries:''
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    28
	category:'GDB-Core'
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    29
!
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    30
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    31
!GDBArch_RV64 class methodsFor:'documentation'!
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    32
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    33
copyright
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    34
"
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    35
jv:libgdbs - GNU Debugger Interface Library
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    36
Copyright (C) 2015-now Jan Vrany
241
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    37
Copyright (C) 2021 LabWare
205
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    38
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    39
This library is free software; you can redistribute it and/or
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    40
modify it under the terms of the GNU Lesser General Public
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    41
License as published by the Free Software Foundation; either
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    42
version 2.1 of the License. 
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    43
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    44
This library is distributed in the hope that it will be useful,
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    45
but WITHOUT ANY WARRANTY; without even the implied warranty of
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    46
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    47
Lesser General Public License for more details.
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    48
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    49
You should have received a copy of the GNU Lesser General Public
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    50
License along with this library; if not, write to the Free Software
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    51
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    52
"
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    53
! !
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    54
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    55
!GDBArch_RV64 methodsFor:'accessing'!
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    56
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    57
name
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    58
    ^ 'RISC-V 64'
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    59
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    60
    "Created: / 22-05-2020 / 13:12:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
206
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    61
!
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    62
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    63
registerNamesToDisplay
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    64
    "Returns a list of register names to display in register view (VDBRegisterListApplication)
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    65
     or `nil` if all available registers are to be displayed.
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    66
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    67
     This is used on platforms for limit the number of registers, usually
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    68
     because either (i) it is too long and has a lots of 'uninterested' registers
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    69
     or (ii) some registers are not supported by gdbserver / QEMU or whatever
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    70
     and this is used to avoid errors while still displaying 'interesting' registers.
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    71
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    72
     Essentially a hack.
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    73
    "
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    74
    ^ #('pc' 'zero' 'ra' 'sp' 'gp' 'tp' 't0' 't1' 't2' 'fp' 's1' 'a0' 'a1' 'a2' 'a3' 'a4' 'a5' 'a6' 'a7' 's2' 's3' 's4' 's5' 's6' 's7' 's8' 's9' 's10' 's11' 't3' 't4' 't5' 't6' 'ft0' 'ft1' 'ft2' 'ft3' 'ft4' 'ft5' 'ft6' 'ft7' 'fs0' 'fs1' 'fa0' 'fa1' 'fa2' 'fa3' 'fa4' 'fa5' 'fa6' 'fa7' 'fs2' 'fs3' 'fs4' 'fs5' 'fs6' 'fs7' 'fs8' 'fs9' 'fs10' 'fs11' 'ft8' 'ft9' 'ft10' 'ft11')
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    75
3d4aca3ff608 Allow architecture definition to specify a subset of registers to display
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 205
diff changeset
    76
    "Created: / 22-05-2020 / 13:21:05 / Jan Vrany <jan.vrany@fit.cvut.cz>"
205
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    77
! !
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    78
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    79
!GDBArch_RV64 methodsFor:'queries'!
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    80
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    81
sizeofPointer
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    82
    ^ 8
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    83
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    84
    "Created: / 22-05-2020 / 13:12:24 / Jan Vrany <jan.vrany@fit.cvut.cz>"
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    85
! !
26ed194991b7 Add RISC-V architecture definition
Jan Vrany <jan.vrany@fit.cvut.cz>
parents:
diff changeset
    86
241
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    87
!GDBArch_RV64 class methodsFor:'documentation'!
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    88
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    89
version_HG
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    90
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    91
    ^ '$Changeset: <not expanded> $'
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    92
! !
286aa6020b9e Update only "displayed" registers
Jan Vrany <jan.vrany@labware.com>
parents: 206
diff changeset
    93