1 /* Remote debugging interface for AMD 29k interfaced via UDI, for GDB.
2 Copyright 1990, 1992, 1995, 2000 Free Software Foundation, Inc.
3 Written by Daniel Mann. Contributed by AMD.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* This is like remote.c but uses the Universal Debug Interface (UDI) to
23 talk to the target hardware (or simulator). UDI is a TCP/IP based
24 protocol; for hardware that doesn't run TCP, an interface adapter
25 daemon talks UDI on one side, and talks to the hardware (typically
26 over a serial port) on the other side.
28 - Originally written by Daniel Mann at AMD for MiniMON and gdb 3.91.6.
29 - David Wood (wood@lab.ultra.nyu.edu) at New York University adapted this
30 file to gdb 3.95. I was unable to get this working on sun3os4
31 with termio, only with sgtty.
32 - Daniel Mann at AMD took the 3.95 adaptions above and replaced
33 MiniMON interface with UDI-p interface. */
44 #include "gdb_string.h"
47 #include "29k-share/udi/udiproc.h"
50 #include "gdbcore.h" /* For download function */
52 /* access the register store directly, without going through
53 the normal handler functions. This avoids an extra data copy. */
55 extern int stop_soon_quietly
; /* for wait_for_inferior */
56 extern struct value
*call_function_by_hand ();
57 static void udi_resume (int pid
, int step
, enum target_signal sig
);
58 static void udi_fetch_registers (int regno
);
59 static void udi_load (char *args
, int from_tty
);
60 static void fetch_register (int regno
);
61 static void udi_store_registers (int regno
);
62 static int store_register (int regno
);
63 static int regnum_to_srnum (int regno
);
64 static void udi_close (int quitting
);
65 static CPUSpace
udi_memory_space (CORE_ADDR addr
);
66 static int udi_write_inferior_memory (CORE_ADDR memaddr
, char *myaddr
,
68 static int udi_read_inferior_memory (CORE_ADDR memaddr
, char *myaddr
,
70 static void download (char *load_arg_string
, int from_tty
);
71 char CoffFileName
[100] = "";
73 #define FREEZE_MODE (read_register(CPS_REGNUM) & 0x400)
74 #define USE_SHADOW_PC ((processor_type == a29k_freeze_mode) && FREEZE_MODE)
76 static int timeout
= 5;
77 extern struct target_ops udi_ops
; /* Forward declaration */
79 /* Special register enumeration.
82 /******************************************************************* UDI DATA*/
83 #define MAXDATA 2*1024 /* max UDI[read/write] byte size */
84 /* Descriptor for I/O to remote machine. Initialize it to -1 so that
85 udi_open knows that we don't have a file open when the program
88 UDISessionId udi_session_id
= -1;
89 static char *udi_config_id
;
91 CPUOffset IMemStart
= 0;
92 CPUSizeT IMemSize
= 0;
93 CPUOffset DMemStart
= 0;
94 CPUSizeT DMemSize
= 0;
95 CPUOffset RMemStart
= 0;
96 CPUSizeT RMemSize
= 0;
100 UDIMemoryRange address_ranges
[2]; /* Text and data */
102 {0, 0}; /* Entry point */
103 CPUSizeT stack_sizes
[2]; /* Regular and memory stacks */
105 #define SBUF_MAX 1024 /* maximum size of string handling buffer */
108 typedef struct bkpt_entry_str
113 unsigned int BreakId
;
116 #define BKPT_TABLE_SIZE 40
117 static bkpt_entry_t bkpt_table
[BKPT_TABLE_SIZE
];
118 extern char dfe_errmsg
[]; /* error string */
120 /* malloc'd name of the program on the remote system. */
121 static char *prog_name
= NULL
;
123 /* This is called not only when we first attach, but also when the
124 user types "run" after having attached. */
127 udi_create_inferior (execfile
, args
, env
)
136 if (prog_name
!= NULL
)
138 prog_name
= savestring (execfile
, strlen (execfile
));
140 else if (entry
.Offset
)
143 error ("No image loaded into target.");
145 if (udi_session_id
< 0)
147 /* If the TIP is not open, open it. */
148 if (UDIConnect (udi_config_id
, &udi_session_id
))
149 error ("UDIConnect() failed: %s\n", dfe_errmsg
);
150 /* We will need to download the program. */
154 inferior_pid
= 40000;
157 download (execfile
, 0);
159 args1
= alloca (strlen (execfile
) + strlen (args
) + 2);
161 if (execfile
[0] == '\0')
163 /* It is empty. We need to quote it somehow, or else the target
164 will think there is no argument being passed here. According
165 to the UDI spec it is quoted "according to TIP OS rules" which
166 I guess means quoting it like the Unix shell should work
167 (sounds pretty bogus to me...). In fact it doesn't work (with
168 isstip anyway), but passing in two quotes as the argument seems
169 like a reasonable enough behavior anyway (I guess). */
171 strcpy (args1
, "''");
173 strcpy (args1
, execfile
);
175 strcat (args1
, args
);
177 UDIInitializeProcess (address_ranges
, /* ProcessMemory[] */
178 (UDIInt
) 2, /* NumberOfRanges */
179 entry
, /* EntryPoint */
180 stack_sizes
, /* *StackSizes */
181 (UDIInt
) 2, /* NumberOfStacks */
182 args1
); /* ArgString */
184 init_wait_for_inferior ();
185 clear_proceed_status ();
186 proceed (-1, TARGET_SIGNAL_DEFAULT
, 0);
193 /* Requiring "target udi" each time you run is a major pain. I suspect
194 this was just blindy copied from remote.c, in which "target" and
195 "run" are combined. Having a udi target without an inferior seems
196 to work between "target udi" and "run", so why not now? */
197 pop_target (); /* Pop back to no-child state */
199 /* But if we're going to want to run it again, we better remove the
201 remove_breakpoints ();
202 generic_mourn_inferior ();
205 /******************************************************************** UDI_OPEN
206 ** Open a connection to remote TIP.
207 NAME is the socket domain used for communication with the TIP,
208 then a space and the socket name or TIP-host name.
209 '<udi_udi_config_id>' for example.
212 /* XXX - need cleanups for udiconnect for various failures!!! */
215 udi_open (name
, from_tty
)
222 UDIMemoryRange KnownMemory
[10];
223 UDIUInt32 ChipVersions
[10];
224 UDIInt NumberOfRanges
= 10;
225 UDIInt NumberOfChips
= 10;
227 UDIUInt32 TIPId
, TargetId
, DFEId
, DFE
, TIP
, DFEIPCId
, TIPIPCId
;
229 target_preopen (from_tty
);
233 for (cnt
= 0; cnt
< BKPT_TABLE_SIZE
; cnt
++)
234 bkpt_table
[cnt
].Type
= 0;
237 free (udi_config_id
);
240 error ("Usage: target udi config_id, where config_id appears in udi_soc file");
242 udi_config_id
= strdup (strtok (name
, " \t"));
244 if (UDIConnect (udi_config_id
, &udi_session_id
))
245 /* FIXME: Should set udi_session_id to -1 here. */
246 error ("UDIConnect() failed: %s\n", dfe_errmsg
);
248 push_target (&udi_ops
);
251 ** Initialize target configuration structure (global)
253 if (UDIGetTargetConfig (KnownMemory
, &NumberOfRanges
,
254 ChipVersions
, &NumberOfChips
))
255 error ("UDIGetTargetConfig() failed");
256 if (NumberOfChips
> 2)
257 fprintf_unfiltered (gdb_stderr
, "Target has more than one processor\n");
258 for (cnt
= 0; cnt
< NumberOfRanges
; cnt
++)
260 switch (KnownMemory
[cnt
].Space
)
263 fprintf_unfiltered (gdb_stderr
, "UDIGetTargetConfig() unknown memory space\n");
267 case UDI29KIROMSpace
:
268 RMemStart
= KnownMemory
[cnt
].Offset
;
269 RMemSize
= KnownMemory
[cnt
].Size
;
271 case UDI29KIRAMSpace
:
272 IMemStart
= KnownMemory
[cnt
].Offset
;
273 IMemSize
= KnownMemory
[cnt
].Size
;
275 case UDI29KDRAMSpace
:
276 DMemStart
= KnownMemory
[cnt
].Offset
;
277 DMemSize
= KnownMemory
[cnt
].Size
;
282 a29k_get_processor_type ();
284 if (UDICreateProcess (&PId
))
285 fprintf_unfiltered (gdb_stderr
, "UDICreateProcess() failed\n");
287 /* Print out some stuff, letting the user now what's going on */
288 if (UDICapabilities (&TIPId
, &TargetId
, DFEId
, DFE
, &TIP
, &DFEIPCId
,
290 error ("UDICapabilities() failed");
293 printf_filtered ("Connected via UDI socket,\n\
294 DFE-IPC version %x.%x.%x TIP-IPC version %x.%x.%x TIP version %x.%x.%x\n %s\n",
295 (DFEIPCId
>> 8) & 0xf, (DFEIPCId
>> 4) & 0xf, DFEIPCId
& 0xf,
296 (TIPIPCId
>> 8) & 0xf, (TIPIPCId
>> 4) & 0xf, TIPIPCId
& 0xf,
297 (TargetId
>> 8) & 0xf, (TargetId
>> 4) & 0xf, TargetId
& 0xf,
302 /******************************************************************* UDI_CLOSE
303 Close the open connection to the TIP process.
304 Use this when you want to detach and do something else
307 udi_close (quitting
) /*FIXME: how is quitting used */
310 if (udi_session_id
< 0)
313 /* We should never get here if there isn't something valid in
316 if (UDIDisconnect (udi_session_id
, UDITerminateSession
))
319 warning ("UDIDisconnect() failed in udi_close");
321 error ("UDIDisconnect() failed in udi_close");
324 /* Do not try to close udi_session_id again, later in the program. */
328 printf_filtered (" Ending remote debugging\n");
331 /**************************************************************** UDI_ATACH */
332 /* Attach to a program that is already loaded and running
333 * Upon exiting the process's execution is stopped.
336 udi_attach (args
, from_tty
)
345 UDIBool HostEndian
= 0;
349 error_no_arg ("program to attach");
351 if (udi_session_id
< 0)
352 error ("UDI connection not opened yet, use the 'target udi' command.\n");
355 printf_unfiltered ("Attaching to remote program %s...\n", prog_name
);
358 From
.Space
= UDI29KSpecialRegs
;
360 if (err
= UDIRead (From
, &PC_adds
, Count
, Size
, &CountDone
, HostEndian
))
361 error ("UDIRead failed in udi_attach");
362 printf_unfiltered ("Remote process is now halted, pc1 = 0x%x.\n", PC_adds
);
364 /************************************************************* UDI_DETACH */
365 /* Terminate the open connection to the TIP process.
366 Use this when you want to detach and do something else
367 with your gdb. Leave remote process running (with no breakpoints set). */
369 udi_detach (args
, from_tty
)
374 remove_breakpoints (); /* Just in case there were any left in */
376 if (UDIDisconnect (udi_session_id
, UDIContinueSession
))
377 error ("UDIDisconnect() failed in udi_detach");
379 /* Don't try to UDIDisconnect it again in udi_close, which is called from
387 printf_unfiltered ("Detaching from TIP\n");
391 /****************************************************************** UDI_RESUME
392 ** Tell the remote machine to resume. */
395 udi_resume (pid
, step
, sig
)
397 enum target_signal sig
;
401 UDIStepType StepType
= UDIStepNatural
;
404 if (step
) /* step 1 instruction */
406 tip_error
= UDIStep (Steps
, StepType
, Range
);
410 fprintf_unfiltered (gdb_stderr
, "UDIStep() error = %d\n", tip_error
);
411 error ("failed in udi_resume");
415 error ("UDIExecute() failed in udi_resume");
418 /******************************************************************** UDI_WAIT
419 ** Wait until the remote machine stops, then return,
420 storing status in STATUS just as `wait' would. */
423 udi_wait (pid
, status
)
425 struct target_waitstatus
*status
;
431 int old_timeout
= timeout
;
432 int old_immediate_quit
= immediate_quit
;
435 status
->kind
= TARGET_WAITKIND_EXITED
;
436 status
->value
.integer
= 0;
438 /* wait for message to arrive. It should be:
439 If the target stops executing, udi_wait() should return.
441 timeout
= 0; /* Wait indefinetly for a message */
442 immediate_quit
= 1; /* Helps ability to QUIT */
447 MaxTime
= UDIWaitForever
;
448 UDIWait (MaxTime
, &PId
, &StopReason
);
449 QUIT
; /* Let user quit if they want */
451 switch (StopReason
& UDIGrossState
)
454 if (UDIGetStdout (sbuf
, (UDISizeT
) SBUF_MAX
, &CountDone
))
455 /* This is said to happen if the program tries to output
456 a whole bunch of output (more than SBUF_MAX, I would
457 guess). It doesn't seem to happen with the simulator. */
458 warning ("UDIGetStdout() failed in udi_wait");
459 fwrite (sbuf
, 1, CountDone
, stdout
);
460 gdb_flush (gdb_stdout
);
464 UDIGetStderr (sbuf
, (UDISizeT
) SBUF_MAX
, &CountDone
);
465 fwrite (sbuf
, 1, CountDone
, stderr
);
466 gdb_flush (gdb_stderr
);
480 while (i
< SBUF_MAX
&& ch
!= '\n');
481 UDIPutStdin (sbuf
, (UDISizeT
) i
, &CountDone
);
486 /* In spite of the fact that we told UDIWait to wait forever, it will
487 return spuriously sometimes. */
496 switch (StopReason
& UDIGrossState
)
499 printf_unfiltered ("Am290*0 received vector number %d\n", StopReason
>> 24);
501 switch ((StopReason
>> 8) & 0xff)
503 case 0: /* Illegal opcode */
504 printf_unfiltered (" (break point)\n");
505 status
->kind
= TARGET_WAITKIND_STOPPED
;
506 status
->value
.sig
= TARGET_SIGNAL_TRAP
;
508 case 1: /* Unaligned Access */
509 status
->kind
= TARGET_WAITKIND_STOPPED
;
510 status
->value
.sig
= TARGET_SIGNAL_BUS
;
514 status
->kind
= TARGET_WAITKIND_STOPPED
;
515 status
->value
.sig
= TARGET_SIGNAL_FPE
;
517 case 5: /* Protection Violation */
518 status
->kind
= TARGET_WAITKIND_STOPPED
;
519 /* Why not SEGV? What is a Protection Violation? */
520 status
->value
.sig
= TARGET_SIGNAL_ILL
;
524 case 8: /* User Instruction Mapping Miss */
525 case 9: /* User Data Mapping Miss */
526 case 10: /* Supervisor Instruction Mapping Miss */
527 case 11: /* Supervisor Data Mapping Miss */
528 status
->kind
= TARGET_WAITKIND_STOPPED
;
529 status
->value
.sig
= TARGET_SIGNAL_SEGV
;
533 status
->kind
= TARGET_WAITKIND_STOPPED
;
534 status
->value
.sig
= TARGET_SIGNAL_ILL
;
537 status
->kind
= TARGET_WAITKIND_STOPPED
;
538 status
->value
.sig
= TARGET_SIGNAL_ALRM
;
541 status
->kind
= TARGET_WAITKIND_STOPPED
;
542 status
->value
.sig
= TARGET_SIGNAL_TRAP
;
547 case 19: /* INTR3/Internal */
550 status
->kind
= TARGET_WAITKIND_STOPPED
;
551 status
->value
.sig
= TARGET_SIGNAL_INT
;
553 case 22: /* Floating-Point Exception */
554 status
->kind
= TARGET_WAITKIND_STOPPED
;
556 status
->value
.sig
= TARGET_SIGNAL_ILL
;
558 case 77: /* assert 77 */
559 status
->kind
= TARGET_WAITKIND_STOPPED
;
560 status
->value
.sig
= TARGET_SIGNAL_TRAP
;
563 status
->kind
= TARGET_WAITKIND_EXITED
;
564 status
->value
.integer
= 0;
567 case UDINotExecuting
:
568 status
->kind
= TARGET_WAITKIND_STOPPED
;
569 status
->value
.sig
= TARGET_SIGNAL_TERM
;
572 status
->kind
= TARGET_WAITKIND_STOPPED
;
573 status
->value
.sig
= TARGET_SIGNAL_TSTP
;
576 status
->kind
= TARGET_WAITKIND_STOPPED
;
577 status
->value
.sig
= TARGET_SIGNAL_URG
;
581 status
->kind
= TARGET_WAITKIND_STOPPED
;
582 status
->value
.sig
= TARGET_SIGNAL_TRAP
;
585 status
->kind
= TARGET_WAITKIND_STOPPED
;
586 status
->value
.sig
= TARGET_SIGNAL_STOP
;
589 status
->kind
= TARGET_WAITKIND_STOPPED
;
590 status
->value
.sig
= TARGET_SIGNAL_KILL
;
594 status
->kind
= TARGET_WAITKIND_EXITED
;
595 status
->value
.integer
= 0;
598 timeout
= old_timeout
; /* Restore original timeout value */
599 immediate_quit
= old_immediate_quit
;
604 /* Handy for debugging */
612 UDIBool HostEndian
= 0;
615 unsigned long myregs
[256];
618 From
.Space
= UDI29KPC
;
620 To
= (UDIUInt32
*) pc
;
623 err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
);
625 printf_unfiltered ("err = %d, CountDone = %d, pc[0] = 0x%x, pc[1] = 0x%x\n",
626 err
, CountDone
, pc
[0], pc
[1]);
628 udi_fetch_registers (-1);
630 printf_unfiltered ("other pc1 = 0x%x, pc0 = 0x%x\n", *(int *) ®isters
[4 * PC_REGNUM
],
631 *(int *) ®isters
[4 * NPC_REGNUM
]);
633 /* Now, read all the registers globally */
635 From
.Space
= UDI29KGlobalRegs
;
637 err
= UDIRead (From
, myregs
, 256, 4, &CountDone
, HostEndian
);
639 printf ("err = %d, CountDone = %d\n", err
, CountDone
);
643 for (i
= 0; i
< 256; i
+= 2)
644 printf ("%d:\t%#10x\t%11d\t%#10x\t%11d\n", i
, myregs
[i
], myregs
[i
],
645 myregs
[i
+ 1], myregs
[i
+ 1]);
652 /********************************************************** UDI_FETCH_REGISTERS
653 * Read a remote register 'regno'.
654 * If regno==-1 then read all the registers.
657 udi_fetch_registers (regno
)
665 UDIBool HostEndian
= 0;
671 fetch_register (regno
);
677 From
.Space
= UDI29KGlobalRegs
;
679 To
= (UDIUInt32
*) & registers
[4 * GR1_REGNUM
];
681 if (err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
682 error ("UDIRead() failed in udi_fetch_registers");
684 register_valid
[GR1_REGNUM
] = 1;
686 #if defined(GR64_REGNUM) /* Read gr64-127 */
688 /* Global Registers gr64-gr95 */
690 From
.Space
= UDI29KGlobalRegs
;
692 To
= (UDIUInt32
*) & registers
[4 * GR64_REGNUM
];
694 if (err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
695 error ("UDIRead() failed in udi_fetch_registers");
697 for (i
= GR64_REGNUM
; i
< GR64_REGNUM
+ 32; i
++)
698 register_valid
[i
] = 1;
700 #endif /* GR64_REGNUM */
702 /* Global Registers gr96-gr127 */
704 From
.Space
= UDI29KGlobalRegs
;
706 To
= (UDIUInt32
*) & registers
[4 * GR96_REGNUM
];
708 if (err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
709 error ("UDIRead() failed in udi_fetch_registers");
711 for (i
= GR96_REGNUM
; i
< GR96_REGNUM
+ 32; i
++)
712 register_valid
[i
] = 1;
714 /* Local Registers */
716 From
.Space
= UDI29KLocalRegs
;
718 To
= (UDIUInt32
*) & registers
[4 * LR0_REGNUM
];
720 if (err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
721 error ("UDIRead() failed in udi_fetch_registers");
723 for (i
= LR0_REGNUM
; i
< LR0_REGNUM
+ 128; i
++)
724 register_valid
[i
] = 1;
726 /* Protected Special Registers */
728 From
.Space
= UDI29KSpecialRegs
;
730 To
= (UDIUInt32
*) & registers
[4 * SR_REGNUM (0)];
732 if (err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
733 error ("UDIRead() failed in udi_fetch_registers");
735 for (i
= SR_REGNUM (0); i
< SR_REGNUM (0) + 15; i
++)
736 register_valid
[i
] = 1;
739 { /* Let regno_to_srnum() handle the register number */
740 fetch_register (NPC_REGNUM
);
741 fetch_register (PC_REGNUM
);
742 fetch_register (PC2_REGNUM
);
744 /* Unprotected Special Registers sr128-sr135 */
746 From
.Space
= UDI29KSpecialRegs
;
748 To
= (UDIUInt32
*) & registers
[4 * SR_REGNUM (128)];
749 Count
= 135 - 128 + 1;
750 if (err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
751 error ("UDIRead() failed in udi_fetch_registers");
753 for (i
= SR_REGNUM (128); i
< SR_REGNUM (128) + 135 - 128 + 1; i
++)
754 register_valid
[i
] = 1;
759 fprintf_unfiltered (gdb_stdlog
, "Fetching all registers\n");
760 fprintf_unfiltered (gdb_stdlog
,
761 "Fetching PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n",
762 read_register (NPC_REGNUM
),
763 read_register (PC_REGNUM
),
764 read_register (PC2_REGNUM
));
767 /* There doesn't seem to be any way to get these. */
770 supply_register (FPE_REGNUM
, (char *) &val
);
771 supply_register (INTE_REGNUM
, (char *) &val
);
772 supply_register (FPS_REGNUM
, (char *) &val
);
773 supply_register (EXO_REGNUM
, (char *) &val
);
778 /********************************************************* UDI_STORE_REGISTERS
779 ** Store register regno into the target.
780 * If regno==-1 then store all the registers.
784 udi_store_registers (regno
)
792 UDIBool HostEndian
= 0;
796 store_register (regno
);
802 fprintf_unfiltered (gdb_stdlog
, "Storing all registers\n");
803 fprintf_unfiltered (gdb_stdlog
,
804 "PC0 = 0x%x, PC1 = 0x%x, PC2 = 0x%x\n",
805 read_register (NPC_REGNUM
),
806 read_register (PC_REGNUM
),
807 read_register (PC2_REGNUM
));
812 From
= (UDIUInt32
*) & registers
[4 * GR1_REGNUM
];
813 To
.Space
= UDI29KGlobalRegs
;
816 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
817 error ("UDIWrite() failed in udi_store_regisetrs");
819 #if defined(GR64_REGNUM)
821 /* Global registers gr64-gr95 */
823 From
= (UDIUInt32
*) & registers
[4 * GR64_REGNUM
];
824 To
.Space
= UDI29KGlobalRegs
;
827 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
828 error ("UDIWrite() failed in udi_store_regisetrs");
830 #endif /* GR64_REGNUM */
832 /* Global registers gr96-gr127 */
834 From
= (UDIUInt32
*) & registers
[4 * GR96_REGNUM
];
835 To
.Space
= UDI29KGlobalRegs
;
838 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
839 error ("UDIWrite() failed in udi_store_regisetrs");
841 /* Local Registers */
843 From
= (UDIUInt32
*) & registers
[4 * LR0_REGNUM
];
844 To
.Space
= UDI29KLocalRegs
;
847 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
848 error ("UDIWrite() failed in udi_store_regisetrs");
851 /* Protected Special Registers *//* VAB through TMR */
853 From
= (UDIUInt32
*) & registers
[4 * SR_REGNUM (0)];
854 To
.Space
= UDI29KSpecialRegs
;
857 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
858 error ("UDIWrite() failed in udi_store_regisetrs");
860 /* PC0, PC1, PC2 possibly as shadow registers */
862 From
= (UDIUInt32
*) & registers
[4 * SR_REGNUM (10)];
863 To
.Space
= UDI29KSpecialRegs
;
866 To
.Offset
= 20; /* SPC0 */
868 To
.Offset
= 10; /* PC0 */
869 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
870 error ("UDIWrite() failed in udi_store_regisetrs");
872 /* PC1 via UDI29KPC */
874 From
= (UDIUInt32
*) & registers
[4 * PC_REGNUM
];
876 To
.Offset
= 0; /* PC1 */
878 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
879 error ("UDIWrite() failed in udi_store_regisetrs");
883 From
= (UDIUInt32
*) & registers
[4 * SR_REGNUM (13)];
884 To
.Space
= UDI29KSpecialRegs
;
887 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
888 error ("UDIWrite() failed in udi_store_regisetrs");
890 /* Unprotected Special Registers */
892 From
= (UDIUInt32
*) & registers
[4 * SR_REGNUM (128)];
893 To
.Space
= UDI29KSpecialRegs
;
895 Count
= 135 - 128 + 1;
896 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
897 error ("UDIWrite() failed in udi_store_regisetrs");
899 registers_changed ();
902 /****************************************************** UDI_PREPARE_TO_STORE */
903 /* Get ready to modify the registers array. On machines which store
904 individual registers, this doesn't need to do anything. On machines
905 which store all the registers in one fell swoop, this makes sure
906 that registers contains all the registers from the program being
910 udi_prepare_to_store ()
912 /* Do nothing, since we can store individual regs */
915 /********************************************************** TRANSLATE_ADDR */
917 translate_addr (addr
)
920 #if defined(ULTRA3) && defined(KERNEL_DEBUGGING)
921 /* Check for a virtual address in the kernel */
922 /* Assume physical address of ublock is in paddr_u register */
923 /* FIXME: doesn't work for user virtual addresses */
926 /* PADDR_U register holds the physical address of the ublock */
927 CORE_ADDR i
= (CORE_ADDR
) read_register (PADDR_U_REGNUM
);
928 return (i
+ addr
- (CORE_ADDR
) UVADDR
);
938 /************************************************* UDI_XFER_INFERIOR_MEMORY */
939 /* FIXME! Merge these two. */
941 udi_xfer_inferior_memory (memaddr
, myaddr
, len
, write
)
948 memaddr
= translate_addr (memaddr
);
951 return udi_write_inferior_memory (memaddr
, myaddr
, len
);
953 return udi_read_inferior_memory (memaddr
, myaddr
, len
);
956 /********************************************************** UDI_FILES_INFO */
960 printf_unfiltered ("\tAttached to UDI socket to %s", udi_config_id
);
961 if (prog_name
!= NULL
)
962 printf_unfiltered ("and running program %s", prog_name
);
963 printf_unfiltered (".\n");
966 /**************************************************** UDI_INSERT_BREAKPOINT */
968 udi_insert_breakpoint (addr
, contents_cache
)
970 char *contents_cache
;
975 for (cnt
= 0; cnt
< BKPT_TABLE_SIZE
; cnt
++)
976 if (bkpt_table
[cnt
].Type
== 0) /* Find first free slot */
979 if (cnt
>= BKPT_TABLE_SIZE
)
980 error ("Too many breakpoints set");
982 bkpt_table
[cnt
].Addr
.Offset
= addr
;
983 bkpt_table
[cnt
].Addr
.Space
= UDI29KIRAMSpace
;
984 bkpt_table
[cnt
].PassCount
= 1;
985 bkpt_table
[cnt
].Type
= UDIBreakFlagExecute
;
987 err
= UDISetBreakpoint (bkpt_table
[cnt
].Addr
,
988 bkpt_table
[cnt
].PassCount
,
989 bkpt_table
[cnt
].Type
,
990 &bkpt_table
[cnt
].BreakId
);
993 return 0; /* Success */
995 bkpt_table
[cnt
].Type
= 0;
996 error ("UDISetBreakpoint returned error code %d\n", err
);
999 /**************************************************** UDI_REMOVE_BREAKPOINT */
1001 udi_remove_breakpoint (addr
, contents_cache
)
1003 char *contents_cache
;
1008 for (cnt
= 0; cnt
< BKPT_TABLE_SIZE
; cnt
++)
1009 if (bkpt_table
[cnt
].Addr
.Offset
== addr
) /* Find matching breakpoint */
1012 if (cnt
>= BKPT_TABLE_SIZE
)
1013 error ("Can't find breakpoint in table");
1015 bkpt_table
[cnt
].Type
= 0;
1017 err
= UDIClearBreakpoint (bkpt_table
[cnt
].BreakId
);
1019 return 0; /* Success */
1021 error ("UDIClearBreakpoint returned error code %d\n", err
);
1025 udi_kill (arg
, from_tty
)
1032 UDIStop does not really work as advertised. It causes the TIP to close it's
1033 connection, which usually results in GDB dying with a SIGPIPE. For now, we
1034 just invoke udi_close, which seems to get things right.
1038 udi_session_id
= -1;
1042 printf_unfiltered ("Target has been stopped.");
1049 /* Keep the target around, e.g. so "run" can do the right thing when
1050 we are already debugging something. */
1052 if (UDIDisconnect (udi_session_id
, UDITerminateSession
))
1054 warning ("UDIDisconnect() failed");
1057 /* Do not try to close udi_session_id again, later in the program. */
1058 udi_session_id
= -1;
1063 Load a program into the target. Args are: `program {options}'. The options
1064 are used to control loading of the program, and are NOT passed onto the
1065 loaded code as arguments. (You need to use the `run' command to do that.)
1068 -ms %d Set mem stack size to %d
1069 -rs %d Set regular stack size to %d
1070 -i send init info (default)
1071 -noi don't send init info
1072 -[tT] Load Text section
1073 -[dD] Load Data section
1074 -[bB] Load BSS section
1075 -[lL] Load Lit section
1079 download (load_arg_string
, from_tty
)
1080 char *load_arg_string
;
1083 #define DEFAULT_MEM_STACK_SIZE 0x6000
1084 #define DEFAULT_REG_STACK_SIZE 0x2000
1091 int load_text
= 1, load_data
= 1, load_bss
= 1, load_lit
= 1;
1093 address_ranges
[0].Space
= UDI29KIRAMSpace
;
1094 address_ranges
[0].Offset
= 0xffffffff;
1095 address_ranges
[0].Size
= 0;
1097 address_ranges
[1].Space
= UDI29KDRAMSpace
;
1098 address_ranges
[1].Offset
= 0xffffffff;
1099 address_ranges
[1].Size
= 0;
1101 stack_sizes
[0] = DEFAULT_REG_STACK_SIZE
;
1102 stack_sizes
[1] = DEFAULT_MEM_STACK_SIZE
;
1106 filename
= strtok (load_arg_string
, " \t");
1108 error ("Must specify at least a file name with the load command");
1110 filename
= tilde_expand (filename
);
1111 make_cleanup (free
, filename
);
1113 while (token
= strtok (NULL
, " \t"))
1115 if (token
[0] == '-')
1119 if (STREQ (token
, "ms"))
1120 stack_sizes
[1] = atol (strtok (NULL
, " \t"));
1121 else if (STREQ (token
, "rs"))
1122 stack_sizes
[0] = atol (strtok (NULL
, " \t"));
1125 load_text
= load_data
= load_bss
= load_lit
= 0;
1148 error ("Unknown UDI load option -%s", token
- 1);
1155 pbfd
= bfd_openr (filename
, gnutarget
);
1158 /* FIXME: should be using bfd_errmsg, not assuming it was
1159 bfd_error_system_call. */
1160 perror_with_name (filename
);
1162 /* FIXME: should be checking for errors from bfd_close (for one thing,
1163 on error it does not free all the storage associated with the
1165 make_cleanup_bfd_close (pbfd
);
1170 if (!bfd_check_format (pbfd
, bfd_object
))
1171 error ("It doesn't seem to be an object file");
1173 for (section
= pbfd
->sections
; section
; section
= section
->next
)
1175 if (bfd_get_section_flags (pbfd
, section
) & SEC_ALLOC
)
1179 unsigned long section_size
, section_end
;
1180 const char *section_name
;
1182 section_name
= bfd_get_section_name (pbfd
, section
);
1183 if (STREQ (section_name
, ".text") && !load_text
)
1185 else if (STREQ (section_name
, ".data") && !load_data
)
1187 else if (STREQ (section_name
, ".bss") && !load_bss
)
1189 else if (STREQ (section_name
, ".lit") && !load_lit
)
1192 To
.Offset
= bfd_get_section_vma (pbfd
, section
);
1193 section_size
= bfd_section_size (pbfd
, section
);
1194 section_end
= To
.Offset
+ section_size
;
1196 if (section_size
== 0)
1197 /* This is needed at least in the BSS case, where the code
1198 below starts writing before it even checks the size. */
1201 printf_unfiltered ("[Loading section %s at %x (%d bytes)]\n",
1206 if (bfd_get_section_flags (pbfd
, section
) & SEC_CODE
)
1208 To
.Space
= UDI29KIRAMSpace
;
1210 address_ranges
[0].Offset
= min (address_ranges
[0].Offset
,
1212 address_ranges
[0].Size
= max (address_ranges
[0].Size
,
1214 - address_ranges
[0].Offset
);
1218 To
.Space
= UDI29KDRAMSpace
;
1220 address_ranges
[1].Offset
= min (address_ranges
[1].Offset
,
1222 address_ranges
[1].Size
= max (address_ranges
[1].Size
,
1224 - address_ranges
[1].Offset
);
1227 if (bfd_get_section_flags (pbfd
, section
) & SEC_LOAD
) /* Text, data or lit */
1233 while (section_size
> 0)
1237 Count
= min (section_size
, 1024);
1239 bfd_get_section_contents (pbfd
, section
, buffer
, fptr
,
1242 err
= UDIWrite ((UDIHostMemPtr
) buffer
, /* From */
1245 (UDISizeT
) 1, /* Size */
1246 &Count
, /* CountDone */
1247 (UDIBool
) 0); /* HostEndian */
1249 error ("UDIWrite failed, error = %d", err
);
1253 section_size
-= Count
;
1260 unsigned long zero
= 0;
1262 /* Write a zero byte at the vma */
1263 /* FIXME: Broken for sections of 1-3 bytes (we test for
1265 err
= UDIWrite ((UDIHostMemPtr
) & zero
, /* From */
1267 (UDICount
) 1, /* Count */
1268 (UDISizeT
) 4, /* Size */
1269 &Count
, /* CountDone */
1270 (UDIBool
) 0); /* HostEndian */
1272 error ("UDIWrite failed, error = %d", err
);
1277 /* Now, duplicate it for the length of the BSS */
1278 err
= UDICopy (From
, /* From */
1280 (UDICount
) (section_size
/ 4 - 1), /* Count */
1281 (UDISizeT
) 4, /* Size */
1282 &Count
, /* CountDone */
1283 (UDIBool
) 1); /* Direction */
1289 xerr
= UDIGetErrorMsg (err
, 100, message
, &Count
);
1291 fprintf_unfiltered (gdb_stderr
, "Error is %s\n", message
);
1293 fprintf_unfiltered (gdb_stderr
, "xerr is %d\n", xerr
);
1294 error ("UDICopy failed, error = %d", err
);
1301 entry
.Space
= UDI29KIRAMSpace
;
1302 entry
.Offset
= bfd_get_start_address (pbfd
);
1307 /* Function to download an image into the remote target. */
1310 udi_load (args
, from_tty
)
1314 download (args
, from_tty
);
1316 /* As a convenience, pick up any symbol info that is in the program
1317 being loaded. Note that we assume that the program is the``mainline'';
1318 if this is not always true, then this code will need to be augmented. */
1319 symbol_file_add (strtok (args
, " \t"), from_tty
, NULL
, 1, 0);
1321 /* Getting new symbols may change our opinion about what is
1323 reinit_frame_cache ();
1326 /*************************************************** UDI_WRITE_INFERIOR_MEMORY
1327 ** Copy LEN bytes of data from debugger memory at MYADDR
1328 to inferior's memory at MEMADDR. Returns number of bytes written. */
1330 udi_write_inferior_memory (memaddr
, myaddr
, len
)
1340 UDICount CountDone
= 0;
1341 UDIBool HostEndian
= 0;
1343 To
.Space
= udi_memory_space (memaddr
);
1344 From
= (UDIUInt32
*) myaddr
;
1346 while (nwritten
< len
)
1348 Count
= len
- nwritten
;
1349 if (Count
> MAXDATA
)
1351 To
.Offset
= memaddr
+ nwritten
;
1352 if (UDIWrite (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
1354 error ("UDIWrite() failed in udi_write_inferior_memory");
1359 nwritten
+= CountDone
;
1366 /**************************************************** UDI_READ_INFERIOR_MEMORY
1367 ** Read LEN bytes from inferior memory at MEMADDR. Put the result
1368 at debugger address MYADDR. Returns number of bytes read. */
1370 udi_read_inferior_memory (memaddr
, myaddr
, len
)
1380 UDICount CountDone
= 0;
1381 UDIBool HostEndian
= 0;
1384 From
.Space
= udi_memory_space (memaddr
);
1385 To
= (UDIUInt32
*) myaddr
;
1389 Count
= len
- nread
;
1390 if (Count
> MAXDATA
)
1392 From
.Offset
= memaddr
+ nread
;
1393 if (err
= UDIRead (From
, To
, Count
, Size
, &CountDone
, HostEndian
))
1395 error ("UDIRead() failed in udi_read_inferior_memory");
1407 /********************************************************************* WARNING
1412 error ("ERROR while loading program into remote TIP: $d\n", num
);
1416 /*****************************************************************************/
1417 /* Fetch a single register indicatated by 'regno'.
1418 * Returns 0/-1 on success/failure.
1421 fetch_register (regno
)
1429 UDIBool HostEndian
= 0;
1433 if (regno
== GR1_REGNUM
)
1435 From
.Space
= UDI29KGlobalRegs
;
1438 else if (regno
>= GR96_REGNUM
&& regno
< GR96_REGNUM
+ 32)
1440 From
.Space
= UDI29KGlobalRegs
;
1441 From
.Offset
= (regno
- GR96_REGNUM
) + 96;;
1444 #if defined(GR64_REGNUM)
1446 else if (regno
>= GR64_REGNUM
&& regno
< GR64_REGNUM
+ 32)
1448 From
.Space
= UDI29KGlobalRegs
;
1449 From
.Offset
= (regno
- GR64_REGNUM
) + 64;
1452 #endif /* GR64_REGNUM */
1454 else if (regno
>= LR0_REGNUM
&& regno
< LR0_REGNUM
+ 128)
1456 From
.Space
= UDI29KLocalRegs
;
1457 From
.Offset
= (regno
- LR0_REGNUM
);
1459 else if (regno
>= FPE_REGNUM
&& regno
<= EXO_REGNUM
)
1462 /*supply_register(160 + (regno - FPE_REGNUM),(char *) &val); */
1463 supply_register (regno
, (char *) &val
);
1464 return; /* Pretend Success */
1468 From
.Space
= UDI29KSpecialRegs
;
1469 From
.Offset
= regnum_to_srnum (regno
);
1472 if (err
= UDIRead (From
, &To
, Count
, Size
, &CountDone
, HostEndian
))
1473 error ("UDIRead() failed in udi_fetch_registers");
1475 supply_register (regno
, (char *) &To
);
1478 fprintf_unfiltered (gdb_stdlog
, "Fetching register %s = 0x%x\n",
1479 REGISTER_NAME (regno
), To
);
1481 /*****************************************************************************/
1482 /* Store a single register indicated by 'regno'.
1483 * Returns 0/-1 on success/failure.
1486 store_register (regno
)
1495 UDIBool HostEndian
= 0;
1497 From
= read_register (regno
); /* get data value */
1500 fprintf_unfiltered (gdb_stdlog
, "Storing register %s = 0x%x\n",
1501 REGISTER_NAME (regno
), From
);
1503 if (regno
== GR1_REGNUM
)
1505 To
.Space
= UDI29KGlobalRegs
;
1507 result
= UDIWrite (&From
, To
, Count
, Size
, &CountDone
, HostEndian
);
1508 /* Setting GR1 changes the numbers of all the locals, so invalidate the
1509 * register cache. Do this *after* calling read_register, because we want
1510 * read_register to return the value that write_register has just stuffed
1511 * into the registers array, not the value of the register fetched from
1514 registers_changed ();
1516 #if defined(GR64_REGNUM)
1517 else if (regno
>= GR64_REGNUM
&& regno
< GR64_REGNUM
+ 32)
1519 To
.Space
= UDI29KGlobalRegs
;
1520 To
.Offset
= (regno
- GR64_REGNUM
) + 64;
1521 result
= UDIWrite (&From
, To
, Count
, Size
, &CountDone
, HostEndian
);
1523 #endif /* GR64_REGNUM */
1524 else if (regno
>= GR96_REGNUM
&& regno
< GR96_REGNUM
+ 32)
1526 To
.Space
= UDI29KGlobalRegs
;
1527 To
.Offset
= (regno
- GR96_REGNUM
) + 96;
1528 result
= UDIWrite (&From
, To
, Count
, Size
, &CountDone
, HostEndian
);
1530 else if (regno
>= LR0_REGNUM
&& regno
< LR0_REGNUM
+ 128)
1532 To
.Space
= UDI29KLocalRegs
;
1533 To
.Offset
= (regno
- LR0_REGNUM
);
1534 result
= UDIWrite (&From
, To
, Count
, Size
, &CountDone
, HostEndian
);
1536 else if (regno
>= FPE_REGNUM
&& regno
<= EXO_REGNUM
)
1537 return 0; /* Pretend Success */
1538 else if (regno
== PC_REGNUM
)
1540 /* PC1 via UDI29KPC */
1542 To
.Space
= UDI29KPC
;
1543 To
.Offset
= 0; /* PC1 */
1544 result
= UDIWrite (&From
, To
, Count
, Size
, &CountDone
, HostEndian
);
1546 /* Writing to this loc actually changes the values of pc0 & pc1 */
1548 register_valid
[PC_REGNUM
] = 0; /* pc1 */
1549 register_valid
[NPC_REGNUM
] = 0; /* pc0 */
1552 /* An unprotected or protected special register */
1554 To
.Space
= UDI29KSpecialRegs
;
1555 To
.Offset
= regnum_to_srnum (regno
);
1556 result
= UDIWrite (&From
, To
, Count
, Size
, &CountDone
, HostEndian
);
1560 error ("UDIWrite() failed in store_registers");
1564 /********************************************************** REGNUM_TO_SRNUM */
1566 * Convert a gdb special register number to a 29000 special register number.
1569 regnum_to_srnum (regno
)
1595 return (USE_SHADOW_PC
? (20) : (10));
1597 return (USE_SHADOW_PC
? (21) : (11));
1599 return (USE_SHADOW_PC
? (22) : (12));
1629 return (255); /* Failure ? */
1632 /****************************************************************************/
1634 * Determine the Target memory space qualifier based on the addr.
1635 * FIXME: Can't distinguis I_ROM/D_ROM.
1636 * FIXME: Doesn't know anything about I_CACHE/D_CACHE.
1639 udi_memory_space (addr
)
1642 UDIUInt32 tstart
= IMemStart
;
1643 UDIUInt32 tend
= tstart
+ IMemSize
;
1644 UDIUInt32 dstart
= DMemStart
;
1645 UDIUInt32 dend
= tstart
+ DMemSize
;
1646 UDIUInt32 rstart
= RMemStart
;
1647 UDIUInt32 rend
= tstart
+ RMemSize
;
1649 if (((UDIUInt32
) addr
>= tstart
) && ((UDIUInt32
) addr
< tend
))
1651 return UDI29KIRAMSpace
;
1653 else if (((UDIUInt32
) addr
>= dstart
) && ((UDIUInt32
) addr
< dend
))
1655 return UDI29KDRAMSpace
;
1657 else if (((UDIUInt32
) addr
>= rstart
) && ((UDIUInt32
) addr
< rend
))
1659 /* FIXME: how do we determine between D_ROM and I_ROM */
1660 return UDI29KIROMSpace
;
1662 else /* FIXME: what do me do now? */
1663 return UDI29KDRAMSpace
; /* Hmmm! */
1665 /*********************************************************************** STUBS
1676 struct ui_file
*EchoFile
= 0; /* used for debugging */
1677 int QuietMode
= 0; /* used for debugging */
1679 #ifdef NO_HIF_SUPPORT
1683 return (0); /* Emulate a failure */
1687 /* Target_ops vector. Not static because there does not seem to be
1688 any portable way to do a forward declaration of a static variable.
1689 The RS/6000 doesn't like "extern" followed by "static"; SunOS
1690 /bin/cc doesn't like "static" twice. */
1692 struct target_ops udi_ops
;
1697 udi_ops
.to_shortname
= "udi";
1698 udi_ops
.to_longname
= "Remote UDI connected TIP";
1699 udi_ops
.to_doc
= "Remote debug an AMD 29k using UDI socket connection to TIP process.\n\
1701 `configuration-id AF_INET hostname port-number'\n\
1702 To connect via the network, where hostname and port-number specify the\n\
1703 host and port where you can connect via UDI.\n\
1704 configuration-id is unused.\n\
1706 `configuration-id AF_UNIX socket-name tip-program'\n\
1707 To connect using a local connection to the \"tip.exe\" program which is\n\
1708 supplied by AMD. If socket-name specifies an AF_UNIX socket then the\n\
1709 tip program must already be started; connect to it using that socket.\n\
1710 If not, start up tip-program, which should be the name of the tip\n\
1711 program. If appropriate, the PATH environment variable is searched.\n\
1712 configuration-id is unused.\n\
1714 `configuration-id'\n\
1715 Look up the configuration in ./udi_soc or /etc/udi_soc, which\n\
1716 are files containing lines in the above formats. configuration-id is\n\
1717 used to pick which line of the file to use.";
1718 udi_ops
.to_open
= udi_open
;
1719 udi_ops
.to_close
= udi_close
;
1720 udi_ops
.to_attach
= udi_attach
;
1721 udi_ops
.to_detach
= udi_detach
;
1722 udi_ops
.to_resume
= udi_resume
;
1723 udi_ops
.to_wait
= udi_wait
;
1724 udi_ops
.to_fetch_registers
= udi_fetch_registers
;
1725 udi_ops
.to_store_registers
= udi_store_registers
;
1726 udi_ops
.to_prepare_to_store
= udi_prepare_to_store
;
1727 udi_ops
.to_xfer_memory
= udi_xfer_inferior_memory
;
1728 udi_ops
.to_files_info
= udi_files_info
;
1729 udi_ops
.to_insert_breakpoint
= udi_insert_breakpoint
;
1730 udi_ops
.to_remove_breakpoint
= udi_remove_breakpoint
;
1731 udi_ops
.to_terminal_init
= 0;
1732 udi_ops
.to_terminal_inferior
= 0;
1733 udi_ops
.to_terminal_ours_for_output
= 0;
1734 udi_ops
.to_terminal_ours
= 0;
1735 udi_ops
.to_terminal_info
= 0;
1736 udi_ops
.to_kill
= udi_kill
;
1737 udi_ops
.to_load
= udi_load
;
1738 udi_ops
.to_lookup_symbol
= 0;
1739 udi_ops
.to_create_inferior
= udi_create_inferior
;
1740 udi_ops
.to_mourn_inferior
= udi_mourn
;
1741 udi_ops
.to_can_run
= 0;
1742 udi_ops
.to_notice_signals
= 0;
1743 udi_ops
.to_thread_alive
= 0;
1744 udi_ops
.to_stop
= 0;
1745 udi_ops
.to_stratum
= process_stratum
;
1746 udi_ops
.DONT_USE
= 0;
1747 udi_ops
.to_has_all_memory
= 1;
1748 udi_ops
.to_has_memory
= 1;
1749 udi_ops
.to_has_stack
= 1;
1750 udi_ops
.to_has_registers
= 1;
1751 udi_ops
.to_has_execution
= 1;
1752 udi_ops
.to_sections
= 0;
1753 udi_ops
.to_sections_end
= 0;
1754 udi_ops
.to_magic
= OPS_MAGIC
;
1758 _initialize_remote_udi ()
1761 add_target (&udi_ops
);