2012-05-30 Jeff Kenton <jkenton@tilera.com>
* Makefile.in (ALL_TARGET_OBJS): Add tilegx-tdep.o and tilegx-linux-tdep.o. (ALLDEPFILES): Add tilegx-linux-nat.c, tilegx-tdep.c and tilegx-linux-tdep.c. * configure.tgt: Handle tilegx-*-linux*. * tilegx-tdep.h: New file. * tilegx-tdep.c: New file. * tilegx-linux-tdep.c: New file. * regformats/reg-tilegx.dat: New file.
This commit is contained in:
parent
ea52a08872
commit
ade64f0e04
7 changed files with 1359 additions and 0 deletions
|
@ -1,3 +1,15 @@
|
|||
2012-05-30 Jeff Kenton <jkenton@tilera.com>
|
||||
|
||||
* Makefile.in (ALL_TARGET_OBJS): Add tilegx-tdep.o and
|
||||
tilegx-linux-tdep.o.
|
||||
(ALLDEPFILES): Add tilegx-linux-nat.c, tilegx-tdep.c and
|
||||
tilegx-linux-tdep.c.
|
||||
* configure.tgt: Handle tilegx-*-linux*.
|
||||
* tilegx-tdep.h: New file.
|
||||
* tilegx-tdep.c: New file.
|
||||
* tilegx-linux-tdep.c: New file.
|
||||
* regformats/reg-tilegx.dat: New file.
|
||||
|
||||
2012-05-30 Edjunior Machado <emachado@linux.vnet.ibm.com>
|
||||
|
||||
* ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): fix
|
||||
|
|
|
@ -566,6 +566,7 @@ ALL_TARGET_OBS = \
|
|||
sparc-sol2-tdep.o sparc-tdep.o \
|
||||
spu-tdep.o spu-multiarch.o solib-spu.o \
|
||||
tic6x-tdep.o tic6x-linux-tdep.o \
|
||||
tilegx-tdep.o tilegx-linux-tdep.o \
|
||||
v850-tdep.o \
|
||||
vaxnbsd-tdep.o vaxobsd-tdep.o vax-tdep.o \
|
||||
xstormy16-tdep.o \
|
||||
|
@ -1498,6 +1499,7 @@ ALLDEPFILES = \
|
|||
sparc64nbsd-nat.c sparc64nbsd-tdep.c sparc64obsd-tdep.c \
|
||||
sparcnbsd-nat.c sparcnbsd-tdep.c sparcobsd-tdep.c \
|
||||
spu-linux-nat.c spu-tdep.c spu-multiarch.c solib-spu.c \
|
||||
tilegx-linux-nat.c tilegx-tdep.c tilegx-linux-tdep.c \
|
||||
v850-tdep.c \
|
||||
vax-nat.c vax-tdep.c vaxbsd-nat.c vaxnbsd-tdep.c \
|
||||
windows-nat.c windows-tdep.c \
|
||||
|
|
|
@ -552,6 +552,12 @@ tic6x-*-*)
|
|||
gdb_target_obs="tic6x-tdep.o"
|
||||
;;
|
||||
|
||||
tilegx-*-linux*)
|
||||
# Target: TILE-Gx
|
||||
gdb_target_obs="tilegx-tdep.o tilegx-linux-tdep.o solib-svr4.o \
|
||||
symfile-mem.o glibc-tdep.o linux-tdep.o"
|
||||
;;
|
||||
|
||||
xstormy16-*-*)
|
||||
# Target: Sanyo Xstormy16a processor
|
||||
gdb_target_obs="xstormy16-tdep.o"
|
||||
|
|
67
gdb/regformats/reg-tilegx.dat
Normal file
67
gdb/regformats/reg-tilegx.dat
Normal file
|
@ -0,0 +1,67 @@
|
|||
name:tile
|
||||
expedite:sp,lr,pc
|
||||
64:r0
|
||||
64:r1
|
||||
64:r2
|
||||
64:r3
|
||||
64:r4
|
||||
64:r5
|
||||
64:r6
|
||||
64:r7
|
||||
64:r8
|
||||
64:r9
|
||||
64:r10
|
||||
64:r11
|
||||
64:r12
|
||||
64:r13
|
||||
64:r14
|
||||
64:r15
|
||||
64:r16
|
||||
64:r17
|
||||
64:r18
|
||||
64:r19
|
||||
64:r20
|
||||
64:r21
|
||||
64:r22
|
||||
64:r23
|
||||
64:r24
|
||||
64:r25
|
||||
64:r26
|
||||
64:r27
|
||||
64:r28
|
||||
64:r29
|
||||
64:r30
|
||||
64:r31
|
||||
64:r32
|
||||
64:r33
|
||||
64:r34
|
||||
64:r35
|
||||
64:r36
|
||||
64:r37
|
||||
64:r38
|
||||
64:r39
|
||||
64:r40
|
||||
64:r41
|
||||
64:r42
|
||||
64:r43
|
||||
64:r44
|
||||
64:r45
|
||||
64:r46
|
||||
64:r47
|
||||
64:r48
|
||||
64:r49
|
||||
64:r50
|
||||
64:r51
|
||||
64:r52
|
||||
64:tp
|
||||
64:sp
|
||||
64:lr
|
||||
64:sn
|
||||
64:io0
|
||||
64:io1
|
||||
64:us0
|
||||
64:us1
|
||||
64:us2
|
||||
64:us3
|
||||
64:zero
|
||||
64:pc
|
146
gdb/tilegx-linux-tdep.c
Normal file
146
gdb/tilegx-linux-tdep.c
Normal file
|
@ -0,0 +1,146 @@
|
|||
/* Target-dependent code for GNU/Linux on Tilera TILE-Gx processors.
|
||||
|
||||
Copyright 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#include "defs.h"
|
||||
#include "osabi.h"
|
||||
#include "linux-tdep.h"
|
||||
#include "glibc-tdep.h"
|
||||
#include "solib-svr4.h"
|
||||
#include "symtab.h"
|
||||
#include "regcache.h"
|
||||
#include "regset.h"
|
||||
#include "tramp-frame.h"
|
||||
#include "trad-frame.h"
|
||||
#include "tilegx-tdep.h"
|
||||
|
||||
/* Signal trampoline support. */
|
||||
|
||||
static void
|
||||
tilegx_linux_sigframe_init (const struct tramp_frame *self,
|
||||
struct frame_info *this_frame,
|
||||
struct trad_frame_cache *this_cache,
|
||||
CORE_ADDR func)
|
||||
{
|
||||
CORE_ADDR pc = get_frame_register_unsigned (this_frame, 64);
|
||||
CORE_ADDR sp = get_frame_register_unsigned (this_frame, 54);
|
||||
CORE_ADDR base = sp + 16;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 56; i++)
|
||||
trad_frame_set_reg_addr (this_cache, i, base + i * 8);
|
||||
|
||||
trad_frame_set_reg_value (this_cache, 64, pc);
|
||||
|
||||
/* Save a frame ID. */
|
||||
trad_frame_set_id (this_cache, frame_id_build (base, func));
|
||||
}
|
||||
|
||||
static const struct tramp_frame tilegx_linux_rt_sigframe =
|
||||
{
|
||||
SIGTRAMP_FRAME,
|
||||
8,
|
||||
{
|
||||
{ 0x00045fe551483000, -1 }, /* { moveli r10, 139 } */
|
||||
{ 0x286b180051485000, -1 }, /* { swint1 } */
|
||||
{ TRAMP_SENTINEL_INSN, -1 }
|
||||
},
|
||||
tilegx_linux_sigframe_init
|
||||
};
|
||||
|
||||
/* Supply raw registers from REGCACHE to REGS. */
|
||||
|
||||
static void
|
||||
tilegx_linux_supply_regset (const struct regset *regset,
|
||||
struct regcache *regcache,
|
||||
int regnum, const void *regs, size_t len)
|
||||
{
|
||||
struct gdbarch *arch = get_regcache_arch (regcache);
|
||||
const char *ptr = regs;
|
||||
int i;
|
||||
|
||||
/* This logic must match that of struct pt_regs in "ptrace.h". */
|
||||
for (i = 0; i < TILEGX_NUM_EASY_REGS + 1; i++, ptr += tilegx_reg_size)
|
||||
{
|
||||
int gri = (i < TILEGX_NUM_EASY_REGS) ? i : TILEGX_PC_REGNUM;
|
||||
|
||||
if (regnum == gri || regnum == -1)
|
||||
regcache_raw_supply (regcache, gri, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
/* TILE-Gx Linux kernel register set. */
|
||||
static struct regset tilegx_linux_regset =
|
||||
{
|
||||
NULL,
|
||||
tilegx_linux_supply_regset
|
||||
};
|
||||
|
||||
static const struct regset *
|
||||
tilegx_regset_from_core_section (struct gdbarch *gdbarch,
|
||||
const char *sect_name,
|
||||
size_t sect_size)
|
||||
{
|
||||
if (strcmp (sect_name, ".reg") == 0)
|
||||
return &tilegx_linux_regset;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* OS specific initialization of gdbarch. */
|
||||
|
||||
static void
|
||||
tilegx_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
|
||||
{
|
||||
int arch_size = gdbarch_addr_bit (gdbarch);
|
||||
|
||||
linux_init_abi (info, gdbarch);
|
||||
|
||||
tramp_frame_prepend_unwinder (gdbarch, &tilegx_linux_rt_sigframe);
|
||||
|
||||
set_gdbarch_regset_from_core_section (gdbarch,
|
||||
tilegx_regset_from_core_section);
|
||||
|
||||
/* GNU/Linux uses SVR4-style shared libraries. */
|
||||
if (arch_size == 32)
|
||||
set_solib_svr4_fetch_link_map_offsets (gdbarch,
|
||||
svr4_ilp32_fetch_link_map_offsets);
|
||||
else
|
||||
set_solib_svr4_fetch_link_map_offsets (gdbarch,
|
||||
svr4_lp64_fetch_link_map_offsets);
|
||||
|
||||
/* Enable TLS support. */
|
||||
set_gdbarch_fetch_tls_load_module_address (gdbarch,
|
||||
svr4_fetch_objfile_link_map);
|
||||
|
||||
/* Shared library handling. */
|
||||
set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
|
||||
set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
|
||||
|
||||
set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
|
||||
}
|
||||
|
||||
/* Provide a prototype to silence -Wmissing-prototypes. */
|
||||
extern initialize_file_ftype _initialize_tilegx_linux_tdep;
|
||||
|
||||
void
|
||||
_initialize_tilegx_linux_tdep (void)
|
||||
{
|
||||
gdbarch_register_osabi (bfd_arch_tilegx, bfd_mach_tilegx, GDB_OSABI_LINUX,
|
||||
tilegx_linux_init_abi);
|
||||
}
|
1017
gdb/tilegx-tdep.c
Normal file
1017
gdb/tilegx-tdep.c
Normal file
File diff suppressed because it is too large
Load diff
109
gdb/tilegx-tdep.h
Normal file
109
gdb/tilegx-tdep.h
Normal file
|
@ -0,0 +1,109 @@
|
|||
/* Target-dependent code for the Tilera TILE-Gx processor.
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GDB.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||
|
||||
#ifndef TILEGX_TDEP_H
|
||||
#define TILEGX_TDEP_H
|
||||
|
||||
/* TILE-Gx has 56 general purpose registers (R0 - R52, TP, SP, LR),
|
||||
plus 8 special general purpose registers (network and ZERO),
|
||||
plus 1 magic register (PC).
|
||||
|
||||
TP (aka R53) is the thread specific data pointer.
|
||||
SP (aka R54) is the stack pointer.
|
||||
LR (aka R55) is the link register. */
|
||||
|
||||
enum tilegx_regnum
|
||||
{
|
||||
TILEGX_R0_REGNUM,
|
||||
TILEGX_R1_REGNUM,
|
||||
TILEGX_R2_REGNUM,
|
||||
TILEGX_R3_REGNUM,
|
||||
TILEGX_R4_REGNUM,
|
||||
TILEGX_R5_REGNUM,
|
||||
TILEGX_R6_REGNUM,
|
||||
TILEGX_R7_REGNUM,
|
||||
TILEGX_R8_REGNUM,
|
||||
TILEGX_R9_REGNUM,
|
||||
TILEGX_R10_REGNUM,
|
||||
TILEGX_R11_REGNUM,
|
||||
TILEGX_R12_REGNUM,
|
||||
TILEGX_R13_REGNUM,
|
||||
TILEGX_R14_REGNUM,
|
||||
TILEGX_R15_REGNUM,
|
||||
TILEGX_R16_REGNUM,
|
||||
TILEGX_R17_REGNUM,
|
||||
TILEGX_R18_REGNUM,
|
||||
TILEGX_R19_REGNUM,
|
||||
TILEGX_R20_REGNUM,
|
||||
TILEGX_R21_REGNUM,
|
||||
TILEGX_R22_REGNUM,
|
||||
TILEGX_R23_REGNUM,
|
||||
TILEGX_R24_REGNUM,
|
||||
TILEGX_R25_REGNUM,
|
||||
TILEGX_R26_REGNUM,
|
||||
TILEGX_R27_REGNUM,
|
||||
TILEGX_R28_REGNUM,
|
||||
TILEGX_R29_REGNUM,
|
||||
TILEGX_R30_REGNUM,
|
||||
TILEGX_R31_REGNUM,
|
||||
TILEGX_R32_REGNUM,
|
||||
TILEGX_R33_REGNUM,
|
||||
TILEGX_R34_REGNUM,
|
||||
TILEGX_R35_REGNUM,
|
||||
TILEGX_R36_REGNUM,
|
||||
TILEGX_R37_REGNUM,
|
||||
TILEGX_R38_REGNUM,
|
||||
TILEGX_R39_REGNUM,
|
||||
TILEGX_R40_REGNUM,
|
||||
TILEGX_R41_REGNUM,
|
||||
TILEGX_R42_REGNUM,
|
||||
TILEGX_R43_REGNUM,
|
||||
TILEGX_R44_REGNUM,
|
||||
TILEGX_R45_REGNUM,
|
||||
TILEGX_R46_REGNUM,
|
||||
TILEGX_R47_REGNUM,
|
||||
TILEGX_R48_REGNUM,
|
||||
TILEGX_R49_REGNUM,
|
||||
TILEGX_R50_REGNUM,
|
||||
TILEGX_R51_REGNUM,
|
||||
TILEGX_R52_REGNUM,
|
||||
TILEGX_TP_REGNUM,
|
||||
TILEGX_SP_REGNUM,
|
||||
TILEGX_LR_REGNUM,
|
||||
|
||||
TILEGX_SN_REGNUM,
|
||||
TILEGX_NUM_EASY_REGS = TILEGX_SN_REGNUM, /* 56 */
|
||||
|
||||
TILEGX_IO0_REGNUM,
|
||||
TILEGX_IO1_REGNUM,
|
||||
TILEGX_US0_REGNUM,
|
||||
TILEGX_US1_REGNUM,
|
||||
TILEGX_US2_REGNUM,
|
||||
TILEGX_US3_REGNUM,
|
||||
TILEGX_ZERO_REGNUM,
|
||||
|
||||
TILEGX_PC_REGNUM,
|
||||
TILEGX_NUM_PHYS_REGS = TILEGX_PC_REGNUM, /* 64 */
|
||||
|
||||
TILEGX_NUM_REGS /* 65 */
|
||||
};
|
||||
|
||||
enum { tilegx_reg_size = 8 };
|
||||
|
||||
#endif /* tilegx-tdep.h */
|
Loading…
Add table
Reference in a new issue