From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8020 invoked by alias); 13 Oct 2010 15:10:22 -0000 Mailing-List: contact archer-commits-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: Received: (qmail 7967 invoked by uid 9674); 13 Oct 2010 15:10:21 -0000 Date: Wed, 13 Oct 2010 15:10:00 -0000 Message-ID: <20101013151021.7952.qmail@sourceware.org> From: jkratoch@sourceware.org To: archer-commits@sourceware.org Subject: [SCM] archer-jankratochvil-ifunc: Merge remote branch 'origin/master' into archer-jankratochvil-ifunc X-Git-Refname: refs/heads/archer-jankratochvil-ifunc X-Git-Reftype: branch X-Git-Oldrev: fdef815049aed6c810010442174edbdbb9872286 X-Git-Newrev: 31c39a82c03398809d542d0da4d9de4ca12d38fb X-SW-Source: 2010-q4/txt/msg00027.txt.bz2 List-Id: The branch, archer-jankratochvil-ifunc has been updated via 31c39a82c03398809d542d0da4d9de4ca12d38fb (commit) via 6cf47741faf811d7816dd54cf838e256e32d29b9 (commit) via 2d72b617c4080b4f6ad82c0212ecedd90042a289 (commit) via d66549fedb7aba7ab755452e068cc3cdb3525739 (commit) via 4272775a1eff21ac17a90a5b3b11e3de0554dd73 (commit) via cca862e1eb7d8a3f1a6f16dee3bfd953ad0e23f9 (commit) via 0ae6e883ffabbbd3ebc60d59e3e6aa0d4eecf383 (commit) via 539f158bf0dd3e9ebaad971f40998fde44a679fb (commit) via 656eeed366db725765eb1bbba41387595b2f3910 (commit) via 44cad9ebe5f8f69251216948bd7b0f1719cd417b (commit) via 38dc720f9b66df1122f4d63b96a866a00386816a (commit) via a4c2a2ca7166bff825e4806197e040374c854c92 (commit) via d2a8b4a4c7e8c1ae5ecf3935644514eff6e2077c (commit) via f2af4777c54d5b99a30890a0bdb6e5cb2c2a0920 (commit) via 75eefffd1a0359b2e38bcd703b63d6232209144c (commit) via a2964f7ce24fabe1e4357e82ea457b9252c550a7 (commit) via bfa490e2a62d2330775c3354a2bb4a10b1ce9f94 (commit) via b9fec5b4ee3a77a1d49e9c6f55ced129f43b8006 (commit) via 13b68f3e84043a7be14dfaf4e48456c589ada73b (commit) via e5b782fb1908e3bdb9950489aa0a1b84460ea73c (commit) via 86a26289bc9d7f8b26115134a36044748095a9de (commit) from fdef815049aed6c810010442174edbdbb9872286 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email. - Log ----------------------------------------------------------------- commit 31c39a82c03398809d542d0da4d9de4ca12d38fb Merge: fdef815 6cf4774 Author: Jan Kratochvil Date: Wed Oct 13 17:09:22 2010 +0200 Merge remote branch 'origin/master' into archer-jankratochvil-ifunc ----------------------------------------------------------------------- Summary of changes: bfd/ChangeLog | 6 +++ bfd/elf32-frv.c | 9 +++- bfd/version.h | 2 +- gdb/ChangeLog | 62 +++++++++++++++++++++++++++++++ gdb/arm-tdep.c | 3 +- gdb/c-typeprint.c | 3 +- gdb/doc/ChangeLog | 5 ++ gdb/doc/gdb.texinfo | 2 +- gdb/gdbtypes.c | 48 +++++++++++------------ gdb/python/py-breakpoint.c | 3 + gdb/python/py-cmd.c | 21 +++++++++- gdb/python/py-frame.c | 3 +- gdb/python/py-function.c | 9 ++++- gdb/python/py-inferior.c | 16 +++---- gdb/python/py-param.c | 52 ++++++++++++++++++++------ gdb/python/py-prettyprint.c | 32 ++++++++++++--- gdb/python/py-value.c | 13 ++++-- gdb/python/python.c | 14 +++++++ gdb/ser-go32.c | 1 + gdb/testsuite/ChangeLog | 29 ++++++++++++++ gdb/testsuite/gdb.base/break-interp.exp | 15 +++++-- gdb/testsuite/gdb.base/prelink.exp | 4 +- gdb/testsuite/gdb.base/solib-nodir.exp | 2 +- gdb/testsuite/gdb.cp/infcall-dlopen.cc | 6 +++ gdb/testsuite/gdb.python/py-error.exp | 56 ++++++++++++++++++++++++++++ gdb/testsuite/gdb.python/py-error.py | 25 ++++++++++++ gdb/testsuite/lib/gdb.exp | 4 +- gdb/testsuite/lib/prelink-support.exp | 2 +- gdb/varobj.c | 4 ++ gdb/version.in | 2 +- opcodes/ChangeLog | 10 +++++ opcodes/m68k-opc.c | 7 ++- opcodes/s390-opc.c | 2 +- opcodes/s390-opc.txt | 8 ++-- 34 files changed, 392 insertions(+), 88 deletions(-) create mode 100644 gdb/testsuite/gdb.python/py-error.exp create mode 100644 gdb/testsuite/gdb.python/py-error.py First 500 lines of diff: diff --git a/bfd/ChangeLog b/bfd/ChangeLog index fcfa945..2e18e8c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +2010-10-11 Alan Modra + + * elf32-frv.c (elf32_frv_relocate_section): Set "name" for global syms. + (elf32_frvfdpic_finish_dynamic_sections): Don't crash on + __ROFIXUP_END__ defined in shared lib. + 2010-10-11 Thomas Schwinge * elf32-arm.c (elf32_arm_final_link_relocate) diff --git a/bfd/elf32-frv.c b/bfd/elf32-frv.c index 2acc917..f6975f3 100644 --- a/bfd/elf32-frv.c +++ b/bfd/elf32-frv.c @@ -2770,7 +2770,7 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, struct elf_link_hash_entry *h; bfd_vma relocation; bfd_reloc_status_type r; - const char * name = NULL; + const char *name; int r_type; asection *osec; struct frvfdpic_relocs_info *picrel; @@ -2796,7 +2796,8 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); - name = (name == NULL) ? bfd_section_name (input_bfd, sec) : name; + if (name == NULL || name[0] == 0) + name = bfd_section_name (input_bfd, sec); } else { @@ -2808,6 +2809,7 @@ elf32_frv_relocate_section (output_bfd, info, input_bfd, input_section, h, sec, relocation, unresolved_reloc, warned); osec = sec; + name = h->root.root.string; } if (sec != NULL && elf_discarded_section (sec)) @@ -5896,7 +5898,8 @@ elf32_frvfdpic_finish_dynamic_sections (bfd *output_bfd, FALSE, FALSE, TRUE); if (hend && (hend->type == bfd_link_hash_defined - || hend->type == bfd_link_hash_defweak)) + || hend->type == bfd_link_hash_defweak) + && hend->u.def.section->output_section != NULL) { bfd_vma value = frvfdpic_gotfixup_section (info)->output_section->vma diff --git a/bfd/version.h b/bfd/version.h index 3332bf6..6ec0248 100644 --- a/bfd/version.h +++ b/bfd/version.h @@ -1,4 +1,4 @@ -#define BFD_VERSION_DATE 20101011 +#define BFD_VERSION_DATE 20101013 #define BFD_VERSION @bfd_version@ #define BFD_VERSION_STRING @bfd_version_package@ @bfd_version_string@ #define REPORT_BUGS_TO @report_bugs_to@ diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5f3b259..0f35473 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,65 @@ +2010-10-13 Jan Kratochvil + + * python/py-breakpoint.c (bppy_set_condition): New comment. + * python/py-cmd.c (cmdpy_function): Call also gdbpy_print_stack for + failed PyUnicode_Decode. + (cmdpy_completer): Skip element for failed + python_string_to_host_string. + (cmdpy_init): Return -1 on failed python_string_to_host_string. + * python/py-frame.c (frapy_read_var): Extend the function comment. + * python/py-function.c (fnpy_init): Return -1 on failed + python_string_to_host_string. + * python/py-inferior.c (infpy_read_memory, infpy_write_memory): Extend + the function comment. + (infpy_search_memory): Extend the function comment. Remove the + PyErr_SetString call on already set error state. + * python/py-param.c (set_parameter_value): Extend the function + comment. Return -1 on failed python_string_to_host_string, twice. + (set_attr): Extend the function comment. + (compute_enum_values): Extend the function comment. New variable + back_to. Protect self->enumeration by BACK_TO cleanups. Return 0 on + failed python_string_to_host_string. + (get_doc_string): Call gdbpy_print_stack on failed + python_string_to_host_string. + (parmpy_init): Extend the function comment. + * python/py-prettyprint.c (pretty_print_one_value): Likewise. + (gdbpy_get_display_hint, print_children): Call gdbpy_print_stack on + failed python_string_to_host_string. + * python/py-value.c (valpy_new, valpy_getitem, valpy_call) + (valpy_binop, valpy_richcompare): Extend the function comment. + * python/python.c + (struct python_env) : New + fields. + (restore_python_env): Handle PyErr_Occurred. Call PyErr_Restore. + (ensure_python_env): Call PyErr_Fetch. + * varobj.c (update_dynamic_varobj_children): Call gdbpy_print_stack on + failed convert_value_from_python. + (value_get_print_value): Call gdbpy_print_stack on failed + python_string_to_target_python_string. + +2010-10-12 Tom Tromey + + * python/py-prettyprint.c (search_pp_list): Fix error checking. + +2010-10-12 Sami Wagiaalla + + * gdbtypes.c (do_is_ancestor): New function. + (is_ancestor): Use do_is_ancestor. + (is_public_ancestor): Use do_is_ancestor. + +2010-10-12 Pierre Muller + + * ser-go32.c (struct dos_ops): Add missing fdopen field. + +2010-10-12 Matthew Gretton-Dann + + * arm-tdep.c (arm_mode_strings): Add NULL entry at end of array. + +2010-10-11 Doug Evans + + * c-typeprint.c (c_type_print_modifier): Add note that this prints + the address space id too. + 2010-10-11 Jan Kratochvil Fix attaching to re-prelinked executables on ppc64. diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 19b9c85..5b32b8a 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -124,7 +124,8 @@ static const char *arm_mode_strings[] = { "auto", "arm", - "thumb" + "thumb", + NULL }; static const char *arm_fallback_mode_string = "auto"; diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 926ae2f..c7cadc0 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -321,7 +321,8 @@ c_type_print_varspec_prefix (struct type *type, struct ui_file *stream, } } -/* Print out "const" and "volatile" attributes. +/* Print out "const" and "volatile" attributes, + and address space id if present. TYPE is a pointer to the type being printed out. STREAM is the output destination. NEED_SPACE = 1 indicates an initial white space is needed */ diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index a967bd7..e2b435e 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2010-10-11 Doug Evans + + * gdb.texinfo (Values From Inferior): Add reference to "Types in + Python" from gdb.Value.type description. + 2010-09-28 Joel Brobecker * gdb.texinfo (Ravenscar Profile): New node. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 0b24718..c73e2f3 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -20789,7 +20789,7 @@ this value, thus it is not available for fetching from the inferior. @defivar Value type The type of this @code{gdb.Value}. The value of this attribute is a -@code{gdb.Type} object. +@code{gdb.Type} object (@pxref{Types In Python}). @end defivar @defivar Value dynamic_type diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index cf64947..eac5d85 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1870,14 +1870,13 @@ class_types_same_p (const struct type *a, const struct type *b) && !strcmp (TYPE_NAME (a), TYPE_NAME (b)))); } -/* Check whether BASE is an ancestor or base class or DCLASS - Return 1 if so, and 0 if not. - Note: callers may want to check for identity of the types before - calling this function -- identical types are considered to satisfy - the ancestor relationship even if they're identical. */ +/* Check whether BASE is an ancestor or base class of DCLASS + Return 1 if so, and 0 if not. If PUBLIC is 1 then only public + ancestors are considered, and the function returns 1 only if + BASE is a public ancestor of DCLASS. */ -int -is_ancestor (struct type *base, struct type *dclass) +static int +do_is_ancestor (struct type *base, struct type *dclass, int public) { int i; @@ -1889,36 +1888,35 @@ is_ancestor (struct type *base, struct type *dclass) for (i = 0; i < TYPE_N_BASECLASSES (dclass); i++) { - if (is_ancestor (base, TYPE_BASECLASS (dclass, i))) + if (public && ! BASETYPE_VIA_PUBLIC (dclass, i)) + continue; + + if (do_is_ancestor (base, TYPE_BASECLASS (dclass, i), public)) return 1; } return 0; } +/* Check whether BASE is an ancestor or base class or DCLASS + Return 1 if so, and 0 if not. + Note: If BASE and DCLASS are of the same type, this function + will return 1. So for some class A, is_ancestor (A, A) will + return 1. */ + +int +is_ancestor (struct type *base, struct type *dclass) +{ + return do_is_ancestor (base, dclass, 0); +} + /* Like is_ancestor, but only returns true when BASE is a public ancestor of DCLASS. */ int is_public_ancestor (struct type *base, struct type *dclass) { - int i; - - CHECK_TYPEDEF (base); - CHECK_TYPEDEF (dclass); - - if (class_types_same_p (base, dclass)) - return 1; - - for (i = 0; i < TYPE_N_BASECLASSES (dclass); ++i) - { - if (! BASETYPE_VIA_PUBLIC (dclass, i)) - continue; - if (is_public_ancestor (base, TYPE_BASECLASS (dclass, i))) - return 1; - } - - return 0; + return do_is_ancestor (base, dclass, 1); } /* A helper function for is_unique_ancestor. */ diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index 0c70cbf..b18f7f3 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -420,6 +420,9 @@ bppy_get_condition (PyObject *self, void *closure) return PyString_Decode (str, strlen (str), host_charset (), NULL); } +/* Returns 0 on success. Returns -1 on error, with a python exception set. + */ + static int bppy_set_condition (PyObject *self, PyObject *newvalue, void *closure) { diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c index 2cff4ba..9f71290 100644 --- a/gdb/python/py-cmd.c +++ b/gdb/python/py-cmd.c @@ -139,7 +139,10 @@ cmdpy_function (struct cmd_list_element *command, char *args, int from_tty) args = ""; argobj = PyUnicode_Decode (args, strlen (args), host_charset (), NULL); if (! argobj) - error (_("Could not convert arguments to Python string.")); + { + gdbpy_print_stack (); + error (_("Could not convert arguments to Python string.")); + } ttyobj = from_tty ? Py_True : Py_False; Py_INCREF (ttyobj); @@ -256,6 +259,12 @@ cmdpy_completer (struct cmd_list_element *command, char *text, char *word) continue; } result[out] = python_string_to_host_string (elt); + if (result[out] == NULL) + { + /* Skip problem elements. */ + PyErr_Clear (); + continue; + } ++out; } result[out] = NULL; @@ -466,7 +475,15 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw) PyObject *ds_obj = PyObject_GetAttr (self, gdbpy_doc_cst); if (ds_obj && gdbpy_is_string (ds_obj)) - docstring = python_string_to_host_string (ds_obj); + { + docstring = python_string_to_host_string (ds_obj); + if (docstring == NULL) + { + xfree (cmd_name); + xfree (pfx_name); + return -1; + } + } } if (! docstring) docstring = xstrdup (_("This command is not documented.")); diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index bb82903..1d3152c 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -385,7 +385,8 @@ frapy_find_sal (PyObject *self, PyObject *args) start the search from that block, otherwise search from the frame's current block (determined by examining the resume address of the frame). The variable argument must be a string or an instance of a - gdb.Symbol. The block argument must be an instance of gdb.Block. */ + gdb.Symbol. The block argument must be an instance of gdb.Block. Returns + NULL on error, with a python exception set. */ static PyObject * frapy_read_var (PyObject *self, PyObject *args) { diff --git a/gdb/python/py-function.c b/gdb/python/py-function.c index f09c6b4..762eb35 100644 --- a/gdb/python/py-function.c +++ b/gdb/python/py-function.c @@ -113,7 +113,14 @@ fnpy_init (PyObject *self, PyObject *args, PyObject *kwds) { PyObject *ds_obj = PyObject_GetAttrString (self, "__doc__"); if (ds_obj && gdbpy_is_string (ds_obj)) - docstring = python_string_to_host_string (ds_obj); + { + docstring = python_string_to_host_string (ds_obj); + if (docstring == NULL) + { + Py_DECREF (self); + return -1; + } + } } if (! docstring) docstring = xstrdup (_("This function is not documented.")); diff --git a/gdb/python/py-inferior.c b/gdb/python/py-inferior.c index 3a0feab..b1ddb168 100644 --- a/gdb/python/py-inferior.c +++ b/gdb/python/py-inferior.c @@ -293,7 +293,8 @@ gdbpy_inferiors (PyObject *unused, PyObject *unused2) /* Implementation of gdb.read_memory (address, length). Returns a Python buffer object with LENGTH bytes of the inferior's - memory at ADDRESS. Both arguments are integers. */ + memory at ADDRESS. Both arguments are integers. Returns NULL on error, + with a python exception set. */ static PyObject * infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw) { @@ -361,7 +362,8 @@ infpy_read_memory (PyObject *self, PyObject *args, PyObject *kw) Writes the contents of BUFFER (a Python object supporting the read buffer protocol) at ADDRESS in the inferior's memory. Write LENGTH bytes from BUFFER, or its entire contents if the argument is not - provided. The function returns nothing. */ + provided. The function returns nothing. Returns NULL on error, with + a python exception set. */ static PyObject * infpy_write_memory (PyObject *self, PyObject *args, PyObject *kw) { @@ -473,7 +475,8 @@ get_char_buffer (PyObject *self, Py_ssize_t segment, char **ptrptr) search from ADDRESS. PATTERN is the pattern to search for (and must be a Python object supporting the buffer protocol). Returns a Python Long object holding the address where the pattern - was located, or if the pattern was not found, returns None. */ + was located, or if the pattern was not found, returns None. Returns NULL + on error, with a python exception set. */ static PyObject * infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw) { @@ -511,12 +514,7 @@ infpy_search_memory (PyObject *self, PyObject *args, PyObject *kw) } } else - { - PyErr_SetString (PyExc_RuntimeError, - _("Cannot get search address/range from Python.")); - - return NULL; - } + return NULL; if (!PyObject_CheckReadBuffer (pattern)) { diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index 5596eb7..b8eb447 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -110,8 +110,8 @@ get_attr (PyObject *obj, PyObject *attr_name) return PyObject_GenericGetAttr (obj, attr_name); } -/* Set a parameter value from a Python value. Return 0 on success, -1 - on failure. */ +/* Set a parameter value from a Python value. Return 0 on success. Returns + -1 on error, with a python exception set. */ static int set_parameter_value (parmpy_object *self, PyObject *value) { @@ -132,17 +132,25 @@ set_parameter_value (parmpy_object *self, PyObject *value) return -1; } - if (self->value.stringval) - xfree (self->value.stringval); if (value == Py_None) { + xfree (self->value.stringval); if (self->type == var_optional_filename) self->value.stringval = xstrdup (""); else self->value.stringval = NULL; } else - self->value.stringval = python_string_to_host_string (value); + { + char *string; + + string = python_string_to_host_string (value); + if (string == NULL) + return -1; + + xfree (self->value.stringval); + self->value.stringval = string; + } break; case var_enum: @@ -158,6 +166,8 @@ set_parameter_value (parmpy_object *self, PyObject *value) } str = python_string_to_host_string (value); + if (str == NULL) + return -1; for (i = 0; self->enumeration[i]; ++i) if (! strcmp (self->enumeration[i], str)) break; @@ -258,7 +268,7 @@ set_parameter_value (parmpy_object *self, PyObject *value) return 0; } -/* Set an attribute. */ +/* Set an attribute. Returns -1 on error, with a python exception set. */ static int set_attr (PyObject *obj, PyObject *attr_name, PyObject *val) { @@ -358,12 +368,13 @@ add_setshow_generic (int parmclass, enum command_class cmdclass, } } -/* A helper which computes enum values. Returns 1 on success, 0 on - error. */ +/* A helper which computes enum values. Returns 1 on success. Returns 0 on + error, with a python exception set. */ static int compute_enum_values (parmpy_object *self, PyObject *enum_values) { Py_ssize_t size, i; + struct cleanup *back_to; if (! enum_values) { @@ -390,6 +401,7 @@ compute_enum_values (parmpy_object *self, PyObject *enum_values) } self->enumeration = xmalloc ((size + 1) * sizeof (char *)); + back_to = make_cleanup (free_current_contents, &self->enumeration); memset (self->enumeration, 0, (size + 1) * sizeof (char *)); for (i = 0; i < size; ++i) @@ -397,16 +409,27 @@ compute_enum_values (parmpy_object *self, PyObject *enum_values) PyObject *item = PySequence_GetItem (enum_values, i); if (! item) hooks/post-receive -- Repository for Project Archer.