aboutsummaryrefslogtreecommitdiff
path: root/gdb/csky-tdep.h
AgeCommit message (Collapse)AuthorFilesLines
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-09-13gdb/csky add unwinder for long branch casesJiangshuai Li1-0/+5
There are two sequences of instructions for long branch: 1. jmpi [pc+4] //insn code: 0xeac00001 .long addr 2. lrw t1, [pc+8] //insn code: 0xea8d0002 jmp t1 //insn code: 0x7834 nop //insn code: 0x6c03 .long addr
2022-08-15gdb/csky add unwinder for sigtramp frame when kernel 4.x and laterJiangshuai Li1-0/+6
When kernel veriosn >= V4.x, the characteristic values used to determine whether it is a signal function call are: movi r7, 139 trap 0 Registers are saved at (sp + CSKY_SIGINFO_OFFSET + CSKY_SIGINFO_SIZE + CSKY_UCONTEXT_SIGCONTEXT + CSKY_SIGCONTEXT_PT_REGS_TLS). The order is described in csky_linux_rt_sigreturn_init_pt_regs.
2022-08-08gdb/csky support .reg2 for kernel 4.x and laterJiangshuai Li1-0/+3
When kernel's version >= 4.x, the size of .reg2 section will be 400. Contents of .reg2 are { unsigned long vr[96]; unsigned long fcr; unsigned long fesr; unsigned long fid; unsigned long reserved; }; VR[96] means: (vr0~vr15) + (fr16~fr31), each Vector register is 128-bits, each Float register is 64 bits, the total size is (4*96). In addition, for fr0~fr15, each FRx is the lower 64 bits of the corresponding VRx. So fr0~fr15 and vr0~vr15 regisetrs use the same offset.
2022-07-26gdb: rename gdbarch_tdep struct to fix g++ 4.8 buildAndrew Burgess1-1/+1
After the commit: commit 08106042d9f5fdff60c129bf33190639f1a98b2a Date: Thu May 19 13:20:17 2022 +0100 gdb: move the type cast into gdbarch_tdep GDB would no longer build using g++ 4.8. The issue appears to be some confusion caused by GDB having 'struct gdbarch_tdep', but also a templated function called 'gdbarch_tdep'. Prior to the above commit the gdbarch_tdep function was not templated, and this compiled just fine. Note that the above commit compiles just fine with later versions of g++, so this issue was clearly fixed at some point, though I've not tried to track down exactly when. In this commit I propose to fix the g++ 4.8 build problem by renaming 'struct gdbarch_tdep' to 'struct gdbarch_tdep_base'. This rename better represents that the struct is only ever used as a base class, and removes the overloading of the name, which allows GDB to build with g++ 4.8. I've also updated the comment on 'struct gdbarch_tdep_base' to fix a typo, and the comment on the 'gdbarch_tdep' function, to mention that in maintainer mode a run-time type check is performed.
2022-07-12gdb/csky complete csky_dwarf_reg_to_regnumJiangshuai Li1-0/+4
For csky arch, the correspondence between Dwarf registers and GDB registers are as follows: dwarf regnos 0~31 ==> gdb regs r0~r31 dwarf regno CSKY_HI_REGNUM(36) ==> gdb reg hi dwarf regno CSKY_LO_REGNUM(37) ==> gdb reg hi dwarf regno CSKY_PC_REGNUM(72) ==> gdb reg pc dwarf regnos FV_PSEUDO_REGNO_FIRST(74)~FV_PSEUDO_REGNO_LAST(201) ==> gdb regs s0~s127 (pseudo regs for float and vector regs) other dwarf regnos have no corresponding gdb regs to them.
2022-06-28gdb:csky add pseudo regs for float and vector regsJiangshuai Li1-0/+7
In the existing CSKY architecture, there are at most 32 floating and 16 vector registers. Float registers's count can be configured as 16 or 32. In the future, the vector registers's count may be extended to 32. The bit width of floating-point register is 64bits, and the bit width of vector register is 128bit. Special points: in fr0~fr15 and vr0~vr15, each FRx is the lower 64 bits of the corresponding VRx. Here, we will split each floating-point and vector register to 32bits wide, add the corresponding pseudo registers, and finally use them for the dwarf registers. There are 128 pseudo registers in total, s0~s127, including: 1. s0 and s1 correspond to fr0, s4 and s5 correspond to fr1, and so on. Every two separated pseudo registers correspond to a float register. 2. s0, s1, s2 and s3 correspond to vr0; s4, s5, s6 and s7 correspond to vr1, and so on. Every four pseudo registers corresponds to a vector register. Therefore, in s64~s127, there are general registers that are not actually used. This part is to prepare for the expansion of vector registers to 32 Therefore, in s64~s127, half of the registers are actually unused. This part is to prepare for the expansion of the vector register to 32.
2022-06-13gdb:csky add support target-descriptions for CSKY archJiangshuai Li1-3/+11
Registers in CSKY architecture included: 1. 32 gprs 2. 16 ars (alternative gprs used for quick interrupt) 3. hi, lo, pc 4. fr0~fr31, fcsr, fid, fesr 5. vr0~vr15 6. ((32 banks) * 32) cr regs (max 32 banks, 32 control regs a bank) For register names: Except over control registers, other registers, like gprs, hi, lo ... are fixed names. Among the 32*32 control registers, some used registers will have fixed names, others will have a default name "cpxcry". 'x' refers to bank, y refers index in the bank(a control register in bank 4 with index 14 will has a default name cp4cr14). For register numbers in GDB: We assign a fixed number to each register in GDB, like: r0~r31 with 0~31 hi, lo with 36, 37 fpu/vpu with 40~71 ... described in function csky_get_supported_register_by_index(). Function csky_get_supported_tdesc_registers_count(): To calculate the total number of registers that GDB can analyze, including those with fixed names and those with default register names. Function csky_get_supported_register_by_index(): To find a supported struct csky_supported_tdesc_register, return a struct include name with regnum via index. Arrays csky_supported_tdesc_feature_names[]: Include all supported feature names in tdesc-xmls. We use the information described above to load the register description file of the target from the stub. When loading, do a little check that whether the register description file contains SP, LR and PC.
2022-06-01gdb:csky save fpu and vdsp info to struct csky_gdbarch_tdepJiangshuai Li1-1/+4
First, add three variables fpu_abi, fpu_hardfp and vdsp_version to csky_gdbarch_tdep. They will be initialized from info.abfd in cskg_gdbarch_init. Now, they are just used to find a candidate among the list of pre-declared architectures Later, they will be used in gdbarch_return_value and gdbarch_push_dummy_call for funtions described below: fpu_abi: to check if the bfd is using VAL_CSKY_FPU_ABI_HARD or VAL_CSKY_FPU_ABI_SOFT fpu_hardfp: to check if the bfd is using VAL_CSKY_FPU_HARDFP_SINGLE or VAL_CSKY_FPU_HARDFP_DOUBLE vdsp_version: to check if a function is returned with CSKY_VRET_REGNUM
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-11-18gdb: include gdbarch.h in all files extending gdbarch_tdepSimon Marchi1-0/+2
Commit 345bd07cce33 ("gdb: fix gdbarch_tdep ODR violation") made a bunch of files define a *_gdbarch_tdep class that inherits from a gdbarch_tdep base. But some of these files don't include gdbarch.h, where gdbarch_tdep is defined. This may cause build errors if gdbarch.h isn't already included by chance by some other header file. Avoid this by making them include gdbarch.h. Change-Id: If433d302007e274daa4f656cfc94f769cf1aa68a
2021-11-15gdb: fix gdbarch_tdep ODR violationSimon Marchi1-1/+1
I would like to be able to use non-trivial types in gdbarch_tdep types. This is not possible at the moment (in theory), because of the one definition rule. To allow it, rename all gdbarch_tdep types to <arch>_gdbarch_tdep, and make them inherit from a gdbarch_tdep base class. The inheritance is necessary to be able to pass pointers to all these <arch>_gdbarch_tdep objects to gdbarch_alloc, which takes a pointer to gdbarch_tdep. These objects are never deleted through a base class pointer, so I didn't include a virtual destructor. In the future, if gdbarch objects deletable, I could imagine that the gdbarch_tdep objects could become owned by the gdbarch objects, and then it would become useful to have a virtual destructor (so that the gdbarch object can delete the owned gdbarch_tdep object). But that's not necessary right now. It turns out that RISC-V already has a gdbarch_tdep that is non-default-constructible, so that provides a good motivation for this change. Most changes are fairly straightforward, mostly needing to add some casts all over the place. There is however the xtensa architecture, doing its own little weird thing to define its gdbarch_tdep. I did my best to adapt it, but I can't test those changes. Change-Id: Ic001903f91ddd106bd6ca09a79dabe8df2d69f3b
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-08-28Add support for new target 'csky'.Hafiz Abid Qadeer1-0/+355
2018-08-28 Jiangshuai Li <jiangshuai_li@c-sky.com> Hafiz Abid Qadeer <abidh@codesourcery.com> Don Breazeal <donb@codesourcery.com> * csky-linux-tdep.c: New file. * csky-tdep.c: Likewise. * csky-tdep.h: Likewise. * Makefile.in (ALL_TARGET_OBS): Add csky-linux-tdep.o and csky-tdep.o. (HFILES_NO_SRCDIR): Add csky-tdep.h. (ALLDEPFILES): Add csky-linux-tdep.c and csky-tdep.c * configure.tgt: Add csky support.