Rebase to FSF GDB 7.3.1 release.

Fix `layout regs' (BZ 749379, PR 13073, Pedro Alves).
This commit is contained in:
Jan Kratochvil 2011-10-27 01:03:36 +02:00
parent b37d386529
commit 4909b1573f
4 changed files with 10 additions and 283 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/libstdc++-v3-python-r155978.tar.bz2
/gdb-7.3.tar.bz2
/gdb-7.3.1.tar.bz2

View File

@ -1,277 +0,0 @@
http://sourceware.org/ml/gdb-cvs/2011-08/msg00047.html
### src/gdb/ChangeLog 2011/08/08 21:41:12 1.13259
### src/gdb/ChangeLog 2011/08/09 12:45:39 1.13260
## -1,3 +1,13 @@
+2011-08-09 Phil Muldoon <pmuldoon@redhat.com>
+
+ * python/lib/gdb/__init__.py: Auto-load files in command and
+ function directories.
+ * python/python.c (finish_python_initialization): Use
+ os.path.join.
+ * python/lib/gdb/command/pretty_printers.py: Self register
+ command.
+ * NEWS: Document auto-loading.
+
2011-08-08 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2loc.c (dwarf2_evaluate_loc_desc_full) <DWARF_VALUE_STACK>
--- src/gdb/NEWS 2011/07/26 20:57:53 1.446
+++ src/gdb/NEWS 2011/08/09 12:45:39 1.447
@@ -1,6 +1,13 @@
What has changed in GDB?
(Organized release by release)
+*** Changes after GDB 7.3
+
+ ** Python commands and convenience-functions located in
+ 'data-directory'/python/gdb/command and
+ 'data-directory'/python/gdb/function are now automatically loaded
+ on GDB start-up.
+
*** Changes in GDB 7.3
* GDB has a new command: "thread find [REGEXP]".
### src/gdb/doc/ChangeLog 2011/07/26 16:59:23 1.1202
### src/gdb/doc/ChangeLog 2011/08/09 12:45:39 1.1203
## -1,3 +1,8 @@
+2011-08-09 Phil Muldoon <pmuldoon@redhat.com>
+
+ * gdb.texinfo (Python): Document command and function
+ auto-loading.
+
2011-07-26 Jan Kratochvil <jan.kratochvil@redhat.com>
Eli Zaretskii <eliz@gnu.org>
--- src/gdb/doc/gdb.texinfo 2011/07/26 20:57:54 1.851
+++ src/gdb/doc/gdb.texinfo 2011/08/09 12:45:39 1.852
@@ -20845,6 +20845,12 @@
is automatically added to the Python Search Path in order to allow
the Python interpreter to locate all scripts installed at this location.
+Additionally, @value{GDBN} commands and convenience functions which
+are written in Python and are located in the
+@file{@var{data-directory}/python/gdb/command} or
+@file{@var{data-directory}/python/gdb/function} directories are
+automatically imported when @value{GDBN} starts.
+
@menu
* Python Commands:: Accessing Python from @value{GDBN}.
* Python API:: Accessing @value{GDBN} from Python.
--- src/gdb/python/python.c 2011/07/22 09:22:50 1.68
+++ src/gdb/python/python.c 2011/08/09 12:45:40 1.69
@@ -1302,13 +1302,13 @@
sys.path.insert (0, gdb.PYTHONDIR)\n\
\n\
# Tell python where to find submodules of gdb.\n\
- gdb.__path__ = [gdb.PYTHONDIR + '/gdb']\n\
+ gdb.__path__ = [os.path.join (gdb.PYTHONDIR, 'gdb')]\n\
\n\
# The gdb module is implemented in C rather than in Python. As a result,\n\
# the associated __init.py__ script is not not executed by default when\n\
# the gdb module gets imported. Execute that script manually if it\n\
# exists.\n\
- ipy = gdb.PYTHONDIR + '/gdb/__init__.py'\n\
+ ipy = os.path.join (gdb.PYTHONDIR, 'gdb', '__init__.py')\n\
if os.path.exists (ipy):\n\
execfile (ipy)\n\
\n\
--- src/gdb/python/lib/gdb/__init__.py 2011/01/01 15:33:26 1.3
+++ src/gdb/python/lib/gdb/__init__.py 2011/08/09 12:45:40 1.4
@@ -13,6 +13,29 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import gdb.command.pretty_printers
+import traceback
-gdb.command.pretty_printers.register_pretty_printer_commands()
+# Auto-load all functions/commands.
+
+# Modules to auto-load, and the paths where those modules exist.
+
+module_dict = {
+ 'gdb.function': os.path.join(gdb.PYTHONDIR, 'gdb', 'function'),
+ 'gdb.command': os.path.join(gdb.PYTHONDIR, 'gdb', 'command')
+}
+
+# Iterate the dictionary, collating the Python files in each module
+# path. Construct the module name, and import.
+
+for module, location in module_dict.iteritems():
+ if os.path.exists(location):
+ py_files = filter(lambda x: x.endswith('.py') and x != '__init__.py',
+ os.listdir(location))
+
+ for py_file in py_files:
+ # Construct from foo.py, gdb.module.foo
+ py_file = module + '.' + py_file[:-3]
+ try:
+ exec('import ' + py_file)
+ except:
+ print >> sys.stderr, traceback.format_exc()
--- src/gdb/python/lib/gdb/command/pretty_printers.py 2011/01/01 15:33:27 1.4
+++ src/gdb/python/lib/gdb/command/pretty_printers.py 2011/08/09 12:45:40 1.5
@@ -368,3 +368,5 @@
InfoPrettyPrinter()
EnablePrettyPrinter()
DisablePrettyPrinter()
+
+register_pretty_printer_commands()
[commit] Fix sleb128 reading
http://sourceware.org/ml/gdb-patches/2011-07/msg00270.html
http://sourceware.org/ml/gdb-cvs/2011-07/msg00112.html
### src/gdb/ChangeLog 2011/07/11 13:07:36 1.13180
### src/gdb/ChangeLog 2011/07/11 13:40:23 1.13181
## -1,3 +1,8 @@
+2011-07-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * dwarf2expr.c (read_sleb128): Fix signed extension overflowing host
+ `int'.
+
2011-07-11 Phil Muldoon <pmuldoon@redhat.com>
PR python/12438
--- src/gdb/dwarf2expr.c 2011/07/08 16:02:59 1.67
+++ src/gdb/dwarf2expr.c 2011/07/11 13:40:23 1.68
@@ -418,7 +418,7 @@
break;
}
if (shift < (sizeof (*r) * 8) && (byte & 0x40) != 0)
- result |= -(1 << shift);
+ result |= -(((LONGEST) 1) << shift);
*r = result;
return buf;
### src/gdb/testsuite/ChangeLog 2011/07/11 13:07:37 1.2788
### src/gdb/testsuite/ChangeLog 2011/07/11 13:40:24 1.2789
## -1,3 +1,10 @@
+2011-07-11 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.dwarf2/dw2-const.S (Pointer size): Change from 4 to 8.
+ (DW_AT_high_pc, DW_AT_low_pc): Remove them.
+ (val8, .Ltype_const8, .Ltype_int8, DW_TAG_variable): New.
+ * gdb.dwarf2/dw2-const.exp (print/x val8): New test.
+
2011-07-11 Phil Muldoon <pmuldoon@redhat.com>
PR python/12438
--- src/gdb/testsuite/gdb.dwarf2/dw2-const.S 2011/01/01 15:33:44 1.4
+++ src/gdb/testsuite/gdb.dwarf2/dw2-const.S 2011/07/11 13:40:24 1.5
@@ -37,13 +37,11 @@
.Lcu1_start:
.2byte 2 /* DWARF Version */
.4byte .Labbrev1_begin /* Offset into abbrev section */
- .byte 4 /* Pointer size */
+ .byte 8 /* Pointer size */
/* CU die */
.uleb128 1 /* Abbrev: DW_TAG_compile_unit */
.4byte .Lline1_begin /* DW_AT_stmt_list */
- .4byte .Lend_text1 /* DW_AT_high_pc */
- .4byte .Lbegin_text1 /* DW_AT_low_pc */
.ascii "file1.txt\0" /* DW_AT_name */
.ascii "GNU C 3.3.3\0" /* DW_AT_producer */
.byte 1 /* DW_AT_language (C) */
@@ -57,6 +55,27 @@
.uleb128 0x9 /* Abbrev: DW_TAG_const_type */
.4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
+ .uleb128 0xa /* Abbrev: DW_TAG_variable */
+ .ascii "val8\0" /* DW_AT_name */
+ .4byte .Ltype_const8-.Lcu1_begin /* DW_AT_type */
+ .byte 2f - 1f /* DW_AT_location */
+1: .byte 0x11 /* DW_OP_consts */
+#if 0 /* gas encodes it explicitly. */
+ .slab128 0xffffffff00000000
+#endif
+#if 0 /* gas encoded it correctly - formed GDB FAILed. */
+ .sleb128 -4294967296
+#endif
+#if 1 /* Rather encode sleb128 by hand. */
+ .byte 0x80, 0x80, 0x80, 0x80, 0x70
+#endif
+ .byte 0x9f /* DW_OP_stack_value */
+2:
+
+.Ltype_const8:
+ .uleb128 0x9 /* Abbrev: DW_TAG_const_type */
+ .4byte .Ltype_int8-.Lcu1_begin /* DW_AT_type */
+
/* func_cu1 */
.uleb128 2 /* Abbrev: DW_TAG_subprogram */
.byte 1 /* DW_AT_external */
@@ -64,8 +83,6 @@
.byte 2 /* DW_AT_decl_line */
.ascii "func_cu1\0" /* DW_AT_name */
.4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
- .4byte .Lbegin_func_cu1 /* DW_AT_low_pc */
- .4byte .Lend_func_cu1 /* DW_AT_high_pc */
.byte 1 /* DW_AT_frame_base: length */
.byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
@@ -75,6 +92,12 @@
.byte 4 /* DW_AT_byte_size */
.byte 5 /* DW_AT_encoding */
+.Ltype_int8:
+ .uleb128 3 /* Abbrev: DW_TAG_base_type */
+ .ascii "int8\0" /* DW_AT_name */
+ .byte 8 /* DW_AT_byte_size */
+ .byte 5 /* DW_AT_encoding */
+
.byte 0 /* End of children of CU */
.Lcu1_end:
@@ -87,10 +110,6 @@
.byte 1 /* has_children */
.uleb128 0x10 /* DW_AT_stmt_list */
.uleb128 0x6 /* DW_FORM_data4 */
- .uleb128 0x12 /* DW_AT_high_pc */
- .uleb128 0x1 /* DW_FORM_addr */
- .uleb128 0x11 /* DW_AT_low_pc */
- .uleb128 0x1 /* DW_FORM_addr */
.uleb128 0x3 /* DW_AT_name */
.uleb128 0x8 /* DW_FORM_string */
.uleb128 0x25 /* DW_AT_producer */
@@ -113,10 +132,6 @@
.uleb128 0x8 /* DW_FORM_string */
.uleb128 0x49 /* DW_AT_type */
.uleb128 0x13 /* DW_FORM_ref4 */
- .uleb128 0x11 /* DW_AT_low_pc */
- .uleb128 0x1 /* DW_FORM_addr */
- .uleb128 0x12 /* DW_AT_high_pc */
- .uleb128 0x1 /* DW_FORM_addr */
.uleb128 0x40 /* DW_AT_frame_base */
.uleb128 0xa /* DW_FORM_block1 */
.byte 0x0 /* Terminator */
@@ -154,6 +169,18 @@
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
+ .uleb128 0xa /* abbrev code */
+ .uleb128 0x34 /* TAG: DW_TAG_variable */
+ .byte 0x0 /* DW_children_no */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x02 /* DW_AT_location */
+ .uleb128 0xa /* DW_FORM_block1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
.byte 0x0 /* Terminator */
.byte 0x0 /* Terminator */
--- src/gdb/testsuite/gdb.dwarf2/dw2-const.exp 2011/01/19 20:26:09 1.3
+++ src/gdb/testsuite/gdb.dwarf2/dw2-const.exp 2011/07/11 13:40:24 1.4
@@ -39,3 +39,4 @@
gdb_test "print twelve" "= 12"
+gdb_test "print/x val8" " = 0xffffffff00000000"

View File

@ -23,11 +23,11 @@ Name: gdb%{?_with_debug:-debug}
# Set version to contents of gdb/version.in.
# NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3
# and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch).
Version: 7.3
Version: 7.3.1
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 44%{?_with_upstream:.upstream}%{?dist}
Release: 45%{?_with_upstream:.upstream}%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
Group: Development/Debuggers
@ -260,7 +260,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
# Backported fixups post the source tarball.
#Xdrop: Just backports.
Patch232: gdb-upstream.patch
#Patch232: gdb-upstream.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
#=fedoratest+ppc
@ -730,7 +730,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%if 0%{!?_with_upstream:1}
%patch232 -p1
#patch232 -p1
%patch349 -p1
%patch1 -p1
%patch3 -p1
@ -1275,6 +1275,10 @@ fi
%{_infodir}/gdb.info*
%changelog
* Thu Oct 27 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.3.1-45.fc15
- Rebase to FSF GDB 7.3.1 release.
- Fix `layout regs' (BZ 749379, PR 13073, Pedro Alves).
* Mon Sep 26 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.3-44.fc15
- [vla] Fix VLA arrays displayed in `bt full' (BZ 738482).
- Fix DW_OP_GNU_implicit_pointer for DWARF32 v3+ on 64-bit arches.

View File

@ -1,2 +1,2 @@
04e5c4b1b9e633422cc48990fe61958d libstdc++-v3-python-r155978.tar.bz2
485022b8df7ba2221f217e128f479fe7 gdb-7.3.tar.bz2
b89a5fac359c618dda97b88645ceab47 gdb-7.3.1.tar.bz2