2001-04-06 David Smith <dsmith@redhat.com>
[deliverable/binutils-gdb.git] / gdb / arch-utils.c
1 /* Dynamic architecture support for GDB, the GNU debugger.
2 Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
20
21 #include "defs.h"
22
23 #if GDB_MULTI_ARCH
24 #include "gdbcmd.h"
25 #include "inferior.h" /* enum CALL_DUMMY_LOCATION et.al. */
26 #else
27 /* Just include everything in sight so that the every old definition
28 of macro is visible. */
29 #include "gdb_string.h"
30 #include "symtab.h"
31 #include "frame.h"
32 #include "inferior.h"
33 #include "breakpoint.h"
34 #include "gdb_wait.h"
35 #include "gdbcore.h"
36 #include "gdbcmd.h"
37 #include "target.h"
38 #include "annotate.h"
39 #endif
40
41 #include "version.h"
42
43 #include "floatformat.h"
44
45 /* Use the program counter to determine the contents and size
46 of a breakpoint instruction. If no target-dependent macro
47 BREAKPOINT_FROM_PC has been defined to implement this function,
48 assume that the breakpoint doesn't depend on the PC, and
49 use the values of the BIG_BREAKPOINT and LITTLE_BREAKPOINT macros.
50 Return a pointer to a string of bytes that encode a breakpoint
51 instruction, stores the length of the string to *lenptr,
52 and optionally adjust the pc to point to the correct memory location
53 for inserting the breakpoint. */
54
55 unsigned char *
56 legacy_breakpoint_from_pc (CORE_ADDR * pcptr, int *lenptr)
57 {
58 /* {BIG_,LITTLE_}BREAKPOINT is the sequence of bytes we insert for a
59 breakpoint. On some machines, breakpoints are handled by the
60 target environment and we don't have to worry about them here. */
61 #ifdef BIG_BREAKPOINT
62 if (TARGET_BYTE_ORDER == BIG_ENDIAN)
63 {
64 static unsigned char big_break_insn[] = BIG_BREAKPOINT;
65 *lenptr = sizeof (big_break_insn);
66 return big_break_insn;
67 }
68 #endif
69 #ifdef LITTLE_BREAKPOINT
70 if (TARGET_BYTE_ORDER != BIG_ENDIAN)
71 {
72 static unsigned char little_break_insn[] = LITTLE_BREAKPOINT;
73 *lenptr = sizeof (little_break_insn);
74 return little_break_insn;
75 }
76 #endif
77 #ifdef BREAKPOINT
78 {
79 static unsigned char break_insn[] = BREAKPOINT;
80 *lenptr = sizeof (break_insn);
81 return break_insn;
82 }
83 #endif
84 *lenptr = 0;
85 return NULL;
86 }
87
88 int
89 generic_frameless_function_invocation_not (struct frame_info *fi)
90 {
91 return 0;
92 }
93
94 int
95 generic_return_value_on_stack_not (struct type *type)
96 {
97 return 0;
98 }
99
100 char *
101 legacy_register_name (int i)
102 {
103 #ifdef REGISTER_NAMES
104 static char *names[] = REGISTER_NAMES;
105 if (i < 0 || i >= (sizeof (names) / sizeof (*names)))
106 return NULL;
107 else
108 return names[i];
109 #else
110 internal_error (__FILE__, __LINE__,
111 "legacy_register_name: called.");
112 return NULL;
113 #endif
114 }
115
116 #if defined (CALL_DUMMY)
117 LONGEST legacy_call_dummy_words[] = CALL_DUMMY;
118 #else
119 LONGEST legacy_call_dummy_words[1];
120 #endif
121 int legacy_sizeof_call_dummy_words = sizeof (legacy_call_dummy_words);
122
123 void
124 generic_remote_translate_xfer_address (CORE_ADDR gdb_addr, int gdb_len,
125 CORE_ADDR * rem_addr, int *rem_len)
126 {
127 *rem_addr = gdb_addr;
128 *rem_len = gdb_len;
129 }
130
131 int
132 generic_prologue_frameless_p (CORE_ADDR ip)
133 {
134 #ifdef SKIP_PROLOGUE_FRAMELESS_P
135 return ip == SKIP_PROLOGUE_FRAMELESS_P (ip);
136 #else
137 return ip == SKIP_PROLOGUE (ip);
138 #endif
139 }
140
141
142 /* Helper functions for INNER_THAN */
143
144 int
145 core_addr_lessthan (CORE_ADDR lhs, CORE_ADDR rhs)
146 {
147 return (lhs < rhs);
148 }
149
150 int
151 core_addr_greaterthan (CORE_ADDR lhs, CORE_ADDR rhs)
152 {
153 return (lhs > rhs);
154 }
155
156
157 /* Helper functions for TARGET_{FLOAT,DOUBLE}_FORMAT */
158
159 const struct floatformat *
160 default_float_format (struct gdbarch *gdbarch)
161 {
162 #if GDB_MULTI_ARCH
163 int byte_order = gdbarch_byte_order (gdbarch);
164 #else
165 int byte_order = TARGET_BYTE_ORDER;
166 #endif
167 switch (byte_order)
168 {
169 case BIG_ENDIAN:
170 return &floatformat_ieee_single_big;
171 case LITTLE_ENDIAN:
172 return &floatformat_ieee_single_little;
173 default:
174 internal_error (__FILE__, __LINE__,
175 "default_float_format: bad byte order");
176 }
177 }
178
179
180 const struct floatformat *
181 default_double_format (struct gdbarch *gdbarch)
182 {
183 #if GDB_MULTI_ARCH
184 int byte_order = gdbarch_byte_order (gdbarch);
185 #else
186 int byte_order = TARGET_BYTE_ORDER;
187 #endif
188 switch (byte_order)
189 {
190 case BIG_ENDIAN:
191 return &floatformat_ieee_double_big;
192 case LITTLE_ENDIAN:
193 return &floatformat_ieee_double_little;
194 default:
195 internal_error (__FILE__, __LINE__,
196 "default_double_format: bad byte order");
197 }
198 }
199
200 /* Misc helper functions for targets. */
201
202 int
203 frame_num_args_unknown (struct frame_info *fi)
204 {
205 return -1;
206 }
207
208
209 int
210 generic_register_convertible_not (int num)
211 {
212 return 0;
213 }
214
215
216 int
217 default_register_sim_regno (int num)
218 {
219 return num;
220 }
221
222
223 CORE_ADDR
224 default_convert_from_func_ptr_addr (CORE_ADDR addr)
225 {
226 return addr;
227 }
228
229 int
230 no_op_reg_to_regnum (int reg)
231 {
232 return reg;
233 }
234
235 /* For use by frame_args_address and frame_locals_address. */
236 CORE_ADDR
237 default_frame_address (struct frame_info *fi)
238 {
239 return fi->frame;
240 }
241
242 /* Default prepare_to_procced(). */
243 int
244 default_prepare_to_proceed (int select_it)
245 {
246 return 0;
247 }
248
249 /* Generic prepare_to_proceed(). This one should be suitable for most
250 targets that support threads. */
251 int
252 generic_prepare_to_proceed (int select_it)
253 {
254 int wait_pid;
255 struct target_waitstatus wait_status;
256
257 /* Get the last target status returned by target_wait(). */
258 get_last_target_status (&wait_pid, &wait_status);
259
260 /* Make sure we were stopped at a breakpoint. */
261 if (wait_status.kind != TARGET_WAITKIND_STOPPED
262 || wait_status.value.sig != TARGET_SIGNAL_TRAP)
263 {
264 return 0;
265 }
266
267 if (wait_pid != -1 && inferior_pid != wait_pid)
268 {
269 /* Switched over from WAIT_PID. */
270 CORE_ADDR wait_pc = read_pc_pid (wait_pid);
271
272 /* Avoid switching where it wouldn't do any good, i.e. if both
273 threads are at the same breakpoint. */
274 if (wait_pc != read_pc () && breakpoint_here_p (wait_pc))
275 {
276 if (select_it)
277 {
278 /* User hasn't deleted the breakpoint. Switch back to
279 WAIT_PID and return non-zero. */
280 inferior_pid = wait_pid;
281
282 /* FIXME: This stuff came from switch_to_thread() in
283 thread.c (which should probably be a public function). */
284 flush_cached_frames ();
285 registers_changed ();
286 stop_pc = wait_pc;
287 select_frame (get_current_frame (), 0);
288 }
289
290 return 1;
291 }
292 }
293 return 0;
294
295 }
296
297 /* Functions to manipulate the endianness of the target. */
298
299 #ifdef TARGET_BYTE_ORDER_SELECTABLE
300 /* compat - Catch old targets that expect a selectable byte-order to
301 default to BIG_ENDIAN */
302 #ifndef TARGET_BYTE_ORDER_DEFAULT
303 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN
304 #endif
305 #endif
306 #if !TARGET_BYTE_ORDER_SELECTABLE_P
307 #ifndef TARGET_BYTE_ORDER_DEFAULT
308 /* compat - Catch old non byte-order selectable targets that do not
309 define TARGET_BYTE_ORDER_DEFAULT and instead expect
310 TARGET_BYTE_ORDER to be used as the default. For targets that
311 defined neither TARGET_BYTE_ORDER nor TARGET_BYTE_ORDER_DEFAULT the
312 below will get a strange compiler warning. */
313 #define TARGET_BYTE_ORDER_DEFAULT TARGET_BYTE_ORDER
314 #endif
315 #endif
316 #ifndef TARGET_BYTE_ORDER_DEFAULT
317 #define TARGET_BYTE_ORDER_DEFAULT BIG_ENDIAN /* arbitrary */
318 #endif
319 /* ``target_byte_order'' is only used when non- multi-arch.
320 Multi-arch targets obtain the current byte order using
321 TARGET_BYTE_ORDER which is controlled by gdbarch.*. */
322 int target_byte_order = TARGET_BYTE_ORDER_DEFAULT;
323 int target_byte_order_auto = 1;
324
325 static const char endian_big[] = "big";
326 static const char endian_little[] = "little";
327 static const char endian_auto[] = "auto";
328 static const char *endian_enum[] =
329 {
330 endian_big,
331 endian_little,
332 endian_auto,
333 NULL,
334 };
335 static const char *set_endian_string;
336
337 /* Called by ``show endian''. */
338
339 static void
340 show_endian (char *args, int from_tty)
341 {
342 if (TARGET_BYTE_ORDER_AUTO)
343 printf_unfiltered ("The target endianness is set automatically (currently %s endian)\n",
344 (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
345 else
346 printf_unfiltered ("The target is assumed to be %s endian\n",
347 (TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little"));
348 }
349
350 static void
351 set_endian (char *ignore_args, int from_tty, struct cmd_list_element *c)
352 {
353 if (!TARGET_BYTE_ORDER_SELECTABLE_P)
354 {
355 printf_unfiltered ("Byte order is not selectable.");
356 }
357 else if (set_endian_string == endian_auto)
358 {
359 target_byte_order_auto = 1;
360 }
361 else if (set_endian_string == endian_little)
362 {
363 target_byte_order_auto = 0;
364 if (GDB_MULTI_ARCH)
365 {
366 struct gdbarch_info info;
367 memset (&info, 0, sizeof info);
368 info.byte_order = LITTLE_ENDIAN;
369 if (! gdbarch_update_p (info))
370 {
371 printf_unfiltered ("Little endian target not supported by GDB\n");
372 }
373 }
374 else
375 {
376 target_byte_order = LITTLE_ENDIAN;
377 }
378 }
379 else if (set_endian_string == endian_big)
380 {
381 target_byte_order_auto = 0;
382 if (GDB_MULTI_ARCH)
383 {
384 struct gdbarch_info info;
385 memset (&info, 0, sizeof info);
386 info.byte_order = BIG_ENDIAN;
387 if (! gdbarch_update_p (info))
388 {
389 printf_unfiltered ("Big endian target not supported by GDB\n");
390 }
391 }
392 else
393 {
394 target_byte_order = BIG_ENDIAN;
395 }
396 }
397 else
398 internal_error (__FILE__, __LINE__,
399 "set_endian: bad value");
400 show_endian (NULL, from_tty);
401 }
402
403 /* Set the endianness from a BFD. */
404
405 static void
406 set_endian_from_file (bfd *abfd)
407 {
408 if (GDB_MULTI_ARCH)
409 internal_error (__FILE__, __LINE__,
410 "set_endian_from_file: not for multi-arch");
411 if (TARGET_BYTE_ORDER_SELECTABLE_P)
412 {
413 int want;
414
415 if (bfd_big_endian (abfd))
416 want = BIG_ENDIAN;
417 else
418 want = LITTLE_ENDIAN;
419 if (TARGET_BYTE_ORDER_AUTO)
420 target_byte_order = want;
421 else if (TARGET_BYTE_ORDER != want)
422 warning ("%s endian file does not match %s endian target.",
423 want == BIG_ENDIAN ? "big" : "little",
424 TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
425 }
426 else
427 {
428 if (bfd_big_endian (abfd)
429 ? TARGET_BYTE_ORDER != BIG_ENDIAN
430 : TARGET_BYTE_ORDER == BIG_ENDIAN)
431 warning ("%s endian file does not match %s endian target.",
432 bfd_big_endian (abfd) ? "big" : "little",
433 TARGET_BYTE_ORDER == BIG_ENDIAN ? "big" : "little");
434 }
435 }
436
437
438 /* Functions to manipulate the architecture of the target */
439
440 enum set_arch { set_arch_auto, set_arch_manual };
441
442 int target_architecture_auto = 1;
443
444 const char *set_architecture_string;
445
446 /* Old way of changing the current architecture. */
447
448 extern const struct bfd_arch_info bfd_default_arch_struct;
449 const struct bfd_arch_info *target_architecture = &bfd_default_arch_struct;
450 int (*target_architecture_hook) (const struct bfd_arch_info *ap);
451
452 static int
453 arch_ok (const struct bfd_arch_info *arch)
454 {
455 if (GDB_MULTI_ARCH)
456 internal_error (__FILE__, __LINE__,
457 "arch_ok: not multi-arched");
458 /* Should be performing the more basic check that the binary is
459 compatible with GDB. */
460 /* Check with the target that the architecture is valid. */
461 return (target_architecture_hook == NULL
462 || target_architecture_hook (arch));
463 }
464
465 static void
466 set_arch (const struct bfd_arch_info *arch,
467 enum set_arch type)
468 {
469 if (GDB_MULTI_ARCH)
470 internal_error (__FILE__, __LINE__,
471 "set_arch: not multi-arched");
472 switch (type)
473 {
474 case set_arch_auto:
475 if (!arch_ok (arch))
476 warning ("Target may not support %s architecture",
477 arch->printable_name);
478 target_architecture = arch;
479 break;
480 case set_arch_manual:
481 if (!arch_ok (arch))
482 {
483 printf_unfiltered ("Target does not support `%s' architecture.\n",
484 arch->printable_name);
485 }
486 else
487 {
488 target_architecture_auto = 0;
489 target_architecture = arch;
490 }
491 break;
492 }
493 if (gdbarch_debug)
494 gdbarch_dump (current_gdbarch, gdb_stdlog);
495 }
496
497 /* Set the architecture from arch/machine (deprecated) */
498
499 void
500 set_architecture_from_arch_mach (enum bfd_architecture arch,
501 unsigned long mach)
502 {
503 const struct bfd_arch_info *wanted = bfd_lookup_arch (arch, mach);
504 if (GDB_MULTI_ARCH)
505 internal_error (__FILE__, __LINE__,
506 "set_architecture_from_arch_mach: not multi-arched");
507 if (wanted != NULL)
508 set_arch (wanted, set_arch_manual);
509 else
510 internal_error (__FILE__, __LINE__,
511 "gdbarch: hardwired architecture/machine not recognized");
512 }
513
514 /* Set the architecture from a BFD (deprecated) */
515
516 static void
517 set_architecture_from_file (bfd *abfd)
518 {
519 const struct bfd_arch_info *wanted = bfd_get_arch_info (abfd);
520 if (GDB_MULTI_ARCH)
521 internal_error (__FILE__, __LINE__,
522 "set_architecture_from_file: not multi-arched");
523 if (target_architecture_auto)
524 {
525 set_arch (wanted, set_arch_auto);
526 }
527 else if (wanted != target_architecture)
528 {
529 warning ("%s architecture file may be incompatible with %s target.",
530 wanted->printable_name,
531 target_architecture->printable_name);
532 }
533 }
534
535
536 /* Called if the user enters ``show architecture'' without an
537 argument. */
538
539 static void
540 show_architecture (char *args, int from_tty)
541 {
542 const char *arch;
543 arch = TARGET_ARCHITECTURE->printable_name;
544 if (target_architecture_auto)
545 printf_filtered ("The target architecture is set automatically (currently %s)\n", arch);
546 else
547 printf_filtered ("The target architecture is assumed to be %s\n", arch);
548 }
549
550
551 /* Called if the user enters ``set architecture'' with or without an
552 argument. */
553
554 static void
555 set_architecture (char *ignore_args, int from_tty, struct cmd_list_element *c)
556 {
557 if (strcmp (set_architecture_string, "auto") == 0)
558 {
559 target_architecture_auto = 1;
560 }
561 else if (GDB_MULTI_ARCH)
562 {
563 struct gdbarch_info info;
564 memset (&info, 0, sizeof info);
565 info.bfd_arch_info = bfd_scan_arch (set_architecture_string);
566 if (info.bfd_arch_info == NULL)
567 internal_error (__FILE__, __LINE__,
568 "set_architecture: bfd_scan_arch failed");
569 if (gdbarch_update_p (info))
570 target_architecture_auto = 0;
571 else
572 printf_unfiltered ("Architecture `%s' not recognized.\n",
573 set_architecture_string);
574 }
575 else
576 {
577 const struct bfd_arch_info *arch
578 = bfd_scan_arch (set_architecture_string);
579 if (arch == NULL)
580 internal_error (__FILE__, __LINE__,
581 "set_architecture: bfd_scan_arch failed");
582 set_arch (arch, set_arch_manual);
583 }
584 show_architecture (NULL, from_tty);
585 }
586
587 /* Called if the user enters ``info architecture'' without an argument. */
588
589 static void
590 info_architecture (char *args, int from_tty)
591 {
592 printf_filtered ("Available architectures are:\n");
593 if (GDB_MULTI_ARCH)
594 {
595 const char **arches = gdbarch_printable_names ();
596 const char **arch;
597 for (arch = arches; *arch != NULL; arch++)
598 {
599 printf_filtered (" %s", *arch);
600 }
601 xfree (arches);
602 }
603 else
604 {
605 enum bfd_architecture a;
606 for (a = bfd_arch_obscure + 1; a < bfd_arch_last; a++)
607 {
608 const struct bfd_arch_info *ap;
609 for (ap = bfd_lookup_arch (a, 0);
610 ap != NULL;
611 ap = ap->next)
612 {
613 printf_filtered (" %s", ap->printable_name);
614 ap = ap->next;
615 }
616 }
617 }
618 printf_filtered ("\n");
619 }
620
621 /* Set the dynamic target-system-dependent parameters (architecture,
622 byte-order) using information found in the BFD */
623
624 void
625 set_gdbarch_from_file (bfd *abfd)
626 {
627 if (GDB_MULTI_ARCH)
628 {
629 struct gdbarch_info info;
630 memset (&info, 0, sizeof info);
631 info.abfd = abfd;
632 if (! gdbarch_update_p (info))
633 error ("Architecture of file not recognized.\n");
634 }
635 else
636 {
637 set_architecture_from_file (abfd);
638 set_endian_from_file (abfd);
639 }
640 }
641
642 /* Initialize the current architecture. Update the ``set
643 architecture'' command so that it specifies a list of valid
644 architectures. */
645
646 #ifdef DEFAULT_BFD_ARCH
647 extern const bfd_arch_info_type DEFAULT_BFD_ARCH;
648 static const bfd_arch_info_type *default_bfd_arch = &DEFAULT_BFD_ARCH;
649 #else
650 static const bfd_arch_info_type *default_bfd_arch;
651 #endif
652
653 #ifdef DEFAULT_BFD_VEC
654 extern const bfd_target DEFAULT_BFD_VEC;
655 static const bfd_target *default_bfd_vec = &DEFAULT_BFD_VEC;
656 #else
657 static const bfd_target *default_bfd_vec;
658 #endif
659
660 void
661 initialize_current_architecture (void)
662 {
663 const char **arches = gdbarch_printable_names ();
664
665 /* determine a default architecture and byte order. */
666 struct gdbarch_info info;
667 memset (&info, 0, sizeof (info));
668
669 /* Find a default architecture. */
670 if (info.bfd_arch_info == NULL
671 && default_bfd_arch != NULL)
672 info.bfd_arch_info = default_bfd_arch;
673 if (info.bfd_arch_info == NULL)
674 {
675 /* Choose the architecture by taking the first one
676 alphabetically. */
677 const char *chosen = arches[0];
678 const char **arch;
679 for (arch = arches; *arch != NULL; arch++)
680 {
681 if (strcmp (*arch, chosen) < 0)
682 chosen = *arch;
683 }
684 if (chosen == NULL)
685 internal_error (__FILE__, __LINE__,
686 "initialize_current_architecture: No arch");
687 info.bfd_arch_info = bfd_scan_arch (chosen);
688 if (info.bfd_arch_info == NULL)
689 internal_error (__FILE__, __LINE__,
690 "initialize_current_architecture: Arch not found");
691 }
692
693 /* take several guesses at a byte order. */
694 /* NB: can't use TARGET_BYTE_ORDER_DEFAULT as its definition is
695 forced above. */
696 if (info.byte_order == 0
697 && default_bfd_vec != NULL)
698 {
699 /* Extract BFD's default vector's byte order. */
700 switch (default_bfd_vec->byteorder)
701 {
702 case BFD_ENDIAN_BIG:
703 info.byte_order = BIG_ENDIAN;
704 break;
705 case BFD_ENDIAN_LITTLE:
706 info.byte_order = LITTLE_ENDIAN;
707 break;
708 default:
709 break;
710 }
711 }
712 if (info.byte_order == 0)
713 {
714 /* look for ``*el-*'' in the target name. */
715 const char *chp;
716 chp = strchr (target_name, '-');
717 if (chp != NULL
718 && chp - 2 >= target_name
719 && strncmp (chp - 2, "el", 2) == 0)
720 info.byte_order = LITTLE_ENDIAN;
721 }
722 if (info.byte_order == 0)
723 {
724 /* Wire it to big-endian!!! */
725 info.byte_order = BIG_ENDIAN;
726 }
727
728 if (GDB_MULTI_ARCH)
729 {
730 if (! gdbarch_update_p (info))
731 {
732 internal_error (__FILE__, __LINE__,
733 "initialize_current_architecture: Selection of initial architecture failed");
734 }
735 }
736
737 /* Create the ``set architecture'' command appending ``auto'' to the
738 list of architectures. */
739 {
740 struct cmd_list_element *c;
741 /* Append ``auto''. */
742 int nr;
743 for (nr = 0; arches[nr] != NULL; nr++);
744 arches = xrealloc (arches, sizeof (char*) * (nr + 2));
745 arches[nr + 0] = "auto";
746 arches[nr + 1] = NULL;
747 /* FIXME: add_set_enum_cmd() uses an array of ``char *'' instead
748 of ``const char *''. We just happen to know that the casts are
749 safe. */
750 c = add_set_enum_cmd ("architecture", class_support,
751 arches, &set_architecture_string,
752 "Set architecture of target.",
753 &setlist);
754 c->function.sfunc = set_architecture;
755 add_alias_cmd ("processor", "architecture", class_support, 1, &setlist);
756 /* Don't use set_from_show - need to print both auto/manual and
757 current setting. */
758 add_cmd ("architecture", class_support, show_architecture,
759 "Show the current target architecture", &showlist);
760 c = add_cmd ("architecture", class_support, info_architecture,
761 "List supported target architectures", &infolist);
762 deprecate_cmd (c, "set architecture");
763 }
764 }
765
766
767 /* */
768
769 extern initialize_file_ftype _initialize_gdbarch_utils;
770
771 void
772 _initialize_gdbarch_utils (void)
773 {
774 struct cmd_list_element *c;
775 c = add_set_enum_cmd ("endian", class_support,
776 endian_enum, &set_endian_string,
777 "Set endianness of target.",
778 &setlist);
779 c->function.sfunc = set_endian;
780 /* Don't use set_from_show - need to print both auto/manual and
781 current setting. */
782 add_cmd ("endian", class_support, show_endian,
783 "Show the current byte-order", &showlist);
784 }
This page took 0.045394 seconds and 4 git commands to generate.