gdbtypes.resolve_dynamic_range: Add function description.
[deliverable/binutils-gdb.git] / gdb / i386-linux-tdep.c
CommitLineData
871fbe6a 1/* Target-dependent code for GNU/Linux i386.
ca557f44 2
ecd75fc8 3 Copyright (C) 2000-2014 Free Software Foundation, Inc.
e7ee86a9
JB
4
5 This file is part of GDB.
6
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
a9762ec7 9 the Free Software Foundation; either version 3 of the License, or
e7ee86a9
JB
10 (at your option) any later version.
11
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.
16
17 You should have received a copy of the GNU General Public License
a9762ec7 18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
e7ee86a9
JB
19
20#include "defs.h"
21#include "gdbcore.h"
22#include "frame.h"
23#include "value.h"
4e052eda 24#include "regcache.h"
c131fcee 25#include "regset.h"
6441c4a0 26#include "inferior.h"
0670c0aa 27#include "osabi.h"
38c968cf 28#include "reggroups.h"
5cb2fe25 29#include "dwarf2-frame.h"
0e9f083f 30#include <string.h>
4be87837 31
8201327c
MK
32#include "i386-tdep.h"
33#include "i386-linux-tdep.h"
4aa995e1 34#include "linux-tdep.h"
0670c0aa 35#include "glibc-tdep.h"
871fbe6a 36#include "solib-svr4.h"
982e9687 37#include "symtab.h"
237fc4c9 38#include "arch-utils.h"
a96d9b2e
SDJ
39#include "xml-syscall.h"
40
c131fcee
L
41#include "i387-tdep.h"
42#include "i386-xstate.h"
43
a96d9b2e
SDJ
44/* The syscall's XML filename for i386. */
45#define XML_SYSCALL_FILENAME_I386 "syscalls/i386-linux.xml"
17ea7499 46
d02ed0bb 47#include "record-full.h"
77fcef51
HZ
48#include "linux-record.h"
49#include <stdint.h>
50
90884b2b 51#include "features/i386/i386-linux.c"
3a13a53b 52#include "features/i386/i386-mmx-linux.c"
1dbcd68c 53#include "features/i386/i386-mpx-linux.c"
c131fcee 54#include "features/i386/i386-avx-linux.c"
01f9f808 55#include "features/i386/i386-avx512-linux.c"
90884b2b 56
17ea7499
CES
57/* Supported register note sections. */
58static struct core_regset_section i386_linux_regset_sections[] =
59{
e0e0e543 60 { ".reg", 68, "general-purpose" },
1b1818e4 61 { ".reg2", 108, "floating-point" },
4ac5d44e
MK
62 { NULL, 0 }
63};
64
65static struct core_regset_section i386_linux_sse_regset_sections[] =
66{
e0e0e543 67 { ".reg", 68, "general-purpose" },
1b1818e4 68 { ".reg-xfp", 512, "extended floating-point" },
4ac5d44e
MK
69 { NULL, 0 }
70};
71
72static struct core_regset_section i386_linux_avx_regset_sections[] =
73{
e0e0e543 74 { ".reg", 68, "general-purpose" },
c131fcee 75 { ".reg-xstate", I386_XSTATE_MAX_SIZE, "XSAVE extended state" },
17ea7499
CES
76 { NULL, 0 }
77};
8201327c 78
38c968cf
AC
79/* Return non-zero, when the register is in the corresponding register
80 group. Put the LINUX_ORIG_EAX register in the system group. */
81static int
82i386_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
83 struct reggroup *group)
84{
85 if (regnum == I386_LINUX_ORIG_EAX_REGNUM)
86 return (group == system_reggroup
87 || group == save_reggroup
88 || group == restore_reggroup);
89 return i386_register_reggroup_p (gdbarch, regnum, group);
90}
91
e7ee86a9
JB
92\f
93/* Recognizing signal handler frames. */
94
ca557f44 95/* GNU/Linux has two flavors of signals. Normal signal handlers, and
e7ee86a9
JB
96 "realtime" (RT) signals. The RT signals can provide additional
97 information to the signal handler if the SA_SIGINFO flag is set
98 when establishing a signal handler using `sigaction'. It is not
ca557f44
AC
99 unlikely that future versions of GNU/Linux will support SA_SIGINFO
100 for normal signals too. */
e7ee86a9
JB
101
102/* When the i386 Linux kernel calls a signal handler and the
103 SA_RESTORER flag isn't set, the return address points to a bit of
104 code on the stack. This function returns whether the PC appears to
105 be within this bit of code.
106
107 The instruction sequence for normal signals is
108 pop %eax
acd5c798 109 mov $0x77, %eax
e7ee86a9
JB
110 int $0x80
111 or 0x58 0xb8 0x77 0x00 0x00 0x00 0xcd 0x80.
112
113 Checking for the code sequence should be somewhat reliable, because
114 the effect is to call the system call sigreturn. This is unlikely
911bc6ee 115 to occur anywhere other than in a signal trampoline.
e7ee86a9
JB
116
117 It kind of sucks that we have to read memory from the process in
118 order to identify a signal trampoline, but there doesn't seem to be
911bc6ee
MK
119 any other way. Therefore we only do the memory reads if no
120 function name could be identified, which should be the case since
121 the code is on the stack.
e7ee86a9
JB
122
123 Detection of signal trampolines for handlers that set the
124 SA_RESTORER flag is in general not possible. Unfortunately this is
125 what the GNU C Library has been doing for quite some time now.
126 However, as of version 2.1.2, the GNU C Library uses signal
127 trampolines (named __restore and __restore_rt) that are identical
128 to the ones used by the kernel. Therefore, these trampolines are
129 supported too. */
130
acd5c798
MK
131#define LINUX_SIGTRAMP_INSN0 0x58 /* pop %eax */
132#define LINUX_SIGTRAMP_OFFSET0 0
133#define LINUX_SIGTRAMP_INSN1 0xb8 /* mov $NNNN, %eax */
134#define LINUX_SIGTRAMP_OFFSET1 1
135#define LINUX_SIGTRAMP_INSN2 0xcd /* int */
136#define LINUX_SIGTRAMP_OFFSET2 6
e7ee86a9 137
4252dc94 138static const gdb_byte linux_sigtramp_code[] =
e7ee86a9
JB
139{
140 LINUX_SIGTRAMP_INSN0, /* pop %eax */
acd5c798 141 LINUX_SIGTRAMP_INSN1, 0x77, 0x00, 0x00, 0x00, /* mov $0x77, %eax */
e7ee86a9
JB
142 LINUX_SIGTRAMP_INSN2, 0x80 /* int $0x80 */
143};
144
145#define LINUX_SIGTRAMP_LEN (sizeof linux_sigtramp_code)
146
10458914
DJ
147/* If THIS_FRAME is a sigtramp routine, return the address of the
148 start of the routine. Otherwise, return 0. */
e7ee86a9
JB
149
150static CORE_ADDR
10458914 151i386_linux_sigtramp_start (struct frame_info *this_frame)
e7ee86a9 152{
10458914 153 CORE_ADDR pc = get_frame_pc (this_frame);
4252dc94 154 gdb_byte buf[LINUX_SIGTRAMP_LEN];
e7ee86a9
JB
155
156 /* We only recognize a signal trampoline if PC is at the start of
157 one of the three instructions. We optimize for finding the PC at
158 the start, as will be the case when the trampoline is not the
159 first frame on the stack. We assume that in the case where the
160 PC is not at the start of the instruction sequence, there will be
161 a few trailing readable bytes on the stack. */
162
10458914 163 if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
e7ee86a9
JB
164 return 0;
165
166 if (buf[0] != LINUX_SIGTRAMP_INSN0)
167 {
168 int adjust;
169
170 switch (buf[0])
171 {
172 case LINUX_SIGTRAMP_INSN1:
173 adjust = LINUX_SIGTRAMP_OFFSET1;
174 break;
175 case LINUX_SIGTRAMP_INSN2:
176 adjust = LINUX_SIGTRAMP_OFFSET2;
177 break;
178 default:
179 return 0;
180 }
181
182 pc -= adjust;
183
10458914 184 if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_SIGTRAMP_LEN))
e7ee86a9
JB
185 return 0;
186 }
187
188 if (memcmp (buf, linux_sigtramp_code, LINUX_SIGTRAMP_LEN) != 0)
189 return 0;
190
191 return pc;
192}
193
194/* This function does the same for RT signals. Here the instruction
195 sequence is
acd5c798 196 mov $0xad, %eax
e7ee86a9
JB
197 int $0x80
198 or 0xb8 0xad 0x00 0x00 0x00 0xcd 0x80.
199
200 The effect is to call the system call rt_sigreturn. */
201
acd5c798
MK
202#define LINUX_RT_SIGTRAMP_INSN0 0xb8 /* mov $NNNN, %eax */
203#define LINUX_RT_SIGTRAMP_OFFSET0 0
204#define LINUX_RT_SIGTRAMP_INSN1 0xcd /* int */
205#define LINUX_RT_SIGTRAMP_OFFSET1 5
e7ee86a9 206
4252dc94 207static const gdb_byte linux_rt_sigtramp_code[] =
e7ee86a9 208{
acd5c798 209 LINUX_RT_SIGTRAMP_INSN0, 0xad, 0x00, 0x00, 0x00, /* mov $0xad, %eax */
e7ee86a9
JB
210 LINUX_RT_SIGTRAMP_INSN1, 0x80 /* int $0x80 */
211};
212
213#define LINUX_RT_SIGTRAMP_LEN (sizeof linux_rt_sigtramp_code)
214
10458914
DJ
215/* If THIS_FRAME is an RT sigtramp routine, return the address of the
216 start of the routine. Otherwise, return 0. */
e7ee86a9
JB
217
218static CORE_ADDR
10458914 219i386_linux_rt_sigtramp_start (struct frame_info *this_frame)
e7ee86a9 220{
10458914 221 CORE_ADDR pc = get_frame_pc (this_frame);
4252dc94 222 gdb_byte buf[LINUX_RT_SIGTRAMP_LEN];
e7ee86a9
JB
223
224 /* We only recognize a signal trampoline if PC is at the start of
225 one of the two instructions. We optimize for finding the PC at
226 the start, as will be the case when the trampoline is not the
227 first frame on the stack. We assume that in the case where the
228 PC is not at the start of the instruction sequence, there will be
229 a few trailing readable bytes on the stack. */
230
10458914 231 if (!safe_frame_unwind_memory (this_frame, pc, buf, LINUX_RT_SIGTRAMP_LEN))
e7ee86a9
JB
232 return 0;
233
234 if (buf[0] != LINUX_RT_SIGTRAMP_INSN0)
235 {
236 if (buf[0] != LINUX_RT_SIGTRAMP_INSN1)
237 return 0;
238
239 pc -= LINUX_RT_SIGTRAMP_OFFSET1;
240
10458914 241 if (!safe_frame_unwind_memory (this_frame, pc, buf,
8e6bed05 242 LINUX_RT_SIGTRAMP_LEN))
e7ee86a9
JB
243 return 0;
244 }
245
246 if (memcmp (buf, linux_rt_sigtramp_code, LINUX_RT_SIGTRAMP_LEN) != 0)
247 return 0;
248
249 return pc;
250}
251
10458914
DJ
252/* Return whether THIS_FRAME corresponds to a GNU/Linux sigtramp
253 routine. */
e7ee86a9 254
8201327c 255static int
10458914 256i386_linux_sigtramp_p (struct frame_info *this_frame)
e7ee86a9 257{
10458914 258 CORE_ADDR pc = get_frame_pc (this_frame);
2c02bd72 259 const char *name;
911bc6ee
MK
260
261 find_pc_partial_function (pc, &name, NULL, NULL);
262
ef17e74b
DJ
263 /* If we have NAME, we can optimize the search. The trampolines are
264 named __restore and __restore_rt. However, they aren't dynamically
265 exported from the shared C library, so the trampoline may appear to
266 be part of the preceding function. This should always be sigaction,
267 __sigaction, or __libc_sigaction (all aliases to the same function). */
268 if (name == NULL || strstr (name, "sigaction") != NULL)
10458914
DJ
269 return (i386_linux_sigtramp_start (this_frame) != 0
270 || i386_linux_rt_sigtramp_start (this_frame) != 0);
ef17e74b
DJ
271
272 return (strcmp ("__restore", name) == 0
273 || strcmp ("__restore_rt", name) == 0);
e7ee86a9
JB
274}
275
4a4e5149
DJ
276/* Return one if the PC of THIS_FRAME is in a signal trampoline which
277 may have DWARF-2 CFI. */
12b8a2cb
DJ
278
279static int
280i386_linux_dwarf_signal_frame_p (struct gdbarch *gdbarch,
4a4e5149 281 struct frame_info *this_frame)
12b8a2cb 282{
4a4e5149 283 CORE_ADDR pc = get_frame_pc (this_frame);
2c02bd72 284 const char *name;
12b8a2cb
DJ
285
286 find_pc_partial_function (pc, &name, NULL, NULL);
287
288 /* If a vsyscall DSO is in use, the signal trampolines may have these
289 names. */
290 if (name && (strcmp (name, "__kernel_sigreturn") == 0
291 || strcmp (name, "__kernel_rt_sigreturn") == 0))
292 return 1;
293
294 return 0;
295}
296
acd5c798
MK
297/* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
298#define I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET 20
299
10458914
DJ
300/* Assuming THIS_FRAME is a GNU/Linux sigtramp routine, return the
301 address of the associated sigcontext structure. */
e7ee86a9 302
b7d15bf7 303static CORE_ADDR
10458914 304i386_linux_sigcontext_addr (struct frame_info *this_frame)
e7ee86a9 305{
e17a4113
UW
306 struct gdbarch *gdbarch = get_frame_arch (this_frame);
307 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
e7ee86a9 308 CORE_ADDR pc;
acd5c798 309 CORE_ADDR sp;
4252dc94 310 gdb_byte buf[4];
acd5c798 311
10458914 312 get_frame_register (this_frame, I386_ESP_REGNUM, buf);
e17a4113 313 sp = extract_unsigned_integer (buf, 4, byte_order);
e7ee86a9 314
10458914 315 pc = i386_linux_sigtramp_start (this_frame);
e7ee86a9
JB
316 if (pc)
317 {
acd5c798
MK
318 /* The sigcontext structure lives on the stack, right after
319 the signum argument. We determine the address of the
320 sigcontext structure by looking at the frame's stack
321 pointer. Keep in mind that the first instruction of the
322 sigtramp code is "pop %eax". If the PC is after this
323 instruction, adjust the returned value accordingly. */
10458914 324 if (pc == get_frame_pc (this_frame))
e7ee86a9
JB
325 return sp + 4;
326 return sp;
327 }
328
10458914 329 pc = i386_linux_rt_sigtramp_start (this_frame);
e7ee86a9
JB
330 if (pc)
331 {
acd5c798
MK
332 CORE_ADDR ucontext_addr;
333
334 /* The sigcontext structure is part of the user context. A
335 pointer to the user context is passed as the third argument
336 to the signal handler. */
337 read_memory (sp + 8, buf, 4);
e17a4113 338 ucontext_addr = extract_unsigned_integer (buf, 4, byte_order);
acd5c798 339 return ucontext_addr + I386_LINUX_UCONTEXT_SIGCONTEXT_OFFSET;
e7ee86a9
JB
340 }
341
8a3fe4f8 342 error (_("Couldn't recognize signal trampoline."));
e7ee86a9
JB
343 return 0;
344}
345
6441c4a0
MK
346/* Set the program counter for process PTID to PC. */
347
8201327c 348static void
61a1198a 349i386_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
6441c4a0 350{
61a1198a 351 regcache_cooked_write_unsigned (regcache, I386_EIP_REGNUM, pc);
6441c4a0
MK
352
353 /* We must be careful with modifying the program counter. If we
354 just interrupted a system call, the kernel might try to restart
355 it when we resume the inferior. On restarting the system call,
356 the kernel will try backing up the program counter even though it
357 no longer points at the system call. This typically results in a
358 SIGSEGV or SIGILL. We can prevent this by writing `-1' in the
359 "orig_eax" pseudo-register.
360
361 Note that "orig_eax" is saved when setting up a dummy call frame.
362 This means that it is properly restored when that frame is
363 popped, and that the interrupted system call will be restarted
364 when we resume the inferior on return from a function call from
365 within GDB. In all other cases the system call will not be
366 restarted. */
61a1198a 367 regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1);
6441c4a0 368}
77fcef51 369
8a2e0e28
HZ
370/* Record all registers but IP register for process-record. */
371
372static int
373i386_all_but_ip_registers_record (struct regcache *regcache)
374{
25ea693b 375 if (record_full_arch_list_add_reg (regcache, I386_EAX_REGNUM))
8a2e0e28 376 return -1;
25ea693b 377 if (record_full_arch_list_add_reg (regcache, I386_ECX_REGNUM))
8a2e0e28 378 return -1;
25ea693b 379 if (record_full_arch_list_add_reg (regcache, I386_EDX_REGNUM))
8a2e0e28 380 return -1;
25ea693b 381 if (record_full_arch_list_add_reg (regcache, I386_EBX_REGNUM))
8a2e0e28 382 return -1;
25ea693b 383 if (record_full_arch_list_add_reg (regcache, I386_ESP_REGNUM))
8a2e0e28 384 return -1;
25ea693b 385 if (record_full_arch_list_add_reg (regcache, I386_EBP_REGNUM))
8a2e0e28 386 return -1;
25ea693b 387 if (record_full_arch_list_add_reg (regcache, I386_ESI_REGNUM))
8a2e0e28 388 return -1;
25ea693b 389 if (record_full_arch_list_add_reg (regcache, I386_EDI_REGNUM))
8a2e0e28 390 return -1;
25ea693b 391 if (record_full_arch_list_add_reg (regcache, I386_EFLAGS_REGNUM))
8a2e0e28
HZ
392 return -1;
393
394 return 0;
395}
13b6d1d4
MS
396
397/* i386_canonicalize_syscall maps from the native i386 Linux set
398 of syscall ids into a canonical set of syscall ids used by
399 process record (a mostly trivial mapping, since the canonical
400 set was originally taken from the i386 set). */
401
402static enum gdb_syscall
403i386_canonicalize_syscall (int syscall)
404{
405 enum { i386_syscall_max = 499 };
406
407 if (syscall <= i386_syscall_max)
408 return syscall;
409 else
410 return -1;
411}
412
77fcef51
HZ
413/* Parse the arguments of current system call instruction and record
414 the values of the registers and memory that will be changed into
415 "record_arch_list". This instruction is "int 0x80" (Linux
416 Kernel2.4) or "sysenter" (Linux Kernel 2.6).
417
418 Return -1 if something wrong. */
419
8a2e0e28
HZ
420static struct linux_record_tdep i386_linux_record_tdep;
421
77fcef51 422static int
ffdf6de5 423i386_linux_intx80_sysenter_syscall_record (struct regcache *regcache)
77fcef51
HZ
424{
425 int ret;
13b6d1d4
MS
426 LONGEST syscall_native;
427 enum gdb_syscall syscall_gdb;
428
429 regcache_raw_read_signed (regcache, I386_EAX_REGNUM, &syscall_native);
77fcef51 430
13b6d1d4 431 syscall_gdb = i386_canonicalize_syscall (syscall_native);
2c543fc4 432
13b6d1d4 433 if (syscall_gdb < 0)
2c543fc4
HZ
434 {
435 printf_unfiltered (_("Process record and replay target doesn't "
13b6d1d4
MS
436 "support syscall number %s\n"),
437 plongest (syscall_native));
2c543fc4
HZ
438 return -1;
439 }
77fcef51 440
8a2e0e28
HZ
441 if (syscall_gdb == gdb_sys_sigreturn
442 || syscall_gdb == gdb_sys_rt_sigreturn)
443 {
444 if (i386_all_but_ip_registers_record (regcache))
445 return -1;
446 return 0;
447 }
448
13b6d1d4 449 ret = record_linux_system_call (syscall_gdb, regcache,
77fcef51
HZ
450 &i386_linux_record_tdep);
451 if (ret)
452 return ret;
453
454 /* Record the return value of the system call. */
25ea693b 455 if (record_full_arch_list_add_reg (regcache, I386_EAX_REGNUM))
77fcef51
HZ
456 return -1;
457
458 return 0;
459}
8a2e0e28
HZ
460
461#define I386_LINUX_xstate 270
462#define I386_LINUX_frame_size 732
463
70221824 464static int
8a2e0e28
HZ
465i386_linux_record_signal (struct gdbarch *gdbarch,
466 struct regcache *regcache,
2ea28649 467 enum gdb_signal signal)
8a2e0e28
HZ
468{
469 ULONGEST esp;
470
471 if (i386_all_but_ip_registers_record (regcache))
472 return -1;
473
25ea693b 474 if (record_full_arch_list_add_reg (regcache, I386_EIP_REGNUM))
8a2e0e28
HZ
475 return -1;
476
477 /* Record the change in the stack. */
478 regcache_raw_read_unsigned (regcache, I386_ESP_REGNUM, &esp);
479 /* This is for xstate.
480 sp -= sizeof (struct _fpstate); */
481 esp -= I386_LINUX_xstate;
482 /* This is for frame_size.
483 sp -= sizeof (struct rt_sigframe); */
484 esp -= I386_LINUX_frame_size;
25ea693b
MM
485 if (record_full_arch_list_add_mem (esp,
486 I386_LINUX_xstate + I386_LINUX_frame_size))
8a2e0e28
HZ
487 return -1;
488
25ea693b 489 if (record_full_arch_list_add_end ())
8a2e0e28
HZ
490 return -1;
491
492 return 0;
493}
6441c4a0 494\f
8201327c 495
9a7f938f
JK
496/* Core of the implementation for gdbarch get_syscall_number. Get pending
497 syscall number from REGCACHE. If there is no pending syscall -1 will be
498 returned. Pending syscall means ptrace has stepped into the syscall but
499 another ptrace call will step out. PC is right after the int $0x80
500 / syscall / sysenter instruction in both cases, PC does not change during
501 the second ptrace step. */
502
a96d9b2e 503static LONGEST
9a7f938f 504i386_linux_get_syscall_number_from_regcache (struct regcache *regcache)
a96d9b2e 505{
9a7f938f 506 struct gdbarch *gdbarch = get_regcache_arch (regcache);
a96d9b2e
SDJ
507 enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
508 /* The content of a register. */
509 gdb_byte buf[4];
510 /* The result. */
511 LONGEST ret;
512
513 /* Getting the system call number from the register.
514 When dealing with x86 architecture, this information
515 is stored at %eax register. */
516 regcache_cooked_read (regcache, I386_LINUX_ORIG_EAX_REGNUM, buf);
517
518 ret = extract_signed_integer (buf, 4, byte_order);
519
520 return ret;
521}
522
9a7f938f
JK
523/* Wrapper for i386_linux_get_syscall_number_from_regcache to make it
524 compatible with gdbarch get_syscall_number method prototype. */
525
526static LONGEST
527i386_linux_get_syscall_number (struct gdbarch *gdbarch,
528 ptid_t ptid)
529{
530 struct regcache *regcache = get_thread_regcache (ptid);
531
532 return i386_linux_get_syscall_number_from_regcache (regcache);
533}
534
e9f1aad5
MK
535/* The register sets used in GNU/Linux ELF core-dumps are identical to
536 the register sets in `struct user' that are used for a.out
537 core-dumps. These are also used by ptrace(2). The corresponding
538 types are `elf_gregset_t' for the general-purpose registers (with
539 `elf_greg_t' the type of a single GP register) and `elf_fpregset_t'
540 for the floating-point registers.
541
542 Those types used to be available under the names `gregset_t' and
543 `fpregset_t' too, and GDB used those names in the past. But those
544 names are now used for the register sets used in the `mcontext_t'
545 type, which have a different size and layout. */
546
547/* Mapping between the general-purpose registers in `struct user'
548 format and GDB's register cache layout. */
549
550/* From <sys/reg.h>. */
be0d2954 551int i386_linux_gregset_reg_offset[] =
e9f1aad5
MK
552{
553 6 * 4, /* %eax */
554 1 * 4, /* %ecx */
555 2 * 4, /* %edx */
556 0 * 4, /* %ebx */
557 15 * 4, /* %esp */
558 5 * 4, /* %ebp */
559 3 * 4, /* %esi */
560 4 * 4, /* %edi */
561 12 * 4, /* %eip */
562 14 * 4, /* %eflags */
563 13 * 4, /* %cs */
564 16 * 4, /* %ss */
565 7 * 4, /* %ds */
566 8 * 4, /* %es */
567 9 * 4, /* %fs */
568 10 * 4, /* %gs */
569 -1, -1, -1, -1, -1, -1, -1, -1,
570 -1, -1, -1, -1, -1, -1, -1, -1,
571 -1, -1, -1, -1, -1, -1, -1, -1,
572 -1,
c131fcee 573 -1, -1, -1, -1, -1, -1, -1, -1,
01f9f808
MS
574 -1, -1, -1, -1, /* MPX registers BND0 ... BND3. */
575 -1, -1, /* MPX registers BNDCFGU, BNDSTATUS. */
576 -1, -1, -1, -1, -1, -1, -1, -1, /* k0 ... k7 (AVX512) */
577 -1, -1, -1, -1, -1, -1, -1, -1, /* zmm0 ... zmm7 (AVX512) */
578 11 * 4, /* "orig_eax" */
e9f1aad5
MK
579};
580
581/* Mapping between the general-purpose registers in `struct
582 sigcontext' format and GDB's register cache layout. */
583
a3386186 584/* From <asm/sigcontext.h>. */
bb489b3c 585static int i386_linux_sc_reg_offset[] =
a3386186
MK
586{
587 11 * 4, /* %eax */
588 10 * 4, /* %ecx */
589 9 * 4, /* %edx */
590 8 * 4, /* %ebx */
591 7 * 4, /* %esp */
592 6 * 4, /* %ebp */
593 5 * 4, /* %esi */
594 4 * 4, /* %edi */
595 14 * 4, /* %eip */
596 16 * 4, /* %eflags */
597 15 * 4, /* %cs */
598 18 * 4, /* %ss */
599 3 * 4, /* %ds */
600 2 * 4, /* %es */
601 1 * 4, /* %fs */
602 0 * 4 /* %gs */
603};
604
c131fcee
L
605/* Get XSAVE extended state xcr0 from core dump. */
606
607uint64_t
6df81a63 608i386_linux_core_read_xcr0 (bfd *abfd)
c131fcee
L
609{
610 asection *xstate = bfd_get_section_by_name (abfd, ".reg-xstate");
611 uint64_t xcr0;
612
613 if (xstate)
614 {
615 size_t size = bfd_section_size (abfd, xstate);
616
617 /* Check extended state size. */
618 if (size < I386_XSTATE_AVX_SIZE)
619 xcr0 = I386_XSTATE_SSE_MASK;
620 else
621 {
622 char contents[8];
623
624 if (! bfd_get_section_contents (abfd, xstate, contents,
625 I386_LINUX_XSAVE_XCR0_OFFSET,
626 8))
627 {
1777feb0
MS
628 warning (_("Couldn't read `xcr0' bytes from "
629 "`.reg-xstate' section in core file."));
c131fcee
L
630 return 0;
631 }
632
633 xcr0 = bfd_get_64 (abfd, contents);
634 }
635 }
636 else
f335d1b3 637 xcr0 = 0;
c131fcee
L
638
639 return xcr0;
640}
641
90884b2b
L
642/* Get Linux/x86 target description from core dump. */
643
644static const struct target_desc *
645i386_linux_core_read_description (struct gdbarch *gdbarch,
646 struct target_ops *target,
647 bfd *abfd)
648{
90884b2b 649 /* Linux/i386. */
6df81a63 650 uint64_t xcr0 = i386_linux_core_read_xcr0 (abfd);
1dbcd68c
WT
651
652 switch ((xcr0 & I386_XSTATE_ALL_MASK))
f335d1b3 653 {
01f9f808
MS
654 case I386_XSTATE_MPX_AVX512_MASK:
655 case I386_XSTATE_AVX512_MASK:
656 return tdesc_i386_avx512_linux;
1dbcd68c
WT
657 case I386_XSTATE_MPX_MASK:
658 return tdesc_i386_mpx_linux;
f335d1b3
L
659 case I386_XSTATE_AVX_MASK:
660 return tdesc_i386_avx_linux;
661 case I386_XSTATE_SSE_MASK:
662 return tdesc_i386_linux;
663 case I386_XSTATE_X87_MASK:
664 return tdesc_i386_mmx_linux;
665 default:
666 break;
667 }
668
669 if (bfd_get_section_by_name (abfd, ".reg-xfp") != NULL)
c131fcee 670 return tdesc_i386_linux;
f335d1b3
L
671 else
672 return tdesc_i386_mmx_linux;
90884b2b
L
673}
674
9a7f938f
JK
675/* Linux kernel shows PC value after the 'int $0x80' instruction even if
676 inferior is still inside the syscall. On next PTRACE_SINGLESTEP it will
677 finish the syscall but PC will not change.
678
679 Some vDSOs contain 'int $0x80; ret' and during stepping out of the syscall
680 i386_displaced_step_fixup would keep PC at the displaced pad location.
681 As PC is pointing to the 'ret' instruction before the step
682 i386_displaced_step_fixup would expect inferior has just executed that 'ret'
683 and PC should not be adjusted. In reality it finished syscall instead and
684 PC should get relocated back to its vDSO address. Hide the 'ret'
685 instruction by 'nop' so that i386_displaced_step_fixup is not confused.
686
687 It is not fully correct as the bytes in struct displaced_step_closure will
688 not match the inferior code. But we would need some new flag in
689 displaced_step_closure otherwise to keep the state that syscall is finishing
690 for the later i386_displaced_step_fixup execution as the syscall execution
691 is already no longer detectable there. The new flag field would mean
692 i386-linux-tdep.c needs to wrap all the displacement methods of i386-tdep.c
693 which does not seem worth it. The same effect is achieved by patching that
694 'nop' instruction there instead. */
695
693be288 696static struct displaced_step_closure *
9a7f938f
JK
697i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
698 CORE_ADDR from, CORE_ADDR to,
699 struct regcache *regs)
700{
701 struct displaced_step_closure *closure;
702
703 closure = i386_displaced_step_copy_insn (gdbarch, from, to, regs);
704
705 if (i386_linux_get_syscall_number_from_regcache (regs) != -1)
706 {
707 /* Since we use simple_displaced_step_copy_insn, our closure is a
708 copy of the instruction. */
709 gdb_byte *insn = (gdb_byte *) closure;
710
711 /* Fake nop. */
712 insn[0] = 0x90;
713 }
714
715 return closure;
716}
717
8201327c
MK
718static void
719i386_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
720{
721 struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
90884b2b
L
722 const struct target_desc *tdesc = info.target_desc;
723 struct tdesc_arch_data *tdesc_data = (void *) info.tdep_info;
724 const struct tdesc_feature *feature;
725 int valid_p;
726
727 gdb_assert (tdesc_data);
8201327c 728
a5ee0f0c
PA
729 linux_init_abi (info, gdbarch);
730
8201327c
MK
731 /* GNU/Linux uses ELF. */
732 i386_elf_init_abi (info, gdbarch);
733
90884b2b
L
734 /* Reserve a number for orig_eax. */
735 set_gdbarch_num_regs (gdbarch, I386_LINUX_NUM_REGS);
736
737 if (! tdesc_has_registers (tdesc))
738 tdesc = tdesc_i386_linux;
739 tdep->tdesc = tdesc;
740
741 feature = tdesc_find_feature (tdesc, "org.gnu.gdb.i386.linux");
742 if (feature == NULL)
743 return;
8201327c 744
90884b2b
L
745 valid_p = tdesc_numbered_register (feature, tdesc_data,
746 I386_LINUX_ORIG_EAX_REGNUM,
747 "orig_eax");
748 if (!valid_p)
749 return;
750
751 /* Add the %orig_eax register used for syscall restarting. */
8201327c 752 set_gdbarch_write_pc (gdbarch, i386_linux_write_pc);
90884b2b
L
753
754 tdep->register_reggroup_p = i386_linux_register_reggroup_p;
8201327c 755
e9f1aad5
MK
756 tdep->gregset_reg_offset = i386_linux_gregset_reg_offset;
757 tdep->gregset_num_regs = ARRAY_SIZE (i386_linux_gregset_reg_offset);
758 tdep->sizeof_gregset = 17 * 4;
759
8201327c
MK
760 tdep->jb_pc_offset = 20; /* From <bits/setjmp.h>. */
761
911bc6ee 762 tdep->sigtramp_p = i386_linux_sigtramp_p;
b7d15bf7 763 tdep->sigcontext_addr = i386_linux_sigcontext_addr;
a3386186 764 tdep->sc_reg_offset = i386_linux_sc_reg_offset;
bb489b3c 765 tdep->sc_num_regs = ARRAY_SIZE (i386_linux_sc_reg_offset);
8201327c 766
c131fcee
L
767 tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET;
768
a6b808b4 769 set_gdbarch_process_record (gdbarch, i386_process_record);
8a2e0e28 770 set_gdbarch_process_record_signal (gdbarch, i386_linux_record_signal);
a6b808b4 771
77fcef51 772 /* Initialize the i386_linux_record_tdep. */
5e31abdf
HZ
773 /* These values are the size of the type that will be used in a system
774 call. They are obtained from Linux Kernel source. */
2c543fc4
HZ
775 i386_linux_record_tdep.size_pointer
776 = gdbarch_ptr_bit (gdbarch) / TARGET_CHAR_BIT;
5e31abdf
HZ
777 i386_linux_record_tdep.size__old_kernel_stat = 32;
778 i386_linux_record_tdep.size_tms = 16;
779 i386_linux_record_tdep.size_loff_t = 8;
780 i386_linux_record_tdep.size_flock = 16;
781 i386_linux_record_tdep.size_oldold_utsname = 45;
782 i386_linux_record_tdep.size_ustat = 20;
783 i386_linux_record_tdep.size_old_sigaction = 140;
784 i386_linux_record_tdep.size_old_sigset_t = 128;
785 i386_linux_record_tdep.size_rlimit = 8;
786 i386_linux_record_tdep.size_rusage = 72;
787 i386_linux_record_tdep.size_timeval = 8;
788 i386_linux_record_tdep.size_timezone = 8;
789 i386_linux_record_tdep.size_old_gid_t = 2;
790 i386_linux_record_tdep.size_old_uid_t = 2;
791 i386_linux_record_tdep.size_fd_set = 128;
792 i386_linux_record_tdep.size_dirent = 268;
793 i386_linux_record_tdep.size_dirent64 = 276;
794 i386_linux_record_tdep.size_statfs = 64;
795 i386_linux_record_tdep.size_statfs64 = 84;
796 i386_linux_record_tdep.size_sockaddr = 16;
2c543fc4
HZ
797 i386_linux_record_tdep.size_int
798 = gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT;
799 i386_linux_record_tdep.size_long
800 = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
801 i386_linux_record_tdep.size_ulong
802 = gdbarch_long_bit (gdbarch) / TARGET_CHAR_BIT;
5e31abdf
HZ
803 i386_linux_record_tdep.size_msghdr = 28;
804 i386_linux_record_tdep.size_itimerval = 16;
805 i386_linux_record_tdep.size_stat = 88;
806 i386_linux_record_tdep.size_old_utsname = 325;
807 i386_linux_record_tdep.size_sysinfo = 64;
808 i386_linux_record_tdep.size_msqid_ds = 88;
809 i386_linux_record_tdep.size_shmid_ds = 84;
810 i386_linux_record_tdep.size_new_utsname = 390;
811 i386_linux_record_tdep.size_timex = 128;
812 i386_linux_record_tdep.size_mem_dqinfo = 24;
813 i386_linux_record_tdep.size_if_dqblk = 68;
814 i386_linux_record_tdep.size_fs_quota_stat = 68;
815 i386_linux_record_tdep.size_timespec = 8;
816 i386_linux_record_tdep.size_pollfd = 8;
817 i386_linux_record_tdep.size_NFS_FHSIZE = 32;
818 i386_linux_record_tdep.size_knfsd_fh = 132;
819 i386_linux_record_tdep.size_TASK_COMM_LEN = 16;
820 i386_linux_record_tdep.size_sigaction = 140;
821 i386_linux_record_tdep.size_sigset_t = 8;
822 i386_linux_record_tdep.size_siginfo_t = 128;
823 i386_linux_record_tdep.size_cap_user_data_t = 12;
824 i386_linux_record_tdep.size_stack_t = 12;
825 i386_linux_record_tdep.size_off_t = i386_linux_record_tdep.size_long;
826 i386_linux_record_tdep.size_stat64 = 96;
827 i386_linux_record_tdep.size_gid_t = 2;
828 i386_linux_record_tdep.size_uid_t = 2;
829 i386_linux_record_tdep.size_PAGE_SIZE = 4096;
830 i386_linux_record_tdep.size_flock64 = 24;
831 i386_linux_record_tdep.size_user_desc = 16;
832 i386_linux_record_tdep.size_io_event = 32;
833 i386_linux_record_tdep.size_iocb = 64;
834 i386_linux_record_tdep.size_epoll_event = 12;
2c543fc4
HZ
835 i386_linux_record_tdep.size_itimerspec
836 = i386_linux_record_tdep.size_timespec * 2;
5e31abdf
HZ
837 i386_linux_record_tdep.size_mq_attr = 32;
838 i386_linux_record_tdep.size_siginfo = 128;
839 i386_linux_record_tdep.size_termios = 36;
840 i386_linux_record_tdep.size_termios2 = 44;
841 i386_linux_record_tdep.size_pid_t = 4;
842 i386_linux_record_tdep.size_winsize = 8;
843 i386_linux_record_tdep.size_serial_struct = 60;
844 i386_linux_record_tdep.size_serial_icounter_struct = 80;
845 i386_linux_record_tdep.size_hayes_esp_config = 12;
2c543fc4
HZ
846 i386_linux_record_tdep.size_size_t = 4;
847 i386_linux_record_tdep.size_iovec = 8;
5e31abdf
HZ
848
849 /* These values are the second argument of system call "sys_ioctl".
850 They are obtained from Linux Kernel source. */
851 i386_linux_record_tdep.ioctl_TCGETS = 0x5401;
852 i386_linux_record_tdep.ioctl_TCSETS = 0x5402;
853 i386_linux_record_tdep.ioctl_TCSETSW = 0x5403;
854 i386_linux_record_tdep.ioctl_TCSETSF = 0x5404;
855 i386_linux_record_tdep.ioctl_TCGETA = 0x5405;
856 i386_linux_record_tdep.ioctl_TCSETA = 0x5406;
857 i386_linux_record_tdep.ioctl_TCSETAW = 0x5407;
858 i386_linux_record_tdep.ioctl_TCSETAF = 0x5408;
859 i386_linux_record_tdep.ioctl_TCSBRK = 0x5409;
860 i386_linux_record_tdep.ioctl_TCXONC = 0x540A;
861 i386_linux_record_tdep.ioctl_TCFLSH = 0x540B;
862 i386_linux_record_tdep.ioctl_TIOCEXCL = 0x540C;
863 i386_linux_record_tdep.ioctl_TIOCNXCL = 0x540D;
864 i386_linux_record_tdep.ioctl_TIOCSCTTY = 0x540E;
865 i386_linux_record_tdep.ioctl_TIOCGPGRP = 0x540F;
866 i386_linux_record_tdep.ioctl_TIOCSPGRP = 0x5410;
867 i386_linux_record_tdep.ioctl_TIOCOUTQ = 0x5411;
868 i386_linux_record_tdep.ioctl_TIOCSTI = 0x5412;
869 i386_linux_record_tdep.ioctl_TIOCGWINSZ = 0x5413;
870 i386_linux_record_tdep.ioctl_TIOCSWINSZ = 0x5414;
871 i386_linux_record_tdep.ioctl_TIOCMGET = 0x5415;
872 i386_linux_record_tdep.ioctl_TIOCMBIS = 0x5416;
873 i386_linux_record_tdep.ioctl_TIOCMBIC = 0x5417;
874 i386_linux_record_tdep.ioctl_TIOCMSET = 0x5418;
875 i386_linux_record_tdep.ioctl_TIOCGSOFTCAR = 0x5419;
876 i386_linux_record_tdep.ioctl_TIOCSSOFTCAR = 0x541A;
877 i386_linux_record_tdep.ioctl_FIONREAD = 0x541B;
878 i386_linux_record_tdep.ioctl_TIOCINQ = i386_linux_record_tdep.ioctl_FIONREAD;
879 i386_linux_record_tdep.ioctl_TIOCLINUX = 0x541C;
880 i386_linux_record_tdep.ioctl_TIOCCONS = 0x541D;
881 i386_linux_record_tdep.ioctl_TIOCGSERIAL = 0x541E;
882 i386_linux_record_tdep.ioctl_TIOCSSERIAL = 0x541F;
883 i386_linux_record_tdep.ioctl_TIOCPKT = 0x5420;
884 i386_linux_record_tdep.ioctl_FIONBIO = 0x5421;
885 i386_linux_record_tdep.ioctl_TIOCNOTTY = 0x5422;
886 i386_linux_record_tdep.ioctl_TIOCSETD = 0x5423;
887 i386_linux_record_tdep.ioctl_TIOCGETD = 0x5424;
888 i386_linux_record_tdep.ioctl_TCSBRKP = 0x5425;
889 i386_linux_record_tdep.ioctl_TIOCTTYGSTRUCT = 0x5426;
890 i386_linux_record_tdep.ioctl_TIOCSBRK = 0x5427;
891 i386_linux_record_tdep.ioctl_TIOCCBRK = 0x5428;
892 i386_linux_record_tdep.ioctl_TIOCGSID = 0x5429;
893 i386_linux_record_tdep.ioctl_TCGETS2 = 0x802c542a;
894 i386_linux_record_tdep.ioctl_TCSETS2 = 0x402c542b;
895 i386_linux_record_tdep.ioctl_TCSETSW2 = 0x402c542c;
896 i386_linux_record_tdep.ioctl_TCSETSF2 = 0x402c542d;
897 i386_linux_record_tdep.ioctl_TIOCGPTN = 0x80045430;
898 i386_linux_record_tdep.ioctl_TIOCSPTLCK = 0x40045431;
899 i386_linux_record_tdep.ioctl_FIONCLEX = 0x5450;
900 i386_linux_record_tdep.ioctl_FIOCLEX = 0x5451;
901 i386_linux_record_tdep.ioctl_FIOASYNC = 0x5452;
902 i386_linux_record_tdep.ioctl_TIOCSERCONFIG = 0x5453;
903 i386_linux_record_tdep.ioctl_TIOCSERGWILD = 0x5454;
904 i386_linux_record_tdep.ioctl_TIOCSERSWILD = 0x5455;
905 i386_linux_record_tdep.ioctl_TIOCGLCKTRMIOS = 0x5456;
906 i386_linux_record_tdep.ioctl_TIOCSLCKTRMIOS = 0x5457;
907 i386_linux_record_tdep.ioctl_TIOCSERGSTRUCT = 0x5458;
908 i386_linux_record_tdep.ioctl_TIOCSERGETLSR = 0x5459;
909 i386_linux_record_tdep.ioctl_TIOCSERGETMULTI = 0x545A;
910 i386_linux_record_tdep.ioctl_TIOCSERSETMULTI = 0x545B;
911 i386_linux_record_tdep.ioctl_TIOCMIWAIT = 0x545C;
912 i386_linux_record_tdep.ioctl_TIOCGICOUNT = 0x545D;
913 i386_linux_record_tdep.ioctl_TIOCGHAYESESP = 0x545E;
914 i386_linux_record_tdep.ioctl_TIOCSHAYESESP = 0x545F;
915 i386_linux_record_tdep.ioctl_FIOQSIZE = 0x5460;
916
917 /* These values are the second argument of system call "sys_fcntl"
918 and "sys_fcntl64". They are obtained from Linux Kernel source. */
919 i386_linux_record_tdep.fcntl_F_GETLK = 5;
920 i386_linux_record_tdep.fcntl_F_GETLK64 = 12;
921 i386_linux_record_tdep.fcntl_F_SETLK64 = 13;
922 i386_linux_record_tdep.fcntl_F_SETLKW64 = 14;
50ef67b3 923
77fcef51
HZ
924 i386_linux_record_tdep.arg1 = I386_EBX_REGNUM;
925 i386_linux_record_tdep.arg2 = I386_ECX_REGNUM;
926 i386_linux_record_tdep.arg3 = I386_EDX_REGNUM;
927 i386_linux_record_tdep.arg4 = I386_ESI_REGNUM;
928 i386_linux_record_tdep.arg5 = I386_EDI_REGNUM;
2c543fc4 929 i386_linux_record_tdep.arg6 = I386_EBP_REGNUM;
77fcef51 930
ffdf6de5
JK
931 tdep->i386_intx80_record = i386_linux_intx80_sysenter_syscall_record;
932 tdep->i386_sysenter_record = i386_linux_intx80_sysenter_syscall_record;
933 tdep->i386_syscall_record = i386_linux_intx80_sysenter_syscall_record;
77fcef51 934
203c3895 935 /* N_FUN symbols in shared libaries have 0 for their values and need
1777feb0 936 to be relocated. */
203c3895
UW
937 set_gdbarch_sofun_address_maybe_missing (gdbarch, 1);
938
871fbe6a 939 /* GNU/Linux uses SVR4-style shared libraries. */
982e9687 940 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
871fbe6a
MK
941 set_solib_svr4_fetch_link_map_offsets
942 (gdbarch, svr4_ilp32_fetch_link_map_offsets);
943
944 /* GNU/Linux uses the dynamic linker included in the GNU C Library. */
bb41a796 945 set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver);
12b8a2cb
DJ
946
947 dwarf2_frame_set_signal_frame_p (gdbarch, i386_linux_dwarf_signal_frame_p);
b2756930
KB
948
949 /* Enable TLS support. */
950 set_gdbarch_fetch_tls_load_module_address (gdbarch,
951 svr4_fetch_objfile_link_map);
237fc4c9 952
17ea7499 953 /* Install supported register note sections. */
01f9f808
MS
954 if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.avx512")
955 || tdesc_find_feature (tdesc, "org.gnu.gdb.i386.avx"))
4ac5d44e
MK
956 set_gdbarch_core_regset_sections (gdbarch, i386_linux_avx_regset_sections);
957 else if (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.sse"))
958 set_gdbarch_core_regset_sections (gdbarch, i386_linux_sse_regset_sections);
959 else
960 set_gdbarch_core_regset_sections (gdbarch, i386_linux_regset_sections);
17ea7499 961
90884b2b
L
962 set_gdbarch_core_read_description (gdbarch,
963 i386_linux_core_read_description);
964
237fc4c9
PA
965 /* Displaced stepping. */
966 set_gdbarch_displaced_step_copy_insn (gdbarch,
9a7f938f 967 i386_linux_displaced_step_copy_insn);
237fc4c9
PA
968 set_gdbarch_displaced_step_fixup (gdbarch, i386_displaced_step_fixup);
969 set_gdbarch_displaced_step_free_closure (gdbarch,
970 simple_displaced_step_free_closure);
971 set_gdbarch_displaced_step_location (gdbarch,
972 displaced_step_at_entry_point);
4aa995e1 973
a96d9b2e
SDJ
974 /* Functions for 'catch syscall'. */
975 set_xml_syscall_file_name (XML_SYSCALL_FILENAME_I386);
976 set_gdbarch_get_syscall_number (gdbarch,
977 i386_linux_get_syscall_number);
978
4aa995e1 979 set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
8201327c
MK
980}
981
982/* Provide a prototype to silence -Wmissing-prototypes. */
983extern void _initialize_i386_linux_tdep (void);
984
985void
986_initialize_i386_linux_tdep (void)
987{
05816f70 988 gdbarch_register_osabi (bfd_arch_i386, 0, GDB_OSABI_LINUX,
8201327c 989 i386_linux_init_abi);
90884b2b 990
1777feb0 991 /* Initialize the Linux target description. */
90884b2b 992 initialize_tdesc_i386_linux ();
3a13a53b 993 initialize_tdesc_i386_mmx_linux ();
c131fcee 994 initialize_tdesc_i386_avx_linux ();
1dbcd68c 995 initialize_tdesc_i386_mpx_linux ();
01f9f808 996 initialize_tdesc_i386_avx512_linux ();
8201327c 997}
This page took 1.066997 seconds and 4 git commands to generate.