X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;ds=sidebyside;f=gdb%2Fada-exp.y;h=d47f6a785d8a3a74963bf673fee5db37502e526e;hb=02063a34cf9b676a643e60b46b2d43e253a11f4b;hp=243b1524513b195f37a5342985bd0f7e8031b1a0;hpb=2c0b251b29eeafa90c84a3a938c744bc7ba81aea;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y index 243b152451..d47f6a785d 100644 --- a/gdb/ada-exp.y +++ b/gdb/ada-exp.y @@ -1,23 +1,21 @@ /* YACC parser for Ada expressions, for GDB. Copyright (C) 1986, 1989, 1990, 1991, 1993, 1994, 1997, 2000, 2003, 2004, - 2007, 2008, 2009 Free Software Foundation, Inc. + 2007, 2008, 2009, 2010 Free Software Foundation, Inc. -This file is part of GDB. + This file is part of GDB. -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ /* Parse an Ada expression from text in a string, and return the result as a struct expression pointer. @@ -1023,8 +1021,8 @@ block_lookup (struct block *context, char *raw_name) name = ada_encode (raw_name); nsyms = ada_lookup_symbol_list (name, context, VAR_DOMAIN, &syms); - if (context == NULL && - (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK)) + if (context == NULL + && (nsyms == 0 || SYMBOL_CLASS (syms[0].sym) != LOC_BLOCK)) symtab = lookup_symtab (name); else symtab = NULL; @@ -1209,6 +1207,7 @@ get_symbol_field_type (struct symbol *sym, char *encoded_field_name) if (type == NULL || field_name == NULL) return NULL; + type = check_typedef (type); while (field_name[0] != '\0') { @@ -1453,7 +1452,7 @@ convert_char_literal (struct type *type, LONGEST val) if (type == NULL || TYPE_CODE (type) != TYPE_CODE_ENUM) return val; - sprintf (name, "QU%02x", (int) val); + xsnprintf (name, sizeof (name), "QU%02x", (int) val); for (f = 0; f < TYPE_NFIELDS (type); f += 1) { if (strcmp (name, TYPE_FIELD_NAME (type, f)) == 0)