Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / lldb / examples / python / x86_64_target_definition.py
blobc6f2e0888e0376698ccea6ba1c463e670279d3e4
1 #!/usr/bin/env python
2 # ===-- x86_64_target_definition.py -----------------------------*- C++ -*-===//
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 # ===----------------------------------------------------------------------===//
10 # ----------------------------------------------------------------------
11 # DESCRIPTION
13 # This file can be used with the following setting:
14 # plugin.process.gdb-remote.target-definition-file
15 # This setting should be used when you are trying to connect to a
16 # remote GDB server that doesn't support any of the register discovery
17 # packets that LLDB normally uses.
19 # Why is this necessary? LLDB doesn't require a new build of LLDB that
20 # targets each new architecture you will debug with. Instead, all
21 # architectures are supported and LLDB relies on extra GDB server
22 # packets to discover the target we are connecting to so that is can
23 # show the right registers for each target. This allows the GDB server
24 # to change and add new registers without requiring a new LLDB build
25 # just so we can see new registers.
27 # This file implements the x86_64 registers for the darwin version of
28 # GDB and allows you to connect to servers that use this register set.
30 # USAGE
32 # (lldb) settings set plugin.process.gdb-remote.target-definition-file /path/to/x86_64_target_definition.py
33 # (lldb) gdb-remote other.baz.com:1234
35 # The target definition file will get used if and only if the
36 # qRegisterInfo packets are not supported when connecting to a remote
37 # GDB server.
38 # ----------------------------------------------------------------------
39 from lldb import *
41 # Compiler and DWARF register numbers
42 name_to_gcc_dwarf_regnum = {
43 "rax": 0,
44 "rdx": 1,
45 "rcx": 2,
46 "rbx": 3,
47 "rsi": 4,
48 "rdi": 5,
49 "rbp": 6,
50 "rsp": 7,
51 "r8": 8,
52 "r9": 9,
53 "r10": 10,
54 "r11": 11,
55 "r12": 12,
56 "r13": 13,
57 "r14": 14,
58 "r15": 15,
59 "rip": 16,
60 "xmm0": 17,
61 "xmm1": 18,
62 "xmm2": 19,
63 "xmm3": 20,
64 "xmm4": 21,
65 "xmm5": 22,
66 "xmm6": 23,
67 "xmm7": 24,
68 "xmm8": 25,
69 "xmm9": 26,
70 "xmm10": 27,
71 "xmm11": 28,
72 "xmm12": 29,
73 "xmm13": 30,
74 "xmm14": 31,
75 "xmm15": 32,
76 "stmm0": 33,
77 "stmm1": 34,
78 "stmm2": 35,
79 "stmm3": 36,
80 "stmm4": 37,
81 "stmm5": 38,
82 "stmm6": 39,
83 "stmm7": 30,
84 "ymm0": 41,
85 "ymm1": 42,
86 "ymm2": 43,
87 "ymm3": 44,
88 "ymm4": 45,
89 "ymm5": 46,
90 "ymm6": 47,
91 "ymm7": 48,
92 "ymm8": 49,
93 "ymm9": 40,
94 "ymm10": 41,
95 "ymm11": 42,
96 "ymm12": 43,
97 "ymm13": 44,
98 "ymm14": 45,
99 "ymm15": 46,
102 name_to_gdb_regnum = {
103 "rax": 0,
104 "rbx": 1,
105 "rcx": 2,
106 "rdx": 3,
107 "rsi": 4,
108 "rdi": 5,
109 "rbp": 6,
110 "rsp": 7,
111 "r8": 8,
112 "r9": 9,
113 "r10": 10,
114 "r11": 11,
115 "r12": 12,
116 "r13": 13,
117 "r14": 14,
118 "r15": 15,
119 "rip": 16,
120 "rflags": 17,
121 "cs": 18,
122 "ss": 19,
123 "ds": 20,
124 "es": 21,
125 "fs": 22,
126 "gs": 23,
127 "stmm0": 24,
128 "stmm1": 25,
129 "stmm2": 26,
130 "stmm3": 27,
131 "stmm4": 28,
132 "stmm5": 29,
133 "stmm6": 30,
134 "stmm7": 31,
135 "fctrl": 32,
136 "fstat": 33,
137 "ftag": 34,
138 "fiseg": 35,
139 "fioff": 36,
140 "foseg": 37,
141 "fooff": 38,
142 "fop": 39,
143 "xmm0": 40,
144 "xmm1": 41,
145 "xmm2": 42,
146 "xmm3": 43,
147 "xmm4": 44,
148 "xmm5": 45,
149 "xmm6": 46,
150 "xmm7": 47,
151 "xmm8": 48,
152 "xmm9": 49,
153 "xmm10": 50,
154 "xmm11": 51,
155 "xmm12": 52,
156 "xmm13": 53,
157 "xmm14": 54,
158 "xmm15": 55,
159 "mxcsr": 56,
160 "ymm0": 57,
161 "ymm1": 58,
162 "ymm2": 59,
163 "ymm3": 60,
164 "ymm4": 61,
165 "ymm5": 62,
166 "ymm6": 63,
167 "ymm7": 64,
168 "ymm8": 65,
169 "ymm9": 66,
170 "ymm10": 67,
171 "ymm11": 68,
172 "ymm12": 69,
173 "ymm13": 70,
174 "ymm14": 71,
175 "ymm15": 72,
178 name_to_generic_regnum = {
179 "rip": LLDB_REGNUM_GENERIC_PC,
180 "rsp": LLDB_REGNUM_GENERIC_SP,
181 "rbp": LLDB_REGNUM_GENERIC_FP,
182 "rdi": LLDB_REGNUM_GENERIC_ARG1,
183 "rsi": LLDB_REGNUM_GENERIC_ARG2,
184 "rdx": LLDB_REGNUM_GENERIC_ARG3,
185 "rcx": LLDB_REGNUM_GENERIC_ARG4,
186 "r8": LLDB_REGNUM_GENERIC_ARG5,
187 "r9": LLDB_REGNUM_GENERIC_ARG6,
191 def get_reg_num(reg_num_dict, reg_name):
192 if reg_name in reg_num_dict:
193 return reg_num_dict[reg_name]
194 return LLDB_INVALID_REGNUM
197 def get_reg_num(reg_num_dict, reg_name):
198 if reg_name in reg_num_dict:
199 return reg_num_dict[reg_name]
200 return LLDB_INVALID_REGNUM
203 x86_64_register_infos = [
205 "name": "rax",
206 "set": 0,
207 "bitsize": 64,
208 "encoding": eEncodingUint,
209 "format": eFormatAddressInfo,
212 "name": "rbx",
213 "set": 0,
214 "bitsize": 64,
215 "encoding": eEncodingUint,
216 "format": eFormatAddressInfo,
219 "name": "rcx",
220 "set": 0,
221 "bitsize": 64,
222 "encoding": eEncodingUint,
223 "format": eFormatAddressInfo,
224 "alt-name": "arg4",
227 "name": "rdx",
228 "set": 0,
229 "bitsize": 64,
230 "encoding": eEncodingUint,
231 "format": eFormatAddressInfo,
232 "alt-name": "arg3",
235 "name": "rsi",
236 "set": 0,
237 "bitsize": 64,
238 "encoding": eEncodingUint,
239 "format": eFormatAddressInfo,
240 "alt-name": "arg2",
243 "name": "rdi",
244 "set": 0,
245 "bitsize": 64,
246 "encoding": eEncodingUint,
247 "format": eFormatAddressInfo,
248 "alt-name": "arg1",
251 "name": "rbp",
252 "set": 0,
253 "bitsize": 64,
254 "encoding": eEncodingUint,
255 "format": eFormatAddressInfo,
256 "alt-name": "fp",
259 "name": "rsp",
260 "set": 0,
261 "bitsize": 64,
262 "encoding": eEncodingUint,
263 "format": eFormatAddressInfo,
264 "alt-name": "sp",
267 "name": "r8",
268 "set": 0,
269 "bitsize": 64,
270 "encoding": eEncodingUint,
271 "format": eFormatAddressInfo,
272 "alt-name": "arg5",
275 "name": "r9",
276 "set": 0,
277 "bitsize": 64,
278 "encoding": eEncodingUint,
279 "format": eFormatAddressInfo,
280 "alt-name": "arg6",
283 "name": "r10",
284 "set": 0,
285 "bitsize": 64,
286 "encoding": eEncodingUint,
287 "format": eFormatAddressInfo,
290 "name": "r11",
291 "set": 0,
292 "bitsize": 64,
293 "encoding": eEncodingUint,
294 "format": eFormatAddressInfo,
297 "name": "r12",
298 "set": 0,
299 "bitsize": 64,
300 "encoding": eEncodingUint,
301 "format": eFormatAddressInfo,
304 "name": "r13",
305 "set": 0,
306 "bitsize": 64,
307 "encoding": eEncodingUint,
308 "format": eFormatAddressInfo,
311 "name": "r14",
312 "set": 0,
313 "bitsize": 64,
314 "encoding": eEncodingUint,
315 "format": eFormatAddressInfo,
318 "name": "r15",
319 "set": 0,
320 "bitsize": 64,
321 "encoding": eEncodingUint,
322 "format": eFormatAddressInfo,
325 "name": "rip",
326 "set": 0,
327 "bitsize": 64,
328 "encoding": eEncodingUint,
329 "format": eFormatAddressInfo,
330 "alt-name": "pc",
333 "name": "rflags",
334 "set": 0,
335 "bitsize": 32,
336 "encoding": eEncodingUint,
337 "format": eFormatHex,
340 "name": "cs",
341 "set": 0,
342 "bitsize": 32,
343 "encoding": eEncodingUint,
344 "format": eFormatHex,
347 "name": "ss",
348 "set": 0,
349 "bitsize": 32,
350 "encoding": eEncodingUint,
351 "format": eFormatHex,
354 "name": "ds",
355 "set": 0,
356 "bitsize": 32,
357 "encoding": eEncodingUint,
358 "format": eFormatHex,
361 "name": "es",
362 "set": 0,
363 "bitsize": 32,
364 "encoding": eEncodingUint,
365 "format": eFormatHex,
368 "name": "fs",
369 "set": 0,
370 "bitsize": 32,
371 "encoding": eEncodingUint,
372 "format": eFormatHex,
375 "name": "gs",
376 "set": 0,
377 "bitsize": 32,
378 "encoding": eEncodingUint,
379 "format": eFormatHex,
382 "name": "stmm0",
383 "set": 1,
384 "bitsize": 80,
385 "encoding": eEncodingVector,
386 "format": eFormatVectorOfUInt8,
389 "name": "stmm1",
390 "set": 1,
391 "bitsize": 80,
392 "encoding": eEncodingVector,
393 "format": eFormatVectorOfUInt8,
396 "name": "stmm2",
397 "set": 1,
398 "bitsize": 80,
399 "encoding": eEncodingVector,
400 "format": eFormatVectorOfUInt8,
403 "name": "stmm3",
404 "set": 1,
405 "bitsize": 80,
406 "encoding": eEncodingVector,
407 "format": eFormatVectorOfUInt8,
410 "name": "stmm4",
411 "set": 1,
412 "bitsize": 80,
413 "encoding": eEncodingVector,
414 "format": eFormatVectorOfUInt8,
417 "name": "stmm5",
418 "set": 1,
419 "bitsize": 80,
420 "encoding": eEncodingVector,
421 "format": eFormatVectorOfUInt8,
424 "name": "stmm6",
425 "set": 1,
426 "bitsize": 80,
427 "encoding": eEncodingVector,
428 "format": eFormatVectorOfUInt8,
431 "name": "stmm7",
432 "set": 1,
433 "bitsize": 80,
434 "encoding": eEncodingVector,
435 "format": eFormatVectorOfUInt8,
438 "name": "fctrl",
439 "set": 1,
440 "bitsize": 32,
441 "encoding": eEncodingUint,
442 "format": eFormatHex,
445 "name": "fstat",
446 "set": 1,
447 "bitsize": 32,
448 "encoding": eEncodingUint,
449 "format": eFormatHex,
452 "name": "ftag",
453 "set": 1,
454 "bitsize": 32,
455 "encoding": eEncodingUint,
456 "format": eFormatHex,
459 "name": "fiseg",
460 "set": 1,
461 "bitsize": 32,
462 "encoding": eEncodingUint,
463 "format": eFormatHex,
466 "name": "fioff",
467 "set": 1,
468 "bitsize": 32,
469 "encoding": eEncodingUint,
470 "format": eFormatHex,
473 "name": "foseg",
474 "set": 1,
475 "bitsize": 32,
476 "encoding": eEncodingUint,
477 "format": eFormatHex,
480 "name": "fooff",
481 "set": 1,
482 "bitsize": 32,
483 "encoding": eEncodingUint,
484 "format": eFormatHex,
487 "name": "fop",
488 "set": 1,
489 "bitsize": 32,
490 "encoding": eEncodingUint,
491 "format": eFormatHex,
494 "name": "xmm0",
495 "set": 1,
496 "bitsize": 128,
497 "encoding": eEncodingVector,
498 "format": eFormatVectorOfUInt8,
501 "name": "xmm1",
502 "set": 1,
503 "bitsize": 128,
504 "encoding": eEncodingVector,
505 "format": eFormatVectorOfUInt8,
508 "name": "xmm2",
509 "set": 1,
510 "bitsize": 128,
511 "encoding": eEncodingVector,
512 "format": eFormatVectorOfUInt8,
515 "name": "xmm3",
516 "set": 1,
517 "bitsize": 128,
518 "encoding": eEncodingVector,
519 "format": eFormatVectorOfUInt8,
522 "name": "xmm4",
523 "set": 1,
524 "bitsize": 128,
525 "encoding": eEncodingVector,
526 "format": eFormatVectorOfUInt8,
529 "name": "xmm5",
530 "set": 1,
531 "bitsize": 128,
532 "encoding": eEncodingVector,
533 "format": eFormatVectorOfUInt8,
536 "name": "xmm6",
537 "set": 1,
538 "bitsize": 128,
539 "encoding": eEncodingVector,
540 "format": eFormatVectorOfUInt8,
543 "name": "xmm7",
544 "set": 1,
545 "bitsize": 128,
546 "encoding": eEncodingVector,
547 "format": eFormatVectorOfUInt8,
550 "name": "xmm8",
551 "set": 1,
552 "bitsize": 128,
553 "encoding": eEncodingVector,
554 "format": eFormatVectorOfUInt8,
557 "name": "xmm9",
558 "set": 1,
559 "bitsize": 128,
560 "encoding": eEncodingVector,
561 "format": eFormatVectorOfUInt8,
564 "name": "xmm10",
565 "set": 1,
566 "bitsize": 128,
567 "encoding": eEncodingVector,
568 "format": eFormatVectorOfUInt8,
571 "name": "xmm11",
572 "set": 1,
573 "bitsize": 128,
574 "encoding": eEncodingVector,
575 "format": eFormatVectorOfUInt8,
578 "name": "xmm12",
579 "set": 1,
580 "bitsize": 128,
581 "encoding": eEncodingVector,
582 "format": eFormatVectorOfUInt8,
585 "name": "xmm13",
586 "set": 1,
587 "bitsize": 128,
588 "encoding": eEncodingVector,
589 "format": eFormatVectorOfUInt8,
592 "name": "xmm14",
593 "set": 1,
594 "bitsize": 128,
595 "encoding": eEncodingVector,
596 "format": eFormatVectorOfUInt8,
599 "name": "xmm15",
600 "set": 1,
601 "bitsize": 128,
602 "encoding": eEncodingVector,
603 "format": eFormatVectorOfUInt8,
606 "name": "mxcsr",
607 "set": 1,
608 "bitsize": 32,
609 "encoding": eEncodingUint,
610 "format": eFormatHex,
612 # Registers that are contained in or composed of one of more other
613 # registers
615 "name": "eax",
616 "set": 0,
617 "bitsize": 32,
618 "encoding": eEncodingUint,
619 "format": eFormatHex,
620 "slice": "rax[31:0]",
623 "name": "ebx",
624 "set": 0,
625 "bitsize": 32,
626 "encoding": eEncodingUint,
627 "format": eFormatHex,
628 "slice": "rbx[31:0]",
631 "name": "ecx",
632 "set": 0,
633 "bitsize": 32,
634 "encoding": eEncodingUint,
635 "format": eFormatHex,
636 "slice": "rcx[31:0]",
639 "name": "edx",
640 "set": 0,
641 "bitsize": 32,
642 "encoding": eEncodingUint,
643 "format": eFormatHex,
644 "slice": "rdx[31:0]",
647 "name": "edi",
648 "set": 0,
649 "bitsize": 32,
650 "encoding": eEncodingUint,
651 "format": eFormatHex,
652 "slice": "rdi[31:0]",
655 "name": "esi",
656 "set": 0,
657 "bitsize": 32,
658 "encoding": eEncodingUint,
659 "format": eFormatHex,
660 "slice": "rsi[31:0]",
663 "name": "ebp",
664 "set": 0,
665 "bitsize": 32,
666 "encoding": eEncodingUint,
667 "format": eFormatHex,
668 "slice": "rbp[31:0]",
671 "name": "esp",
672 "set": 0,
673 "bitsize": 32,
674 "encoding": eEncodingUint,
675 "format": eFormatHex,
676 "slice": "rsp[31:0]",
679 "name": "r8d",
680 "set": 0,
681 "bitsize": 32,
682 "encoding": eEncodingUint,
683 "format": eFormatHex,
684 "slice": "r8[31:0]",
687 "name": "r9d",
688 "set": 0,
689 "bitsize": 32,
690 "encoding": eEncodingUint,
691 "format": eFormatHex,
692 "slice": "r9[31:0]",
695 "name": "r10d",
696 "set": 0,
697 "bitsize": 32,
698 "encoding": eEncodingUint,
699 "format": eFormatHex,
700 "slice": "r10[31:0]",
703 "name": "r11d",
704 "set": 0,
705 "bitsize": 32,
706 "encoding": eEncodingUint,
707 "format": eFormatHex,
708 "slice": "r11[31:0]",
711 "name": "r12d",
712 "set": 0,
713 "bitsize": 32,
714 "encoding": eEncodingUint,
715 "format": eFormatHex,
716 "slice": "r12[31:0]",
719 "name": "r13d",
720 "set": 0,
721 "bitsize": 32,
722 "encoding": eEncodingUint,
723 "format": eFormatHex,
724 "slice": "r13[31:0]",
727 "name": "r14d",
728 "set": 0,
729 "bitsize": 32,
730 "encoding": eEncodingUint,
731 "format": eFormatHex,
732 "slice": "r14[31:0]",
735 "name": "r15d",
736 "set": 0,
737 "bitsize": 32,
738 "encoding": eEncodingUint,
739 "format": eFormatHex,
740 "slice": "r15[31:0]",
743 "name": "ax",
744 "set": 0,
745 "bitsize": 16,
746 "encoding": eEncodingUint,
747 "format": eFormatHex,
748 "slice": "rax[15:0]",
751 "name": "bx",
752 "set": 0,
753 "bitsize": 16,
754 "encoding": eEncodingUint,
755 "format": eFormatHex,
756 "slice": "rbx[15:0]",
759 "name": "cx",
760 "set": 0,
761 "bitsize": 16,
762 "encoding": eEncodingUint,
763 "format": eFormatHex,
764 "slice": "rcx[15:0]",
767 "name": "dx",
768 "set": 0,
769 "bitsize": 16,
770 "encoding": eEncodingUint,
771 "format": eFormatHex,
772 "slice": "rdx[15:0]",
775 "name": "di",
776 "set": 0,
777 "bitsize": 16,
778 "encoding": eEncodingUint,
779 "format": eFormatHex,
780 "slice": "rdi[15:0]",
783 "name": "si",
784 "set": 0,
785 "bitsize": 16,
786 "encoding": eEncodingUint,
787 "format": eFormatHex,
788 "slice": "rsi[15:0]",
791 "name": "bp",
792 "set": 0,
793 "bitsize": 16,
794 "encoding": eEncodingUint,
795 "format": eFormatHex,
796 "slice": "rbp[15:0]",
799 "name": "sp",
800 "set": 0,
801 "bitsize": 16,
802 "encoding": eEncodingUint,
803 "format": eFormatHex,
804 "slice": "rsp[15:0]",
807 "name": "r8w",
808 "set": 0,
809 "bitsize": 16,
810 "encoding": eEncodingUint,
811 "format": eFormatHex,
812 "slice": "r8[15:0]",
815 "name": "r9w",
816 "set": 0,
817 "bitsize": 16,
818 "encoding": eEncodingUint,
819 "format": eFormatHex,
820 "slice": "r9[15:0]",
823 "name": "r10w",
824 "set": 0,
825 "bitsize": 16,
826 "encoding": eEncodingUint,
827 "format": eFormatHex,
828 "slice": "r10[15:0]",
831 "name": "r11w",
832 "set": 0,
833 "bitsize": 16,
834 "encoding": eEncodingUint,
835 "format": eFormatHex,
836 "slice": "r11[15:0]",
839 "name": "r12w",
840 "set": 0,
841 "bitsize": 16,
842 "encoding": eEncodingUint,
843 "format": eFormatHex,
844 "slice": "r12[15:0]",
847 "name": "r13w",
848 "set": 0,
849 "bitsize": 16,
850 "encoding": eEncodingUint,
851 "format": eFormatHex,
852 "slice": "r13[15:0]",
855 "name": "r14w",
856 "set": 0,
857 "bitsize": 16,
858 "encoding": eEncodingUint,
859 "format": eFormatHex,
860 "slice": "r14[15:0]",
863 "name": "r15w",
864 "set": 0,
865 "bitsize": 16,
866 "encoding": eEncodingUint,
867 "format": eFormatHex,
868 "slice": "r15[15:0]",
871 "name": "ah",
872 "set": 0,
873 "bitsize": 8,
874 "encoding": eEncodingUint,
875 "format": eFormatHex,
876 "slice": "rax[15:8]",
879 "name": "bh",
880 "set": 0,
881 "bitsize": 8,
882 "encoding": eEncodingUint,
883 "format": eFormatHex,
884 "slice": "rbx[15:8]",
887 "name": "ch",
888 "set": 0,
889 "bitsize": 8,
890 "encoding": eEncodingUint,
891 "format": eFormatHex,
892 "slice": "rcx[15:8]",
895 "name": "dh",
896 "set": 0,
897 "bitsize": 8,
898 "encoding": eEncodingUint,
899 "format": eFormatHex,
900 "slice": "rdx[15:8]",
903 "name": "al",
904 "set": 0,
905 "bitsize": 8,
906 "encoding": eEncodingUint,
907 "format": eFormatHex,
908 "slice": "rax[7:0]",
911 "name": "bl",
912 "set": 0,
913 "bitsize": 8,
914 "encoding": eEncodingUint,
915 "format": eFormatHex,
916 "slice": "rbx[7:0]",
919 "name": "cl",
920 "set": 0,
921 "bitsize": 8,
922 "encoding": eEncodingUint,
923 "format": eFormatHex,
924 "slice": "rcx[7:0]",
927 "name": "dl",
928 "set": 0,
929 "bitsize": 8,
930 "encoding": eEncodingUint,
931 "format": eFormatHex,
932 "slice": "rdx[7:0]",
935 "name": "dil",
936 "set": 0,
937 "bitsize": 8,
938 "encoding": eEncodingUint,
939 "format": eFormatHex,
940 "slice": "rdi[7:0]",
943 "name": "sil",
944 "set": 0,
945 "bitsize": 8,
946 "encoding": eEncodingUint,
947 "format": eFormatHex,
948 "slice": "rsi[7:0]",
951 "name": "bpl",
952 "set": 0,
953 "bitsize": 8,
954 "encoding": eEncodingUint,
955 "format": eFormatHex,
956 "slice": "rbp[7:0]",
959 "name": "spl",
960 "set": 0,
961 "bitsize": 8,
962 "encoding": eEncodingUint,
963 "format": eFormatHex,
964 "slice": "rsp[7:0]",
967 "name": "r8l",
968 "set": 0,
969 "bitsize": 8,
970 "encoding": eEncodingUint,
971 "format": eFormatHex,
972 "slice": "r8[7:0]",
975 "name": "r9l",
976 "set": 0,
977 "bitsize": 8,
978 "encoding": eEncodingUint,
979 "format": eFormatHex,
980 "slice": "r9[7:0]",
983 "name": "r10l",
984 "set": 0,
985 "bitsize": 8,
986 "encoding": eEncodingUint,
987 "format": eFormatHex,
988 "slice": "r10[7:0]",
991 "name": "r11l",
992 "set": 0,
993 "bitsize": 8,
994 "encoding": eEncodingUint,
995 "format": eFormatHex,
996 "slice": "r11[7:0]",
999 "name": "r12l",
1000 "set": 0,
1001 "bitsize": 8,
1002 "encoding": eEncodingUint,
1003 "format": eFormatHex,
1004 "slice": "r12[7:0]",
1007 "name": "r13l",
1008 "set": 0,
1009 "bitsize": 8,
1010 "encoding": eEncodingUint,
1011 "format": eFormatHex,
1012 "slice": "r13[7:0]",
1015 "name": "r14l",
1016 "set": 0,
1017 "bitsize": 8,
1018 "encoding": eEncodingUint,
1019 "format": eFormatHex,
1020 "slice": "r14[7:0]",
1023 "name": "r15l",
1024 "set": 0,
1025 "bitsize": 8,
1026 "encoding": eEncodingUint,
1027 "format": eFormatHex,
1028 "slice": "r15[7:0]",
1032 g_target_definition = None
1035 def get_target_definition():
1036 global g_target_definition
1037 if g_target_definition is None:
1038 g_target_definition = {}
1039 offset = 0
1040 for reg_info in x86_64_register_infos:
1041 reg_name = reg_info["name"]
1043 # Only fill in the offset if there is no 'slice' in the register
1044 # info
1045 if "slice" not in reg_info and "composite" not in reg_info:
1046 reg_info["offset"] = offset
1047 offset += reg_info["bitsize"] // 8
1049 # Set the GCC/DWARF register number for this register if it has one
1050 reg_num = get_reg_num(name_to_gcc_dwarf_regnum, reg_name)
1051 if reg_num != LLDB_INVALID_REGNUM:
1052 reg_info["gcc"] = reg_num
1053 reg_info["dwarf"] = reg_num
1055 # Set the generic register number for this register if it has one
1056 reg_num = get_reg_num(name_to_generic_regnum, reg_name)
1057 if reg_num != LLDB_INVALID_REGNUM:
1058 reg_info["generic"] = reg_num
1060 # Set the GDB register number for this register if it has one
1061 reg_num = get_reg_num(name_to_gdb_regnum, reg_name)
1062 if reg_num != LLDB_INVALID_REGNUM:
1063 reg_info["gdb"] = reg_num
1065 g_target_definition["sets"] = [
1066 "General Purpose Registers",
1067 "Floating Point Registers",
1069 g_target_definition["registers"] = x86_64_register_infos
1070 g_target_definition["host-info"] = {
1071 "triple": "x86_64-apple-macosx",
1072 "endian": eByteOrderLittle,
1074 g_target_definition["g-packet-size"] = offset
1075 return g_target_definition
1078 def get_dynamic_setting(target, setting_name):
1079 if setting_name == "gdb-server-target-definition":
1080 return get_target_definition()