[AArch64] Fix SDNode type mismatches between *.td files and ISel (#116523)
[llvm-project.git] / lldb / examples / python / x86_64_linux_target_definition.py
blob6c9aab10e9495a0e766c0bdbf061d66c45de5f32
1 #!/usr/bin/env python
2 # ===-- x86_64_linux_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_linux_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 x86_64_register_infos = [
199 "name": "rax",
200 "set": 0,
201 "bitsize": 64,
202 "encoding": eEncodingUint,
203 "format": eFormatAddressInfo,
206 "name": "rbx",
207 "set": 0,
208 "bitsize": 64,
209 "encoding": eEncodingUint,
210 "format": eFormatAddressInfo,
213 "name": "rcx",
214 "set": 0,
215 "bitsize": 64,
216 "encoding": eEncodingUint,
217 "format": eFormatAddressInfo,
218 "alt-name": "arg4",
221 "name": "rdx",
222 "set": 0,
223 "bitsize": 64,
224 "encoding": eEncodingUint,
225 "format": eFormatAddressInfo,
226 "alt-name": "arg3",
229 "name": "rsi",
230 "set": 0,
231 "bitsize": 64,
232 "encoding": eEncodingUint,
233 "format": eFormatAddressInfo,
234 "alt-name": "arg2",
237 "name": "rdi",
238 "set": 0,
239 "bitsize": 64,
240 "encoding": eEncodingUint,
241 "format": eFormatAddressInfo,
242 "alt-name": "arg1",
245 "name": "rbp",
246 "set": 0,
247 "bitsize": 64,
248 "encoding": eEncodingUint,
249 "format": eFormatAddressInfo,
250 "alt-name": "fp",
253 "name": "rsp",
254 "set": 0,
255 "bitsize": 64,
256 "encoding": eEncodingUint,
257 "format": eFormatAddressInfo,
258 "alt-name": "sp",
261 "name": "r8",
262 "set": 0,
263 "bitsize": 64,
264 "encoding": eEncodingUint,
265 "format": eFormatAddressInfo,
266 "alt-name": "arg5",
269 "name": "r9",
270 "set": 0,
271 "bitsize": 64,
272 "encoding": eEncodingUint,
273 "format": eFormatAddressInfo,
274 "alt-name": "arg6",
277 "name": "r10",
278 "set": 0,
279 "bitsize": 64,
280 "encoding": eEncodingUint,
281 "format": eFormatAddressInfo,
284 "name": "r11",
285 "set": 0,
286 "bitsize": 64,
287 "encoding": eEncodingUint,
288 "format": eFormatAddressInfo,
291 "name": "r12",
292 "set": 0,
293 "bitsize": 64,
294 "encoding": eEncodingUint,
295 "format": eFormatAddressInfo,
298 "name": "r13",
299 "set": 0,
300 "bitsize": 64,
301 "encoding": eEncodingUint,
302 "format": eFormatAddressInfo,
305 "name": "r14",
306 "set": 0,
307 "bitsize": 64,
308 "encoding": eEncodingUint,
309 "format": eFormatAddressInfo,
312 "name": "r15",
313 "set": 0,
314 "bitsize": 64,
315 "encoding": eEncodingUint,
316 "format": eFormatAddressInfo,
319 "name": "rip",
320 "set": 0,
321 "bitsize": 64,
322 "encoding": eEncodingUint,
323 "format": eFormatAddressInfo,
324 "alt-name": "pc",
327 "name": "rflags",
328 "set": 0,
329 "bitsize": 32,
330 "encoding": eEncodingUint,
331 "format": eFormatHex,
334 "name": "cs",
335 "set": 0,
336 "bitsize": 32,
337 "encoding": eEncodingUint,
338 "format": eFormatHex,
341 "name": "ss",
342 "set": 0,
343 "bitsize": 32,
344 "encoding": eEncodingUint,
345 "format": eFormatHex,
348 "name": "ds",
349 "set": 0,
350 "bitsize": 32,
351 "encoding": eEncodingUint,
352 "format": eFormatHex,
355 "name": "es",
356 "set": 0,
357 "bitsize": 32,
358 "encoding": eEncodingUint,
359 "format": eFormatHex,
362 "name": "fs",
363 "set": 0,
364 "bitsize": 32,
365 "encoding": eEncodingUint,
366 "format": eFormatHex,
369 "name": "gs",
370 "set": 0,
371 "bitsize": 32,
372 "encoding": eEncodingUint,
373 "format": eFormatHex,
376 "name": "stmm0",
377 "set": 1,
378 "bitsize": 80,
379 "encoding": eEncodingVector,
380 "format": eFormatVectorOfUInt8,
383 "name": "stmm1",
384 "set": 1,
385 "bitsize": 80,
386 "encoding": eEncodingVector,
387 "format": eFormatVectorOfUInt8,
390 "name": "stmm2",
391 "set": 1,
392 "bitsize": 80,
393 "encoding": eEncodingVector,
394 "format": eFormatVectorOfUInt8,
397 "name": "stmm3",
398 "set": 1,
399 "bitsize": 80,
400 "encoding": eEncodingVector,
401 "format": eFormatVectorOfUInt8,
404 "name": "stmm4",
405 "set": 1,
406 "bitsize": 80,
407 "encoding": eEncodingVector,
408 "format": eFormatVectorOfUInt8,
411 "name": "stmm5",
412 "set": 1,
413 "bitsize": 80,
414 "encoding": eEncodingVector,
415 "format": eFormatVectorOfUInt8,
418 "name": "stmm6",
419 "set": 1,
420 "bitsize": 80,
421 "encoding": eEncodingVector,
422 "format": eFormatVectorOfUInt8,
425 "name": "stmm7",
426 "set": 1,
427 "bitsize": 80,
428 "encoding": eEncodingVector,
429 "format": eFormatVectorOfUInt8,
432 "name": "fctrl",
433 "set": 1,
434 "bitsize": 32,
435 "encoding": eEncodingUint,
436 "format": eFormatHex,
439 "name": "fstat",
440 "set": 1,
441 "bitsize": 32,
442 "encoding": eEncodingUint,
443 "format": eFormatHex,
446 "name": "ftag",
447 "set": 1,
448 "bitsize": 32,
449 "encoding": eEncodingUint,
450 "format": eFormatHex,
453 "name": "fiseg",
454 "set": 1,
455 "bitsize": 32,
456 "encoding": eEncodingUint,
457 "format": eFormatHex,
460 "name": "fioff",
461 "set": 1,
462 "bitsize": 32,
463 "encoding": eEncodingUint,
464 "format": eFormatHex,
467 "name": "foseg",
468 "set": 1,
469 "bitsize": 32,
470 "encoding": eEncodingUint,
471 "format": eFormatHex,
474 "name": "fooff",
475 "set": 1,
476 "bitsize": 32,
477 "encoding": eEncodingUint,
478 "format": eFormatHex,
481 "name": "fop",
482 "set": 1,
483 "bitsize": 32,
484 "encoding": eEncodingUint,
485 "format": eFormatHex,
488 "name": "xmm0",
489 "set": 1,
490 "bitsize": 128,
491 "encoding": eEncodingVector,
492 "format": eFormatVectorOfUInt8,
495 "name": "xmm1",
496 "set": 1,
497 "bitsize": 128,
498 "encoding": eEncodingVector,
499 "format": eFormatVectorOfUInt8,
502 "name": "xmm2",
503 "set": 1,
504 "bitsize": 128,
505 "encoding": eEncodingVector,
506 "format": eFormatVectorOfUInt8,
509 "name": "xmm3",
510 "set": 1,
511 "bitsize": 128,
512 "encoding": eEncodingVector,
513 "format": eFormatVectorOfUInt8,
516 "name": "xmm4",
517 "set": 1,
518 "bitsize": 128,
519 "encoding": eEncodingVector,
520 "format": eFormatVectorOfUInt8,
523 "name": "xmm5",
524 "set": 1,
525 "bitsize": 128,
526 "encoding": eEncodingVector,
527 "format": eFormatVectorOfUInt8,
530 "name": "xmm6",
531 "set": 1,
532 "bitsize": 128,
533 "encoding": eEncodingVector,
534 "format": eFormatVectorOfUInt8,
537 "name": "xmm7",
538 "set": 1,
539 "bitsize": 128,
540 "encoding": eEncodingVector,
541 "format": eFormatVectorOfUInt8,
544 "name": "xmm8",
545 "set": 1,
546 "bitsize": 128,
547 "encoding": eEncodingVector,
548 "format": eFormatVectorOfUInt8,
551 "name": "xmm9",
552 "set": 1,
553 "bitsize": 128,
554 "encoding": eEncodingVector,
555 "format": eFormatVectorOfUInt8,
558 "name": "xmm10",
559 "set": 1,
560 "bitsize": 128,
561 "encoding": eEncodingVector,
562 "format": eFormatVectorOfUInt8,
565 "name": "xmm11",
566 "set": 1,
567 "bitsize": 128,
568 "encoding": eEncodingVector,
569 "format": eFormatVectorOfUInt8,
572 "name": "xmm12",
573 "set": 1,
574 "bitsize": 128,
575 "encoding": eEncodingVector,
576 "format": eFormatVectorOfUInt8,
579 "name": "xmm13",
580 "set": 1,
581 "bitsize": 128,
582 "encoding": eEncodingVector,
583 "format": eFormatVectorOfUInt8,
586 "name": "xmm14",
587 "set": 1,
588 "bitsize": 128,
589 "encoding": eEncodingVector,
590 "format": eFormatVectorOfUInt8,
593 "name": "xmm15",
594 "set": 1,
595 "bitsize": 128,
596 "encoding": eEncodingVector,
597 "format": eFormatVectorOfUInt8,
600 "name": "mxcsr",
601 "set": 1,
602 "bitsize": 32,
603 "encoding": eEncodingUint,
604 "format": eFormatHex,
607 "name": "orig_rax",
608 "set": 1,
609 "bitsize": 64,
610 "encoding": eEncodingUint,
611 "format": eFormatHex,
613 # Registers that are contained in or composed of one of more other
614 # registers
616 "name": "eax",
617 "set": 0,
618 "bitsize": 32,
619 "encoding": eEncodingUint,
620 "format": eFormatHex,
621 "slice": "rax[31:0]",
624 "name": "ebx",
625 "set": 0,
626 "bitsize": 32,
627 "encoding": eEncodingUint,
628 "format": eFormatHex,
629 "slice": "rbx[31:0]",
632 "name": "ecx",
633 "set": 0,
634 "bitsize": 32,
635 "encoding": eEncodingUint,
636 "format": eFormatHex,
637 "slice": "rcx[31:0]",
640 "name": "edx",
641 "set": 0,
642 "bitsize": 32,
643 "encoding": eEncodingUint,
644 "format": eFormatHex,
645 "slice": "rdx[31:0]",
648 "name": "edi",
649 "set": 0,
650 "bitsize": 32,
651 "encoding": eEncodingUint,
652 "format": eFormatHex,
653 "slice": "rdi[31:0]",
656 "name": "esi",
657 "set": 0,
658 "bitsize": 32,
659 "encoding": eEncodingUint,
660 "format": eFormatHex,
661 "slice": "rsi[31:0]",
664 "name": "ebp",
665 "set": 0,
666 "bitsize": 32,
667 "encoding": eEncodingUint,
668 "format": eFormatHex,
669 "slice": "rbp[31:0]",
672 "name": "esp",
673 "set": 0,
674 "bitsize": 32,
675 "encoding": eEncodingUint,
676 "format": eFormatHex,
677 "slice": "rsp[31:0]",
680 "name": "r8d",
681 "set": 0,
682 "bitsize": 32,
683 "encoding": eEncodingUint,
684 "format": eFormatHex,
685 "slice": "r8[31:0]",
688 "name": "r9d",
689 "set": 0,
690 "bitsize": 32,
691 "encoding": eEncodingUint,
692 "format": eFormatHex,
693 "slice": "r9[31:0]",
696 "name": "r10d",
697 "set": 0,
698 "bitsize": 32,
699 "encoding": eEncodingUint,
700 "format": eFormatHex,
701 "slice": "r10[31:0]",
704 "name": "r11d",
705 "set": 0,
706 "bitsize": 32,
707 "encoding": eEncodingUint,
708 "format": eFormatHex,
709 "slice": "r11[31:0]",
712 "name": "r12d",
713 "set": 0,
714 "bitsize": 32,
715 "encoding": eEncodingUint,
716 "format": eFormatHex,
717 "slice": "r12[31:0]",
720 "name": "r13d",
721 "set": 0,
722 "bitsize": 32,
723 "encoding": eEncodingUint,
724 "format": eFormatHex,
725 "slice": "r13[31:0]",
728 "name": "r14d",
729 "set": 0,
730 "bitsize": 32,
731 "encoding": eEncodingUint,
732 "format": eFormatHex,
733 "slice": "r14[31:0]",
736 "name": "r15d",
737 "set": 0,
738 "bitsize": 32,
739 "encoding": eEncodingUint,
740 "format": eFormatHex,
741 "slice": "r15[31:0]",
744 "name": "ax",
745 "set": 0,
746 "bitsize": 16,
747 "encoding": eEncodingUint,
748 "format": eFormatHex,
749 "slice": "rax[15:0]",
752 "name": "bx",
753 "set": 0,
754 "bitsize": 16,
755 "encoding": eEncodingUint,
756 "format": eFormatHex,
757 "slice": "rbx[15:0]",
760 "name": "cx",
761 "set": 0,
762 "bitsize": 16,
763 "encoding": eEncodingUint,
764 "format": eFormatHex,
765 "slice": "rcx[15:0]",
768 "name": "dx",
769 "set": 0,
770 "bitsize": 16,
771 "encoding": eEncodingUint,
772 "format": eFormatHex,
773 "slice": "rdx[15:0]",
776 "name": "di",
777 "set": 0,
778 "bitsize": 16,
779 "encoding": eEncodingUint,
780 "format": eFormatHex,
781 "slice": "rdi[15:0]",
784 "name": "si",
785 "set": 0,
786 "bitsize": 16,
787 "encoding": eEncodingUint,
788 "format": eFormatHex,
789 "slice": "rsi[15:0]",
792 "name": "bp",
793 "set": 0,
794 "bitsize": 16,
795 "encoding": eEncodingUint,
796 "format": eFormatHex,
797 "slice": "rbp[15:0]",
800 "name": "sp",
801 "set": 0,
802 "bitsize": 16,
803 "encoding": eEncodingUint,
804 "format": eFormatHex,
805 "slice": "rsp[15:0]",
808 "name": "r8w",
809 "set": 0,
810 "bitsize": 16,
811 "encoding": eEncodingUint,
812 "format": eFormatHex,
813 "slice": "r8[15:0]",
816 "name": "r9w",
817 "set": 0,
818 "bitsize": 16,
819 "encoding": eEncodingUint,
820 "format": eFormatHex,
821 "slice": "r9[15:0]",
824 "name": "r10w",
825 "set": 0,
826 "bitsize": 16,
827 "encoding": eEncodingUint,
828 "format": eFormatHex,
829 "slice": "r10[15:0]",
832 "name": "r11w",
833 "set": 0,
834 "bitsize": 16,
835 "encoding": eEncodingUint,
836 "format": eFormatHex,
837 "slice": "r11[15:0]",
840 "name": "r12w",
841 "set": 0,
842 "bitsize": 16,
843 "encoding": eEncodingUint,
844 "format": eFormatHex,
845 "slice": "r12[15:0]",
848 "name": "r13w",
849 "set": 0,
850 "bitsize": 16,
851 "encoding": eEncodingUint,
852 "format": eFormatHex,
853 "slice": "r13[15:0]",
856 "name": "r14w",
857 "set": 0,
858 "bitsize": 16,
859 "encoding": eEncodingUint,
860 "format": eFormatHex,
861 "slice": "r14[15:0]",
864 "name": "r15w",
865 "set": 0,
866 "bitsize": 16,
867 "encoding": eEncodingUint,
868 "format": eFormatHex,
869 "slice": "r15[15:0]",
872 "name": "ah",
873 "set": 0,
874 "bitsize": 8,
875 "encoding": eEncodingUint,
876 "format": eFormatHex,
877 "slice": "rax[15:8]",
880 "name": "bh",
881 "set": 0,
882 "bitsize": 8,
883 "encoding": eEncodingUint,
884 "format": eFormatHex,
885 "slice": "rbx[15:8]",
888 "name": "ch",
889 "set": 0,
890 "bitsize": 8,
891 "encoding": eEncodingUint,
892 "format": eFormatHex,
893 "slice": "rcx[15:8]",
896 "name": "dh",
897 "set": 0,
898 "bitsize": 8,
899 "encoding": eEncodingUint,
900 "format": eFormatHex,
901 "slice": "rdx[15:8]",
904 "name": "al",
905 "set": 0,
906 "bitsize": 8,
907 "encoding": eEncodingUint,
908 "format": eFormatHex,
909 "slice": "rax[7:0]",
912 "name": "bl",
913 "set": 0,
914 "bitsize": 8,
915 "encoding": eEncodingUint,
916 "format": eFormatHex,
917 "slice": "rbx[7:0]",
920 "name": "cl",
921 "set": 0,
922 "bitsize": 8,
923 "encoding": eEncodingUint,
924 "format": eFormatHex,
925 "slice": "rcx[7:0]",
928 "name": "dl",
929 "set": 0,
930 "bitsize": 8,
931 "encoding": eEncodingUint,
932 "format": eFormatHex,
933 "slice": "rdx[7:0]",
936 "name": "dil",
937 "set": 0,
938 "bitsize": 8,
939 "encoding": eEncodingUint,
940 "format": eFormatHex,
941 "slice": "rdi[7:0]",
944 "name": "sil",
945 "set": 0,
946 "bitsize": 8,
947 "encoding": eEncodingUint,
948 "format": eFormatHex,
949 "slice": "rsi[7:0]",
952 "name": "bpl",
953 "set": 0,
954 "bitsize": 8,
955 "encoding": eEncodingUint,
956 "format": eFormatHex,
957 "slice": "rbp[7:0]",
960 "name": "spl",
961 "set": 0,
962 "bitsize": 8,
963 "encoding": eEncodingUint,
964 "format": eFormatHex,
965 "slice": "rsp[7:0]",
968 "name": "r8l",
969 "set": 0,
970 "bitsize": 8,
971 "encoding": eEncodingUint,
972 "format": eFormatHex,
973 "slice": "r8[7:0]",
976 "name": "r9l",
977 "set": 0,
978 "bitsize": 8,
979 "encoding": eEncodingUint,
980 "format": eFormatHex,
981 "slice": "r9[7:0]",
984 "name": "r10l",
985 "set": 0,
986 "bitsize": 8,
987 "encoding": eEncodingUint,
988 "format": eFormatHex,
989 "slice": "r10[7:0]",
992 "name": "r11l",
993 "set": 0,
994 "bitsize": 8,
995 "encoding": eEncodingUint,
996 "format": eFormatHex,
997 "slice": "r11[7:0]",
1000 "name": "r12l",
1001 "set": 0,
1002 "bitsize": 8,
1003 "encoding": eEncodingUint,
1004 "format": eFormatHex,
1005 "slice": "r12[7:0]",
1008 "name": "r13l",
1009 "set": 0,
1010 "bitsize": 8,
1011 "encoding": eEncodingUint,
1012 "format": eFormatHex,
1013 "slice": "r13[7:0]",
1016 "name": "r14l",
1017 "set": 0,
1018 "bitsize": 8,
1019 "encoding": eEncodingUint,
1020 "format": eFormatHex,
1021 "slice": "r14[7:0]",
1024 "name": "r15l",
1025 "set": 0,
1026 "bitsize": 8,
1027 "encoding": eEncodingUint,
1028 "format": eFormatHex,
1029 "slice": "r15[7:0]",
1033 g_target_definition = None
1036 def get_target_definition():
1037 global g_target_definition
1038 if g_target_definition is None:
1039 g_target_definition = {}
1040 offset = 0
1041 for reg_info in x86_64_register_infos:
1042 reg_name = reg_info["name"]
1044 # Only fill in the offset if there is no 'slice' in the register
1045 # info
1046 if "slice" not in reg_info and "composite" not in reg_info:
1047 reg_info["offset"] = offset
1048 offset += reg_info["bitsize"] // 8
1050 # Set the GCC/DWARF register number for this register if it has one
1051 reg_num = get_reg_num(name_to_gcc_dwarf_regnum, reg_name)
1052 if reg_num != LLDB_INVALID_REGNUM:
1053 reg_info["gcc"] = reg_num
1054 reg_info["dwarf"] = reg_num
1056 # Set the generic register number for this register if it has one
1057 reg_num = get_reg_num(name_to_generic_regnum, reg_name)
1058 if reg_num != LLDB_INVALID_REGNUM:
1059 reg_info["generic"] = reg_num
1061 # Set the GDB register number for this register if it has one
1062 reg_num = get_reg_num(name_to_gdb_regnum, reg_name)
1063 if reg_num != LLDB_INVALID_REGNUM:
1064 reg_info["gdb"] = reg_num
1066 g_target_definition["sets"] = [
1067 "General Purpose Registers",
1068 "Floating Point Registers",
1070 g_target_definition["registers"] = x86_64_register_infos
1071 g_target_definition["host-info"] = {
1072 "triple": "x86_64-*-linux",
1073 "endian": eByteOrderLittle,
1075 g_target_definition["g-packet-size"] = offset
1076 g_target_definition["breakpoint-pc-offset"] = -1
1077 return g_target_definition
1080 def get_dynamic_setting(target, setting_name):
1081 if setting_name == "gdb-server-target-definition":
1082 return get_target_definition()