Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(232)

Side by Side Diff: gdb/nacl-tdep.c

Issue 12380017: Recognize NaCl OS ABI for all ELF files. (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@master
Patch Set: comment formatting Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Target-dependent code for NaCl. 1 /* Target-dependent code for NaCl.
2 2
3 Copyright (C) 2001, 2003-2012 Free Software Foundation, Inc. 3 Copyright (C) 2001, 2003-2012 Free Software Foundation, Inc.
4 4
5 This file is part of GDB. 5 This file is part of GDB.
6 6
7 This program is free software; you can redistribute it and/or modify 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 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or 9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
(...skipping 18 matching lines...) Expand all
29 #include "osabi.h" 29 #include "osabi.h"
30 #include "disasm.h" 30 #include "disasm.h"
31 #include "breakpoint.h" 31 #include "breakpoint.h"
32 #include "target.h" 32 #include "target.h"
33 #include "elf-bfd.h" 33 #include "elf-bfd.h"
34 #include "inferior.h" 34 #include "inferior.h"
35 35
36 static enum gdb_osabi 36 static enum gdb_osabi
37 nacl_osabi_sniffer (bfd *abfd) 37 nacl_osabi_sniffer (bfd *abfd)
38 { 38 {
39 /* WARNING! This way of checking for NaCl OS ABI is deprecated. 39 /* We removed Linux remote debugging support from NaCl debugger, so we must
40 See http://code.google.com/p/nativeclient/issues/detail?id=2971 */ 40 handle all ELF files ourselves now.
41 if (bfd_get_flavour (abfd) == bfd_target_elf_flavour && 41
42 elf_elfheader (abfd)->e_ident[EI_OSABI] == 123) 42 If we want to support both Linux and NaCl remote debugging simultaneously,
43 we would have to find some way to distinguish NaCl and Linux binaries here.
44 Currently there is no way to distinguish PNaCl-produced binaries from
45 Linux binaries.
46
47 See issues https://code.google.com/p/nativeclient/issues/detail?id=2971 and
48 https://code.google.com/p/nativeclient/issues/detail?id=3313
49 for details. */
50 if (bfd_get_flavour (abfd) == bfd_target_elf_flavour)
43 return GDB_OSABI_NACL; 51 return GDB_OSABI_NACL;
44 52
45 return GDB_OSABI_UNKNOWN; 53 return GDB_OSABI_UNKNOWN;
46 } 54 }
47 55
48 static void 56 static void
49 nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) 57 nacl_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
50 { 58 {
51 /* NaCl uses SVR4-style shared libraries. */ 59 /* NaCl uses SVR4-style shared libraries. */
52 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target); 60 set_gdbarch_skip_trampoline_code (gdbarch, find_solib_trampoline_target);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 { 232 {
225 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour, 233 gdbarch_register_osabi_sniffer (bfd_arch_i386, bfd_target_elf_flavour,
226 nacl_osabi_sniffer); 234 nacl_osabi_sniffer);
227 235
228 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64, 236 gdbarch_register_osabi (bfd_arch_i386, bfd_mach_x86_64,
229 GDB_OSABI_NACL, amd64_nacl_init_abi); 237 GDB_OSABI_NACL, amd64_nacl_init_abi);
230 238
231 gdbarch_register_osabi (bfd_arch_i386, 0, 239 gdbarch_register_osabi (bfd_arch_i386, 0,
232 GDB_OSABI_NACL, i386_nacl_init_abi); 240 GDB_OSABI_NACL, i386_nacl_init_abi);
233 } 241 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698