gdb/
[deliverable/binutils-gdb.git] / gdb / d10v-tdep.c
CommitLineData
f81cd1cf
AC
1// OBSOLETE /* Target-dependent code for Renesas D10V, for GDB.
2// OBSOLETE
197e01b6 3// OBSOLETE Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software
f81cd1cf
AC
4// OBSOLETE Foundation, Inc.
5// OBSOLETE
6// OBSOLETE This file is part of GDB.
7// OBSOLETE
8// OBSOLETE This program is free software; you can redistribute it and/or modify
9// OBSOLETE it under the terms of the GNU General Public License as published by
10// OBSOLETE the Free Software Foundation; either version 2 of the License, or
11// OBSOLETE (at your option) any later version.
12// OBSOLETE
13// OBSOLETE This program is distributed in the hope that it will be useful,
14// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
15// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// OBSOLETE GNU General Public License for more details.
17// OBSOLETE
18// OBSOLETE You should have received a copy of the GNU General Public License
19// OBSOLETE along with this program; if not, write to the Free Software
197e01b6
EZ
20// OBSOLETE Foundation, Inc., 51 Franklin Street, Fifth Floor,
21// OBSOLETE Boston, MA 02110-1301, USA. */
f81cd1cf
AC
22// OBSOLETE
23// OBSOLETE /* Contributed by Martin Hunt, hunt@cygnus.com */
24// OBSOLETE
25// OBSOLETE #include "defs.h"
26// OBSOLETE #include "frame.h"
27// OBSOLETE #include "frame-unwind.h"
28// OBSOLETE #include "frame-base.h"
29// OBSOLETE #include "symtab.h"
30// OBSOLETE #include "gdbtypes.h"
31// OBSOLETE #include "gdbcmd.h"
32// OBSOLETE #include "gdbcore.h"
33// OBSOLETE #include "gdb_string.h"
34// OBSOLETE #include "value.h"
35// OBSOLETE #include "inferior.h"
36// OBSOLETE #include "dis-asm.h"
37// OBSOLETE #include "symfile.h"
38// OBSOLETE #include "objfiles.h"
39// OBSOLETE #include "language.h"
40// OBSOLETE #include "arch-utils.h"
41// OBSOLETE #include "regcache.h"
42// OBSOLETE #include "remote.h"
43// OBSOLETE #include "floatformat.h"
44// OBSOLETE #include "gdb/sim-d10v.h"
45// OBSOLETE #include "sim-regno.h"
46// OBSOLETE #include "disasm.h"
47// OBSOLETE #include "trad-frame.h"
48// OBSOLETE
49// OBSOLETE #include "gdb_assert.h"
50// OBSOLETE
51// OBSOLETE struct gdbarch_tdep
52// OBSOLETE {
53// OBSOLETE int a0_regnum;
54// OBSOLETE int nr_dmap_regs;
55// OBSOLETE unsigned long (*dmap_register) (void *regcache, int nr);
56// OBSOLETE unsigned long (*imap_register) (void *regcache, int nr);
57// OBSOLETE };
58// OBSOLETE
59// OBSOLETE /* These are the addresses the D10V-EVA board maps data and
60// OBSOLETE instruction memory to. */
61// OBSOLETE
62// OBSOLETE enum memspace {
63// OBSOLETE DMEM_START = 0x2000000,
64// OBSOLETE IMEM_START = 0x1000000,
65// OBSOLETE STACK_START = 0x200bffe
66// OBSOLETE };
67// OBSOLETE
68// OBSOLETE /* d10v register names. */
69// OBSOLETE
70// OBSOLETE enum
71// OBSOLETE {
72// OBSOLETE R0_REGNUM = 0,
73// OBSOLETE R3_REGNUM = 3,
74// OBSOLETE D10V_FP_REGNUM = 11,
75// OBSOLETE LR_REGNUM = 13,
76// OBSOLETE D10V_SP_REGNUM = 15,
77// OBSOLETE PSW_REGNUM = 16,
78// OBSOLETE D10V_PC_REGNUM = 18,
79// OBSOLETE NR_IMAP_REGS = 2,
80// OBSOLETE NR_A_REGS = 2,
81// OBSOLETE TS2_NUM_REGS = 37,
82// OBSOLETE TS3_NUM_REGS = 42,
83// OBSOLETE /* d10v calling convention. */
84// OBSOLETE ARG1_REGNUM = R0_REGNUM,
85// OBSOLETE ARGN_REGNUM = R3_REGNUM
86// OBSOLETE };
87// OBSOLETE
88// OBSOLETE static int
89// OBSOLETE nr_dmap_regs (struct gdbarch *gdbarch)
90// OBSOLETE {
91// OBSOLETE return gdbarch_tdep (gdbarch)->nr_dmap_regs;
92// OBSOLETE }
93// OBSOLETE
94// OBSOLETE static int
95// OBSOLETE a0_regnum (struct gdbarch *gdbarch)
96// OBSOLETE {
97// OBSOLETE return gdbarch_tdep (gdbarch)->a0_regnum;
98// OBSOLETE }
99// OBSOLETE
100// OBSOLETE /* Local functions */
101// OBSOLETE
102// OBSOLETE extern void _initialize_d10v_tdep (void);
103// OBSOLETE
104// OBSOLETE static void d10v_eva_prepare_to_trace (void);
105// OBSOLETE
106// OBSOLETE static void d10v_eva_get_trace_data (void);
107// OBSOLETE
108// OBSOLETE static CORE_ADDR
109// OBSOLETE d10v_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
110// OBSOLETE {
111// OBSOLETE /* Align to the size of an instruction (so that they can safely be
112// OBSOLETE pushed onto the stack. */
113// OBSOLETE return sp & ~3;
114// OBSOLETE }
115// OBSOLETE
116// OBSOLETE static const unsigned char *
117// OBSOLETE d10v_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr)
118// OBSOLETE {
119// OBSOLETE static unsigned char breakpoint[] =
120// OBSOLETE {0x2f, 0x90, 0x5e, 0x00};
121// OBSOLETE *lenptr = sizeof (breakpoint);
122// OBSOLETE return breakpoint;
123// OBSOLETE }
124// OBSOLETE
125// OBSOLETE /* Map the REG_NR onto an ascii name. Return NULL or an empty string
126// OBSOLETE when the reg_nr isn't valid. */
127// OBSOLETE
128// OBSOLETE enum ts2_regnums
129// OBSOLETE {
130// OBSOLETE TS2_IMAP0_REGNUM = 32,
131// OBSOLETE TS2_DMAP_REGNUM = 34,
132// OBSOLETE TS2_NR_DMAP_REGS = 1,
133// OBSOLETE TS2_A0_REGNUM = 35
134// OBSOLETE };
135// OBSOLETE
136// OBSOLETE static const char *
137// OBSOLETE d10v_ts2_register_name (int reg_nr)
138// OBSOLETE {
139// OBSOLETE static char *register_names[] =
140// OBSOLETE {
141// OBSOLETE "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
142// OBSOLETE "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
143// OBSOLETE "psw", "bpsw", "pc", "bpc", "cr4", "cr5", "cr6", "rpt_c",
144// OBSOLETE "rpt_s", "rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "cr15",
145// OBSOLETE "imap0", "imap1", "dmap", "a0", "a1"
146// OBSOLETE };
147// OBSOLETE if (reg_nr < 0)
148// OBSOLETE return NULL;
149// OBSOLETE if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
150// OBSOLETE return NULL;
151// OBSOLETE return register_names[reg_nr];
152// OBSOLETE }
153// OBSOLETE
154// OBSOLETE enum ts3_regnums
155// OBSOLETE {
156// OBSOLETE TS3_IMAP0_REGNUM = 36,
157// OBSOLETE TS3_DMAP0_REGNUM = 38,
158// OBSOLETE TS3_NR_DMAP_REGS = 4,
159// OBSOLETE TS3_A0_REGNUM = 32
160// OBSOLETE };
161// OBSOLETE
162// OBSOLETE static const char *
163// OBSOLETE d10v_ts3_register_name (int reg_nr)
164// OBSOLETE {
165// OBSOLETE static char *register_names[] =
166// OBSOLETE {
167// OBSOLETE "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
168// OBSOLETE "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15",
169// OBSOLETE "psw", "bpsw", "pc", "bpc", "cr4", "cr5", "cr6", "rpt_c",
170// OBSOLETE "rpt_s", "rpt_e", "mod_s", "mod_e", "cr12", "cr13", "iba", "cr15",
171// OBSOLETE "a0", "a1",
172// OBSOLETE "spi", "spu",
173// OBSOLETE "imap0", "imap1",
174// OBSOLETE "dmap0", "dmap1", "dmap2", "dmap3"
175// OBSOLETE };
176// OBSOLETE if (reg_nr < 0)
177// OBSOLETE return NULL;
178// OBSOLETE if (reg_nr >= (sizeof (register_names) / sizeof (*register_names)))
179// OBSOLETE return NULL;
180// OBSOLETE return register_names[reg_nr];
181// OBSOLETE }
182// OBSOLETE
183// OBSOLETE /* Access the DMAP/IMAP registers in a target independent way.
184// OBSOLETE
185// OBSOLETE Divide the D10V's 64k data space into four 16k segments:
186// OBSOLETE 0x0000 -- 0x3fff, 0x4000 -- 0x7fff, 0x8000 -- 0xbfff, and
187// OBSOLETE 0xc000 -- 0xffff.
188// OBSOLETE
189// OBSOLETE On the TS2, the first two segments (0x0000 -- 0x3fff, 0x4000 --
190// OBSOLETE 0x7fff) always map to the on-chip data RAM, and the fourth always
191// OBSOLETE maps to I/O space. The third (0x8000 - 0xbfff) can be mapped into
192// OBSOLETE unified memory or instruction memory, under the control of the
193// OBSOLETE single DMAP register.
194// OBSOLETE
195// OBSOLETE On the TS3, there are four DMAP registers, each of which controls
196// OBSOLETE one of the segments. */
197// OBSOLETE
198// OBSOLETE static unsigned long
199// OBSOLETE d10v_ts2_dmap_register (void *regcache, int reg_nr)
200// OBSOLETE {
201// OBSOLETE switch (reg_nr)
202// OBSOLETE {
203// OBSOLETE case 0:
204// OBSOLETE case 1:
205// OBSOLETE return 0x2000;
206// OBSOLETE case 2:
207// OBSOLETE {
208// OBSOLETE ULONGEST reg;
209// OBSOLETE regcache_cooked_read_unsigned (regcache, TS2_DMAP_REGNUM, &reg);
210// OBSOLETE return reg;
211// OBSOLETE }
212// OBSOLETE default:
213// OBSOLETE return 0;
214// OBSOLETE }
215// OBSOLETE }
216// OBSOLETE
217// OBSOLETE static unsigned long
218// OBSOLETE d10v_ts3_dmap_register (void *regcache, int reg_nr)
219// OBSOLETE {
220// OBSOLETE ULONGEST reg;
221// OBSOLETE regcache_cooked_read_unsigned (regcache, TS3_DMAP0_REGNUM + reg_nr, &reg);
222// OBSOLETE return reg;
223// OBSOLETE }
224// OBSOLETE
225// OBSOLETE static unsigned long
226// OBSOLETE d10v_ts2_imap_register (void *regcache, int reg_nr)
227// OBSOLETE {
228// OBSOLETE ULONGEST reg;
229// OBSOLETE regcache_cooked_read_unsigned (regcache, TS2_IMAP0_REGNUM + reg_nr, &reg);
230// OBSOLETE return reg;
231// OBSOLETE }
232// OBSOLETE
233// OBSOLETE static unsigned long
234// OBSOLETE d10v_ts3_imap_register (void *regcache, int reg_nr)
235// OBSOLETE {
236// OBSOLETE ULONGEST reg;
237// OBSOLETE regcache_cooked_read_unsigned (regcache, TS3_IMAP0_REGNUM + reg_nr, &reg);
238// OBSOLETE return reg;
239// OBSOLETE }
240// OBSOLETE
241// OBSOLETE /* MAP GDB's internal register numbering (determined by the layout
242// OBSOLETE from the DEPRECATED_REGISTER_BYTE array) onto the simulator's
243// OBSOLETE register numbering. */
244// OBSOLETE
245// OBSOLETE static int
246// OBSOLETE d10v_ts2_register_sim_regno (int nr)
247// OBSOLETE {
248// OBSOLETE /* Only makes sense to supply raw registers. */
249// OBSOLETE gdb_assert (nr >= 0 && nr < NUM_REGS);
250// OBSOLETE if (nr >= TS2_IMAP0_REGNUM
251// OBSOLETE && nr < TS2_IMAP0_REGNUM + NR_IMAP_REGS)
252// OBSOLETE return nr - TS2_IMAP0_REGNUM + SIM_D10V_IMAP0_REGNUM;
253// OBSOLETE if (nr == TS2_DMAP_REGNUM)
254// OBSOLETE return nr - TS2_DMAP_REGNUM + SIM_D10V_TS2_DMAP_REGNUM;
255// OBSOLETE if (nr >= TS2_A0_REGNUM
256// OBSOLETE && nr < TS2_A0_REGNUM + NR_A_REGS)
257// OBSOLETE return nr - TS2_A0_REGNUM + SIM_D10V_A0_REGNUM;
258// OBSOLETE return nr;
259// OBSOLETE }
260// OBSOLETE
261// OBSOLETE static int
262// OBSOLETE d10v_ts3_register_sim_regno (int nr)
263// OBSOLETE {
264// OBSOLETE /* Only makes sense to supply raw registers. */
265// OBSOLETE gdb_assert (nr >= 0 && nr < NUM_REGS);
266// OBSOLETE if (nr >= TS3_IMAP0_REGNUM
267// OBSOLETE && nr < TS3_IMAP0_REGNUM + NR_IMAP_REGS)
268// OBSOLETE return nr - TS3_IMAP0_REGNUM + SIM_D10V_IMAP0_REGNUM;
269// OBSOLETE if (nr >= TS3_DMAP0_REGNUM
270// OBSOLETE && nr < TS3_DMAP0_REGNUM + TS3_NR_DMAP_REGS)
271// OBSOLETE return nr - TS3_DMAP0_REGNUM + SIM_D10V_DMAP0_REGNUM;
272// OBSOLETE if (nr >= TS3_A0_REGNUM
273// OBSOLETE && nr < TS3_A0_REGNUM + NR_A_REGS)
274// OBSOLETE return nr - TS3_A0_REGNUM + SIM_D10V_A0_REGNUM;
275// OBSOLETE return nr;
276// OBSOLETE }
277// OBSOLETE
278// OBSOLETE /* Return the GDB type object for the "standard" data type
279// OBSOLETE of data in register N. */
280// OBSOLETE
281// OBSOLETE static struct type *
282// OBSOLETE d10v_register_type (struct gdbarch *gdbarch, int reg_nr)
283// OBSOLETE {
284// OBSOLETE if (reg_nr == D10V_PC_REGNUM)
285// OBSOLETE return builtin_type (gdbarch)->builtin_func_ptr;
286// OBSOLETE if (reg_nr == D10V_SP_REGNUM || reg_nr == D10V_FP_REGNUM)
287// OBSOLETE return builtin_type (gdbarch)->builtin_data_ptr;
288// OBSOLETE else if (reg_nr >= a0_regnum (gdbarch)
289// OBSOLETE && reg_nr < (a0_regnum (gdbarch) + NR_A_REGS))
290// OBSOLETE return builtin_type_int64;
291// OBSOLETE else
292// OBSOLETE return builtin_type_int16;
293// OBSOLETE }
294// OBSOLETE
295// OBSOLETE static int
296// OBSOLETE d10v_iaddr_p (CORE_ADDR x)
297// OBSOLETE {
298// OBSOLETE return (((x) & 0x3000000) == IMEM_START);
299// OBSOLETE }
300// OBSOLETE
301// OBSOLETE static CORE_ADDR
302// OBSOLETE d10v_make_daddr (CORE_ADDR x)
303// OBSOLETE {
304// OBSOLETE return ((x) | DMEM_START);
305// OBSOLETE }
306// OBSOLETE
307// OBSOLETE static CORE_ADDR
308// OBSOLETE d10v_make_iaddr (CORE_ADDR x)
309// OBSOLETE {
310// OBSOLETE if (d10v_iaddr_p (x))
311// OBSOLETE return x; /* Idempotency -- x is already in the IMEM space. */
312// OBSOLETE else
313// OBSOLETE return (((x) << 2) | IMEM_START);
314// OBSOLETE }
315// OBSOLETE
316// OBSOLETE static CORE_ADDR
317// OBSOLETE d10v_convert_iaddr_to_raw (CORE_ADDR x)
318// OBSOLETE {
319// OBSOLETE return (((x) >> 2) & 0xffff);
320// OBSOLETE }
321// OBSOLETE
322// OBSOLETE static CORE_ADDR
323// OBSOLETE d10v_convert_daddr_to_raw (CORE_ADDR x)
324// OBSOLETE {
325// OBSOLETE return ((x) & 0xffff);
326// OBSOLETE }
327// OBSOLETE
328// OBSOLETE static void
329// OBSOLETE d10v_address_to_pointer (struct type *type, void *buf, CORE_ADDR addr)
330// OBSOLETE {
331// OBSOLETE /* Is it a code address? */
332// OBSOLETE if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
333// OBSOLETE || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD)
334// OBSOLETE {
335// OBSOLETE store_unsigned_integer (buf, TYPE_LENGTH (type),
336// OBSOLETE d10v_convert_iaddr_to_raw (addr));
337// OBSOLETE }
338// OBSOLETE else
339// OBSOLETE {
340// OBSOLETE /* Strip off any upper segment bits. */
341// OBSOLETE store_unsigned_integer (buf, TYPE_LENGTH (type),
342// OBSOLETE d10v_convert_daddr_to_raw (addr));
343// OBSOLETE }
344// OBSOLETE }
345// OBSOLETE
346// OBSOLETE static CORE_ADDR
347// OBSOLETE d10v_pointer_to_address (struct type *type, const void *buf)
348// OBSOLETE {
349// OBSOLETE CORE_ADDR addr = extract_unsigned_integer (buf, TYPE_LENGTH (type));
350// OBSOLETE /* Is it a code address? */
351// OBSOLETE if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_FUNC
352// OBSOLETE || TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_METHOD
353// OBSOLETE || TYPE_CODE_SPACE (TYPE_TARGET_TYPE (type)))
354// OBSOLETE return d10v_make_iaddr (addr);
355// OBSOLETE else
356// OBSOLETE return d10v_make_daddr (addr);
357// OBSOLETE }
358// OBSOLETE
359// OBSOLETE /* Don't do anything if we have an integer, this way users can type 'x
360// OBSOLETE <addr>' w/o having gdb outsmart them. The internal gdb conversions
361// OBSOLETE to the correct space are taken care of in the pointer_to_address
362// OBSOLETE function. If we don't do this, 'x $fp' wouldn't work. */
363// OBSOLETE static CORE_ADDR
364// OBSOLETE d10v_integer_to_address (struct type *type, void *buf)
365// OBSOLETE {
366// OBSOLETE LONGEST val;
367// OBSOLETE val = unpack_long (type, buf);
368// OBSOLETE return val;
369// OBSOLETE }
370// OBSOLETE
371// OBSOLETE /* Handle the d10v's return_value convention. */
372// OBSOLETE
373// OBSOLETE static enum return_value_convention
374// OBSOLETE d10v_return_value (struct gdbarch *gdbarch, struct type *valtype,
375// OBSOLETE struct regcache *regcache, void *readbuf,
376// OBSOLETE const void *writebuf)
377// OBSOLETE {
378// OBSOLETE if (TYPE_LENGTH (valtype) > 8)
379// OBSOLETE /* Anything larger than 8 bytes (4 registers) goes on the stack. */
380// OBSOLETE return RETURN_VALUE_STRUCT_CONVENTION;
381// OBSOLETE if (TYPE_LENGTH (valtype) == 5
382// OBSOLETE || TYPE_LENGTH (valtype) == 6)
383// OBSOLETE /* Anything 5 or 6 bytes in size goes in memory. Contents don't
384// OBSOLETE appear to matter. Note that 7 and 8 byte objects do end up in
385// OBSOLETE registers! */
386// OBSOLETE return RETURN_VALUE_STRUCT_CONVENTION;
387// OBSOLETE if (TYPE_LENGTH (valtype) == 1)
388// OBSOLETE {
389// OBSOLETE /* All single byte values go in a register stored right-aligned.
390// OBSOLETE Note: 2 byte integer values are handled further down. */
391// OBSOLETE if (readbuf)
392// OBSOLETE {
393// OBSOLETE /* Since TYPE is smaller than the register, there isn't a
394// OBSOLETE sign extension problem. Let the extraction truncate the
395// OBSOLETE register value. */
396// OBSOLETE ULONGEST regval;
397// OBSOLETE regcache_cooked_read_unsigned (regcache, R0_REGNUM,
398// OBSOLETE &regval);
399// OBSOLETE store_unsigned_integer (readbuf, TYPE_LENGTH (valtype), regval);
400// OBSOLETE
401// OBSOLETE }
402// OBSOLETE if (writebuf)
403// OBSOLETE {
404// OBSOLETE ULONGEST regval;
405// OBSOLETE if (TYPE_CODE (valtype) == TYPE_CODE_INT)
406// OBSOLETE /* Some sort of integer value stored in R0. Use
407// OBSOLETE unpack_long since that should handle any required sign
408// OBSOLETE extension. */
409// OBSOLETE regval = unpack_long (valtype, writebuf);
410// OBSOLETE else
411// OBSOLETE /* Some other type. Don't sign-extend the value when
412// OBSOLETE storing it in the register. */
413// OBSOLETE regval = extract_unsigned_integer (writebuf, 1);
414// OBSOLETE regcache_cooked_write_unsigned (regcache, R0_REGNUM, regval);
415// OBSOLETE }
416// OBSOLETE return RETURN_VALUE_REGISTER_CONVENTION;
417// OBSOLETE }
418// OBSOLETE if ((TYPE_CODE (valtype) == TYPE_CODE_STRUCT
419// OBSOLETE || TYPE_CODE (valtype) == TYPE_CODE_UNION)
420// OBSOLETE && TYPE_NFIELDS (valtype) > 1
421// OBSOLETE && TYPE_FIELD_BITPOS (valtype, 1) == 8)
422// OBSOLETE /* If a composite is 8 bit aligned (determined by looking at the
423// OBSOLETE start address of the second field), put it in memory. */
424// OBSOLETE return RETURN_VALUE_STRUCT_CONVENTION;
425// OBSOLETE /* Assume it is in registers. */
426// OBSOLETE if (writebuf || readbuf)
427// OBSOLETE {
428// OBSOLETE int reg;
429// OBSOLETE /* Per above, the value is never more than 8 bytes long. */
430// OBSOLETE gdb_assert (TYPE_LENGTH (valtype) <= 8);
431// OBSOLETE /* Xfer 2 bytes at a time. */
432// OBSOLETE for (reg = 0; (reg * 2) + 1 < TYPE_LENGTH (valtype); reg++)
433// OBSOLETE {
434// OBSOLETE if (readbuf)
435// OBSOLETE regcache_cooked_read (regcache, R0_REGNUM + reg,
436// OBSOLETE (bfd_byte *) readbuf + reg * 2);
437// OBSOLETE if (writebuf)
438// OBSOLETE regcache_cooked_write (regcache, R0_REGNUM + reg,
439// OBSOLETE (bfd_byte *) writebuf + reg * 2);
440// OBSOLETE }
441// OBSOLETE /* Any trailing byte ends up _left_ aligned. */
442// OBSOLETE if ((reg * 2) < TYPE_LENGTH (valtype))
443// OBSOLETE {
444// OBSOLETE if (readbuf)
445// OBSOLETE regcache_cooked_read_part (regcache, R0_REGNUM + reg,
446// OBSOLETE 0, 1, (bfd_byte *) readbuf + reg * 2);
447// OBSOLETE if (writebuf)
448// OBSOLETE regcache_cooked_write_part (regcache, R0_REGNUM + reg,
449// OBSOLETE 0, 1, (bfd_byte *) writebuf + reg * 2);
450// OBSOLETE }
451// OBSOLETE }
452// OBSOLETE return RETURN_VALUE_REGISTER_CONVENTION;
453// OBSOLETE }
454// OBSOLETE
455// OBSOLETE static int
456// OBSOLETE check_prologue (unsigned short op)
457// OBSOLETE {
458// OBSOLETE /* st rn, @-sp */
459// OBSOLETE if ((op & 0x7E1F) == 0x6C1F)
460// OBSOLETE return 1;
461// OBSOLETE
462// OBSOLETE /* st2w rn, @-sp */
463// OBSOLETE if ((op & 0x7E3F) == 0x6E1F)
464// OBSOLETE return 1;
465// OBSOLETE
466// OBSOLETE /* subi sp, n */
467// OBSOLETE if ((op & 0x7FE1) == 0x01E1)
468// OBSOLETE return 1;
469// OBSOLETE
470// OBSOLETE /* mv r11, sp */
471// OBSOLETE if (op == 0x417E)
472// OBSOLETE return 1;
473// OBSOLETE
474// OBSOLETE /* nop */
475// OBSOLETE if (op == 0x5E00)
476// OBSOLETE return 1;
477// OBSOLETE
478// OBSOLETE /* st rn, @sp */
479// OBSOLETE if ((op & 0x7E1F) == 0x681E)
480// OBSOLETE return 1;
481// OBSOLETE
482// OBSOLETE /* st2w rn, @sp */
483// OBSOLETE if ((op & 0x7E3F) == 0x3A1E)
484// OBSOLETE return 1;
485// OBSOLETE
486// OBSOLETE return 0;
487// OBSOLETE }
488// OBSOLETE
489// OBSOLETE static CORE_ADDR
490// OBSOLETE d10v_skip_prologue (CORE_ADDR pc)
491// OBSOLETE {
492// OBSOLETE unsigned long op;
493// OBSOLETE unsigned short op1, op2;
494// OBSOLETE CORE_ADDR func_addr, func_end;
495// OBSOLETE struct symtab_and_line sal;
496// OBSOLETE
497// OBSOLETE /* If we have line debugging information, then the end of the prologue
498// OBSOLETE should be the first assembly instruction of the first source line. */
499// OBSOLETE if (find_pc_partial_function (pc, NULL, &func_addr, &func_end))
500// OBSOLETE {
501// OBSOLETE sal = find_pc_line (func_addr, 0);
502// OBSOLETE if (sal.end && sal.end < func_end)
503// OBSOLETE return sal.end;
504// OBSOLETE }
505// OBSOLETE
506// OBSOLETE if (target_read_memory (pc, (char *) &op, 4))
507// OBSOLETE return pc; /* Can't access it -- assume no prologue. */
508// OBSOLETE
509// OBSOLETE while (1)
510// OBSOLETE {
511// OBSOLETE op = (unsigned long) read_memory_integer (pc, 4);
512// OBSOLETE if ((op & 0xC0000000) == 0xC0000000)
513// OBSOLETE {
514// OBSOLETE /* long instruction */
515// OBSOLETE if (((op & 0x3FFF0000) != 0x01FF0000) && /* add3 sp,sp,n */
516// OBSOLETE ((op & 0x3F0F0000) != 0x340F0000) && /* st rn, @(offset,sp) */
517// OBSOLETE ((op & 0x3F1F0000) != 0x350F0000)) /* st2w rn, @(offset,sp) */
518// OBSOLETE break;
519// OBSOLETE }
520// OBSOLETE else
521// OBSOLETE {
522// OBSOLETE /* short instructions */
523// OBSOLETE if ((op & 0xC0000000) == 0x80000000)
524// OBSOLETE {
525// OBSOLETE op2 = (op & 0x3FFF8000) >> 15;
526// OBSOLETE op1 = op & 0x7FFF;
527// OBSOLETE }
528// OBSOLETE else
529// OBSOLETE {
530// OBSOLETE op1 = (op & 0x3FFF8000) >> 15;
531// OBSOLETE op2 = op & 0x7FFF;
532// OBSOLETE }
533// OBSOLETE if (check_prologue (op1))
534// OBSOLETE {
535// OBSOLETE if (!check_prologue (op2))
536// OBSOLETE {
537// OBSOLETE /* If the previous opcode was really part of the
538// OBSOLETE prologue and not just a NOP, then we want to
539// OBSOLETE break after both instructions. */
540// OBSOLETE if (op1 != 0x5E00)
541// OBSOLETE pc += 4;
542// OBSOLETE break;
543// OBSOLETE }
544// OBSOLETE }
545// OBSOLETE else
546// OBSOLETE break;
547// OBSOLETE }
548// OBSOLETE pc += 4;
549// OBSOLETE }
550// OBSOLETE return pc;
551// OBSOLETE }
552// OBSOLETE
553// OBSOLETE struct d10v_unwind_cache
554// OBSOLETE {
555// OBSOLETE /* The previous frame's inner most stack address. Used as this
556// OBSOLETE frame ID's stack_addr. */
557// OBSOLETE CORE_ADDR prev_sp;
558// OBSOLETE /* The frame's base, optionally used by the high-level debug info. */
559// OBSOLETE CORE_ADDR base;
560// OBSOLETE int size;
561// OBSOLETE /* How far the SP and r11 (FP) have been offset from the start of
562// OBSOLETE the stack frame (as defined by the previous frame's stack
563// OBSOLETE pointer). */
564// OBSOLETE LONGEST sp_offset;
565// OBSOLETE LONGEST r11_offset;
566// OBSOLETE int uses_frame;
567// OBSOLETE /* Table indicating the location of each and every register. */
568// OBSOLETE struct trad_frame_saved_reg *saved_regs;
569// OBSOLETE };
570// OBSOLETE
571// OBSOLETE static int
572// OBSOLETE prologue_find_regs (struct d10v_unwind_cache *info, unsigned short op,
573// OBSOLETE CORE_ADDR addr)
574// OBSOLETE {
575// OBSOLETE int n;
576// OBSOLETE
577// OBSOLETE /* st rn, @-sp */
578// OBSOLETE if ((op & 0x7E1F) == 0x6C1F)
579// OBSOLETE {
580// OBSOLETE n = (op & 0x1E0) >> 5;
581// OBSOLETE info->sp_offset -= 2;
582// OBSOLETE info->saved_regs[n].addr = info->sp_offset;
583// OBSOLETE return 1;
584// OBSOLETE }
585// OBSOLETE
586// OBSOLETE /* st2w rn, @-sp */
587// OBSOLETE else if ((op & 0x7E3F) == 0x6E1F)
588// OBSOLETE {
589// OBSOLETE n = (op & 0x1E0) >> 5;
590// OBSOLETE info->sp_offset -= 4;
591// OBSOLETE info->saved_regs[n + 0].addr = info->sp_offset + 0;
592// OBSOLETE info->saved_regs[n + 1].addr = info->sp_offset + 2;
593// OBSOLETE return 1;
594// OBSOLETE }
595// OBSOLETE
596// OBSOLETE /* subi sp, n */
597// OBSOLETE if ((op & 0x7FE1) == 0x01E1)
598// OBSOLETE {
599// OBSOLETE n = (op & 0x1E) >> 1;
600// OBSOLETE if (n == 0)
601// OBSOLETE n = 16;
602// OBSOLETE info->sp_offset -= n;
603// OBSOLETE return 1;
604// OBSOLETE }
605// OBSOLETE
606// OBSOLETE /* mv r11, sp */
607// OBSOLETE if (op == 0x417E)
608// OBSOLETE {
609// OBSOLETE info->uses_frame = 1;
610// OBSOLETE info->r11_offset = info->sp_offset;
611// OBSOLETE return 1;
612// OBSOLETE }
613// OBSOLETE
614// OBSOLETE /* st rn, @r11 */
615// OBSOLETE if ((op & 0x7E1F) == 0x6816)
616// OBSOLETE {
617// OBSOLETE n = (op & 0x1E0) >> 5;
618// OBSOLETE info->saved_regs[n].addr = info->r11_offset;
619// OBSOLETE return 1;
620// OBSOLETE }
621// OBSOLETE
622// OBSOLETE /* nop */
623// OBSOLETE if (op == 0x5E00)
624// OBSOLETE return 1;
625// OBSOLETE
626// OBSOLETE /* st rn, @sp */
627// OBSOLETE if ((op & 0x7E1F) == 0x681E)
628// OBSOLETE {
629// OBSOLETE n = (op & 0x1E0) >> 5;
630// OBSOLETE info->saved_regs[n].addr = info->sp_offset;
631// OBSOLETE return 1;
632// OBSOLETE }
633// OBSOLETE
634// OBSOLETE /* st2w rn, @sp */
635// OBSOLETE if ((op & 0x7E3F) == 0x3A1E)
636// OBSOLETE {
637// OBSOLETE n = (op & 0x1E0) >> 5;
638// OBSOLETE info->saved_regs[n + 0].addr = info->sp_offset + 0;
639// OBSOLETE info->saved_regs[n + 1].addr = info->sp_offset + 2;
640// OBSOLETE return 1;
641// OBSOLETE }
642// OBSOLETE
643// OBSOLETE return 0;
644// OBSOLETE }
645// OBSOLETE
646// OBSOLETE /* Put here the code to store, into fi->saved_regs, the addresses of
647// OBSOLETE the saved registers of frame described by FRAME_INFO. This
648// OBSOLETE includes special registers such as pc and fp saved in special ways
649// OBSOLETE in the stack frame. sp is even more special: the address we return
650// OBSOLETE for it IS the sp for the next frame. */
651// OBSOLETE
652// OBSOLETE static struct d10v_unwind_cache *
653// OBSOLETE d10v_frame_unwind_cache (struct frame_info *next_frame,
654// OBSOLETE void **this_prologue_cache)
655// OBSOLETE {
656// OBSOLETE struct gdbarch *gdbarch = get_frame_arch (next_frame);
657// OBSOLETE CORE_ADDR pc;
658// OBSOLETE ULONGEST prev_sp;
659// OBSOLETE ULONGEST this_base;
660// OBSOLETE unsigned long op;
661// OBSOLETE unsigned short op1, op2;
662// OBSOLETE int i;
663// OBSOLETE struct d10v_unwind_cache *info;
664// OBSOLETE
665// OBSOLETE if ((*this_prologue_cache))
666// OBSOLETE return (*this_prologue_cache);
667// OBSOLETE
668// OBSOLETE info = FRAME_OBSTACK_ZALLOC (struct d10v_unwind_cache);
669// OBSOLETE (*this_prologue_cache) = info;
670// OBSOLETE info->saved_regs = trad_frame_alloc_saved_regs (next_frame);
671// OBSOLETE
672// OBSOLETE info->size = 0;
673// OBSOLETE info->sp_offset = 0;
674// OBSOLETE
675// OBSOLETE info->uses_frame = 0;
676// OBSOLETE for (pc = frame_func_unwind (next_frame);
677// OBSOLETE pc > 0 && pc < frame_pc_unwind (next_frame);
678// OBSOLETE pc += 4)
679// OBSOLETE {
680// OBSOLETE op = get_frame_memory_unsigned (next_frame, pc, 4);
681// OBSOLETE if ((op & 0xC0000000) == 0xC0000000)
682// OBSOLETE {
683// OBSOLETE /* long instruction */
684// OBSOLETE if ((op & 0x3FFF0000) == 0x01FF0000)
685// OBSOLETE {
686// OBSOLETE /* add3 sp,sp,n */
687// OBSOLETE short n = op & 0xFFFF;
688// OBSOLETE info->sp_offset += n;
689// OBSOLETE }
690// OBSOLETE else if ((op & 0x3F0F0000) == 0x340F0000)
691// OBSOLETE {
692// OBSOLETE /* st rn, @(offset,sp) */
693// OBSOLETE short offset = op & 0xFFFF;
694// OBSOLETE short n = (op >> 20) & 0xF;
695// OBSOLETE info->saved_regs[n].addr = info->sp_offset + offset;
696// OBSOLETE }
697// OBSOLETE else if ((op & 0x3F1F0000) == 0x350F0000)
698// OBSOLETE {
699// OBSOLETE /* st2w rn, @(offset,sp) */
700// OBSOLETE short offset = op & 0xFFFF;
701// OBSOLETE short n = (op >> 20) & 0xF;
702// OBSOLETE info->saved_regs[n + 0].addr = info->sp_offset + offset + 0;
703// OBSOLETE info->saved_regs[n + 1].addr = info->sp_offset + offset + 2;
704// OBSOLETE }
705// OBSOLETE else
706// OBSOLETE break;
707// OBSOLETE }
708// OBSOLETE else
709// OBSOLETE {
710// OBSOLETE /* short instructions */
711// OBSOLETE if ((op & 0xC0000000) == 0x80000000)
712// OBSOLETE {
713// OBSOLETE op2 = (op & 0x3FFF8000) >> 15;
714// OBSOLETE op1 = op & 0x7FFF;
715// OBSOLETE }
716// OBSOLETE else
717// OBSOLETE {
718// OBSOLETE op1 = (op & 0x3FFF8000) >> 15;
719// OBSOLETE op2 = op & 0x7FFF;
720// OBSOLETE }
721// OBSOLETE if (!prologue_find_regs (info, op1, pc)
722// OBSOLETE || !prologue_find_regs (info, op2, pc))
723// OBSOLETE break;
724// OBSOLETE }
725// OBSOLETE }
726// OBSOLETE
727// OBSOLETE info->size = -info->sp_offset;
728// OBSOLETE
729// OBSOLETE /* Compute the previous frame's stack pointer (which is also the
730// OBSOLETE frame's ID's stack address), and this frame's base pointer. */
731// OBSOLETE if (info->uses_frame)
732// OBSOLETE {
733// OBSOLETE /* The SP was moved to the FP. This indicates that a new frame
734// OBSOLETE was created. Get THIS frame's FP value by unwinding it from
735// OBSOLETE the next frame. */
736// OBSOLETE frame_unwind_unsigned_register (next_frame, D10V_FP_REGNUM, &this_base);
737// OBSOLETE /* The FP points at the last saved register. Adjust the FP back
738// OBSOLETE to before the first saved register giving the SP. */
739// OBSOLETE prev_sp = this_base + info->size;
740// OBSOLETE }
741// OBSOLETE else
742// OBSOLETE {
743// OBSOLETE /* Assume that the FP is this frame's SP but with that pushed
744// OBSOLETE stack space added back. */
745// OBSOLETE frame_unwind_unsigned_register (next_frame, D10V_SP_REGNUM, &this_base);
746// OBSOLETE prev_sp = this_base + info->size;
747// OBSOLETE }
748// OBSOLETE
749// OBSOLETE /* Convert that SP/BASE into real addresses. */
750// OBSOLETE info->prev_sp = d10v_make_daddr (prev_sp);
751// OBSOLETE info->base = d10v_make_daddr (this_base);
752// OBSOLETE
753// OBSOLETE /* Adjust all the saved registers so that they contain addresses and
754// OBSOLETE not offsets. */
755// OBSOLETE for (i = 0; i < NUM_REGS - 1; i++)
756// OBSOLETE if (trad_frame_addr_p (info->saved_regs, i))
757// OBSOLETE {
758// OBSOLETE info->saved_regs[i].addr = (info->prev_sp + info->saved_regs[i].addr);
759// OBSOLETE }
760// OBSOLETE
761// OBSOLETE /* The call instruction moves the caller's PC in the callee's LR.
762// OBSOLETE Since this is an unwind, do the reverse. Copy the location of LR
763// OBSOLETE into PC (the address / regnum) so that a request for PC will be
764// OBSOLETE converted into a request for the LR. */
765// OBSOLETE info->saved_regs[D10V_PC_REGNUM] = info->saved_regs[LR_REGNUM];
766// OBSOLETE
767// OBSOLETE /* The previous frame's SP needed to be computed. Save the computed
768// OBSOLETE value. */
769// OBSOLETE trad_frame_set_value (info->saved_regs, D10V_SP_REGNUM,
770// OBSOLETE d10v_make_daddr (prev_sp));
771// OBSOLETE
772// OBSOLETE return info;
773// OBSOLETE }
774// OBSOLETE
775// OBSOLETE static void
776// OBSOLETE d10v_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file,
777// OBSOLETE struct frame_info *frame, int regnum, int all)
778// OBSOLETE {
779// OBSOLETE struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
780// OBSOLETE if (regnum >= 0)
781// OBSOLETE {
782// OBSOLETE default_print_registers_info (gdbarch, file, frame, regnum, all);
783// OBSOLETE return;
784// OBSOLETE }
785// OBSOLETE
786// OBSOLETE {
787// OBSOLETE ULONGEST pc, psw, rpt_s, rpt_e, rpt_c;
788// OBSOLETE pc = get_frame_register_unsigned (frame, D10V_PC_REGNUM);
789// OBSOLETE psw = get_frame_register_unsigned (frame, PSW_REGNUM);
790// OBSOLETE rpt_s = get_frame_register_unsigned (frame, frame_map_name_to_regnum (frame, "rpt_s", -1));
791// OBSOLETE rpt_e = get_frame_register_unsigned (frame, frame_map_name_to_regnum (frame, "rpt_e", -1));
792// OBSOLETE rpt_c = get_frame_register_unsigned (frame, frame_map_name_to_regnum (frame, "rpt_c", -1));
793// OBSOLETE fprintf_filtered (file, "PC=%04lx (0x%lx) PSW=%04lx RPT_S=%04lx RPT_E=%04lx RPT_C=%04lx\n",
794// OBSOLETE (long) pc, (long) d10v_make_iaddr (pc), (long) psw,
795// OBSOLETE (long) rpt_s, (long) rpt_e, (long) rpt_c);
796// OBSOLETE }
797// OBSOLETE
798// OBSOLETE {
799// OBSOLETE int group;
800// OBSOLETE for (group = 0; group < 16; group += 8)
801// OBSOLETE {
802// OBSOLETE int r;
803// OBSOLETE fprintf_filtered (file, "R%d-R%-2d", group, group + 7);
804// OBSOLETE for (r = group; r < group + 8; r++)
805// OBSOLETE {
806// OBSOLETE ULONGEST tmp;
807// OBSOLETE tmp = get_frame_register_unsigned (frame, r);
808// OBSOLETE fprintf_filtered (file, " %04lx", (long) tmp);
809// OBSOLETE }
810// OBSOLETE fprintf_filtered (file, "\n");
811// OBSOLETE }
812// OBSOLETE }
813// OBSOLETE
814// OBSOLETE /* Note: The IMAP/DMAP registers don't participate in function
815// OBSOLETE calls. Don't bother trying to unwind them. */
816// OBSOLETE
817// OBSOLETE {
818// OBSOLETE int a;
819// OBSOLETE for (a = 0; a < NR_IMAP_REGS; a++)
820// OBSOLETE {
821// OBSOLETE if (a > 0)
822// OBSOLETE fprintf_filtered (file, " ");
823// OBSOLETE fprintf_filtered (file, "IMAP%d %04lx", a,
824// OBSOLETE tdep->imap_register (current_regcache, a));
825// OBSOLETE }
826// OBSOLETE if (nr_dmap_regs (gdbarch) == 1)
827// OBSOLETE /* Registers DMAP0 and DMAP1 are constant. Just return dmap2. */
828// OBSOLETE fprintf_filtered (file, " DMAP %04lx\n",
829// OBSOLETE tdep->dmap_register (current_regcache, 2));
830// OBSOLETE else
831// OBSOLETE {
832// OBSOLETE for (a = 0; a < nr_dmap_regs (gdbarch); a++)
833// OBSOLETE {
834// OBSOLETE fprintf_filtered (file, " DMAP%d %04lx", a,
835// OBSOLETE tdep->dmap_register (current_regcache, a));
836// OBSOLETE }
837// OBSOLETE fprintf_filtered (file, "\n");
838// OBSOLETE }
839// OBSOLETE }
840// OBSOLETE
841// OBSOLETE {
842// OBSOLETE char num[MAX_REGISTER_SIZE];
843// OBSOLETE int a;
844// OBSOLETE fprintf_filtered (file, "A0-A%d", NR_A_REGS - 1);
845// OBSOLETE for (a = a0_regnum (gdbarch); a < a0_regnum (gdbarch) + NR_A_REGS; a++)
846// OBSOLETE {
847// OBSOLETE int i;
848// OBSOLETE fprintf_filtered (file, " ");
849// OBSOLETE get_frame_register (frame, a, num);
850// OBSOLETE for (i = 0; i < register_size (gdbarch, a); i++)
851// OBSOLETE {
852// OBSOLETE fprintf_filtered (file, "%02x", (num[i] & 0xff));
853// OBSOLETE }
854// OBSOLETE }
855// OBSOLETE }
856// OBSOLETE fprintf_filtered (file, "\n");
857// OBSOLETE }
858// OBSOLETE
859// OBSOLETE static void
860// OBSOLETE show_regs (char *args, int from_tty)
861// OBSOLETE {
862// OBSOLETE d10v_print_registers_info (current_gdbarch, gdb_stdout,
863// OBSOLETE get_current_frame (), -1, 1);
864// OBSOLETE }
865// OBSOLETE
866// OBSOLETE static CORE_ADDR
867// OBSOLETE d10v_read_pc (ptid_t ptid)
868// OBSOLETE {
869// OBSOLETE ptid_t save_ptid;
870// OBSOLETE CORE_ADDR pc;
871// OBSOLETE CORE_ADDR retval;
872// OBSOLETE
873// OBSOLETE save_ptid = inferior_ptid;
874// OBSOLETE inferior_ptid = ptid;
875// OBSOLETE pc = (int) read_register (D10V_PC_REGNUM);
876// OBSOLETE inferior_ptid = save_ptid;
877// OBSOLETE retval = d10v_make_iaddr (pc);
878// OBSOLETE return retval;
879// OBSOLETE }
880// OBSOLETE
881// OBSOLETE static void
882// OBSOLETE d10v_write_pc (CORE_ADDR val, ptid_t ptid)
883// OBSOLETE {
884// OBSOLETE ptid_t save_ptid;
885// OBSOLETE
886// OBSOLETE save_ptid = inferior_ptid;
887// OBSOLETE inferior_ptid = ptid;
888// OBSOLETE write_register (D10V_PC_REGNUM, d10v_convert_iaddr_to_raw (val));
889// OBSOLETE inferior_ptid = save_ptid;
890// OBSOLETE }
891// OBSOLETE
892// OBSOLETE static CORE_ADDR
893// OBSOLETE d10v_unwind_sp (struct gdbarch *gdbarch, struct frame_info *next_frame)
894// OBSOLETE {
895// OBSOLETE ULONGEST sp;
896// OBSOLETE frame_unwind_unsigned_register (next_frame, D10V_SP_REGNUM, &sp);
897// OBSOLETE return d10v_make_daddr (sp);
898// OBSOLETE }
899// OBSOLETE
900// OBSOLETE /* When arguments must be pushed onto the stack, they go on in reverse
901// OBSOLETE order. The below implements a FILO (stack) to do this. */
902// OBSOLETE
903// OBSOLETE struct stack_item
904// OBSOLETE {
905// OBSOLETE int len;
906// OBSOLETE struct stack_item *prev;
907// OBSOLETE void *data;
908// OBSOLETE };
909// OBSOLETE
910// OBSOLETE static struct stack_item *push_stack_item (struct stack_item *prev,
911// OBSOLETE void *contents, int len);
912// OBSOLETE static struct stack_item *
913// OBSOLETE push_stack_item (struct stack_item *prev, void *contents, int len)
914// OBSOLETE {
915// OBSOLETE struct stack_item *si;
916// OBSOLETE si = xmalloc (sizeof (struct stack_item));
917// OBSOLETE si->data = xmalloc (len);
918// OBSOLETE si->len = len;
919// OBSOLETE si->prev = prev;
920// OBSOLETE memcpy (si->data, contents, len);
921// OBSOLETE return si;
922// OBSOLETE }
923// OBSOLETE
924// OBSOLETE static struct stack_item *pop_stack_item (struct stack_item *si);
925// OBSOLETE static struct stack_item *
926// OBSOLETE pop_stack_item (struct stack_item *si)
927// OBSOLETE {
928// OBSOLETE struct stack_item *dead = si;
929// OBSOLETE si = si->prev;
930// OBSOLETE xfree (dead->data);
931// OBSOLETE xfree (dead);
932// OBSOLETE return si;
933// OBSOLETE }
934// OBSOLETE
935// OBSOLETE
936// OBSOLETE static CORE_ADDR
937// OBSOLETE d10v_push_dummy_code (struct gdbarch *gdbarch,
938// OBSOLETE CORE_ADDR sp, CORE_ADDR funaddr, int using_gcc,
939// OBSOLETE struct value **args, int nargs,
940// OBSOLETE struct type *value_type,
941// OBSOLETE CORE_ADDR *real_pc, CORE_ADDR *bp_addr)
942// OBSOLETE {
943// OBSOLETE /* Allocate space sufficient for a breakpoint. */
944// OBSOLETE sp = (sp - 4) & ~3;
945// OBSOLETE /* Store the address of that breakpoint taking care to first convert
946// OBSOLETE it into a code (IADDR) address from a stack (DADDR) address.
947// OBSOLETE This of course assumes that the two virtual addresses map onto
948// OBSOLETE the same real address. */
949// OBSOLETE (*bp_addr) = d10v_make_iaddr (d10v_convert_iaddr_to_raw (sp));
950// OBSOLETE /* d10v always starts the call at the callee's entry point. */
951// OBSOLETE (*real_pc) = funaddr;
952// OBSOLETE return sp;
953// OBSOLETE }
954// OBSOLETE
955// OBSOLETE static CORE_ADDR
956// OBSOLETE d10v_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
957// OBSOLETE struct regcache *regcache, CORE_ADDR bp_addr,
958// OBSOLETE int nargs, struct value **args, CORE_ADDR sp,
959// OBSOLETE int struct_return, CORE_ADDR struct_addr)
960// OBSOLETE {
961// OBSOLETE int i;
962// OBSOLETE int regnum = ARG1_REGNUM;
963// OBSOLETE struct stack_item *si = NULL;
964// OBSOLETE long val;
965// OBSOLETE
966// OBSOLETE /* Set the return address. For the d10v, the return breakpoint is
967// OBSOLETE always at BP_ADDR. */
968// OBSOLETE regcache_cooked_write_unsigned (regcache, LR_REGNUM,
969// OBSOLETE d10v_convert_iaddr_to_raw (bp_addr));
970// OBSOLETE
971// OBSOLETE /* If STRUCT_RETURN is true, then the struct return address (in
972// OBSOLETE STRUCT_ADDR) will consume the first argument-passing register.
973// OBSOLETE Both adjust the register count and store that value. */
974// OBSOLETE if (struct_return)
975// OBSOLETE {
976// OBSOLETE regcache_cooked_write_unsigned (regcache, regnum, struct_addr);
977// OBSOLETE regnum++;
978// OBSOLETE }
979// OBSOLETE
980// OBSOLETE /* Fill in registers and arg lists */
981// OBSOLETE for (i = 0; i < nargs; i++)
982// OBSOLETE {
983// OBSOLETE struct value *arg = args[i];
984// OBSOLETE struct type *type = check_typedef (VALUE_TYPE (arg));
985// OBSOLETE char *contents = VALUE_CONTENTS (arg);
986// OBSOLETE int len = TYPE_LENGTH (type);
987// OBSOLETE int aligned_regnum = (regnum + 1) & ~1;
988// OBSOLETE
989// OBSOLETE /* printf ("push: type=%d len=%d\n", TYPE_CODE (type), len); */
990// OBSOLETE if (len <= 2 && regnum <= ARGN_REGNUM)
991// OBSOLETE /* fits in a single register, do not align */
992// OBSOLETE {
993// OBSOLETE val = extract_unsigned_integer (contents, len);
994// OBSOLETE regcache_cooked_write_unsigned (regcache, regnum++, val);
995// OBSOLETE }
996// OBSOLETE else if (len <= (ARGN_REGNUM - aligned_regnum + 1) * 2)
997// OBSOLETE /* value fits in remaining registers, store keeping left
998// OBSOLETE aligned */
999// OBSOLETE {
1000// OBSOLETE int b;
1001// OBSOLETE regnum = aligned_regnum;
1002// OBSOLETE for (b = 0; b < (len & ~1); b += 2)
1003// OBSOLETE {
1004// OBSOLETE val = extract_unsigned_integer (&contents[b], 2);
1005// OBSOLETE regcache_cooked_write_unsigned (regcache, regnum++, val);
1006// OBSOLETE }
1007// OBSOLETE if (b < len)
1008// OBSOLETE {
1009// OBSOLETE val = extract_unsigned_integer (&contents[b], 1);
1010// OBSOLETE regcache_cooked_write_unsigned (regcache, regnum++, (val << 8));
1011// OBSOLETE }
1012// OBSOLETE }
1013// OBSOLETE else
1014// OBSOLETE {
1015// OBSOLETE /* arg will go onto stack */
1016// OBSOLETE regnum = ARGN_REGNUM + 1;
1017// OBSOLETE si = push_stack_item (si, contents, len);
1018// OBSOLETE }
1019// OBSOLETE }
1020// OBSOLETE
1021// OBSOLETE while (si)
1022// OBSOLETE {
1023// OBSOLETE sp = (sp - si->len) & ~1;
1024// OBSOLETE write_memory (sp, si->data, si->len);
1025// OBSOLETE si = pop_stack_item (si);
1026// OBSOLETE }
1027// OBSOLETE
1028// OBSOLETE /* Finally, update the SP register. */
1029// OBSOLETE regcache_cooked_write_unsigned (regcache, D10V_SP_REGNUM,
1030// OBSOLETE d10v_convert_daddr_to_raw (sp));
1031// OBSOLETE
1032// OBSOLETE return sp;
1033// OBSOLETE }
1034// OBSOLETE
1035// OBSOLETE /* Translate a GDB virtual ADDR/LEN into a format the remote target
1036// OBSOLETE understands. Returns number of bytes that can be transfered
1037// OBSOLETE starting at TARG_ADDR. Return ZERO if no bytes can be transfered
1038// OBSOLETE (segmentation fault). Since the simulator knows all about how the
1039// OBSOLETE VM system works, we just call that to do the translation. */
1040// OBSOLETE
1041// OBSOLETE static void
1042// OBSOLETE remote_d10v_translate_xfer_address (struct gdbarch *gdbarch,
1043// OBSOLETE struct regcache *regcache,
1044// OBSOLETE CORE_ADDR memaddr, int nr_bytes,
1045// OBSOLETE CORE_ADDR *targ_addr, int *targ_len)
1046// OBSOLETE {
1047// OBSOLETE struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
1048// OBSOLETE long out_addr;
1049// OBSOLETE long out_len;
1050// OBSOLETE out_len = sim_d10v_translate_addr (memaddr, nr_bytes, &out_addr, regcache,
1051// OBSOLETE tdep->dmap_register, tdep->imap_register);
1052// OBSOLETE *targ_addr = out_addr;
1053// OBSOLETE *targ_len = out_len;
1054// OBSOLETE }
1055// OBSOLETE
1056// OBSOLETE
1057// OBSOLETE /* The following code implements access to, and display of, the D10V's
1058// OBSOLETE instruction trace buffer. The buffer consists of 64K or more
1059// OBSOLETE 4-byte words of data, of which each words includes an 8-bit count,
1060// OBSOLETE an 8-bit segment number, and a 16-bit instruction address.
1061// OBSOLETE
1062// OBSOLETE In theory, the trace buffer is continuously capturing instruction
1063// OBSOLETE data that the CPU presents on its "debug bus", but in practice, the
1064// OBSOLETE ROMified GDB stub only enables tracing when it continues or steps
1065// OBSOLETE the program, and stops tracing when the program stops; so it
1066// OBSOLETE actually works for GDB to read the buffer counter out of memory and
1067// OBSOLETE then read each trace word. The counter records where the tracing
1068// OBSOLETE stops, but there is no record of where it started, so we remember
1069// OBSOLETE the PC when we resumed and then search backwards in the trace
1070// OBSOLETE buffer for a word that includes that address. This is not perfect,
1071// OBSOLETE because you will miss trace data if the resumption PC is the target
1072// OBSOLETE of a branch. (The value of the buffer counter is semi-random, any
1073// OBSOLETE trace data from a previous program stop is gone.) */
1074// OBSOLETE
1075// OBSOLETE /* The address of the last word recorded in the trace buffer. */
1076// OBSOLETE
1077// OBSOLETE #define DBBC_ADDR (0xd80000)
1078// OBSOLETE
1079// OBSOLETE /* The base of the trace buffer, at least for the "Board_0". */
1080// OBSOLETE
1081// OBSOLETE #define TRACE_BUFFER_BASE (0xf40000)
1082// OBSOLETE
1083// OBSOLETE static void trace_command (char *, int);
1084// OBSOLETE
1085// OBSOLETE static void untrace_command (char *, int);
1086// OBSOLETE
1087// OBSOLETE static void trace_info (char *, int);
1088// OBSOLETE
1089// OBSOLETE static void tdisassemble_command (char *, int);
1090// OBSOLETE
1091// OBSOLETE static void display_trace (int, int);
1092// OBSOLETE
1093// OBSOLETE /* True when instruction traces are being collected. */
1094// OBSOLETE
1095// OBSOLETE static int tracing;
1096// OBSOLETE
1097// OBSOLETE /* Remembered PC. */
1098// OBSOLETE
1099// OBSOLETE static CORE_ADDR last_pc;
1100// OBSOLETE
1101// OBSOLETE /* True when trace output should be displayed whenever program stops. */
1102// OBSOLETE
1103// OBSOLETE static int trace_display;
1104// OBSOLETE
1105// OBSOLETE /* True when trace listing should include source lines. */
1106// OBSOLETE
1107// OBSOLETE static int default_trace_show_source = 1;
1108// OBSOLETE
1109// OBSOLETE struct trace_buffer
1110// OBSOLETE {
1111// OBSOLETE int size;
1112// OBSOLETE short *counts;
1113// OBSOLETE CORE_ADDR *addrs;
1114// OBSOLETE }
1115// OBSOLETE trace_data;
1116// OBSOLETE
1117// OBSOLETE static void
1118// OBSOLETE trace_command (char *args, int from_tty)
1119// OBSOLETE {
1120// OBSOLETE /* Clear the host-side trace buffer, allocating space if needed. */
1121// OBSOLETE trace_data.size = 0;
1122// OBSOLETE if (trace_data.counts == NULL)
1123// OBSOLETE trace_data.counts = XCALLOC (65536, short);
1124// OBSOLETE if (trace_data.addrs == NULL)
1125// OBSOLETE trace_data.addrs = XCALLOC (65536, CORE_ADDR);
1126// OBSOLETE
1127// OBSOLETE tracing = 1;
1128// OBSOLETE
1129// OBSOLETE printf_filtered ("Tracing is now on.\n");
1130// OBSOLETE }
1131// OBSOLETE
1132// OBSOLETE static void
1133// OBSOLETE untrace_command (char *args, int from_tty)
1134// OBSOLETE {
1135// OBSOLETE tracing = 0;
1136// OBSOLETE
1137// OBSOLETE printf_filtered ("Tracing is now off.\n");
1138// OBSOLETE }
1139// OBSOLETE
1140// OBSOLETE static void
1141// OBSOLETE trace_info (char *args, int from_tty)
1142// OBSOLETE {
1143// OBSOLETE int i;
1144// OBSOLETE
1145// OBSOLETE if (trace_data.size)
1146// OBSOLETE {
1147// OBSOLETE printf_filtered ("%d entries in trace buffer:\n", trace_data.size);
1148// OBSOLETE
1149// OBSOLETE for (i = 0; i < trace_data.size; ++i)
1150// OBSOLETE {
1151// OBSOLETE printf_filtered ("%d: %d instruction%s at 0x%s\n",
1152// OBSOLETE i,
1153// OBSOLETE trace_data.counts[i],
1154// OBSOLETE (trace_data.counts[i] == 1 ? "" : "s"),
1155// OBSOLETE paddr_nz (trace_data.addrs[i]));
1156// OBSOLETE }
1157// OBSOLETE }
1158// OBSOLETE else
1159// OBSOLETE printf_filtered ("No entries in trace buffer.\n");
1160// OBSOLETE
1161// OBSOLETE printf_filtered ("Tracing is currently %s.\n", (tracing ? "on" : "off"));
1162// OBSOLETE }
1163// OBSOLETE
1164// OBSOLETE static void
1165// OBSOLETE d10v_eva_prepare_to_trace (void)
1166// OBSOLETE {
1167// OBSOLETE if (!tracing)
1168// OBSOLETE return;
1169// OBSOLETE
1170// OBSOLETE last_pc = read_register (D10V_PC_REGNUM);
1171// OBSOLETE }
1172// OBSOLETE
1173// OBSOLETE /* Collect trace data from the target board and format it into a form
1174// OBSOLETE more useful for display. */
1175// OBSOLETE
1176// OBSOLETE static void
1177// OBSOLETE d10v_eva_get_trace_data (void)
1178// OBSOLETE {
1179// OBSOLETE int count, i, j, oldsize;
1180// OBSOLETE int trace_addr, trace_seg, trace_cnt, next_cnt;
1181// OBSOLETE unsigned int last_trace, trace_word, next_word;
1182// OBSOLETE unsigned int *tmpspace;
1183// OBSOLETE
1184// OBSOLETE if (!tracing)
1185// OBSOLETE return;
1186// OBSOLETE
1187// OBSOLETE tmpspace = xmalloc (65536 * sizeof (unsigned int));
1188// OBSOLETE
1189// OBSOLETE last_trace = read_memory_unsigned_integer (DBBC_ADDR, 2) << 2;
1190// OBSOLETE
1191// OBSOLETE /* Collect buffer contents from the target, stopping when we reach
1192// OBSOLETE the word recorded when execution resumed. */
1193// OBSOLETE
1194// OBSOLETE count = 0;
1195// OBSOLETE while (last_trace > 0)
1196// OBSOLETE {
1197// OBSOLETE QUIT;
1198// OBSOLETE trace_word =
1199// OBSOLETE read_memory_unsigned_integer (TRACE_BUFFER_BASE + last_trace, 4);
1200// OBSOLETE trace_addr = trace_word & 0xffff;
1201// OBSOLETE last_trace -= 4;
1202// OBSOLETE /* Ignore an apparently nonsensical entry. */
1203// OBSOLETE if (trace_addr == 0xffd5)
1204// OBSOLETE continue;
1205// OBSOLETE tmpspace[count++] = trace_word;
1206// OBSOLETE if (trace_addr == last_pc)
1207// OBSOLETE break;
1208// OBSOLETE if (count > 65535)
1209// OBSOLETE break;
1210// OBSOLETE }
1211// OBSOLETE
1212// OBSOLETE /* Move the data to the host-side trace buffer, adjusting counts to
1213// OBSOLETE include the last instruction executed and transforming the address
1214// OBSOLETE into something that GDB likes. */
1215// OBSOLETE
1216// OBSOLETE for (i = 0; i < count; ++i)
1217// OBSOLETE {
1218// OBSOLETE trace_word = tmpspace[i];
1219// OBSOLETE next_word = ((i == 0) ? 0 : tmpspace[i - 1]);
1220// OBSOLETE trace_addr = trace_word & 0xffff;
1221// OBSOLETE next_cnt = (next_word >> 24) & 0xff;
1222// OBSOLETE j = trace_data.size + count - i - 1;
1223// OBSOLETE trace_data.addrs[j] = (trace_addr << 2) + 0x1000000;
1224// OBSOLETE trace_data.counts[j] = next_cnt + 1;
1225// OBSOLETE }
1226// OBSOLETE
1227// OBSOLETE oldsize = trace_data.size;
1228// OBSOLETE trace_data.size += count;
1229// OBSOLETE
1230// OBSOLETE xfree (tmpspace);
1231// OBSOLETE
1232// OBSOLETE if (trace_display)
1233// OBSOLETE display_trace (oldsize, trace_data.size);
1234// OBSOLETE }
1235// OBSOLETE
1236// OBSOLETE static void
1237// OBSOLETE tdisassemble_command (char *arg, int from_tty)
1238// OBSOLETE {
1239// OBSOLETE int i, count;
1240// OBSOLETE CORE_ADDR low, high;
1241// OBSOLETE
1242// OBSOLETE if (!arg)
1243// OBSOLETE {
1244// OBSOLETE low = 0;
1245// OBSOLETE high = trace_data.size;
1246// OBSOLETE }
1247// OBSOLETE else
1248// OBSOLETE {
1249// OBSOLETE char *space_index = strchr (arg, ' ');
1250// OBSOLETE if (space_index == NULL)
1251// OBSOLETE {
1252// OBSOLETE low = parse_and_eval_address (arg);
1253// OBSOLETE high = low + 5;
1254// OBSOLETE }
1255// OBSOLETE else
1256// OBSOLETE {
1257// OBSOLETE /* Two arguments. */
1258// OBSOLETE *space_index = '\0';
1259// OBSOLETE low = parse_and_eval_address (arg);
1260// OBSOLETE high = parse_and_eval_address (space_index + 1);
1261// OBSOLETE if (high < low)
1262// OBSOLETE high = low;
1263// OBSOLETE }
1264// OBSOLETE }
1265// OBSOLETE
1266// OBSOLETE printf_filtered ("Dump of trace from %s to %s:\n",
1267// OBSOLETE paddr_u (low), paddr_u (high));
1268// OBSOLETE
1269// OBSOLETE display_trace (low, high);
1270// OBSOLETE
1271// OBSOLETE printf_filtered ("End of trace dump.\n");
1272// OBSOLETE gdb_flush (gdb_stdout);
1273// OBSOLETE }
1274// OBSOLETE
1275// OBSOLETE static void
1276// OBSOLETE display_trace (int low, int high)
1277// OBSOLETE {
1278// OBSOLETE int i, count, trace_show_source, first, suppress;
1279// OBSOLETE CORE_ADDR next_address;
1280// OBSOLETE
1281// OBSOLETE trace_show_source = default_trace_show_source;
1282// OBSOLETE if (!have_full_symbols () && !have_partial_symbols ())
1283// OBSOLETE {
1284// OBSOLETE trace_show_source = 0;
1285// OBSOLETE printf_filtered ("No symbol table is loaded. Use the \"file\" command.\n");
1286// OBSOLETE printf_filtered ("Trace will not display any source.\n");
1287// OBSOLETE }
1288// OBSOLETE
1289// OBSOLETE first = 1;
1290// OBSOLETE suppress = 0;
1291// OBSOLETE for (i = low; i < high; ++i)
1292// OBSOLETE {
1293// OBSOLETE next_address = trace_data.addrs[i];
1294// OBSOLETE count = trace_data.counts[i];
1295// OBSOLETE while (count-- > 0)
1296// OBSOLETE {
1297// OBSOLETE QUIT;
1298// OBSOLETE if (trace_show_source)
1299// OBSOLETE {
1300// OBSOLETE struct symtab_and_line sal, sal_prev;
1301// OBSOLETE
1302// OBSOLETE sal_prev = find_pc_line (next_address - 4, 0);
1303// OBSOLETE sal = find_pc_line (next_address, 0);
1304// OBSOLETE
1305// OBSOLETE if (sal.symtab)
1306// OBSOLETE {
1307// OBSOLETE if (first || sal.line != sal_prev.line)
1308// OBSOLETE print_source_lines (sal.symtab, sal.line, sal.line + 1, 0);
1309// OBSOLETE suppress = 0;
1310// OBSOLETE }
1311// OBSOLETE else
1312// OBSOLETE {
1313// OBSOLETE if (!suppress)
1314// OBSOLETE /* FIXME-32x64--assumes sal.pc fits in long. */
1315// OBSOLETE printf_filtered ("No source file for address %s.\n",
1316// OBSOLETE hex_string ((unsigned long) sal.pc));
1317// OBSOLETE suppress = 1;
1318// OBSOLETE }
1319// OBSOLETE }
1320// OBSOLETE first = 0;
1321// OBSOLETE print_address (next_address, gdb_stdout);
1322// OBSOLETE printf_filtered (":");
1323// OBSOLETE printf_filtered ("\t");
1324// OBSOLETE wrap_here (" ");
1325// OBSOLETE next_address += gdb_print_insn (next_address, gdb_stdout);
1326// OBSOLETE printf_filtered ("\n");
1327// OBSOLETE gdb_flush (gdb_stdout);
1328// OBSOLETE }
1329// OBSOLETE }
1330// OBSOLETE }
1331// OBSOLETE
1332// OBSOLETE static CORE_ADDR
1333// OBSOLETE d10v_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
1334// OBSOLETE {
1335// OBSOLETE ULONGEST pc;
1336// OBSOLETE frame_unwind_unsigned_register (next_frame, D10V_PC_REGNUM, &pc);
1337// OBSOLETE return d10v_make_iaddr (pc);
1338// OBSOLETE }
1339// OBSOLETE
1340// OBSOLETE /* Given a GDB frame, determine the address of the calling function's
1341// OBSOLETE frame. This will be used to create a new GDB frame struct. */
1342// OBSOLETE
1343// OBSOLETE static void
1344// OBSOLETE d10v_frame_this_id (struct frame_info *next_frame,
1345// OBSOLETE void **this_prologue_cache,
1346// OBSOLETE struct frame_id *this_id)
1347// OBSOLETE {
1348// OBSOLETE struct d10v_unwind_cache *info
1349// OBSOLETE = d10v_frame_unwind_cache (next_frame, this_prologue_cache);
1350// OBSOLETE CORE_ADDR base;
1351// OBSOLETE CORE_ADDR func;
1352// OBSOLETE struct frame_id id;
1353// OBSOLETE
1354// OBSOLETE /* The FUNC is easy. */
1355// OBSOLETE func = frame_func_unwind (next_frame);
1356// OBSOLETE
1357// OBSOLETE /* Hopefully the prologue analysis either correctly determined the
1358// OBSOLETE frame's base (which is the SP from the previous frame), or set
1359// OBSOLETE that base to "NULL". */
1360// OBSOLETE base = info->prev_sp;
1361// OBSOLETE if (base == STACK_START || base == 0)
1362// OBSOLETE return;
1363// OBSOLETE
1364// OBSOLETE id = frame_id_build (base, func);
1365// OBSOLETE
1366// OBSOLETE (*this_id) = id;
1367// OBSOLETE }
1368// OBSOLETE
1369// OBSOLETE static void
1370// OBSOLETE d10v_frame_prev_register (struct frame_info *next_frame,
1371// OBSOLETE void **this_prologue_cache,
1372// OBSOLETE int regnum, int *optimizedp,
1373// OBSOLETE enum lval_type *lvalp, CORE_ADDR *addrp,
1374// OBSOLETE int *realnump, void *bufferp)
1375// OBSOLETE {
1376// OBSOLETE struct d10v_unwind_cache *info
1377// OBSOLETE = d10v_frame_unwind_cache (next_frame, this_prologue_cache);
1378// OBSOLETE trad_frame_get_prev_register (next_frame, info->saved_regs, regnum,
1379// OBSOLETE optimizedp, lvalp, addrp, realnump, bufferp);
1380// OBSOLETE }
1381// OBSOLETE
1382// OBSOLETE static const struct frame_unwind d10v_frame_unwind = {
1383// OBSOLETE NORMAL_FRAME,
1384// OBSOLETE d10v_frame_this_id,
1385// OBSOLETE d10v_frame_prev_register
1386// OBSOLETE };
1387// OBSOLETE
1388// OBSOLETE static const struct frame_unwind *
1389// OBSOLETE d10v_frame_sniffer (struct frame_info *next_frame)
1390// OBSOLETE {
1391// OBSOLETE return &d10v_frame_unwind;
1392// OBSOLETE }
1393// OBSOLETE
1394// OBSOLETE static CORE_ADDR
1395// OBSOLETE d10v_frame_base_address (struct frame_info *next_frame, void **this_cache)
1396// OBSOLETE {
1397// OBSOLETE struct d10v_unwind_cache *info
1398// OBSOLETE = d10v_frame_unwind_cache (next_frame, this_cache);
1399// OBSOLETE return info->base;
1400// OBSOLETE }
1401// OBSOLETE
1402// OBSOLETE static const struct frame_base d10v_frame_base = {
1403// OBSOLETE &d10v_frame_unwind,
1404// OBSOLETE d10v_frame_base_address,
1405// OBSOLETE d10v_frame_base_address,
1406// OBSOLETE d10v_frame_base_address
1407// OBSOLETE };
1408// OBSOLETE
1409// OBSOLETE /* Assuming NEXT_FRAME->prev is a dummy, return the frame ID of that
1410// OBSOLETE dummy frame. The frame ID's base needs to match the TOS value
1411// OBSOLETE saved by save_dummy_frame_tos(), and the PC match the dummy frame's
1412// OBSOLETE breakpoint. */
1413// OBSOLETE
1414// OBSOLETE static struct frame_id
1415// OBSOLETE d10v_unwind_dummy_id (struct gdbarch *gdbarch, struct frame_info *next_frame)
1416// OBSOLETE {
1417// OBSOLETE return frame_id_build (d10v_unwind_sp (gdbarch, next_frame),
1418// OBSOLETE frame_pc_unwind (next_frame));
1419// OBSOLETE }
1420// OBSOLETE
1421// OBSOLETE static gdbarch_init_ftype d10v_gdbarch_init;
1422// OBSOLETE
1423// OBSOLETE static struct gdbarch *
1424// OBSOLETE d10v_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
1425// OBSOLETE {
1426// OBSOLETE struct gdbarch *gdbarch;
1427// OBSOLETE int d10v_num_regs;
1428// OBSOLETE struct gdbarch_tdep *tdep;
1429// OBSOLETE gdbarch_register_name_ftype *d10v_register_name;
1430// OBSOLETE gdbarch_register_sim_regno_ftype *d10v_register_sim_regno;
1431// OBSOLETE
1432// OBSOLETE /* Find a candidate among the list of pre-declared architectures. */
1433// OBSOLETE arches = gdbarch_list_lookup_by_info (arches, &info);
1434// OBSOLETE if (arches != NULL)
1435// OBSOLETE return arches->gdbarch;
1436// OBSOLETE
1437// OBSOLETE /* None found, create a new architecture from the information
1438// OBSOLETE provided. */
1439// OBSOLETE tdep = XMALLOC (struct gdbarch_tdep);
1440// OBSOLETE gdbarch = gdbarch_alloc (&info, tdep);
1441// OBSOLETE
1442// OBSOLETE switch (info.bfd_arch_info->mach)
1443// OBSOLETE {
1444// OBSOLETE case bfd_mach_d10v_ts2:
1445// OBSOLETE d10v_num_regs = 37;
1446// OBSOLETE d10v_register_name = d10v_ts2_register_name;
1447// OBSOLETE d10v_register_sim_regno = d10v_ts2_register_sim_regno;
1448// OBSOLETE tdep->a0_regnum = TS2_A0_REGNUM;
1449// OBSOLETE tdep->nr_dmap_regs = TS2_NR_DMAP_REGS;
1450// OBSOLETE tdep->dmap_register = d10v_ts2_dmap_register;
1451// OBSOLETE tdep->imap_register = d10v_ts2_imap_register;
1452// OBSOLETE break;
1453// OBSOLETE default:
1454// OBSOLETE case bfd_mach_d10v_ts3:
1455// OBSOLETE d10v_num_regs = 42;
1456// OBSOLETE d10v_register_name = d10v_ts3_register_name;
1457// OBSOLETE d10v_register_sim_regno = d10v_ts3_register_sim_regno;
1458// OBSOLETE tdep->a0_regnum = TS3_A0_REGNUM;
1459// OBSOLETE tdep->nr_dmap_regs = TS3_NR_DMAP_REGS;
1460// OBSOLETE tdep->dmap_register = d10v_ts3_dmap_register;
1461// OBSOLETE tdep->imap_register = d10v_ts3_imap_register;
1462// OBSOLETE break;
1463// OBSOLETE }
1464// OBSOLETE
1465// OBSOLETE set_gdbarch_read_pc (gdbarch, d10v_read_pc);
1466// OBSOLETE set_gdbarch_write_pc (gdbarch, d10v_write_pc);
1467// OBSOLETE set_gdbarch_unwind_sp (gdbarch, d10v_unwind_sp);
1468// OBSOLETE
1469// OBSOLETE set_gdbarch_num_regs (gdbarch, d10v_num_regs);
1470// OBSOLETE set_gdbarch_sp_regnum (gdbarch, D10V_SP_REGNUM);
1471// OBSOLETE set_gdbarch_register_name (gdbarch, d10v_register_name);
1472// OBSOLETE set_gdbarch_register_type (gdbarch, d10v_register_type);
1473// OBSOLETE
1474// OBSOLETE set_gdbarch_ptr_bit (gdbarch, 2 * TARGET_CHAR_BIT);
1475// OBSOLETE set_gdbarch_addr_bit (gdbarch, 32);
1476// OBSOLETE set_gdbarch_address_to_pointer (gdbarch, d10v_address_to_pointer);
1477// OBSOLETE set_gdbarch_pointer_to_address (gdbarch, d10v_pointer_to_address);
1478// OBSOLETE set_gdbarch_integer_to_address (gdbarch, d10v_integer_to_address);
1479// OBSOLETE set_gdbarch_short_bit (gdbarch, 2 * TARGET_CHAR_BIT);
1480// OBSOLETE set_gdbarch_int_bit (gdbarch, 2 * TARGET_CHAR_BIT);
1481// OBSOLETE set_gdbarch_long_bit (gdbarch, 4 * TARGET_CHAR_BIT);
1482// OBSOLETE set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
1483// OBSOLETE /* NOTE: The d10v as a 32 bit ``float'' and ``double''. ``long
1484// OBSOLETE double'' is 64 bits. */
1485// OBSOLETE set_gdbarch_float_bit (gdbarch, 4 * TARGET_CHAR_BIT);
1486// OBSOLETE set_gdbarch_double_bit (gdbarch, 4 * TARGET_CHAR_BIT);
1487// OBSOLETE set_gdbarch_long_double_bit (gdbarch, 8 * TARGET_CHAR_BIT);
1488// OBSOLETE switch (info.byte_order)
1489// OBSOLETE {
1490// OBSOLETE case BFD_ENDIAN_BIG:
1491// OBSOLETE set_gdbarch_float_format (gdbarch, &floatformat_ieee_single_big);
1492// OBSOLETE set_gdbarch_double_format (gdbarch, &floatformat_ieee_single_big);
1493// OBSOLETE set_gdbarch_long_double_format (gdbarch, &floatformat_ieee_double_big);
1494// OBSOLETE break;
1495// OBSOLETE case BFD_ENDIAN_LITTLE:
1496// OBSOLETE set_gdbarch_float_format (gdbarch, &floatformat_ieee_single_little);
1497// OBSOLETE set_gdbarch_double_format (gdbarch, &floatformat_ieee_single_little);
1498// OBSOLETE set_gdbarch_long_double_format (gdbarch,
1499// OBSOLETE &floatformat_ieee_double_little);
1500// OBSOLETE break;
1501// OBSOLETE default:
1502// OBSOLETE internal_error (__FILE__, __LINE__,
1503// OBSOLETE "d10v_gdbarch_init: bad byte order for float format");
1504// OBSOLETE }
1505// OBSOLETE
1506// OBSOLETE set_gdbarch_return_value (gdbarch, d10v_return_value);
1507// OBSOLETE set_gdbarch_push_dummy_code (gdbarch, d10v_push_dummy_code);
1508// OBSOLETE set_gdbarch_push_dummy_call (gdbarch, d10v_push_dummy_call);
1509// OBSOLETE
1510// OBSOLETE set_gdbarch_skip_prologue (gdbarch, d10v_skip_prologue);
1511// OBSOLETE set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
1512// OBSOLETE set_gdbarch_decr_pc_after_break (gdbarch, 4);
1513// OBSOLETE set_gdbarch_breakpoint_from_pc (gdbarch, d10v_breakpoint_from_pc);
1514// OBSOLETE
1515// OBSOLETE set_gdbarch_remote_translate_xfer_address (gdbarch,
1516// OBSOLETE remote_d10v_translate_xfer_address);
1517// OBSOLETE
1518// OBSOLETE set_gdbarch_frame_align (gdbarch, d10v_frame_align);
1519// OBSOLETE
1520// OBSOLETE set_gdbarch_register_sim_regno (gdbarch, d10v_register_sim_regno);
1521// OBSOLETE
1522// OBSOLETE set_gdbarch_print_registers_info (gdbarch, d10v_print_registers_info);
1523// OBSOLETE
1524// OBSOLETE frame_unwind_append_sniffer (gdbarch, d10v_frame_sniffer);
1525// OBSOLETE frame_base_set_default (gdbarch, &d10v_frame_base);
1526// OBSOLETE
1527// OBSOLETE /* Methods for saving / extracting a dummy frame's ID. The ID's
1528// OBSOLETE stack address must match the SP value returned by
1529// OBSOLETE PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */
1530// OBSOLETE set_gdbarch_unwind_dummy_id (gdbarch, d10v_unwind_dummy_id);
1531// OBSOLETE
1532// OBSOLETE /* Return the unwound PC value. */
1533// OBSOLETE set_gdbarch_unwind_pc (gdbarch, d10v_unwind_pc);
1534// OBSOLETE
1535// OBSOLETE set_gdbarch_print_insn (gdbarch, print_insn_d10v);
1536// OBSOLETE
1537// OBSOLETE return gdbarch;
1538// OBSOLETE }
1539// OBSOLETE
1540// OBSOLETE void
1541// OBSOLETE _initialize_d10v_tdep (void)
1542// OBSOLETE {
1543// OBSOLETE register_gdbarch_init (bfd_arch_d10v, d10v_gdbarch_init);
1544// OBSOLETE
1545// OBSOLETE deprecated_target_resume_hook = d10v_eva_prepare_to_trace;
1546// OBSOLETE deprecated_target_wait_loop_hook = d10v_eva_get_trace_data;
1547// OBSOLETE
1548// OBSOLETE deprecate_cmd (add_com ("regs", class_vars, show_regs,
1549// OBSOLETE "Print all registers"),
1550// OBSOLETE "info registers");
1551// OBSOLETE
1552// OBSOLETE add_com ("itrace", class_support, trace_command,
1553// OBSOLETE "Enable tracing of instruction execution.");
1554// OBSOLETE
1555// OBSOLETE add_com ("iuntrace", class_support, untrace_command,
1556// OBSOLETE "Disable tracing of instruction execution.");
1557// OBSOLETE
1558// OBSOLETE add_com ("itdisassemble", class_vars, tdisassemble_command,
1559// OBSOLETE "Disassemble the trace buffer.\n\
1560// OBSOLETE Two optional arguments specify a range of trace buffer entries\n\
1561// OBSOLETE as reported by info trace (NOT addresses!).");
1562// OBSOLETE
1563// OBSOLETE add_info ("itrace", trace_info,
1564// OBSOLETE "Display info about the trace data buffer.");
1565// OBSOLETE
1566// OBSOLETE add_setshow_boolean_cmd ("itracedisplay", no_class, &trace_display, "\
1567// OBSOLETE Set automatic display of trace.", "\
1568// OBSOLETE Show automatic display of trace.", "\
1569// OBSOLETE Controls the display of d10v specific instruction trace information.", "\
1570// OBSOLETE Automatic display of trace is %s.",
1571// OBSOLETE NULL, NULL, &setlist, &showlist);
1572// OBSOLETE add_setshow_boolean_cmd ("itracesource", no_class,
1573// OBSOLETE &default_trace_show_source, "\
1574// OBSOLETE Set display of source code with trace.", "\
1575// OBSOLETE Show display of source code with trace.", "\
1576// OBSOLETE When on source code is included in the d10v instruction trace display.", "\
1577// OBSOLETE Display of source code with trace is %s.",
1578// OBSOLETE NULL, NULL, &setlist, &showlist);
1579// OBSOLETE }
This page took 0.170182 seconds and 4 git commands to generate.