X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fosabi.c;h=f7d4e7423910d350d5393973a588c1ac6be068f2;hb=93daf339a4d9496ecde15d3b1e852fbdb38c07d0;hp=3581eb334c4efcc1e5747a76de09de26c4c03d83;hpb=c8f6c93cb29febd6b8174a20eb35368e70f62faa;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/osabi.c b/gdb/osabi.c index 3581eb334c..f7d4e74239 100644 --- a/gdb/osabi.c +++ b/gdb/osabi.c @@ -1,6 +1,6 @@ /* OS ABI variant handling for GDB. - Copyright (C) 2001-2015 Free Software Foundation, Inc. + Copyright (C) 2001-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -64,17 +64,17 @@ static const struct osabi_names gdb_osabi_names[] = { "GNU/Hurd", NULL }, { "Solaris", NULL }, { "GNU/Linux", "linux(-gnu)?" }, - { "FreeBSD a.out", NULL }, - { "FreeBSD ELF", NULL }, - { "NetBSD a.out", NULL }, - { "NetBSD ELF", NULL }, - { "OpenBSD ELF", NULL }, - { "Windows CE", NULL }, + { "FreeBSD/a.out", NULL }, + { "FreeBSD/ELF", NULL }, + { "NetBSD/a.out", NULL }, + { "NetBSD/ELF", NULL }, + { "OpenBSD/ELF", NULL }, + { "WindowsCE", NULL }, { "DJGPP", NULL }, { "Irix", NULL }, - { "HP/UX ELF", NULL }, - { "HP/UX SOM", NULL }, - { "QNX Neutrino", NULL }, + { "HP-UX/ELF", NULL }, + { "HP-UX/SOM", NULL }, + { "QNX-Neutrino", NULL }, { "Cygwin", NULL }, { "AIX", NULL }, { "DICOS", NULL }, @@ -187,8 +187,7 @@ gdbarch_register_osabi (enum bfd_architecture arch, unsigned long machine, } } - (*handler_p) - = (struct gdb_osabi_handler *) xmalloc (sizeof (struct gdb_osabi_handler)); + (*handler_p) = XNEW (struct gdb_osabi_handler); (*handler_p)->next = NULL; (*handler_p)->arch_info = arch_info; (*handler_p)->osabi = osabi; @@ -228,8 +227,7 @@ gdbarch_register_osabi_sniffer (enum bfd_architecture arch, { struct gdb_osabi_sniffer *sniffer; - sniffer = - (struct gdb_osabi_sniffer *) xmalloc (sizeof (struct gdb_osabi_sniffer)); + sniffer = XNEW (struct gdb_osabi_sniffer); sniffer->arch = arch; sniffer->flavour = flavour; sniffer->sniffer = sniffer_fn; @@ -443,7 +441,7 @@ check_note (bfd *abfd, asection *sect, char *note, unsigned int *sectsize, void generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) { - enum gdb_osabi *osabi = obj; + enum gdb_osabi *osabi = (enum gdb_osabi *) obj; const char *name; unsigned int sectsize; char *note; @@ -460,7 +458,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect, void *obj) compressed section. But, since note sections are not compressed, deferring the reading until we recognize the section avoids any error. */ - note = alloca (sectsize); + note = (char *) alloca (sectsize); /* .note.ABI-tag notes, used by GNU/Linux and FreeBSD. */ if (strcmp (name, ".note.ABI-tag") == 0) @@ -626,12 +624,16 @@ set_osabi (char *args, int from_tty, struct cmd_list_element *c) int i; for (i = 1; i < GDB_OSABI_INVALID; i++) - if (strcmp (set_osabi_string, gdbarch_osabi_name (i)) == 0) - { - user_selected_osabi = i; - user_osabi_state = osabi_user; - break; - } + { + enum gdb_osabi osabi = (enum gdb_osabi) i; + + if (strcmp (set_osabi_string, gdbarch_osabi_name (osabi)) == 0) + { + user_selected_osabi = osabi; + user_osabi_state = osabi_user; + break; + } + } if (i == GDB_OSABI_INVALID) internal_error (__FILE__, __LINE__, _("Invalid OS ABI \"%s\" passed to command handler."),