]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/config/sparc/tm-sparc.h
70f1f20c4ab7fd7f801197dd6b2af81f24b7d43f
[thirdparty/binutils-gdb.git] / gdb / config / sparc / tm-sparc.h
1 /* Target machine sub-parameters for SPARC, for GDB, the GNU debugger.
2 This is included by other tm-*.h files to define SPARC cpu-related info.
3 Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
4 Contributed by Michael Tiemann (tiemann@mcc.com)
5
6 This file is part of GDB.
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
21
22 #define TARGET_BYTE_ORDER BIG_ENDIAN
23
24 /* Floating point is IEEE compatible. */
25 #define IEEE_FLOAT
26
27 /* When passing a structure to a function, Sun cc passes the address
28 not the structure itself. It (under SunOS4) creates two symbols,
29 which we need to combine to a LOC_REGPARM. Gcc version two (as of
30 1.92) behaves like sun cc. REG_STRUCT_HAS_ADDR is smart enough to
31 distinguish between Sun cc, gcc version 1 and gcc version 2.
32
33 This still doesn't work if the argument is not one passed in a
34 register (i.e. it's the 7th or later argument). */
35 #define REG_STRUCT_HAS_ADDR(gcc_p) (gcc_p != 1)
36
37 /* If Pcc says that a parameter is a short, it's a short. This is
38 because the parameter does get passed in in a register as an int,
39 but pcc puts it onto the stack frame as a short (not nailing
40 whatever else might be there. I'm not sure that I consider this
41 swift. Sigh.)
42
43 No, don't do this. The problem here is that pcc says that the
44 argument is in the upper half of the word reserved on the stack,
45 but puts it in the lower half. */
46 /* #define BELIEVE_PCC_PROMOTION 1 */
47 /* OK, I've added code to dbxread.c to deal with this case. */
48 #define BELIEVE_PCC_PROMOTION_TYPE
49
50 /* For acc, there's no need to correct LBRAC entries by guessing how
51 they should work. In fact, this is harmful because the LBRAC
52 entries now all appear at the end of the function, not intermixed
53 with the SLINE entries. n_opt_found detects acc for Solaris binaries;
54 function_stab_type detects acc for SunOS4 binaries.
55
56 For binary from SunOS4 /bin/cc, need to correct LBRAC's.
57
58 For gcc, like acc, don't correct. */
59
60 #define SUN_FIXED_LBRAC_BUG \
61 (n_opt_found \
62 || function_stab_type == N_STSYM \
63 || function_stab_type == N_GSYM \
64 || processing_gcc_compilation)
65
66 /* Do variables in the debug stabs occur after the N_LBRAC or before it?
67 acc: after, gcc: before, SunOS4 /bin/cc: before. */
68
69 #define VARIABLES_INSIDE_BLOCK(desc, gcc_p) \
70 (!(gcc_p) \
71 && (n_opt_found \
72 || function_stab_type == N_STSYM \
73 || function_stab_type == N_GSYM))
74
75 /* Offset from address of function to start of its code.
76 Zero on most machines. */
77
78 #define FUNCTION_START_OFFSET 0
79
80 /* Advance PC across any function entry prologue instructions
81 to reach some "real" code. SKIP_PROLOGUE_FRAMELESS_P advances
82 the PC past some of the prologue, but stops as soon as it
83 knows that the function has a frame. Its result is equal
84 to its input PC if the function is frameless, unequal otherwise. */
85
86 #define SKIP_PROLOGUE(pc) \
87 { pc = skip_prologue (pc, 0); }
88 #define SKIP_PROLOGUE_FRAMELESS_P(pc) \
89 { pc = skip_prologue (pc, 1); }
90 extern CORE_ADDR skip_prologue ();
91
92 /* Immediately after a function call, return the saved pc.
93 Can't go through the frames for this because on some machines
94 the new frame is not set up until the new function executes
95 some instructions. */
96
97 /* On the Sun 4 under SunOS, the compile will leave a fake insn which
98 encodes the structure size being returned. If we detect such
99 a fake insn, step past it. */
100
101 #define PC_ADJUST(pc) sparc_pc_adjust(pc)
102 extern CORE_ADDR sparc_pc_adjust();
103
104 #define SAVED_PC_AFTER_CALL(frame) PC_ADJUST (read_register (RP_REGNUM))
105
106 /* Stack grows downward. */
107
108 #define INNER_THAN <
109
110 /* Stack has strict alignment. */
111
112 #define STACK_ALIGN(ADDR) (((ADDR)+7)&-8)
113
114 /* Sequence of bytes for breakpoint instruction. */
115
116 #define BREAKPOINT {0x91, 0xd0, 0x20, 0x01}
117
118 /* Amount PC must be decremented by after a breakpoint.
119 This is often the number of bytes in BREAKPOINT
120 but not always. */
121
122 #define DECR_PC_AFTER_BREAK 0
123
124 /* Nonzero if instruction at PC is a return instruction. */
125 /* For SPARC, this is either a "jmpl %o7+8,%g0" or "jmpl %i7+8,%g0".
126
127 Note: this does not work for functions returning structures under SunOS. */
128 #define ABOUT_TO_RETURN(pc) \
129 ((read_memory_integer (pc, 4)|0x00040000) == 0x81c7e008)
130
131 /* Return 1 if P points to an invalid floating point value. */
132
133 #define INVALID_FLOAT(p, len) 0 /* Just a first guess; not checked */
134
135 /* Say how long (ordinary) registers are. */
136
137 #define REGISTER_TYPE long
138
139 /* Number of machine registers */
140
141 #define NUM_REGS 72
142
143 /* Initializer for an array of names of registers.
144 There should be NUM_REGS strings in this initializer. */
145
146 #define REGISTER_NAMES \
147 { "g0", "g1", "g2", "g3", "g4", "g5", "g6", "g7", \
148 "o0", "o1", "o2", "o3", "o4", "o5", "sp", "o7", \
149 "l0", "l1", "l2", "l3", "l4", "l5", "l6", "l7", \
150 "i0", "i1", "i2", "i3", "i4", "i5", "fp", "i7", \
151 \
152 "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \
153 "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \
154 "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \
155 "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \
156 \
157 "y", "psr", "wim", "tbr", "pc", "npc", "fpsr", "cpsr" }
158
159 /* Register numbers of various important registers.
160 Note that some of these values are "real" register numbers,
161 and correspond to the general registers of the machine,
162 and some are "phony" register numbers which are too large
163 to be actual register numbers as far as the user is concerned
164 but do serve to get the desired values when passed to read_register. */
165
166 #define G0_REGNUM 0 /* %g0 */
167 #define G1_REGNUM 1 /* %g1 */
168 #define O0_REGNUM 8 /* %o0 */
169 #define SP_REGNUM 14 /* Contains address of top of stack, \
170 which is also the bottom of the frame. */
171 #define RP_REGNUM 15 /* Contains return address value, *before* \
172 any windows get switched. */
173 #define O7_REGNUM 15 /* Last local reg not saved on stack frame */
174 #define L0_REGNUM 16 /* First local reg that's saved on stack frame
175 rather than in machine registers */
176 #define I0_REGNUM 24 /* %i0 */
177 #define FP_REGNUM 30 /* Contains address of executing stack frame */
178 #define I7_REGNUM 31 /* Last local reg saved on stack frame */
179 #define FP0_REGNUM 32 /* Floating point register 0 */
180 #define Y_REGNUM 64 /* Temp register for multiplication, etc. */
181 #define PS_REGNUM 65 /* Contains processor status */
182 #define WIM_REGNUM 66 /* Window Invalid Mask (not really supported) */
183 #define TBR_REGNUM 67 /* Trap Base Register (not really supported) */
184 #define PC_REGNUM 68 /* Contains program counter */
185 #define NPC_REGNUM 69 /* Contains next PC */
186 #define FPS_REGNUM 70 /* Floating point status register */
187 #define CPS_REGNUM 71 /* Coprocessor status register */
188
189 /* Total amount of space needed to store our copies of the machine's
190 register state, the array `registers'. On the sparc, `registers'
191 contains the ins and locals, even though they are saved on the
192 stack rather than with the other registers, and this causes hair
193 and confusion in places like pop_frame. It probably would be
194 better to remove the ins and locals from `registers', make sure
195 that get_saved_register can get them from the stack (even in the
196 innermost frame), and make this the way to access them. For the
197 frame pointer we would do that via TARGET_READ_FP. */
198
199 #define REGISTER_BYTES (32*4+32*4+8*4)
200
201 /* Index within `registers' of the first byte of the space for
202 register N. */
203 /* ?? */
204 #define REGISTER_BYTE(N) ((N)*4)
205
206 /* The SPARC processor has register windows. */
207
208 #define HAVE_REGISTER_WINDOWS
209
210 /* Is this register part of the register window system? A yes answer
211 implies that 1) The name of this register will not be the same in
212 other frames, and 2) This register is automatically "saved" (out
213 registers shifting into ins counts) upon subroutine calls and thus
214 there is no need to search more than one stack frame for it. */
215
216 #define REGISTER_IN_WINDOW_P(regnum) \
217 ((regnum) >= 8 && (regnum) < 32)
218
219 /* Number of bytes of storage in the actual machine representation
220 for register N. */
221
222 /* On the SPARC, all regs are 4 bytes. */
223
224 #define REGISTER_RAW_SIZE(N) (4)
225
226 /* Number of bytes of storage in the program's representation
227 for register N. */
228
229 /* On the SPARC, all regs are 4 bytes. */
230
231 #define REGISTER_VIRTUAL_SIZE(N) (4)
232
233 /* Largest value REGISTER_RAW_SIZE can have. */
234
235 #define MAX_REGISTER_RAW_SIZE 8
236
237 /* Largest value REGISTER_VIRTUAL_SIZE can have. */
238
239 #define MAX_REGISTER_VIRTUAL_SIZE 8
240
241 /* Nonzero if register N requires conversion
242 from raw format to virtual format. */
243
244 #define REGISTER_CONVERTIBLE(N) (0)
245
246 /* Convert data from raw format for register REGNUM
247 to virtual format for register REGNUM. */
248
249 #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,FROM,TO) \
250 { memcpy ((TO), (FROM), REGISTER_RAW_SIZE (REGNUM)); }
251
252 /* Convert data from virtual format for register REGNUM
253 to raw format for register REGNUM. */
254
255 #define REGISTER_CONVERT_TO_RAW(REGNUM,FROM,TO) \
256 { memcpy ((TO), (FROM), REGISTER_RAW_SIZE (REGNUM)); }
257
258 /* Return the GDB type object for the "standard" data type
259 of data in register N. */
260
261 #define REGISTER_VIRTUAL_TYPE(N) \
262 ((N) < 32 ? builtin_type_int : (N) < 64 ? builtin_type_float : \
263 builtin_type_int)
264
265 /* Writing to %g0 is a noop (not an error or exception or anything like
266 that, however). */
267
268 #define CANNOT_STORE_REGISTER(regno) ((regno) == G0_REGNUM)
269
270 /* Store the address of the place in which to copy the structure the
271 subroutine will return. This is called from call_function. */
272
273 #define STORE_STRUCT_RETURN(ADDR, SP) \
274 { target_write_memory ((SP)+(16*4), (char *)&(ADDR), 4); }
275
276 /* Extract from an array REGBUF containing the (raw) register state
277 a function return value of type TYPE, and copy that, in virtual format,
278 into VALBUF. */
279
280 #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
281 { \
282 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
283 { \
284 memcpy ((VALBUF), ((int *)(REGBUF))+FP0_REGNUM, TYPE_LENGTH(TYPE));\
285 } \
286 else \
287 memcpy ((VALBUF), \
288 (char *)(REGBUF) + 4 * 8 + \
289 (TYPE_LENGTH(TYPE) >= 4 ? 0 : 4 - TYPE_LENGTH(TYPE)), \
290 TYPE_LENGTH(TYPE)); \
291 }
292
293 /* Write into appropriate registers a function return value
294 of type TYPE, given in virtual format. */
295 /* On sparc, values are returned in register %o0. */
296 #define STORE_RETURN_VALUE(TYPE,VALBUF) \
297 { \
298 if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
299 /* Floating-point values are returned in the register pair */ \
300 /* formed by %f0 and %f1 (doubles are, anyway). */ \
301 write_register_bytes (REGISTER_BYTE (FP0_REGNUM), (VALBUF), \
302 TYPE_LENGTH (TYPE)); \
303 else \
304 /* Other values are returned in register %o0. */ \
305 write_register_bytes (REGISTER_BYTE (O0_REGNUM), (VALBUF), \
306 TYPE_LENGTH (TYPE)); \
307 }
308
309 /* Extract from an array REGBUF containing the (raw) register state
310 the address in which a function should return its structure value,
311 as a CORE_ADDR (or an expression that can be used as one). */
312
313 #define EXTRACT_STRUCT_VALUE_ADDRESS(REGBUF) \
314 (sparc_extract_struct_value_address (REGBUF))
315
316 extern CORE_ADDR
317 sparc_extract_struct_value_address PARAMS ((char [REGISTER_BYTES]));
318
319 \f
320 /* Describe the pointer in each stack frame to the previous stack frame
321 (its caller). */
322
323 /* FRAME_CHAIN takes a frame's nominal address
324 and produces the frame's chain-pointer. */
325
326 /* In the case of the Sun 4, the frame-chain's nominal address
327 is held in the frame pointer register.
328
329 On the Sun4, the frame (in %fp) is %sp for the previous frame.
330 From the previous frame's %sp, we can find the previous frame's
331 %fp: it is in the save area just above the previous frame's %sp.
332
333 If we are setting up an arbitrary frame, we'll need to know where
334 it ends. Hence the following. This part of the frame cache
335 structure should be checked before it is assumed that this frame's
336 bottom is in the stack pointer.
337
338 If there isn't a frame below this one, the bottom of this frame is
339 in the stack pointer.
340
341 If there is a frame below this one, and the frame pointers are
342 identical, it's a leaf frame and the bottoms are the same also.
343
344 Otherwise the bottom of this frame is the top of the next frame.
345
346 The bottom field is misnamed, since it might imply that memory from
347 bottom to frame contains this frame. That need not be true if
348 stack frames are allocated in different segments (e.g. some on a
349 stack, some on a heap in the data segment). */
350
351 #define EXTRA_FRAME_INFO FRAME_ADDR bottom;
352 #define INIT_EXTRA_FRAME_INFO(fromleaf, fci) \
353 (fci)->bottom = \
354 ((fci)->next ? \
355 ((fci)->frame == (fci)->next->frame ? \
356 (fci)->next->bottom : (fci)->next->frame) : \
357 read_register (SP_REGNUM));
358
359 #define FRAME_CHAIN(thisframe) (sparc_frame_chain (thisframe))
360 CORE_ADDR sparc_frame_chain ();
361
362 /* Define other aspects of the stack frame. */
363
364 /* A macro that tells us whether the function invocation represented
365 by FI does not have a frame on the stack associated with it. If it
366 does not, FRAMELESS is set to 1, else 0. */
367 #define FRAMELESS_FUNCTION_INVOCATION(FI, FRAMELESS) \
368 (FRAMELESS) = frameless_look_for_prologue(FI)
369
370 /* Where is the PC for a specific frame */
371
372 #define FRAME_SAVED_PC(FRAME) frame_saved_pc (FRAME)
373 CORE_ADDR frame_saved_pc ();
374
375 /* If the argument is on the stack, it will be here. */
376 #define FRAME_ARGS_ADDRESS(fi) ((fi)->frame)
377
378 #define FRAME_STRUCT_ARGS_ADDRESS(fi) ((fi)->frame)
379
380 #define FRAME_LOCALS_ADDRESS(fi) ((fi)->frame)
381
382 /* Set VAL to the number of args passed to frame described by FI.
383 Can set VAL to -1, meaning no way to tell. */
384
385 /* We can't tell how many args there are
386 now that the C compiler delays popping them. */
387 #define FRAME_NUM_ARGS(val,fi) (val = -1)
388
389 /* Return number of bytes at start of arglist that are not really args. */
390
391 #define FRAME_ARGS_SKIP 68
392
393 /* Put here the code to store, into a struct frame_saved_regs,
394 the addresses of the saved registers of frame described by FRAME_INFO.
395 The actual code is in sparc-tdep.c so we can debug it sanely. */
396
397 #define FRAME_FIND_SAVED_REGS(fi, frame_saved_regs) \
398 sparc_frame_find_saved_regs ((fi), &(frame_saved_regs))
399 extern void sparc_frame_find_saved_regs ();
400 \f
401 /* Things needed for making the inferior call functions. */
402 /*
403 * First of all, let me give my opinion of what the DUMMY_FRAME
404 * actually looks like.
405 *
406 * | |
407 * | |
408 * + - - - - - - - - - - - - - - - - +<-- fp (level 0)
409 * | |
410 * | |
411 * | |
412 * | |
413 * | Frame of innermost program |
414 * | function |
415 * | |
416 * | |
417 * | |
418 * | |
419 * | |
420 * |---------------------------------|<-- sp (level 0), fp (c)
421 * | |
422 * DUMMY | fp0-31 |
423 * | |
424 * | ------ |<-- fp - 0x80
425 * FRAME | g0-7 |<-- fp - 0xa0
426 * | i0-7 |<-- fp - 0xc0
427 * | other |<-- fp - 0xe0
428 * | ? |
429 * | ? |
430 * |---------------------------------|<-- sp' = fp - 0x140
431 * | |
432 * xcution start | |
433 * sp' + 0x94 -->| CALL_DUMMY (x code) |
434 * | |
435 * | |
436 * |---------------------------------|<-- sp'' = fp - 0x200
437 * | align sp to 8 byte boundary |
438 * | ==> args to fn <== |
439 * Room for | |
440 * i & l's + agg | CALL_DUMMY_STACK_ADJUST = 0x0x44|
441 * |---------------------------------|<-- final sp (variable)
442 * | |
443 * | Where function called will |
444 * | build frame. |
445 * | |
446 * | |
447 *
448 * I understand everything in this picture except what the space
449 * between fp - 0xe0 and fp - 0x140 is used for. Oh, and I don't
450 * understand why there's a large chunk of CALL_DUMMY that never gets
451 * executed (its function is superceeded by PUSH_DUMMY_FRAME; they
452 * are designed to do the same thing).
453 *
454 * PUSH_DUMMY_FRAME saves the registers above sp' and pushes the
455 * register file stack down one.
456 *
457 * call_function then writes CALL_DUMMY, pushes the args onto the
458 * stack, and adjusts the stack pointer.
459 *
460 * run_stack_dummy then starts execution (in the middle of
461 * CALL_DUMMY, as directed by call_function).
462 */
463
464 /* Push an empty stack frame, to record the current PC, etc. */
465
466 #define PUSH_DUMMY_FRAME sparc_push_dummy_frame ()
467 #define POP_FRAME sparc_pop_frame ()
468
469 void sparc_push_dummy_frame (), sparc_pop_frame ();
470 /* This sequence of words is the instructions
471
472 save %sp,-0x140,%sp
473 std %f30,[%fp-0x08]
474 std %f28,[%fp-0x10]
475 std %f26,[%fp-0x18]
476 std %f24,[%fp-0x20]
477 std %f22,[%fp-0x28]
478 std %f20,[%fp-0x30]
479 std %f18,[%fp-0x38]
480 std %f16,[%fp-0x40]
481 std %f14,[%fp-0x48]
482 std %f12,[%fp-0x50]
483 std %f10,[%fp-0x58]
484 std %f8,[%fp-0x60]
485 std %f6,[%fp-0x68]
486 std %f4,[%fp-0x70]
487 std %f2,[%fp-0x78]
488 std %f0,[%fp-0x80]
489 std %g6,[%fp-0x88]
490 std %g4,[%fp-0x90]
491 std %g2,[%fp-0x98]
492 std %g0,[%fp-0xa0]
493 std %i6,[%fp-0xa8]
494 std %i4,[%fp-0xb0]
495 std %i2,[%fp-0xb8]
496 std %i0,[%fp-0xc0]
497 nop ! stcsr [%fp-0xc4]
498 nop ! stfsr [%fp-0xc8]
499 nop ! wr %npc,[%fp-0xcc]
500 nop ! wr %pc,[%fp-0xd0]
501 rd %tbr,%o0
502 st %o0,[%fp-0xd4]
503 rd %wim,%o1
504 st %o0,[%fp-0xd8]
505 rd %psr,%o0
506 st %o0,[%fp-0xdc]
507 rd %y,%o0
508 st %o0,[%fp-0xe0]
509
510 /..* The arguments are pushed at this point by GDB;
511 no code is needed in the dummy for this.
512 The CALL_DUMMY_START_OFFSET gives the position of
513 the following ld instruction. *../
514
515 ld [%sp+0x58],%o5
516 ld [%sp+0x54],%o4
517 ld [%sp+0x50],%o3
518 ld [%sp+0x4c],%o2
519 ld [%sp+0x48],%o1
520 call 0x00000000
521 ld [%sp+0x44],%o0
522 nop
523 ta 1
524 nop
525
526 note that this is 192 bytes, which is a multiple of 8 (not only 4) bytes.
527 note that the `call' insn is a relative, not an absolute call.
528 note that the `nop' at the end is needed to keep the trap from
529 clobbering things (if NPC pointed to garbage instead).
530
531 We actually start executing at the `sethi', since the pushing of the
532 registers (as arguments) is done by PUSH_DUMMY_FRAME. If this were
533 real code, the arguments for the function called by the CALL would be
534 pushed between the list of ST insns and the CALL, and we could allow
535 it to execute through. But the arguments have to be pushed by GDB
536 after the PUSH_DUMMY_FRAME is done, and we cannot allow these ST
537 insns to be performed again, lest the registers saved be taken for
538 arguments. */
539
540 #define CALL_DUMMY { 0x9de3bee0, 0xfd3fbff8, 0xf93fbff0, 0xf53fbfe8, \
541 0xf13fbfe0, 0xed3fbfd8, 0xe93fbfd0, 0xe53fbfc8, \
542 0xe13fbfc0, 0xdd3fbfb8, 0xd93fbfb0, 0xd53fbfa8, \
543 0xd13fbfa0, 0xcd3fbf98, 0xc93fbf90, 0xc53fbf88, \
544 0xc13fbf80, 0xcc3fbf78, 0xc83fbf70, 0xc43fbf68, \
545 0xc03fbf60, 0xfc3fbf58, 0xf83fbf50, 0xf43fbf48, \
546 0xf03fbf40, 0x01000000, 0x01000000, 0x01000000, \
547 0x01000000, 0x91580000, 0xd027bf50, 0x93500000, \
548 0xd027bf4c, 0x91480000, 0xd027bf48, 0x91400000, \
549 0xd027bf44, 0xda03a058, 0xd803a054, 0xd603a050, \
550 0xd403a04c, 0xd203a048, 0x40000000, 0xd003a044, \
551 0x01000000, 0x91d02001, 0x01000000, 0x01000000}
552
553 #define CALL_DUMMY_LENGTH 192
554
555 #define CALL_DUMMY_START_OFFSET 148
556
557 #define CALL_DUMMY_STACK_ADJUST 68
558
559 /* Insert the specified number of args and function address
560 into a call sequence of the above form stored at DUMMYNAME.
561
562 For structs and unions, if the function was compiled with Sun cc,
563 it expects 'unimp' after the call. But gcc doesn't use that
564 (twisted) convention. So leave a nop there for gcc (FIX_CALL_DUMMY
565 can assume it is operating on a pristine CALL_DUMMY, not one that
566 has already been customized for a different function). */
567
568 #define FIX_CALL_DUMMY(dummyname, pc, fun, nargs, args, type, gcc_p) \
569 { \
570 *(int *)((char *) dummyname+168) = (0x40000000|((fun-(pc+168))>>2)); \
571 if (!gcc_p \
572 && (TYPE_CODE (type) == TYPE_CODE_STRUCT \
573 || TYPE_CODE (type) == TYPE_CODE_UNION)) \
574 *(int *)((char *) dummyname+176) = (TYPE_LENGTH (type) & 0x1fff); \
575 }
576
577 \f
578 /* Sparc has no reliable single step ptrace call */
579
580 #define NO_SINGLE_STEP 1
581 extern void single_step ();
582
583 /* We need more arguments in a frame specification for the
584 "frame" or "info frame" command. */
585
586 #define SETUP_ARBITRARY_FRAME(argc, argv) setup_arbitrary_frame (argc, argv)
587 /* FIXME: Depends on equivalence between FRAME and "struct frame_info *",
588 and equivalence between CORE_ADDR and FRAME_ADDR. */
589 extern struct frame_info *setup_arbitrary_frame PARAMS ((int, CORE_ADDR *));
590
591 /* To print every pair of float registers as a double, we use this hook. */
592
593 #define PRINT_REGISTER_HOOK(regno) \
594 if (((regno) >= FP0_REGNUM) \
595 && ((regno) < FP0_REGNUM + 32) \
596 && (0 == ((regno) & 1))) { \
597 char doublereg[8]; /* two float regs */ \
598 if (!read_relative_register_raw_bytes ((regno) , doublereg ) \
599 && !read_relative_register_raw_bytes ((regno)+1, doublereg+4)) { \
600 printf("\t"); \
601 print_floating (doublereg, builtin_type_double, stdout); \
602 } \
603 }
604
605 /* Optimization for storing registers to the inferior. The hook
606 DO_DEFERRED_STORES
607 actually executes any deferred stores. It is called any time
608 we are going to proceed the child, or read its registers.
609 The hook CLEAR_DEFERRED_STORES is called when we want to throw
610 away the inferior process, e.g. when it dies or we kill it.
611 FIXME, this does not handle remote debugging cleanly. */
612
613 extern int deferred_stores;
614 #define DO_DEFERRED_STORES \
615 if (deferred_stores) \
616 target_store_registers (-2);
617 #define CLEAR_DEFERRED_STORES \
618 deferred_stores = 0;