public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  master: Merge remote branch 'gdb/master'
Date: Tue, 16 Nov 2010 05:04:00 -0000	[thread overview]
Message-ID: <20101116050413.12085.qmail@sourceware.org> (raw)

The branch, master has been updated
       via  fe12b092e5f0085281ce09e94c541ea2eeb8e4e4 (commit)
       via  ccae871af2e5963b0b6d5467a41982f7f218875b (commit)
       via  83ef38220fa6a963e11b592dc63fe5ff540fcbf1 (commit)
       via  b3dc839d953520a1e4b2a66425e5c589475cec4d (commit)
       via  f4160a60204da977af41ce5cc984af76a0b96e65 (commit)
       via  35e427b76abcbcbf3faa7be78828a900777476e3 (commit)
       via  479d34415d438cb903b03495d21024f7a0d2bb38 (commit)
       via  4da0884073e5a4e464eed13293fb4458255d8dd7 (commit)
       via  dd80b3ebfaae70b2fb34cc0a92348a272e6cc848 (commit)
       via  603686b32e907e5a2f6761e2633c6a3937128c07 (commit)
       via  5097cdcc3758b39b213555d944e995c57531004c (commit)
       via  1f3223243cb9dce65d15e485eb7b10c3c29b3e0e (commit)
       via  91e77a2dadfcc2da238145c8f7538e1bf60cd893 (commit)
       via  1fbfe5836f6cb33edb0d232ba145ccd52c359b7e (commit)
       via  95aa50e02997e2c95e342adb6895bda63bf89bac (commit)
       via  94607e51af04ec6ee708c55239cdeb78c7d41df0 (commit)
       via  e8b212e21800a12661936e7a943c7daa9d1088a7 (commit)
       via  97060a82bac95c43b0ad497fa1313b5ca59c3d00 (commit)
       via  e15d3f1e9a9e0373291f0f8ca8420ca3fc749ba2 (commit)
       via  1b080e5c812a10d012790f79eefbf638de75ccd1 (commit)
       via  774ffe9e9d84a0ff884bb2b21d97c8f915c5152e (commit)
       via  550202613b8b567107580a062f418947b689e1ed (commit)
       via  787ced139be0421e8c5e0fbfe7ff5429d8b67601 (commit)
       via  dcca8d3dfdd4166e3192214edb8e04dca236731f (commit)
       via  0c775a6234f13a97229cc0bcebeb73f0cafa9d9d (commit)
       via  1afa9b4c79b59bf187f6629e31cafb85f4e445c6 (commit)
       via  9f2a4c761ef976fdfb4f577965f533ece6ae5fbd (commit)
      from  1cc93f904c223a595c3f41894751af0b30445e86 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit fe12b092e5f0085281ce09e94c541ea2eeb8e4e4
Merge: 1cc93f9 ccae871
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Tue Nov 16 06:04:00 2010 +0100

    Merge remote branch 'gdb/master'

commit ccae871af2e5963b0b6d5467a41982f7f218875b
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Tue Nov 16 03:27:05 2010 +0000

    gdbserver: fix warning in nommu clone
    
    Building gdbserver for nommu targets atm fails with:
    	linux-low.c: In function 'linux_tracefork_child':
    	linux-low.c:4151: error: pointer of type 'void *' used in arithmetic
    
    So cast the void* to a char*.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

commit 83ef38220fa6a963e11b592dc63fe5ff540fcbf1
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Tue Nov 16 00:00:03 2010 +0000

    *** empty log message ***

commit b3dc839d953520a1e4b2a66425e5c589475cec4d
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Mon Nov 15 23:00:05 2010 +0000

    daily update

commit f4160a60204da977af41ce5cc984af76a0b96e65
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Nov 15 22:30:45 2010 +0000

    blackfin: add support for L1 code/data flags
    
    Add new linker options for marking programs to load into L1 memory
    at runtime.  This needs new EF flag bits, so declare them.
    
    Signed-off-by: Jie Zhang <jie.zhang@analog.com>
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

commit 35e427b76abcbcbf3faa7be78828a900777476e3
Author: Doug Evans <dje@google.com>
Date:   Mon Nov 15 17:25:09 2010 +0000

    revert previous patch

commit 479d34415d438cb903b03495d21024f7a0d2bb38
Author: Doug Evans <dje@google.com>
Date:   Mon Nov 15 17:17:56 2010 +0000

    	* gdb.base/maint.exp (maint print statistics): Increase timeout for
    	all targets.  Restore old timeout afterwards.

commit 4da0884073e5a4e464eed13293fb4458255d8dd7
Author: mgretton <mgretton>
Date:   Mon Nov 15 10:03:05 2010 +0000

    	PR gas/12198
    	* gas/config/tc-arm.c (arm_arch_v6m_only): New variable.
    	(aeabi_set_public_attributes): Ensure we only set the Operating System
    	Extension when we are on an M-profile core.
    	* gas/testsuite/gas/arm/pr12198-1.d: New test.
    	* gas/testsuite/gas/arm/pr12918-1.s: Likewise.
    	* gas/testsuite/gas/arm/pr12198-2.d: Likewise.
    	* gas/testsuite/gas/arm/pr12918-2.s: Likewise.
    	* include/opcode/arm.h (ARM_AEXT_V6M_ONLY): New define.
    	(ARM_AEXT_V6M): Rewrite in terms of ARM_AEXT_V6M_ONLY.
    	(ARM_ARCH_V6M_ONLY): New define.

commit dd80b3ebfaae70b2fb34cc0a92348a272e6cc848
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Mon Nov 15 08:33:59 2010 +0000

    bfd: bfin: drop needless symbol flag handling imported from FRV
    
    The Blackfin bfd merged some FRV code recently, and then removed pieces
    that didn't make sense.  In the FRV code, it outputs a "_gp" symbol in
    its BFD whereas in the Blackfin code, we don't.  So while on the FRV
    side it fiddles with the "flags" variable (sometimes using it for section
    flags and sometimes using it for symbol flags), we don't need any of
    that.  This lead to BZ 12177 where the Blackfin code is a bit confusing.
    So to fix things up, remove more stuff we don't need.  Shouldn't change
    the behavior at all.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

commit 603686b32e907e5a2f6761e2633c6a3937128c07
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Mon Nov 15 00:00:33 2010 +0000

    *** empty log message ***

commit 5097cdcc3758b39b213555d944e995c57531004c
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sun Nov 14 23:00:06 2010 +0000

    daily update

commit 1f3223243cb9dce65d15e485eb7b10c3c29b3e0e
Author: DJ Delorie <dj@delorie.com>
Date:   Sun Nov 14 21:42:54 2010 +0000

    merge from gcc

commit 91e77a2dadfcc2da238145c8f7538e1bf60cd893
Author: Pierre Muller <muller@ics.u-strasbg.fr>
Date:   Sun Nov 14 12:10:55 2010 +0000

    	* arm-tdep.c (arm_in_function_epilogue_p): Fix code to avoid
    	possible used of uninitialized variable.

commit 1fbfe5836f6cb33edb0d232ba145ccd52c359b7e
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Sun Nov 14 00:00:34 2010 +0000

    *** empty log message ***

commit 95aa50e02997e2c95e342adb6895bda63bf89bac
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Sat Nov 13 23:00:06 2010 +0000

    daily update

commit 94607e51af04ec6ee708c55239cdeb78c7d41df0
Author: DJ Delorie <dj@delorie.com>
Date:   Sat Nov 13 02:20:29 2010 +0000

    merge from gcc

commit e8b212e21800a12661936e7a943c7daa9d1088a7
Author: gdbadmin <gdbadmin@sourceware.org>
Date:   Sat Nov 13 00:00:33 2010 +0000

    *** empty log message ***

commit 97060a82bac95c43b0ad497fa1313b5ca59c3d00
Author: Alan Modra <amodra@bigpond.net.au>
Date:   Fri Nov 12 23:00:05 2010 +0000

    daily update

commit e15d3f1e9a9e0373291f0f8ca8420ca3fc749ba2
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Nov 12 22:10:17 2010 +0000

    Properly copy BFD_COMPRESS and BFD_DECOMPRESS to archive element.
    
    2010-11-12  H.J. Lu  <hongjiu.lu@intel.com>
    
    	* archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS and
    	BFD_DECOMPRESS.
    	(bfd_openr_next_archived_file): Revert the last change.

commit 1b080e5c812a10d012790f79eefbf638de75ccd1
Author: Nathan Froyd <froydnj@codesourcery.com>
Date:   Fri Nov 12 21:54:31 2010 +0000

    gdb/
    	* rs6000-tdep.c (bfd_uses_spe_extensions): New function.
    	(rs6000_gdbarch_init): Call it.

commit 774ffe9e9d84a0ff884bb2b21d97c8f915c5152e
Author: Nathan Froyd <froydnj@codesourcery.com>
Date:   Fri Nov 12 21:53:09 2010 +0000

    gdb/
    	* rs6000-tdep.c (gdb_print_insn_powerpc): Disassemble e500
    	instructions if debugging an E500 binary.

commit 550202613b8b567107580a062f418947b689e1ed
Author: Nathan Froyd <froydnj@codesourcery.com>
Date:   Fri Nov 12 21:49:55 2010 +0000

    gdb/testsuite/
    	* gdb.stabs/gdb11479.exp: Use runto_main.

commit 787ced139be0421e8c5e0fbfe7ff5429d8b67601
Author: Nathan Froyd <froydnj@codesourcery.com>
Date:   Fri Nov 12 21:47:47 2010 +0000

    gdb/testsuite/
    	* gdb.base/break-entry.exp: Skip if using a stub.

commit dcca8d3dfdd4166e3192214edb8e04dca236731f
Author: Nathan Froyd <froydnj@codesourcery.com>
Date:   Fri Nov 12 21:44:48 2010 +0000

    gdb/testsuite/
    	* gdb.python/py-inferior.exp: Pack values in target endianness.

commit 0c775a6234f13a97229cc0bcebeb73f0cafa9d9d
Author: Tom Tromey <tromey@redhat.com>
Date:   Fri Nov 12 20:49:40 2010 +0000

    gdb
    	* varobj.c (value_get_print_value): Rearrange.  Pass stream to
    	apply_varobj_pretty_printer.
    	* c-lang.c: Include exceptions.h.
    	(c_get_string): Throw MEMORY_ERROR when appropriate.
    	* python/py-prettyprint.c (enum string_repr_result): New.
    	(print_stack_unless_memory_error): New function.
    	(print_string_repr): Change return type.  Use
    	print_stack_unless_memory_error.
    	(print_children): Use print_stack_unless_memory_error.
    	(apply_val_pretty_printer): Update.  Don't print children if
    	string representation threw an exception.
    	(apply_varobj_pretty_printer): Add 'stream' argument.  Use
    	print_stack_unless_memory_error.
    	* python/python.c (gdbpy_gdb_error, gdbpy_gdb_memory_error): New
    	globals.
    	(_initialize_python): Initialize them.
    	* python/python-internal.h (GDB_PY_HANDLE_EXCEPTION): Use
    	gdbpy_convert_exception.
    	(GDB_PY_SET_HANDLE_EXCEPTION): Likewise.
    	(gdbpy_gdb_error, gdbpy_gdb_memory_error): Declare.
    	(gdbpy_convert_exception): Declare.
    	(apply_varobj_pretty_printer): Update.
    	* python/py-utils.c (gdbpy_convert_exception): New function.
    gdb/doc
    	* gdb.texinfo (Basic Python): Update.  Add xref.
    	(Exception Handling): Document new exception classes.
    	(Types In Python): Update.
    	(Frames In Python): Update.
    gdb/testsuite
    	* gdb.python/py-prettyprint.c (main): Add new 'ns2' local.
    	* gdb.python/py-prettyprint.exp (run_lang_tests): Add test for
    	MemoryError.
    	* gdb.python/python.exp (gdb_py_test_multiple): Update exception
    	type.
    	* gdb.python/py-value.exp (test_value_in_inferior): Add test for
    	MemoryError.
    	(test_subscript_regression): Update exception type.

commit 1afa9b4c79b59bf187f6629e31cafb85f4e445c6
Author: Marc Khouzam <marc.khouzam@ericsson.com>
Date:   Fri Nov 12 18:46:42 2010 +0000

    2010-11-12  Marc Khouzam  <marc.khouzam@ericsson.com>
    
            * mi/mi-main.c (mi_cmd_target_detach): Accept new
            thread-group id format.

commit 9f2a4c761ef976fdfb4f577965f533ece6ae5fbd
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Fri Nov 12 12:38:38 2010 +0000

    gdb/
    	* spu-tdep.c (spu_catch_start): Fix compilation error typo.

-----------------------------------------------------------------------

Summary of changes:
 bfd/ChangeLog                               |   18 +++
 bfd/archive.c                               |   13 +--
 bfd/elf32-bfin.c                            |   24 +++-
 bfd/version.h                               |    2 +-
 gdb/ChangeLog                               |   50 +++++++++
 gdb/arm-tdep.c                              |    1 +
 gdb/c-lang.c                                |   15 ++-
 gdb/doc/ChangeLog                           |    7 ++
 gdb/doc/gdb.texinfo                         |   47 ++++++---
 gdb/gdbserver/ChangeLog                     |    4 +
 gdb/gdbserver/linux-low.c                   |    2 +-
 gdb/mi/mi-main.c                            |   31 +++++-
 gdb/python/py-prettyprint.c                 |   90 ++++++++++++----
 gdb/python/py-utils.c                       |   19 ++++
 gdb/python/python-internal.h                |   18 ++--
 gdb/python/python.c                         |   13 +++
 gdb/rs6000-tdep.c                           |  149 ++++++++++++++++++++++++--
 gdb/spu-tdep.c                              |    2 +-
 gdb/testsuite/ChangeLog                     |   23 ++++
 gdb/testsuite/gdb.base/break-entry.exp      |   14 +++
 gdb/testsuite/gdb.python/py-inferior.exp    |   25 +++--
 gdb/testsuite/gdb.python/py-prettyprint.c   |    6 +-
 gdb/testsuite/gdb.python/py-prettyprint.exp |    2 +
 gdb/testsuite/gdb.python/py-value.exp       |    7 +-
 gdb/testsuite/gdb.python/python.exp         |    4 +-
 gdb/testsuite/gdb.stabs/gdb11479.exp        |    6 +-
 gdb/varobj.c                                |   16 ++-
 gdb/version.in                              |    2 +-
 include/ChangeLog                           |    5 +
 include/elf/bfin.h                          |    3 +
 include/opcode/ChangeLog                    |    7 ++
 include/opcode/arm.h                        |    7 +-
 libiberty/ChangeLog                         |   12 ++
 libiberty/cp-demangle.c                     |    6 -
 libiberty/simple-object-coff.c              |    3 +-
 libiberty/testsuite/demangle-expected       |    9 ++-
 36 files changed, 549 insertions(+), 113 deletions(-)

First 500 lines of diff:
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index aab75e9..a67868e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,21 @@
+2010-11-16  Jie Zhang  <jie.zhang@analog.com>
+
+	* elf32-bfin.c (elf32_bfin_code_in_l1): New variable.
+	(elf32_bfin_data_in_l1): New variable.
+	(elf32_bfin_final_write_processing): New.
+	(elf_backend_final_write_processing): Define.
+
+2010-11-15  Mike Frysinger  <vapier@gentoo.org>
+
+	PR binutils/12177
+	* elf32-bfin.c (_bfin_create_got_section): Drop unused flags code.
+
+2010-11-12  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* archive.c (_bfd_get_elt_at_filepos): Copy BFD_COMPRESS and
+	BFD_DECOMPRESS.
+	(bfd_openr_next_archived_file): Revert the last change.
+
 2010-11-11  Mingming Sun  <mingm.sun@gmail.com>
 
 	* archures.c (bfd_mach_mips_loongson_3a): Defined.
diff --git a/bfd/archive.c b/bfd/archive.c
index ed40141..258c8d9 100644
--- a/bfd/archive.c
+++ b/bfd/archive.c
@@ -655,6 +655,9 @@ _bfd_get_elt_at_filepos (bfd *archive, file_ptr filepos)
 
   n_nfd->arelt_data = new_areldata;
 
+  /* Copy BFD_COMPRESS and BFD_DECOMPRESS flags.  */
+  n_nfd->flags |= archive->flags & (BFD_COMPRESS | BFD_DECOMPRESS);
+
   if (_bfd_add_bfd_to_archive_cache (archive, filepos, n_nfd))
     return n_nfd;
 
@@ -697,8 +700,6 @@ DESCRIPTION
 bfd *
 bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
 {
-  bfd *abfd;
-
   if ((bfd_get_format (archive) != bfd_archive)
       || (archive->direction == write_direction))
     {
@@ -706,14 +707,8 @@ bfd_openr_next_archived_file (bfd *archive, bfd *last_file)
       return NULL;
     }
 
-  abfd = BFD_SEND (archive,
+  return BFD_SEND (archive,
 		   openr_next_archived_file, (archive, last_file));
-
-  /* Copy BFD_COMPRESS and BFD_DECOMPRESS flags.  */
-  if (abfd)
-    abfd->flags |= archive->flags & (BFD_COMPRESS | BFD_DECOMPRESS);
-
-  return abfd;
 }
 
 bfd *
diff --git a/bfd/elf32-bfin.c b/bfd/elf32-bfin.c
index 237391b..56af244 100644
--- a/bfd/elf32-bfin.c
+++ b/bfd/elf32-bfin.c
@@ -1120,6 +1120,22 @@ bfin_reloc_type_lookup (bfd * abfd ATTRIBUTE_UNUSED,
   return (reloc_howto_type *) NULL;
 }
 
+/* Set by ld emulation if --code-in-l1.  */
+bfd_boolean elf32_bfin_code_in_l1 = 0;
+
+/* Set by ld emulation if --data-in-l1.  */
+bfd_boolean elf32_bfin_data_in_l1 = 0;
+
+static void
+elf32_bfin_final_write_processing (bfd *abfd,
+				   bfd_boolean linker ATTRIBUTE_UNUSED)
+{
+  if (elf32_bfin_code_in_l1)
+    elf_elfheader (abfd)->e_flags |= EF_BFIN_CODE_IN_L1;
+  if (elf32_bfin_data_in_l1)
+    elf_elfheader (abfd)->e_flags |= EF_BFIN_DATA_IN_L1;
+}
+
 /* Return TRUE if the name is a local label.
    bfin local labels begin with L$.  */
 static bfd_boolean
@@ -3442,14 +3458,8 @@ _bfin_create_got_section (bfd *abfd, struct bfd_link_info *info)
 	return FALSE;
 
       bfinfdpic_gotfixup_section (info) = s;
-      flags = BSF_GLOBAL;
-    }
-  else
-    {
-      flags = BSF_GLOBAL | BSF_WEAK;
     }
 
-  flags = pltflags;
   pltflags |= SEC_CODE;
   if (bed->plt_not_loaded)
     pltflags &= ~ (SEC_CODE | SEC_LOAD | SEC_HAS_CONTENTS);
@@ -5793,6 +5803,8 @@ struct bfd_elf_special_section const elf32_bfin_special_sections[] =
                                         elf32_bfin_set_private_flags
 #define bfd_elf32_bfd_print_private_bfd_data \
                                         elf32_bfin_print_private_bfd_data
+#define elf_backend_final_write_processing \
+                                        elf32_bfin_final_write_processing
 #define elf_backend_reloc_type_class    elf32_bfin_reloc_type_class
 #define elf_backend_can_gc_sections 1
 #define elf_backend_special_sections	elf32_bfin_special_sections
diff --git a/bfd/version.h b/bfd/version.h
index 653cfa1..36fbb4f 100644
--- a/bfd/version.h
+++ b/bfd/version.h
@@ -1,4 +1,4 @@
-#define BFD_VERSION_DATE 20101112
+#define BFD_VERSION_DATE 20101116
 #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 2c413a3..7669965 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,53 @@
+2010-11-14  Pierre Muller  <muller@ics.u-strasbg.fr>
+
+	* arm-tdep.c (arm_in_function_epilogue_p): Fix code to avoid
+	possible used of uninitialized variable.
+
+2010-11-12  Nathan Froyd  <froydnj@codesourcery.com>
+
+	* rs6000-tdep.c (bfd_uses_spe_extensions): New function.
+	(rs6000_gdbarch_init): Call it.
+
+2010-11-12  Nathan Froyd  <froydnj@codesourcery.com>
+
+	* rs6000-tdep.c (gdb_print_insn_powerpc): Disassemble e500
+	instructions if debugging an E500 binary.
+
+2010-11-12  Tom Tromey  <tromey@redhat.com>
+
+	* varobj.c (value_get_print_value): Rearrange.  Pass stream to
+	apply_varobj_pretty_printer.
+	* c-lang.c: Include exceptions.h.
+	(c_get_string): Throw MEMORY_ERROR when appropriate.
+	* python/py-prettyprint.c (enum string_repr_result): New.
+	(print_stack_unless_memory_error): New function.
+	(print_string_repr): Change return type.  Use
+	print_stack_unless_memory_error.
+	(print_children): Use print_stack_unless_memory_error.
+	(apply_val_pretty_printer): Update.  Don't print children if
+	string representation threw an exception.
+	(apply_varobj_pretty_printer): Add 'stream' argument.  Use
+	print_stack_unless_memory_error.
+	* python/python.c (gdbpy_gdb_error, gdbpy_gdb_memory_error): New
+	globals.
+	(_initialize_python): Initialize them.
+	* python/python-internal.h (GDB_PY_HANDLE_EXCEPTION): Use
+	gdbpy_convert_exception.
+	(GDB_PY_SET_HANDLE_EXCEPTION): Likewise.
+	(gdbpy_gdb_error, gdbpy_gdb_memory_error): Declare.
+	(gdbpy_convert_exception): Declare.
+	(apply_varobj_pretty_printer): Update.
+	* python/py-utils.c (gdbpy_convert_exception): New function.
+
+2010-11-12  Marc Khouzam  <marc.khouzam@ericsson.com>
+
+	* mi/mi-main.c (mi_cmd_target_detach): Accept new
+	thread-group id format.
+
+2010-11-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+	* spu-tdep.c (spu_catch_start): Fix compilation error typo.
+
 2010-11-11  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* python/py-breakpoint.c (BPPY_REQUIRE_VALID): Check if bp is
diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index 2df96cd..7c24d30 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -2233,6 +2233,7 @@ arm_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   if (pc < func_start + 4)
     return 0;
 
+  found_stack_adjust = 0;
   insn = read_memory_unsigned_integer (pc - 4, 4, byte_order_for_code);
   if (bits (insn, 28, 31) != INST_NV)
     {
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 015ba16..775a6f8 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -35,6 +35,7 @@
 #include "cp-support.h"
 #include "gdb_obstack.h"
 #include <ctype.h>
+#include "exceptions.h"
 
 extern void _initialize_c_language (void);
 
@@ -698,13 +699,19 @@ c_get_string (struct value *value, gdb_byte **buffer, int *length,
     }
   else
     {
-      err = read_string (value_as_address (value), *length, width, fetchlimit,
-  			 byte_order, buffer, length);
+      CORE_ADDR addr = value_as_address (value);
+
+      err = read_string (addr, *length, width, fetchlimit,
+			 byte_order, buffer, length);
       if (err)
 	{
 	  xfree (*buffer);
-	  error (_("Error reading string from inferior: %s"),
-		 safe_strerror (err));
+	  if (err == EIO)
+	    throw_error (MEMORY_ERROR, "Address %s out of bounds",
+			 paddress (get_type_arch (type), addr));
+	  else
+	    error (_("Error reading string from inferior: %s"),
+		   safe_strerror (err));
 	}
     }
 
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog
index d999772..75f6f70 100644
--- a/gdb/doc/ChangeLog
+++ b/gdb/doc/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-12  Tom Tromey  <tromey@redhat.com>
+
+	* gdb.texinfo (Basic Python): Update.  Add xref.
+	(Exception Handling): Document new exception classes.
+	(Types In Python): Update.
+	(Frames In Python): Update.
+
 2010-11-11  Phil Muldoon  <pmuldoon@redhat.com>
 
 	* gdb.texinfo (Breakpoints In Python): Document "internal"
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index cf70ce4..ddc711b 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -20729,8 +20729,9 @@ spaces if the parameter has a multi-part name.  For example,
 @samp{print object} is a valid parameter name.
 
 If the named parameter does not exist, this function throws a
-@code{RuntimeError}.  Otherwise, the parameter's value is converted to
-a Python value of the appropriate type, and returned.
+@code{gdb.error} (@pxref{Exception Handling}).  Otherwise, the
+parameter's value is converted to a Python value of the appropriate
+type, and returned.
 @end defun
 
 @findex gdb.history
@@ -20741,7 +20742,7 @@ If @var{number} is negative, then @value{GDBN} will take its absolute value
 and count backward from the last element (i.e., the most recent element) to
 find the value to return.  If @var{number} is zero, then @value{GDBN} will
 return the most recent element.  If the element specified by @var{number}
-doesn't exist in the value history, a @code{RuntimeError} exception will be
+doesn't exist in the value history, a @code{gdb.error} exception will be
 raised.
 
 If no exception is raised, the return value is always an instance of
@@ -20869,15 +20870,31 @@ Traceback (most recent call last):
 NameError: name 'foo' is not defined
 @end smallexample
 
-@value{GDBN} errors that happen in @value{GDBN} commands invoked by Python
-code are converted to Python @code{RuntimeError} exceptions.  User
-interrupt (via @kbd{C-c} or by typing @kbd{q} at a pagination
-prompt) is translated to a Python @code{KeyboardInterrupt}
-exception.  If you catch these exceptions in your Python code, your
-exception handler will see @code{RuntimeError} or
-@code{KeyboardInterrupt} as the exception type, the @value{GDBN} error
-message as its value, and the Python call stack backtrace at the
-Python statement closest to where the @value{GDBN} error occured as the
+@value{GDBN} errors that happen in @value{GDBN} commands invoked by
+Python code are converted to Python exceptions.  The type of the
+Python exception depends on the error.
+
+@ftable @code
+@item gdb.error
+This is the base class for most exceptions generated by @value{GDBN}.
+It is derived from @code{RuntimeError}, for compatibility with earlier
+versions of @value{GDBN}.
+
+If an error occurring in @value{GDBN} does not fit into some more
+specific category, then the generated exception will have this type.
+
+@item gdb.MemoryError
+This is a subclass of @code{gdb.error} which is thrown when an
+operation tried to access invalid memory in the inferior.
+
+@item KeyboardInterrupt
+User interrupt (via @kbd{C-c} or by typing @kbd{q} at a pagination
+prompt) is translated to a Python @code{KeyboardInterrupt} exception.
+@end ftable
+
+In all cases, your exception handler will see the @value{GDBN} error
+message as its value and the Python call stack backtrace at the Python
+statement closest to where the @value{GDBN} error occured as the
 traceback.
 
 @findex gdb.GdbError
@@ -21242,7 +21259,7 @@ variant of this type.  That is, the result is neither @code{const} nor
 Return a Python @code{Tuple} object that contains two elements: the
 low bound of the argument type and the high bound of that type.  If
 the type does not have a range, @value{GDBN} will raise a
-@code{RuntimeError} exception.
+@code{gdb.error} exception (@pxref{Exception Handling}).
 @end defmethod
 
 @defmethod Type reference
@@ -22433,8 +22450,8 @@ When the debugged program stops, @value{GDBN} is able to analyze its call
 stack (@pxref{Frames,,Stack frames}).  The @code{gdb.Frame} class
 represents a frame in the stack.  A @code{gdb.Frame} object is only valid
 while its corresponding frame exists in the inferior's stack.  If you try
-to use an invalid frame object, @value{GDBN} will throw a @code{RuntimeError}
-exception.
+to use an invalid frame object, @value{GDBN} will throw a @code{gdb.error}
+exception (@pxref{Exception Handling}).
 
 Two @code{gdb.Frame} objects can be compared for equality with the @code{==}
 operator, like:
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index cbee17c..656506c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-16  Mike Frysinger  <vapier@gentoo.org>
+
+	* linux-low.c (linux_tracefork_child): Add char* cast to arg.
+
 2010-10-22  Jie Zhang  <jie@codesourcery.com>
 
 	* Makefile.in: Add FLAGS_TO_PASS variable.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index b798c16..c65ce54 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -4148,7 +4148,7 @@ linux_tracefork_child (void *arg)
   __clone2 (linux_tracefork_grandchild, arg, STACK_SIZE,
 	    CLONE_VM | SIGCHLD, NULL);
 #else
-  clone (linux_tracefork_grandchild, arg + STACK_SIZE,
+  clone (linux_tracefork_grandchild, (char *) arg + STACK_SIZE,
 	 CLONE_VM | SIGCHLD, NULL);
 #endif
 
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 49e913e..3343c03 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -418,19 +418,40 @@ void
 mi_cmd_target_detach (char *command, char **argv, int argc)
 {
   if (argc != 0 && argc != 1)
-    error ("Usage: -target-detach [thread-group]");
+    error ("Usage: -target-detach [pid | thread-group]");
 
   if (argc == 1)
     {
       struct thread_info *tp;
       char *end = argv[0];
-      int pid = strtol (argv[0], &end, 10);
+      int pid;
 
-      if (*end != '\0')
-	error (_("Cannot parse thread group id '%s'"), argv[0]);
+      /* First see if we are dealing with a thread-group id.  */
+      if (*argv[0] == 'i')
+	{
+	  struct inferior *inf;
+	  int id = strtoul (argv[0] + 1, &end, 0);
+
+	  if (*end != '\0')
+	    error (_("Invalid syntax of thread-group id '%s'"), argv[0]);
+
+	  inf = find_inferior_id (id);
+	  if (!inf)
+	    error (_("Non-existent thread-group id '%d'"), id);
+
+	  pid = inf->pid;
+	}
+      else
+	{
+	  /* We must be dealing with a pid.  */
+	  pid = strtol (argv[0], &end, 10);
+
+	  if (*end != '\0')
+	    error (_("Invalid identifier '%s'"), argv[0]);
+	}
 
       /* Pick any thread in the desired process.  Current
-	 target_detach deteches from the parent of inferior_ptid.  */
+	 target_detach detaches from the parent of inferior_ptid.  */
       tp = iterate_over_threads (find_thread_of_process, &pid);
       if (!tp)
 	error (_("Thread group is empty"));
diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
index afe2b40..7be1409 100644
--- a/gdb/python/py-prettyprint.c
+++ b/gdb/python/py-prettyprint.c
@@ -29,6 +29,18 @@
 #ifdef HAVE_PYTHON
 #include "python-internal.h"
 
+/* Return type of print_string_repr.  */
+
+enum string_repr_result
+  {
+    /* The string method returned None.  */
+    string_repr_none,
+    /* The string method had an error.  */
+    string_repr_error,
+    /* Everything ok.  */
+    string_repr_ok
+  };
+
 /* Helper function for find_pretty_printer which iterates over a list,
    calls each function and inspects output.  This will return a
    printer object if one recognizes VALUE.  If no printer is found, it
@@ -256,12 +268,40 @@ gdbpy_get_display_hint (PyObject *printer)
   return result;
 }
 
+/* A wrapper for gdbpy_print_stack that ignores MemoryError.  */
+
+static void
+print_stack_unless_memory_error (struct ui_file *stream)
+{
+  if (PyErr_ExceptionMatches (gdbpy_gdb_memory_error))
+    {
+      struct cleanup *cleanup;
+      PyObject *type, *value, *trace;
+      char *msg;
+
+      PyErr_Fetch (&type, &value, &trace);
+      cleanup = make_cleanup_py_decref (type);
+      make_cleanup_py_decref (value);
+      make_cleanup_py_decref (trace);
+
+      msg = gdbpy_exception_to_string (type, value);
+      make_cleanup (xfree, msg);
+
+      if (msg == NULL || *msg == '\0')
+	fprintf_filtered (stream, _("<error reading variable"));
+      else
+	fprintf_filtered (stream, _("<error reading variable: %s>"), msg);
+
+      do_cleanups (cleanup);
+    }
+  else
+    gdbpy_print_stack ();
+}
+
 /* Helper for apply_val_pretty_printer which calls to_string and
-   formats the result.  If the value returnd is Py_None, nothing is
-   printed and the function returns a 1; in all other cases data is
-   printed as given by the pretty printer and the function returns 0.
-*/
-static int
+   formats the result.  */
+
+static enum string_repr_result
 print_string_repr (PyObject *printer, const char *hint,
 		   struct ui_file *stream, int recurse,
 		   const struct value_print_options *options,
@@ -270,7 +310,7 @@ print_string_repr (PyObject *printer, const char *hint,
 {
   struct value *replacement = NULL;
   PyObject *py_str = NULL;
-  int is_py_none = 0;
+  enum string_repr_result result = string_repr_ok;
 
   py_str = pretty_print_one_value (printer, &replacement);
   if (py_str)
@@ -278,7 +318,7 @@ print_string_repr (PyObject *printer, const char *hint,
       struct cleanup *cleanup = make_cleanup_py_decref (py_str);
 
       if (py_str == Py_None)
-	is_py_none = 1;
+	result = string_repr_none;
       else if (gdbpy_is_lazy_string (py_str))
 	{
 	  CORE_ADDR addr;
@@ -316,7 +356,10 @@ print_string_repr (PyObject *printer, const char *hint,
 		fputs_filtered (output, stream);
 	    }
 	  else
-	    gdbpy_print_stack ();


hooks/post-receive
--
Repository for Project Archer.


             reply	other threads:[~2010-11-16  5:04 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16  5:04 jkratoch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-02-01 19:25 jkratoch
2011-01-29 16:44 jkratoch
2011-01-25 12:53 pmuldoon
2011-01-25  9:10 jkratoch
2011-01-17 13:31 pmuldoon
2011-01-15 11:35 jkratoch
2011-01-14  8:04 jkratoch
2011-01-10 12:00 pmuldoon
2011-01-10  9:10 jkratoch
2011-01-07  5:57 jkratoch
2011-01-06 12:22 pmuldoon
2011-01-04  4:59 jkratoch
2010-12-31 22:30 jkratoch
2010-12-30  7:22 jkratoch
2010-12-22 20:11 swagiaal
2010-12-14 17:13 jkratoch
2010-12-14  8:27 pmuldoon
2010-12-10 17:16 jkratoch
2010-12-08 15:55 pmuldoon
2010-12-06  6:40 jkratoch
2010-12-04  1:03 jkratoch
2010-12-02 15:47 pmuldoon
2010-11-30  0:15 jkratoch
2010-11-28 18:02 jkratoch
2010-11-28  5:41 jkratoch
2010-11-12 11:47 pmuldoon
2010-11-11 11:39 pmuldoon
2010-11-10  9:09 pmuldoon
2010-11-08  9:34 pmuldoon
2010-11-07 18:15 jkratoch
2010-10-22 14:28 pmuldoon
2010-10-20 12:48 pmuldoon
2010-10-19 16:01 pmuldoon
2010-10-17 20:27 jkratoch
2010-10-15 17:07 jkratoch
2010-10-14 20:55 jkratoch
2010-10-13 15:06 jkratoch
2010-10-12 16:45 jkratoch
2010-10-11  9:21 jkratoch
2010-10-11  8:47 pmuldoon
2010-10-06  9:00 pmuldoon
2010-09-30  8:56 pmuldoon
2010-09-27  9:48 jkratoch
2010-09-20 12:34 pmuldoon
2010-09-16 20:49 ratmice
2010-09-04 19:59 jkratoch
2010-09-03  7:26 jkratoch
2010-09-02 15:04 jkratoch
2010-09-01 15:29 swagiaal
2010-08-23 13:54 jkratoch
2010-08-20 17:49 jkratoch
2010-08-12 15:19 swagiaal
2010-08-06 15:32 jkratoch
2010-07-29 19:17 swagiaal
2010-07-22 16:57 jkratoch
2010-07-22 16:26 jkratoch
2010-07-20 18:51 jkratoch
2010-07-09  8:09 jkratoch
2010-06-24  8:55 jkratoch
2010-06-23 20:56 jkratoch
2010-06-17 12:53 jkratoch
2010-06-07  8:14 jkratoch
2010-06-02 19:03 jkratoch
2010-05-28 21:27 jkratoch
2010-05-26 18:36 swagiaal
2010-05-17 18:02 jkratoch
2010-05-17  1:04 jkratoch
2010-05-10 19:30 swagiaal
2010-05-05 14:24 swagiaal
2010-05-03 13:49 jkratoch
2010-05-03  8:48 jkratoch
2010-05-02 23:10 jkratoch
2010-05-02 15:54 jkratoch
2010-04-30  7:11 jkratoch
2010-04-28 11:44 jkratoch
2010-04-25 20:22 jkratoch
2010-04-09 20:37 jkratoch
2010-04-07  1:41 jkratoch
2010-04-05 10:11 jkratoch
2010-04-04 11:58 jkratoch
2010-03-22 23:58 jkratoch
2010-03-20 17:23 jkratoch
2010-03-18 10:01 jkratoch
2010-03-17 18:04 jkratoch
2010-03-12 18:35 jkratoch
2010-03-04 22:28 jkratoch
2010-03-01 22:16 jkratoch
2010-02-26 22:16 jkratoch
2010-02-26 17:50 jkratoch
2010-02-17 16:01 swagiaal
2010-02-13 22:51 jkratoch
2010-02-11 12:51 jkratoch
2010-02-09 19:01 jkratoch
2010-02-08 21:46 jkratoch
2010-02-03  4:38 jkratoch
2010-01-31 17:25 jkratoch
2010-01-28 19:17 swagiaal
2010-01-28 10:56 jkratoch
2010-01-27 19:21 swagiaal
2010-01-27  8:08 jkratoch
2010-01-26 18:58 swagiaal
2010-01-20 21:48 jkratoch
2010-01-15  2:09 jkratoch
2010-01-15  0:52 jkratoch
2010-01-14 22:23 jkratoch
2010-01-13 20:53 jkratoch
2010-01-10 20:47 jkratoch
2010-01-09 10:03 jkratoch
2010-01-09  8:41 jkratoch
2010-01-08 19:16 jkratoch
2009-12-06 17:43 jkratoch
2009-12-03 16:32 jkratoch
2009-11-30 13:59 jkratoch
2009-11-24 21:21 jkratoch
2009-11-21  9:24 jkratoch
2009-11-20 21:06 jkratoch
2009-11-20 15:57 jkratoch
2009-11-17 19:59 jkratoch
2009-11-16  2:22 jkratoch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101116050413.12085.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).