Rebase onto fedora f29 @c720d998

8.2 release

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=187
This commit is contained in:
2018-09-11 13:49:10 +00:00
committed by Git OBS Bridge
parent c4e854fd10
commit 435dad805c
146 changed files with 5388 additions and 4279 deletions

View File

@@ -3,8 +3,6 @@ From: Fedora GDB patches <invalid@email.com>
Date: Fri, 27 Oct 2017 21:07:50 +0200
Subject: gdb-archer.patch
FileName: gdb-archer.patch
;; Python patches of: http://sourceware.org/gdb/wiki/ProjectArcher
;;=push
@@ -15,33 +13,11 @@ GIT snapshot:
commit 718a1618b2f691a7f407213bb50f100ac59f91c3
tromey/python
---
gdb/Makefile.in | 6 ++
gdb/data-directory/Makefile.in | 4 +
gdb/doc/gdb.texinfo | 10 +++
gdb/doc/python.texi | 2 -
gdb/gdb-gdb.gdb.in | 10 +++
gdb/main.c | 93 ++++++++++++++++++-----
gdb/python/lib/gdb/command/ignore_errors.py | 37 +++++++++
gdb/python/lib/gdb/command/pahole.py | 81 ++++++++++++++++++++
gdb/python/lib/gdb/function/in_scope.py | 47 ++++++++++++
gdb/python/python-internal.h | 3 +
gdb/python/python.c | 113 ++++++++++++++++++++++++++++
gdb/python/python.h | 2 +
gdb/testsuite/gdb.python/py-frame.exp | 2 +
gdb/testsuite/gdb.python/py-value.exp | 10 +++
gdb/varobj.c | 8 ++
gdb/varobj.h | 2 +
16 files changed, 411 insertions(+), 19 deletions(-)
create mode 100644 gdb/python/lib/gdb/command/ignore_errors.py
create mode 100644 gdb/python/lib/gdb/command/pahole.py
create mode 100644 gdb/python/lib/gdb/function/in_scope.py
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 3142ad6af1..28d8664236 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -2110,6 +2110,12 @@ stamp-h: $(srcdir)/config.in config.status
@@ -2112,6 +2112,12 @@ stamp-h: $(srcdir)/config.in config.status
CONFIG_LINKS= \
$(SHELL) config.status
@@ -51,23 +27,21 @@ index 3142ad6af1..28d8664236 100644
+ CONFIG_HEADERS= \
+ $(SHELL) config.status
+
config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
config.status: $(srcdir)/configure configure.nat configure.tgt configure.host ../bfd/development.sh
$(SHELL) config.status --recheck
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index 5c7c0b4c2e..2014607e9e 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -80,6 +80,8 @@ PYTHON_FILE_LIST = \
@@ -80,6 +80,7 @@ PYTHON_FILE_LIST = \
gdb/unwinder.py \
gdb/xmethod.py \
gdb/command/__init__.py \
+ gdb/command/ignore_errors.py \
+ gdb/command/pahole.py \
gdb/command/explore.py \
gdb/command/backtrace.py \
gdb/command/frame_filters.py \
@@ -92,6 +94,8 @@ PYTHON_FILE_LIST = \
@@ -92,6 +93,8 @@ PYTHON_FILE_LIST = \
gdb/function/as_string.py \
gdb/function/caller_is.py \
gdb/function/strfns.py \
@@ -77,7 +51,6 @@ index 5c7c0b4c2e..2014607e9e 100644
gdb/printer/bound_registers.py
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 7b99ae1551..dea17fd5a7 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -1245,6 +1245,16 @@ for remote debugging.
@@ -98,7 +71,6 @@ index 7b99ae1551..dea17fd5a7 100644
@item -tui
@cindex @code{--tui}
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index ccf011e35e..461e900f77 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
@@ -88,8 +88,6 @@ containing @code{end}. For example:
@@ -111,7 +83,6 @@ index ccf011e35e..461e900f77 100644
>end
23
diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in
index 05a38b2670..9801fdff67 100644
--- a/gdb/gdb-gdb.gdb.in
+++ b/gdb/gdb-gdb.gdb.in
@@ -1,5 +1,15 @@
@@ -131,7 +102,6 @@ index 05a38b2670..9801fdff67 100644
set variable $gdb_init_done = 1
diff --git a/gdb/main.c b/gdb/main.c
index b079e79c93..b150af4e70 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -33,6 +33,7 @@
@@ -142,7 +112,7 @@ index b079e79c93..b150af4e70 100644
#include "source.h"
#include "cli/cli-cmds.h"
#include "objfiles.h"
@@ -478,7 +479,7 @@ exec_or_core_file_attach (const char *filename, int from_tty)
@@ -479,7 +480,7 @@ exec_or_core_file_attach (const char *filename, int from_tty)
}
static void
@@ -151,7 +121,7 @@ index b079e79c93..b150af4e70 100644
{
int argc = context->argc;
char **argv = context->argv;
@@ -694,10 +695,14 @@ captured_main_1 (struct captured_main_args *context)
@@ -695,10 +696,14 @@ captured_main_1 (struct captured_main_args *context)
{"args", no_argument, &set_args, 1},
{"l", required_argument, 0, 'l'},
{"return-child-result", no_argument, &return_child_result, 1},
@@ -167,7 +137,7 @@ index b079e79c93..b150af4e70 100644
{
int option_index;
@@ -715,6 +720,9 @@ captured_main_1 (struct captured_main_args *context)
@@ -716,6 +721,9 @@ captured_main_1 (struct captured_main_args *context)
case 0:
/* Long option that just sets a flag. */
break;
@@ -177,7 +147,7 @@ index b079e79c93..b150af4e70 100644
case OPT_SE:
symarg = optarg;
execarg = optarg;
@@ -889,7 +897,31 @@ captured_main_1 (struct captured_main_args *context)
@@ -890,7 +898,31 @@ captured_main_1 (struct captured_main_args *context)
/* Now that gdb_init has created the initial inferior, we're in
position to set args for that inferior. */
@@ -210,7 +180,7 @@ index b079e79c93..b150af4e70 100644
{
/* The remaining options are the command-line options for the
inferior. The first one is the sym/exec file, and the rest
@@ -1179,7 +1211,8 @@ captured_main_1 (struct captured_main_args *context)
@@ -1180,7 +1212,8 @@ captured_main_1 (struct captured_main_args *context)
/* Read in the old history after all the command files have been
read. */
@@ -220,7 +190,7 @@ index b079e79c93..b150af4e70 100644
if (batch_flag)
{
@@ -1192,24 +1225,37 @@ static void
@@ -1193,24 +1226,37 @@ static void
captured_main (void *data)
{
struct captured_main_args *context = (struct captured_main_args *) data;
@@ -271,7 +241,7 @@ index b079e79c93..b150af4e70 100644
}
/* No exit -- exit is through quit_command. */
}
@@ -1252,6 +1298,12 @@ print_gdb_help (struct ui_file *stream)
@@ -1253,6 +1299,12 @@ print_gdb_help (struct ui_file *stream)
fputs_unfiltered (_("\
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\
@@ -284,7 +254,7 @@ index b079e79c93..b150af4e70 100644
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
"), stream);
fputs_unfiltered (_("\
@@ -1297,6 +1349,13 @@ Output and user interface control:\n\n\
@@ -1298,6 +1350,13 @@ Output and user interface control:\n\n\
#endif
fputs_unfiltered (_("\
--dbx DBX compatibility mode.\n\
@@ -300,7 +270,6 @@ index b079e79c93..b150af4e70 100644
"), stream);
diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py
new file mode 100644
index 0000000000..6fa48ff081
--- /dev/null
+++ b/gdb/python/lib/gdb/command/ignore_errors.py
@@ -0,0 +1,37 @@
@@ -341,96 +310,8 @@ index 0000000000..6fa48ff081
+ pass
+
+IgnoreErrorsCommand ()
diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py
new file mode 100644
index 0000000000..e08eaf5ca8
--- /dev/null
+++ b/gdb/python/lib/gdb/command/pahole.py
@@ -0,0 +1,81 @@
+# pahole command for gdb
+
+# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc.
+
+# 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.
+#
+# 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
+
+class Pahole (gdb.Command):
+ """Show the holes in a structure.
+This command takes a single argument, a type name.
+It prints the type and displays comments showing where holes are."""
+
+ def __init__ (self):
+ super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE,
+ gdb.COMPLETE_SYMBOL)
+
+ def maybe_print_hole(self, bitpos, field_bitpos):
+ if bitpos != field_bitpos:
+ hole = field_bitpos - bitpos
+ print (' /* XXX %d bit hole, try to pack */' % hole)
+
+ def pahole (self, type, level, name):
+ if name is None:
+ name = ''
+ tag = type.tag
+ if tag is None:
+ tag = ''
+ print ('%sstruct %s {' % (' ' * (2 * level), tag))
+ bitpos = 0
+ for field in type.fields ():
+ # Skip static fields.
+ if not hasattr (field, ('bitpos')):
+ continue
+
+ ftype = field.type.strip_typedefs()
+
+ self.maybe_print_hole(bitpos, field.bitpos)
+ bitpos = field.bitpos
+ if field.bitsize > 0:
+ fieldsize = field.bitsize
+ else:
+ # TARGET_CHAR_BIT here...
+ fieldsize = 8 * ftype.sizeof
+
+ # TARGET_CHAR_BIT
+ print (' /* %3d %3d */' % (int (bitpos / 8), int (fieldsize / 8)), end = "")
+ bitpos = bitpos + fieldsize
+
+ if ftype.code == gdb.TYPE_CODE_STRUCT:
+ self.pahole (ftype, level + 1, field.name)
+ else:
+ print (' ' * (2 + 2 * level), end = "")
+ print ('%s %s' % (str (ftype), field.name))
+
+ if level == 0:
+ self.maybe_print_hole(bitpos, 8 * type.sizeof)
+
+ print (' ' * (14 + 2 * level), end = "")
+ print ('} %s' % name)
+
+ def invoke (self, arg, from_tty):
+ type = gdb.lookup_type (arg)
+ type = type.strip_typedefs ()
+ if type.code != gdb.TYPE_CODE_STRUCT:
+ raise (TypeError, '%s is not a struct type' % arg)
+ print (' ' * 14, end = "")
+ self.pahole (type, 0, '')
+
+Pahole()
diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py
new file mode 100644
index 0000000000..8742680614
--- /dev/null
+++ b/gdb/python/lib/gdb/function/in_scope.py
@@ -0,0 +1,47 @@
@@ -482,10 +363,9 @@ index 0000000000..8742680614
+
+InScope ()
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index 89bbc6987b..69dbb69c06 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -657,6 +657,9 @@ class gdbpy_enter_varobj : public gdbpy_enter
@@ -644,6 +644,9 @@ class gdbpy_enter_varobj : public gdbpy_enter
};
@@ -496,7 +376,6 @@ index 89bbc6987b..69dbb69c06 100644
extern const struct language_defn *python_language;
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 610dda828c..de5ffbd70b 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python =
@@ -508,7 +387,7 @@ index 610dda828c..de5ffbd70b 100644
#include "target.h"
#include "gdbthread.h"
#include "interps.h"
@@ -242,6 +244,29 @@ gdbpy_enter::~gdbpy_enter ()
@@ -237,6 +239,29 @@ gdbpy_enter::~gdbpy_enter ()
restore_active_ext_lang (m_previous_active);
}
@@ -538,7 +417,7 @@ index 610dda828c..de5ffbd70b 100644
/* Set the quit flag. */
static void
@@ -1356,6 +1381,92 @@ gdbpy_print_stack (void)
@@ -1367,6 +1392,92 @@ gdbpy_print_stack (void)
/* Return the current Progspace.
There always is one. */
@@ -631,7 +510,7 @@ index 610dda828c..de5ffbd70b 100644
static PyObject *
gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2)
@@ -2034,6 +2145,8 @@ PyMethodDef python_GdbMethods[] =
@@ -2057,6 +2168,8 @@ PyMethodDef python_GdbMethods[] =
Evaluate command, a string, as a gdb CLI command. Optionally returns\n\
a Python String containing the output of the command if to_string is\n\
set to True." },
@@ -641,7 +520,6 @@ index 610dda828c..de5ffbd70b 100644
"Return a gdb parameter's value" },
diff --git a/gdb/python/python.h b/gdb/python/python.h
index de58fd81df..237a84a0b2 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
@@ -25,4 +25,6 @@
@@ -652,7 +530,6 @@ index de58fd81df..237a84a0b2 100644
+
#endif /* GDB_PYTHON_H */
diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp
index f186fa9578..0327284226 100644
--- a/gdb/testsuite/gdb.python/py-frame.exp
+++ b/gdb/testsuite/gdb.python/py-frame.exp
@@ -95,6 +95,8 @@ gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.r
@@ -665,7 +542,6 @@ index f186fa9578..0327284226 100644
gdb_test "python print ('result = %s' % (gdb.selected_frame ().read_register ('sp') == gdb.parse_and_eval ('\$sp')))" \
" = True" \
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index eb82a7776f..3069a5c6d7 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -384,6 +384,15 @@ proc test_value_after_death {} {
@@ -693,10 +569,9 @@ index eb82a7776f..3069a5c6d7 100644
# Test either C or C++ values.
diff --git a/gdb/varobj.c b/gdb/varobj.c
index 01dabef37c..c198731d0b 100644
--- a/gdb/varobj.c
+++ b/gdb/varobj.c
@@ -217,6 +217,14 @@ is_root_p (const struct varobj *var)
@@ -218,6 +218,14 @@ is_root_p (const struct varobj *var)
}
#ifdef HAVE_PYTHON
@@ -712,10 +587,9 @@ index 01dabef37c..c198731d0b 100644
/* See python-internal.h. */
gdbpy_enter_varobj::gdbpy_enter_varobj (const struct varobj *var)
diff --git a/gdb/varobj.h b/gdb/varobj.h
index 6e80d1b89e..677547996f 100644
--- a/gdb/varobj.h
+++ b/gdb/varobj.h
@@ -327,6 +327,8 @@ extern bool varobj_has_more (const struct varobj *var, int to);
@@ -328,6 +328,8 @@ extern bool varobj_has_more (const struct varobj *var, int to);
extern bool varobj_is_dynamic_p (const struct varobj *var);
@@ -724,6 +598,3 @@ index 6e80d1b89e..677547996f 100644
extern bool varobj_default_value_is_changeable_p (const struct varobj *var);
extern bool varobj_value_is_changeable_p (const struct varobj *var);
--
2.14.3