[packages/gdb] - up to 8.3
arekm
arekm at pld-linux.org
Tue Sep 10 11:26:57 CEST 2019
commit 77d109980b515d9568e46bdd6f850bfe02b83d25
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Tue Sep 10 11:26:48 2019 +0200
- up to 8.3
gdb-6.3-gstack-20050411.patch | 34 +-
gdb-6.6-buildid-locate-core-as-arg.patch | 27 +-
...ding-warning-missing-debuginfo-rhbz981154.patch | 15 -
gdb-6.6-buildid-locate-rpm-librpm-workaround.patch | 2 +-
gdb-6.6-buildid-locate-rpm-scl.patch | 12 +-
gdb-6.6-buildid-locate-rpm.patch | 30 +-
gdb-6.6-buildid-locate-solib-missing-ids.patch | 4 +-
gdb-6.6-buildid-locate.patch | 341 +++++++++++++--------
gdb-readline.patch | 12 +-
gdb-vla-intel-fortran-strides.patch | 151 +++++----
gdb-vla-intel-fortran-vla-strings.patch | 54 ++--
gdb-vla-intel-stringbt-fix.patch | 2 +-
gdb.spec | 4 +-
13 files changed, 406 insertions(+), 282 deletions(-)
---
diff --git a/gdb.spec b/gdb.spec
index d796abf..a3fc5a9 100644
--- a/gdb.spec
+++ b/gdb.spec
@@ -21,12 +21,12 @@ Summary(uk.UTF-8): Символьний відладчик для С та інш
Summary(zh_CN.UTF-8): [开发]C和其他语言的调试器
Summary(zh_TW.UTF-8): [.-A開發]C和.$)B其.-A他語.$)B言的調試器
Name: gdb
-Version: 8.2.1
+Version: 8.3
Release: 1
License: GPL v3+
Group: Development/Debuggers
Source0: http://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.xz
-# Source0-md5: f8b2562e830a4098dd5b5ea9e9296c70
+# Source0-md5: bbd95b2f9b34621ad7a19a3965476314
Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2
# Source1-md5: 2e8a48939ae282c12bbacdd54e398247
Source3: %{name}-gstack.man
diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch
index 37b09de..6690e15 100644
--- a/gdb-6.3-gstack-20050411.patch
+++ b/gdb-6.3-gstack-20050411.patch
@@ -16,7 +16,7 @@ Subject: gdb-6.3-gstack-20050411.patch
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
-@@ -1735,7 +1735,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
+@@ -1749,7 +1749,7 @@ info install-info clean-info dvi pdf install-pdf html install-html: force
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
@@ -25,7 +25,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \
-@@ -1784,7 +1784,25 @@ install-guile:
+@@ -1798,7 +1798,25 @@ install-guile:
install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@@ -52,7 +52,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \
-@@ -1807,6 +1825,18 @@ uninstall: force $(CONFIG_UNINSTALL)
+@@ -1821,6 +1839,18 @@ uninstall: force $(CONFIG_UNINSTALL)
fi
@$(MAKE) DO=uninstall "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
@@ -171,7 +171,7 @@ diff --git a/gdb/testsuite/gdb.base/gstack.exp b/gdb/testsuite/gdb.base/gstack.e
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gstack.exp
-@@ -0,0 +1,66 @@
+@@ -0,0 +1,84 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@@ -202,6 +202,10 @@ new file mode 100644
+ fail $test
+ return
+}
++
++# The spawn id of the test inferior.
++set test_spawn_id $res
++
+set use_gdb_stub 1
+set pid [exp_pid -i $res]
+gdb_expect {
@@ -217,7 +221,6 @@ new file mode 100644
+ return
+ }
+}
-+gdb_exit
+
+# Testcase uses the most simple notification not to get caught by attach on
+# exiting the function. Still we could retry the gstack command if we fail.
@@ -229,12 +232,27 @@ new file mode 100644
+ perror "Spawning $command failed."
+ fail $test
+}
-+set pid [exp_pid -i $res]
++
++set gdb_spawn_id $res
++
+gdb_test_multiple "" $test {
+ -re "^#0 +(0x\[0-9a-f\]+ in )?\\.?func \\(\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in \\.?main \\(\\) at \[^\r\n\]*\r\nGSTACK-END\r\n\$" {
+ pass $test
+ }
+}
-+gdb_exit
+
-+remote_exec host "kill -9 $pid"
++gdb_test_multiple "" "gstack exits" {
++ eof {
++ set result [wait -i $gdb_spawn_id]
++ verbose $result
++
++ gdb_assert { [lindex $result 2] == 0 } "gstack exits with no error"
++ gdb_assert { [lindex $result 3] == 0 } "gstack's exit status is 0"
++
++ remote_close host
++ clear_gdb_spawn_id
++ }
++}
++
++# Kill the test inferior.
++kill_wait_spawned_process $test_spawn_id
diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch
index 40938a5..a59c2b7 100644
--- a/gdb-6.6-buildid-locate-core-as-arg.patch
+++ b/gdb-6.6-buildid-locate-core-as-arg.patch
@@ -85,7 +85,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
#include <fcntl.h>
#include "readline/readline.h"
-@@ -357,12 +358,27 @@ exec_file_attach (const char *filename, int from_tty)
+@@ -355,12 +356,27 @@ exec_file_attach (const char *filename, int from_tty)
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
@@ -102,7 +102,7 @@ diff --git a/gdb/exec.c b/gdb/exec.c
exec_close ();
- error (_("\"%s\": not in executable format: %s"),
- scratch_pathname,
-- gdb_bfd_errmsg (bfd_get_error (), matching));
+- gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
+
+ if (is_core != 0)
+ throw_error (IS_CORE_ERROR,
@@ -112,14 +112,14 @@ diff --git a/gdb/exec.c b/gdb/exec.c
+ else
+ error (_("\"%s\": not in executable format: %s"),
+ scratch_pathname,
-+ gdb_bfd_errmsg (bfd_get_error (), matching));
++ gdb_bfd_errmsg (bfd_get_error (), matching).c_str ());
}
if (build_section_table (exec_bfd, §ions, §ions_end))
diff --git a/gdb/main.c b/gdb/main.c
--- a/gdb/main.c
+++ b/gdb/main.c
-@@ -447,6 +447,37 @@ struct cmdarg
+@@ -448,6 +448,35 @@ struct cmdarg
char *string;
};
@@ -130,8 +130,6 @@ diff --git a/gdb/main.c b/gdb/main.c
+static void
+exec_or_core_file_attach (const char *filename, int from_tty)
+{
-+ volatile struct gdb_exception e;
-+
+ gdb_assert (exec_bfd == NULL);
+
+ TRY
@@ -157,7 +155,7 @@ diff --git a/gdb/main.c b/gdb/main.c
static void
captured_main_1 (struct captured_main_args *context)
{
-@@ -883,6 +914,8 @@ captured_main_1 (struct captured_main_args *context)
+@@ -893,6 +922,8 @@ captured_main_1 (struct captured_main_args *context)
{
symarg = argv[optind];
execarg = argv[optind];
@@ -166,7 +164,7 @@ diff --git a/gdb/main.c b/gdb/main.c
optind++;
}
-@@ -1033,11 +1066,25 @@ captured_main_1 (struct captured_main_args *context)
+@@ -1043,12 +1074,25 @@ captured_main_1 (struct captured_main_args *context)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{
@@ -185,13 +183,14 @@ diff --git a/gdb/main.c b/gdb/main.c
/* The exec file and the symbol-file are the same. If we can't
open it, better only print one error message.
- catch_command_errors returns non-zero on success! */
-- if (catch_command_errors (exec_file_attach, execarg,
-- !batch_flag))
+- ret = catch_command_errors (exec_file_attach, execarg,
+- !batch_flag);
+- if (ret != 0)
+ catch_command_errors returns non-zero on success!
+ Do not load EXECARG as a symbol file if it has been already processed
+ as a core file. */
-+ if (catch_command_errors (func, execarg, !batch_flag)
-+ && core_bfd == NULL)
- catch_command_errors (symbol_file_add_main_adapter, symarg,
- !batch_flag);
++ ret = catch_command_errors (func, execarg, !batch_flag);
++ if (ret != 0 && core_bfd == NULL)
+ ret = catch_command_errors (symbol_file_add_main_adapter,
+ symarg, !batch_flag);
}
diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
index a25057e..985cb6a 100644
--- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
+++ b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch
@@ -25,21 +25,6 @@ Comments by Sergio Durigan Junior <sergiodj at redhat.com>:
NULL after it is free'd, otherwise the code below thinks that it is still
valid and doesn't print the necessary warning ("Try: yum install ...").
-diff --git a/gdb/build-id.c b/gdb/build-id.c
---- a/gdb/build-id.c
-+++ b/gdb/build-id.c
-@@ -581,7 +581,10 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
- do_cleanups (inner);
-
- if (abfd == NULL)
-- continue;
-+ {
-+ filename = NULL;
-+ continue;
-+ }
-
- if (build_id_verify (abfd.get(), build_id_len, build_id))
- break;
diff --git a/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp b/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp
new file mode 100644
--- /dev/null
diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
index 375b178..f8dcbeb 100644
--- a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
+++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
@@ -9,7 +9,7 @@ Subject: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
-@@ -652,6 +652,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+@@ -712,6 +712,19 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
#include <dlfcn.h>
#endif
diff --git a/gdb-6.6-buildid-locate-rpm-scl.patch b/gdb-6.6-buildid-locate-rpm-scl.patch
index 7e39488..5b3d4ad 100644
--- a/gdb-6.6-buildid-locate-rpm-scl.patch
+++ b/gdb-6.6-buildid-locate-rpm-scl.patch
@@ -12,7 +12,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=953585
diff --git a/gdb/build-id.c b/gdb/build-id.c
--- a/gdb/build-id.c
+++ b/gdb/build-id.c
-@@ -689,7 +689,11 @@ static int missing_rpm_list_entries;
+@@ -746,7 +746,11 @@ static int missing_rpm_list_entries;
/* Returns the count of newly added rpms. */
static int
@@ -24,7 +24,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
static int rpm_init_done = 0;
rpmts ts;
-@@ -796,7 +800,11 @@ missing_rpm_enlist (const char *filename)
+@@ -853,7 +857,11 @@ missing_rpm_enlist (const char *filename)
mi = rpmtsInitIterator_p (ts, RPMTAG_BASENAMES, filename, 0);
if (mi != NULL)
{
@@ -36,7 +36,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
{
Header h;
char *debuginfo, **slot, *s, *s2;
-@@ -914,6 +922,37 @@ missing_rpm_enlist (const char *filename)
+@@ -971,6 +979,37 @@ missing_rpm_enlist (const char *filename)
xfree (debuginfo);
count++;
}
@@ -74,7 +74,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
rpmdbFreeIterator_p (mi);
}
-@@ -924,6 +963,21 @@ missing_rpm_enlist (const char *filename)
+@@ -981,6 +1020,21 @@ missing_rpm_enlist (const char *filename)
}
static int
@@ -99,7 +99,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -3469,6 +3469,16 @@ read_gdb_index_from_section (struct objfile *objfile,
+@@ -3501,6 +3501,16 @@ read_gdb_index_from_buffer (struct objfile *objfile,
"set use-deprecated-index-sections on". */
if (version < 6 && !deprecated_ok)
{
@@ -116,7 +116,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
static int warning_printed = 0;
if (!warning_printed)
{
-@@ -3480,6 +3490,10 @@ to use the section anyway."),
+@@ -3512,6 +3522,10 @@ to use the section anyway."),
warning_printed = 1;
}
return 0;
diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch
index d5ec4b0..3f7c651 100644
--- a/gdb-6.6-buildid-locate-rpm.patch
+++ b/gdb-6.6-buildid-locate-rpm.patch
@@ -244,7 +244,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
#define BUILD_ID_VERBOSE_NONE 0
#define BUILD_ID_VERBOSE_FILENAMES 1
-@@ -640,8 +642,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
+@@ -700,8 +702,366 @@ build_id_to_filename (const struct bfd_build_id *build_id, char **link_return)
return result;
}
@@ -612,7 +612,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
avoidance. */
struct missing_filepair
-@@ -695,11 +1055,17 @@ missing_filepair_change (void)
+@@ -755,11 +1115,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL;
}
@@ -630,7 +630,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
missing_filepair_change ();
}
-@@ -766,14 +1132,39 @@ debug_print_missing (const char *binary, const char *debug)
+@@ -826,14 +1192,39 @@ debug_print_missing (const char *binary, const char *debug)
*slot = missing_filepair;
@@ -690,7 +690,7 @@ diff --git a/gdb/config.in b/gdb/config.in
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
-@@ -270,6 +273,9 @@
+@@ -255,6 +258,9 @@
/* Define if Python 2.7 is being used. */
#undef HAVE_LIBPYTHON2_7
@@ -703,7 +703,7 @@ diff --git a/gdb/config.in b/gdb/config.in
diff --git a/gdb/configure b/gdb/configure
--- a/gdb/configure
+++ b/gdb/configure
-@@ -749,6 +749,11 @@ CODESIGN_CERT
+@@ -751,6 +751,11 @@ CODESIGN_CERT
HAVE_NATIVE_GCORE_TARGET
TARGET_OBS
subdirs
@@ -715,15 +715,15 @@ diff --git a/gdb/configure b/gdb/configure
GDB_DATADIR
DEBUGDIR
MAKEINFO_EXTRA_FLAGS
-@@ -853,6 +858,7 @@ with_gdb_datadir
+@@ -855,6 +860,7 @@ with_gdb_datadir
with_relocated_sources
with_auto_load_dir
with_auto_load_safe_path
+with_rpm
enable_targets
enable_64_bit_bfd
- enable_gdbcli
-@@ -912,6 +918,11 @@ CCC
+ enable_gdbmi
+@@ -914,6 +920,11 @@ CCC
CPP
MAKEINFO
MAKEINFOFLAGS
@@ -735,7 +735,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC
YFLAGS
XMKMF'
-@@ -1583,6 +1594,8 @@ Optional Packages:
+@@ -1585,6 +1596,8 @@ Optional Packages:
[--with-auto-load-dir]
--without-auto-load-safe-path
do not restrict auto-loaded files locations
@@ -744,7 +744,7 @@ diff --git a/gdb/configure b/gdb/configure
--with-libunwind-ia64 use libunwind frame unwinding for ia64 targets
--with-curses use the curses library instead of the termcap
library
-@@ -1640,6 +1653,13 @@ Some influential environment variables:
+@@ -1642,6 +1655,13 @@ Some influential environment variables:
MAKEINFO Parent configure detects if it is of sufficient version.
MAKEINFOFLAGS
Parameters for MAKEINFO.
@@ -758,7 +758,7 @@ diff --git a/gdb/configure b/gdb/configure
YACC The `Yet Another Compiler Compiler' implementation to use.
Defaults to the first program found out of: `bison -y', `byacc',
`yacc'.
-@@ -6575,6 +6595,494 @@ _ACEOF
+@@ -6623,6 +6643,494 @@ _ACEOF
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5
$as_echo "$with_auto_load_safe_path" >&6; }
@@ -1459,7 +1459,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
diff --git a/gdb/corelow.c b/gdb/corelow.c
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
-@@ -366,7 +366,7 @@ build_id_locate_exec (int from_tty)
+@@ -365,7 +365,7 @@ build_id_locate_exec (int from_tty)
symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
}
else
@@ -1472,7 +1472,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -40,6 +40,7 @@
- #include "buffer.h"
+ #include "common/buffer.h"
#include "ser-event.h"
#include "gdb_select.h"
+#include "symfile.h"
@@ -1488,7 +1488,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
/* Do not call the python hook on an explicit prompt change as
passed to this function, as this forms a secondary/local prompt,
IE, displayed but not set. */
-@@ -774,7 +777,10 @@ command_line_handler (char *rl)
+@@ -770,7 +773,10 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
command_handler (cmd);
if (ui->prompt_state != PROMPTED)
@@ -1503,7 +1503,7 @@ diff --git a/gdb/event-top.c b/gdb/event-top.c
diff --git a/gdb/symfile.h b/gdb/symfile.h
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
-@@ -540,6 +540,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
+@@ -534,6 +534,8 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
/* build-id support. */
extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr);
extern void debug_print_missing (const char *binary, const char *debug);
diff --git a/gdb-6.6-buildid-locate-solib-missing-ids.patch b/gdb-6.6-buildid-locate-solib-missing-ids.patch
index 2b96166..e86920b 100644
--- a/gdb-6.6-buildid-locate-solib-missing-ids.patch
+++ b/gdb-6.6-buildid-locate-solib-missing-ids.patch
@@ -14,7 +14,7 @@ https://bugzilla.redhat.com/show_bug.cgi?id=1339862
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
-@@ -1358,14 +1358,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1347,14 +1347,27 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
}
{
@@ -44,7 +44,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
if (build_id != NULL)
{
char *name, *build_id_filename;
-@@ -1380,23 +1393,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1369,23 +1382,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
xfree (name);
}
else
diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch
index 6acb6bc..c588eb1 100644
--- a/gdb-6.6-buildid-locate.patch
+++ b/gdb-6.6-buildid-locate.patch
@@ -55,13 +55,13 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ && namesz == sizeof "GNU"
+ && memcmp (xnp->name, "GNU", sizeof "GNU") == 0)
+ {
-+ size_t size = descsz;
++ size_t sz = descsz;
+ gdb_byte *data = (gdb_byte *) descdata;
+ struct bfd_build_id *retval;
+
-+ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + size);
-+ retval->size = size;
-+ memcpy (retval->data, data, size);
++ retval = (struct bfd_build_id *) xmalloc (sizeof *retval - 1 + sz);
++ retval->size = sz;
++ memcpy (retval->data, data, sz);
+
+ return retval;
+ }
@@ -436,7 +436,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"),
-@@ -65,11 +463,50 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
+@@ -65,62 +463,173 @@ build_id_verify (bfd *abfd, size_t check_len, const bfd_byte *check)
return retval;
}
@@ -474,123 +474,132 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ return retval;
+}
+
- /* See build-id.h. */
+ /* Helper for build_id_to_debug_bfd. LINK is a path to a potential
+ build-id-based separate debug file, potentially a symlink to the real file.
+ If the file exists and matches BUILD_ID, return a BFD reference to it. */
- gdb_bfd_ref_ptr
--build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
-+build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
-+ char **link_return, int add_debug_suffix)
+ static gdb_bfd_ref_ptr
+-build_id_to_debug_bfd_1 (const std::string &link, size_t build_id_len,
+- const bfd_byte *build_id)
++build_id_to_debug_bfd_1 (const std::string &orig_link, size_t build_id_len,
++ const bfd_byte *build_id, char **link_return,
++ int add_debug_suffix)
{
-+ char *debugdir;
-+ std::string link, link_all;
-+ struct cleanup *back_to;
-+ int ix;
- gdb_bfd_ref_ptr abfd;
-
- /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
-@@ -82,63 +519,296 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
++ gdb_bfd_ref_ptr ret_bfd = {};
++ std::string ret_link;
++
+ if (separate_debug_file_debug)
{
- const gdb_byte *data = build_id;
- size_t size = build_id_len;
-+ char *filename = NULL;
-+ struct cleanup *inner;
-+ unsigned seqno;
-+ struct stat statbuf_trash;
-+ std::string link0;
-
-- std::string link = debugdir.get ();
-+ link = debugdir.get ();
- link += "/.build-id/";
-
- if (size > 0)
- {
- size--;
-- string_appendf (link, "%02x/", (unsigned) *data++);
-+ string_appendf (link, "%02x", (unsigned) *data++);
- }
--
-+ if (size > 0)
-+ link += "/";
- while (size-- > 0)
- string_appendf (link, "%02x", (unsigned) *data++);
+- printf_unfiltered (_(" Trying %s..."), link.c_str ());
++ printf_unfiltered (_(" Trying %s..."), orig_link.c_str ());
+ gdb_flush (gdb_stdout);
+ }
-- link += ".debug";
+- /* lrealpath() is expensive even for the usually non-existent files. */
+- gdb::unique_xmalloc_ptr<char> filename;
+- if (access (link.c_str (), F_OK) == 0)
+- filename.reset (lrealpath (link.c_str ()));
-
- if (separate_debug_file_debug)
- printf_unfiltered (_(" Trying %s\n"), link.c_str ());
+- if (filename == NULL)
++ for (unsigned seqno = 0;; seqno++)
+ {
+- if (separate_debug_file_debug)
+- printf_unfiltered (_(" no, unable to compute real path\n"));
++ std::string link = orig_link;
-- /* lrealpath() is expensive even for the usually non-existent files. */
-- gdb::unique_xmalloc_ptr<char> filename;
-- if (access (link.c_str (), F_OK) == 0)
-- filename.reset (lrealpath (link.c_str ()));
--
-- if (filename == NULL)
-- continue;
-+ for (seqno = 0;; seqno++)
+- return {};
+- }
++ if (seqno > 0)
+ {
-+ if (seqno)
-+ {
-+ /* There can be multiple build-id symlinks pointing to real files
-+ with the same build-id (such as hard links). Some of the real
-+ files may not be installed. */
++ /* There can be multiple build-id symlinks pointing to real files
++ with the same build-id (such as hard links). Some of the real
++ files may not be installed. */
+
+- /* We expect to be silent on the non-existing files. */
+- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
++ string_appendf (link, ".%u", seqno);
++ }
+
+- if (debug_bfd == NULL)
+- {
+- if (separate_debug_file_debug)
+- printf_unfiltered (_(" no, unable to open.\n"));
++ if (add_debug_suffix)
++ link += ".debug";
+
-+ string_appendf (link, ".%u", seqno);
-+ }
++ ret_link = link;
+
-+ if (add_debug_suffix)
-+ link += ".debug";
++ struct stat statbuf_trash;
+
-+ if (!seqno)
-+ {
-+ /* If none of the real files is found report as missing file
-+ always the non-.%u-suffixed file. */
-+ link0 = link;
-+ }
++ /* `access' automatically dereferences LINK. */
++ if (lstat (link.c_str (), &statbuf_trash) != 0)
++ {
++ /* Stop increasing SEQNO. */
++ break;
++ }
+
-+ /* `access' automatically dereferences LINK. */
-+ if (lstat (link.c_str (), &statbuf_trash) != 0)
-+ {
-+ /* Stop increasing SEQNO. */
-+ break;
-+ }
++ /* lrealpath() is expensive even for the usually non-existent files. */
++ gdb::unique_xmalloc_ptr<char> filename;
+
-+ filename = lrealpath (link.c_str ());
-+ if (filename == NULL)
-+ continue;
++ if (access (link.c_str (), F_OK) == 0)
++ filename.reset (lrealpath (link.c_str ()));
+
-+ /* We expect to be silent on the non-existing files. */
-+ inner = make_cleanup (xfree, filename);
-+ abfd = gdb_bfd_open (filename, gnutarget, -1);
-+ do_cleanups (inner);
++ if (filename == NULL)
++ {
++ if (separate_debug_file_debug)
++ printf_unfiltered (_(" no, unable to compute real path\n"));
+
-+ if (abfd == NULL)
-+ continue;
++ continue;
++ }
+
-+ if (build_id_verify (abfd.get(), build_id_len, build_id))
-+ break;
++ /* We expect to be silent on the non-existing files. */
++ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
+
-+ abfd.release ();
++ if (debug_bfd == NULL)
++ {
++ if (separate_debug_file_debug)
++ printf_unfiltered (_(" no, unable to open.\n"));
+
-+ filename = NULL;
++ continue;
+ }
-
-- /* We expect to be silent on the non-existing files. */
-- abfd = gdb_bfd_open (filename.get (), gnutarget, -1);
-+ if (filename != NULL)
++
++ if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
+ {
-+ /* LINK_ALL is not used below in this non-NULL FILENAME case. */
-+ break;
++ if (separate_debug_file_debug)
++ printf_unfiltered (_(" no, build-id does not match.\n"));
++
++ continue;
+ }
-- if (abfd == NULL)
-- continue;
+- return {};
++ ret_bfd = debug_bfd;
++ break;
+ }
+
+- if (!build_id_verify (debug_bfd.get(), build_id_len, build_id))
++ std::string link_all;
++
++ if (ret_bfd != NULL)
+ {
+ if (separate_debug_file_debug)
+- printf_unfiltered (_(" no, build-id does not match.\n"));
++ printf_unfiltered (_(" yes!\n"));
++ }
++ else
++ {
++ /* If none of the real files is found report as missing file
++ always the non-.%u-suffixed file. */
++ std::string link0 = orig_link;
++
++ if (add_debug_suffix)
++ link0 += ".debug";
++
+ /* If the symlink has target request to install the target.
-+ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
-+ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
++ BASE-debuginfo.rpm contains the symlink but BASE.rpm may be missing.
++ https://bugzilla.redhat.com/show_bug.cgi?id=981154 */
+ std::string link0_resolved (link_resolve (link0.c_str (), 0));
-- if (build_id_verify (abfd.get(), build_id_len, build_id))
-- break;
+- return {};
+ if (link_all.empty ())
+ link_all = link0_resolved;
+ else
@@ -599,22 +608,69 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ its possible use as an argument for installation command. */
+ link_all += " " + link0_resolved;
+ }
-+ }
+ }
-- abfd.release ();
+- if (separate_debug_file_debug)
+- printf_unfiltered (_(" yes!\n"));
+ if (link_return != NULL)
+ {
-+ if (abfd != NULL)
++ if (ret_bfd != NULL)
+ {
-+ *link_return = xstrdup (link.c_str ());
++ *link_return = xstrdup (ret_link.c_str ());
+ }
+ else
+ {
+ *link_return = xstrdup (link_all.c_str ());
+ }
- }
++ }
- return abfd;
+- return debug_bfd;
++ return ret_bfd;
+ }
+
+ /* See build-id.h. */
+
+ gdb_bfd_ref_ptr
+-build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
++build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id,
++ char **link_return, int add_debug_suffix)
+ {
+ /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
+ cause "/.build-id/..." lookups. */
+@@ -143,16 +652,16 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
+ if (size > 0)
+ {
+ size--;
+- string_appendf (link, "%02x/", (unsigned) *data++);
++ string_appendf (link, "%02x", (unsigned) *data++);
+ }
+-
++ if (size > 0)
++ link += "/";
+ while (size-- > 0)
+ string_appendf (link, "%02x", (unsigned) *data++);
+
+- link += ".debug";
+-
+ gdb_bfd_ref_ptr debug_bfd
+- = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
++ = build_id_to_debug_bfd_1 (link, build_id_len, build_id,
++ link_return, add_debug_suffix);
+ if (debug_bfd != NULL)
+ return debug_bfd;
+
+@@ -166,7 +675,8 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
+ if (strcmp (gdb_sysroot, TARGET_SYSROOT_PREFIX) != 0)
+ {
+ link = gdb_sysroot + link;
+- debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id);
++ debug_bfd = build_id_to_debug_bfd_1 (link, build_id_len, build_id,
++ link_return, add_debug_suffix);
+ if (debug_bfd != NULL)
+ return debug_bfd;
+ }
+@@ -175,22 +685,190 @@ build_id_to_debug_bfd (size_t build_id_len, const bfd_byte *build_id)
+ return {};
}
+char *
@@ -807,7 +863,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
/* Prevent looping on a stripped .debug file. */
if (abfd != NULL
&& filename_cmp (bfd_get_filename (abfd.get ()),
-@@ -151,3 +821,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
+@@ -203,3 +881,21 @@ find_separate_debug_file_by_buildid (struct objfile *objfile)
return std::string ();
}
@@ -832,9 +888,9 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
diff --git a/gdb/build-id.h b/gdb/build-id.h
--- a/gdb/build-id.h
+++ b/gdb/build-id.h
-@@ -22,9 +22,10 @@
-
+@@ -23,9 +23,10 @@
#include "gdb_bfd.h"
+ #include "common/rsp-low.h"
-/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
+/* Separate debuginfo files have corrupted PHDR but SHDR is correct there.
@@ -845,7 +901,7 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
/* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value.
Otherwise, issue a warning and return false. */
-@@ -38,13 +39,18 @@ extern int build_id_verify (bfd *abfd,
+@@ -39,14 +40,19 @@ extern int build_id_verify (bfd *abfd,
the caller. */
extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len,
@@ -866,11 +922,12 @@ diff --git a/gdb/build-id.h b/gdb/build-id.h
+extern std::string find_separate_debug_file_by_buildid (struct objfile *objfile,
+ gdb::unique_xmalloc_ptr<char> *build_id_filename_return);
- #endif /* BUILD_ID_H */
+ /* Return an hex-string representation of BUILD_ID. */
+
diff --git a/gdb/coffread.c b/gdb/coffread.c
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
-@@ -733,7 +733,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -729,7 +729,8 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
/* Try to add separate debug file if no symbols table found. */
if (!objfile_has_partial_symbols (objfile))
{
@@ -883,10 +940,10 @@ diff --git a/gdb/coffread.c b/gdb/coffread.c
diff --git a/gdb/corelow.c b/gdb/corelow.c
--- a/gdb/corelow.c
+++ b/gdb/corelow.c
-@@ -45,6 +45,10 @@
+@@ -43,6 +43,10 @@
#include "gdb_bfd.h"
#include "completer.h"
- #include "filestuff.h"
+ #include "common/filestuff.h"
+#include "auxv.h"
+#include "elf/common.h"
+#include "gdbcmd.h"
@@ -894,7 +951,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
#ifndef O_LARGEFILE
#define O_LARGEFILE 0
-@@ -321,6 +325,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
+@@ -320,6 +324,54 @@ add_to_thread_list (bfd *abfd, asection *asect, void *reg_sect_arg)
inferior_ptid = ptid; /* Yes, make it current. */
}
@@ -905,7 +962,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
+{
+ CORE_ADDR at_entry;
+ struct bfd_build_id *build_id;
-+ char *execfilename, *debug_filename;
++ char *execfilename;
+ char *build_id_filename;
+ struct cleanup *back_to;
+
@@ -949,7 +1006,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
/* Issue a message saying we have no core to debug, if FROM_TTY. */
static void
-@@ -464,6 +516,14 @@ core_target_open (const char *arg, int from_tty)
+@@ -455,6 +507,14 @@ core_target_open (const char *arg, int from_tty)
switch_to_thread (thread);
}
@@ -964,7 +1021,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
post_create_inferior (target, from_tty);
/* Now go through the target stack looking for threads since there
-@@ -1072,4 +1132,11 @@ void
+@@ -1063,4 +1123,11 @@ void
_initialize_corelow (void)
{
add_target (core_target_info, core_target_open, filename_completer);
@@ -979,7 +1036,7 @@ diff --git a/gdb/corelow.c b/gdb/corelow.c
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
-@@ -19570,6 +19570,27 @@ information files.
+@@ -19945,6 +19945,27 @@ information files.
@end table
@@ -1007,10 +1064,22 @@ diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
@cindex @code{.gnu_debuglink} sections
@cindex debug link sections
A debug link is a special section of the executable file named
+diff --git a/gdb/dwarf-index-cache.c b/gdb/dwarf-index-cache.c
+--- a/gdb/dwarf-index-cache.c
++++ b/gdb/dwarf-index-cache.c
+@@ -93,7 +93,7 @@ index_cache::store (struct dwarf2_per_objfile *dwarf2_per_objfile)
+ if (!enabled ())
+ return;
+
+- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd);
++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd);
+ if (build_id == nullptr)
+ {
+ if (debug_index_cache)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -2683,7 +2683,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
+@@ -2727,7 +2727,7 @@ dwarf2_get_dwz_file (struct dwarf2_per_objfile *dwarf2_per_objfile)
}
if (dwz_bfd == NULL)
@@ -1019,10 +1088,28 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
if (dwz_bfd == NULL)
error (_("could not find '.gnu_debugaltlink' file for %s"),
+@@ -6237,7 +6237,7 @@ get_gdb_index_contents_from_section (objfile *obj, T *section_owner)
+ static gdb::array_view<const gdb_byte>
+ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
+ {
+- const bfd_build_id *build_id = build_id_bfd_get (obj->obfd);
++ const bfd_build_id *build_id = build_id_bfd_shdr_get (obj->obfd);
+ if (build_id == nullptr)
+ return {};
+
+@@ -6250,7 +6250,7 @@ get_gdb_index_contents_from_cache (objfile *obj, dwarf2_per_objfile *dwarf2_obj)
+ static gdb::array_view<const gdb_byte>
+ get_gdb_index_contents_from_cache_dwz (objfile *obj, dwz_file *dwz)
+ {
+- const bfd_build_id *build_id = build_id_bfd_get (dwz->dwz_bfd.get ());
++ const bfd_build_id *build_id = build_id_bfd_shdr_get (dwz->dwz_bfd.get ());
+ if (build_id == nullptr)
+ return {};
+
diff --git a/gdb/elfread.c b/gdb/elfread.c
--- a/gdb/elfread.c
+++ b/gdb/elfread.c
-@@ -1290,7 +1290,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+@@ -1287,7 +1287,9 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
&& objfile->separate_debug_objfile == NULL
&& objfile->separate_debug_objfile_backlink == NULL)
{
@@ -1033,8 +1120,8 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
if (debugfile.empty ())
debugfile = find_separate_debug_file_by_debuglink (objfile);
-@@ -1302,6 +1304,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
- symbol_file_add_separate (abfd.get (), debugfile.c_str (),
+@@ -1299,6 +1301,10 @@ elf_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
+ symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (),
symfile_flags, objfile);
}
+ /* Check if any separate debug info has been extracted out. */
@@ -1047,7 +1134,7 @@ diff --git a/gdb/elfread.c b/gdb/elfread.c
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
-@@ -470,6 +470,10 @@ struct objfile
+@@ -554,6 +554,10 @@ struct objfile
htab_t static_links {};
};
@@ -1061,7 +1148,7 @@ diff --git a/gdb/objfiles.h b/gdb/objfiles.h
diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
--- a/gdb/python/py-objfile.c
+++ b/gdb/python/py-objfile.c
-@@ -137,7 +137,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
+@@ -132,7 +132,7 @@ objfpy_get_build_id (PyObject *self, void *closure)
TRY
{
@@ -1070,7 +1157,7 @@ diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c
}
CATCH (except, RETURN_MASK_ALL)
{
-@@ -544,7 +544,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id)
+@@ -535,7 +535,7 @@ objfpy_lookup_objfile_by_build_id (const char *build_id)
/* Don't return separate debug files. */
if (objfile->separate_debug_objfile_backlink != NULL)
continue;
@@ -1090,7 +1177,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
-@@ -1356,9 +1357,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
+@@ -1345,9 +1346,51 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
continue;
}
@@ -1148,7 +1235,7 @@ diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
diff --git a/gdb/symfile.h b/gdb/symfile.h
--- a/gdb/symfile.h
+++ b/gdb/symfile.h
-@@ -537,6 +537,10 @@ void expand_symtabs_matching
+@@ -531,6 +531,10 @@ void expand_symtabs_matching
void map_symbol_filenames (symbol_filename_ftype *fun, void *data,
int need_fullname);
@@ -1210,7 +1297,7 @@ diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
-@@ -1695,6 +1695,16 @@ proc default_gdb_start { } {
+@@ -1697,6 +1697,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
}
diff --git a/gdb-readline.patch b/gdb-readline.patch
index 171d68f..d0e7a21 100644
--- a/gdb-readline.patch
+++ b/gdb-readline.patch
@@ -17,15 +17,15 @@
# Where is expat? This will be empty if expat was not available.
LIBEXPAT = @LIBEXPAT@
-@@ -586,7 +586,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(
- @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \
+@@ -597,7 +597,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $(
$(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \
- $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR)
--CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
-+CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) \
+ $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) $(LIBMPFR) \
+ $(SRCHIGH_LIBS)
+-CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
++CDEPS = $(NAT_CDEPS) $(SIM) $(BFD) \
$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
- ADD_FILES = $(XM_ADD_FILES) $(TM_ADD_FILES) $(NAT_ADD_FILES)
+ DIST = gdb
--- gdb-7.4.50.20120120/Makefile.in.orig 2012-01-20 02:48:18.000000000 +0100
+++ gdb-7.4.50.20120120/Makefile.in 2012-03-17 10:35:14.194730128 +0100
@@ -922,7 +922,6 @@
diff --git a/gdb-vla-intel-fortran-strides.patch b/gdb-vla-intel-fortran-strides.patch
index 7868efe..eb6e58a 100644
--- a/gdb-vla-intel-fortran-strides.patch
+++ b/gdb-vla-intel-fortran-strides.patch
@@ -37,7 +37,7 @@ dbfd7140bf4c0500d1f5d192be781f83f78f7922
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
-@@ -2600,11 +2600,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
+@@ -2429,11 +2429,14 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
/* See dwarf2loc.h. */
int
@@ -54,7 +54,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
if (prop == NULL)
return 0;
-@@ -2628,7 +2631,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2457,7 +2460,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
*value = value_as_address (val);
}
@@ -63,7 +63,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
}
}
break;
-@@ -2650,7 +2653,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2479,7 +2482,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
if (!value_optimized_out (val))
{
*value = value_as_address (val);
@@ -72,7 +72,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
}
}
}
-@@ -2658,8 +2661,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2487,8 +2490,8 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
case PROP_CONST:
*value = prop->data.const_val;
@@ -83,7 +83,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
case PROP_ADDR_OFFSET:
{
struct dwarf2_property_baton *baton
-@@ -2680,11 +2683,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
+@@ -2509,11 +2512,38 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop,
val = value_at (baton->offset_info.type,
pinfo->addr + baton->offset_info.offset);
*value = value_as_address (val);
@@ -143,7 +143,7 @@ diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -17566,7 +17566,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17752,7 +17752,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
struct type *base_type, *orig_base_type;
struct type *range_type;
struct attribute *attr;
@@ -152,7 +152,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
int low_default_is_valid;
int high_bound_is_count = 0;
const char *name;
-@@ -17586,7 +17586,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17772,7 +17772,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
low.kind = PROP_CONST;
high.kind = PROP_CONST;
@@ -162,7 +162,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
/* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow
omitting DW_AT_lower_bound. */
-@@ -17619,6 +17621,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17805,6 +17807,14 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
break;
}
@@ -177,7 +177,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
if (attr)
attr_to_dynamic_prop (attr, die, cu, &low);
-@@ -17696,7 +17706,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17897,7 +17907,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
&& !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask))
high.data.const_val |= negative_mask;
@@ -189,7 +189,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
diff --git a/gdb/eval.c b/gdb/eval.c
--- a/gdb/eval.c
+++ b/gdb/eval.c
-@@ -377,29 +377,325 @@ init_array_element (struct value *array, struct value *element,
+@@ -377,29 +377,324 @@ init_array_element (struct value *array, struct value *element,
return index;
}
@@ -207,8 +207,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
+ int *pos, int nargs, enum noside noside)
{
- int pc = (*pos) + 1;
-+ int i, dim_count = 0;
- LONGEST low_bound, high_bound;
+- LONGEST low_bound, high_bound;
- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array)));
- enum range_type range_type
- = (enum range_type) longest_to_int (exp->elts[pc].longconst);
@@ -219,11 +218,12 @@ diff --git a/gdb/eval.c b/gdb/eval.c
- low_bound = TYPE_LOW_BOUND (range);
- else
- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++ int i, dim_count = 0;
+ struct value *new_array = array;
+ struct type *array_type = check_typedef (value_type (new_array));
+ struct type *elt_type;
+
-+ typedef struct subscript_range
++ typedef struct
+ {
+ enum range_type f90_range_type;
+ LONGEST low, high, stride;
@@ -272,11 +272,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
+ for (i = 0; i < nargs; i++)
+ {
+ struct subscript_store *index = &subscript_array[i];
-
-- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
-- high_bound = TYPE_HIGH_BOUND (range);
-- else
-- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
++
+ /* The user input is a range, with or without lower and upper bound.
+ E.g.: "p arry(2:5)", "p arry( :5)", "p arry( : )", etc. */
+ if (exp->elts[*pos].opcode == OP_RANGE)
@@ -310,7 +306,11 @@ diff --git a/gdb/eval.c b/gdb/eval.c
+ /* Assign the default stride value '1'. */
+ else
+ range->stride = 1;
-+
+
+- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT)
+- high_bound = TYPE_HIGH_BOUND (range);
+- else
+- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside));
+ /* Check the provided stride value is illegal, aka '0'. */
+ if (range->stride == 0)
+ error (_("Stride must not be 0"));
@@ -480,7 +480,8 @@ diff --git a/gdb/eval.c b/gdb/eval.c
+ struct value *v = NULL;
+
+ elt_type = TYPE_TARGET_TYPE (value_type (new_array));
-+
+
+- return value_slice (array, low_bound, high_bound - low_bound + 1);
+ /* Every SUBSCRIPT_RANGE in the user input signifies an actual range in
+ the output array. So we traverse the SUBSCRIPT_ARRAY again, looking
+ for a range entry. When we find one, we use the range info to create
@@ -497,8 +498,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
+ struct type *range_type, *interim_array_type;
+
+ int new_length;
-
-- return value_slice (array, low_bound, high_bound - low_bound + 1);
++
+ /* The length of a sub-dimension with all elements between the
+ bounds plus the start element itself. It may be modified by
+ a user provided stride value. */
@@ -533,20 +533,54 @@ diff --git a/gdb/eval.c b/gdb/eval.c
}
-@@ -1926,19 +2222,8 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -1242,19 +1537,6 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
+ return eval_call (exp, noside, nargs, argvec, var_func_name, expect_type);
+ }
+
+-/* Helper for skipping all the arguments in an undetermined argument list.
+- This function was designed for use in the OP_F77_UNDETERMINED_ARGLIST
+- case of evaluate_subexp_standard as multiple, but not all, code paths
+- require a generic skip. */
+-
+-static void
+-skip_undetermined_arglist (int nargs, struct expression *exp, int *pos,
+- enum noside noside)
+-{
+- for (int i = 0; i < nargs; ++i)
+- evaluate_subexp (NULL_TYPE, exp, pos, noside);
+-}
+-
+ struct value *
+ evaluate_subexp_standard (struct type *expect_type,
+ struct expression *exp, int *pos,
+@@ -1949,33 +2231,8 @@ evaluate_subexp_standard (struct type *expect_type,
switch (code)
{
case TYPE_CODE_ARRAY:
- if (exp->elts[*pos].opcode == OP_RANGE)
- return value_f90_subarray (arg1, exp, pos, noside);
- else
-- goto multi_f77_subscript;
+- {
+- if (noside == EVAL_SKIP)
+- {
+- skip_undetermined_arglist (nargs, exp, pos, noside);
+- /* Return the dummy value with the correct type. */
+- return arg1;
+- }
+- goto multi_f77_subscript;
+- }
-
case TYPE_CODE_STRING:
- if (exp->elts[*pos].opcode == OP_RANGE)
- return value_f90_subarray (arg1, exp, pos, noside);
- else
- {
+- if (noside == EVAL_SKIP)
+- {
+- skip_undetermined_arglist (nargs, exp, pos, noside);
+- /* Return the dummy value with the correct type. */
+- return arg1;
+- }
- arg2 = evaluate_subexp_with_coercion (exp, pos, noside);
- return value_subscript (arg1, value_as_long (arg2));
- }
@@ -554,7 +588,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
case TYPE_CODE_PTR:
case TYPE_CODE_FUNC:
-@@ -2334,49 +2619,6 @@ evaluate_subexp_standard (struct type *expect_type,
+@@ -2372,49 +2629,6 @@ evaluate_subexp_standard (struct type *expect_type,
}
return (arg1);
@@ -604,7 +638,7 @@ diff --git a/gdb/eval.c b/gdb/eval.c
case BINOP_LOGICAL_AND:
arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside);
if (noside == EVAL_SKIP)
-@@ -3293,6 +3535,9 @@ calc_f77_array_dims (struct type *array_type)
+@@ -3334,6 +3548,9 @@ calc_f77_array_dims (struct type *array_type)
int ndimen = 1;
struct type *tmp_type;
@@ -639,7 +673,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
print_subexp (exp, pos, stream, PREC_ABOVE_COMMA);
fputs_filtered (")", stream);
return;
-@@ -1098,22 +1095,24 @@ dump_subexp_body_standard (struct expression *exp,
+@@ -1105,22 +1102,24 @@ dump_subexp_body_standard (struct expression *exp,
switch (range_type)
{
@@ -672,7 +706,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
fputs_filtered ("ExclusiveRange 'EXP..EXP'", stream);
break;
default:
-@@ -1121,11 +1120,9 @@ dump_subexp_body_standard (struct expression *exp,
+@@ -1128,11 +1127,9 @@ dump_subexp_body_standard (struct expression *exp,
break;
}
@@ -689,7 +723,7 @@ diff --git a/gdb/expprint.c b/gdb/expprint.c
diff --git a/gdb/expression.h b/gdb/expression.h
--- a/gdb/expression.h
+++ b/gdb/expression.h
-@@ -148,28 +148,27 @@ extern void dump_raw_expression (struct expression *,
+@@ -150,28 +150,27 @@ extern void dump_raw_expression (struct expression *,
struct ui_file *, const char *);
extern void dump_prefix_expression (struct expression *, struct ui_file *);
@@ -832,7 +866,7 @@ diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
-@@ -902,7 +902,8 @@ operator== (const range_bounds &l, const range_bounds &r)
+@@ -911,7 +911,8 @@ operator== (const range_bounds &l, const range_bounds &r)
struct type *
create_range_type (struct type *result_type, struct type *index_type,
const struct dynamic_prop *low_bound,
@@ -842,7 +876,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
{
if (result_type == NULL)
result_type = alloc_type_copy (index_type);
-@@ -917,6 +918,7 @@ create_range_type (struct type *result_type, struct type *index_type,
+@@ -926,6 +927,7 @@ create_range_type (struct type *result_type, struct type *index_type,
TYPE_ZALLOC (result_type, sizeof (struct range_bounds));
TYPE_RANGE_DATA (result_type)->low = *low_bound;
TYPE_RANGE_DATA (result_type)->high = *high_bound;
@@ -850,7 +884,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0)
TYPE_UNSIGNED (result_type) = 1;
-@@ -945,7 +947,7 @@ struct type *
+@@ -954,7 +956,7 @@ struct type *
create_static_range_type (struct type *result_type, struct type *index_type,
LONGEST low_bound, LONGEST high_bound)
{
@@ -859,7 +893,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
low.kind = PROP_CONST;
low.data.const_val = low_bound;
-@@ -953,7 +955,11 @@ create_static_range_type (struct type *result_type, struct type *index_type,
+@@ -962,7 +964,11 @@ create_static_range_type (struct type *result_type, struct type *index_type,
high.kind = PROP_CONST;
high.data.const_val = high_bound;
@@ -872,7 +906,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
return result_type;
}
-@@ -1171,16 +1177,20 @@ create_array_type_with_stride (struct type *result_type,
+@@ -1180,16 +1186,20 @@ create_array_type_with_stride (struct type *result_type,
&& (!type_not_associated (result_type)
&& !type_not_allocated (result_type)))
{
@@ -894,7 +928,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
else if (bit_stride > 0)
TYPE_LENGTH (result_type) =
(bit_stride * (high_bound - low_bound + 1) + 7) / 8;
-@@ -1981,12 +1991,12 @@ resolve_dynamic_range (struct type *dyn_range_type,
+@@ -1990,12 +2000,12 @@ resolve_dynamic_range (struct type *dyn_range_type,
CORE_ADDR value;
struct type *static_range_type, *static_target_type;
const struct dynamic_prop *prop;
@@ -909,7 +943,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
{
low_bound.kind = PROP_CONST;
low_bound.data.const_val = value;
-@@ -1998,7 +2008,7 @@ resolve_dynamic_range (struct type *dyn_range_type,
+@@ -2007,7 +2017,7 @@ resolve_dynamic_range (struct type *dyn_range_type,
}
prop = &TYPE_RANGE_DATA (dyn_range_type)->high;
@@ -918,7 +952,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
{
high_bound.kind = PROP_CONST;
high_bound.data.const_val = value;
-@@ -2013,12 +2023,20 @@ resolve_dynamic_range (struct type *dyn_range_type,
+@@ -2022,12 +2032,20 @@ resolve_dynamic_range (struct type *dyn_range_type,
high_bound.data.const_val = 0;
}
@@ -943,7 +977,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
-@@ -612,6 +612,10 @@ struct range_bounds
+@@ -614,6 +614,10 @@ struct range_bounds
struct dynamic_prop high;
@@ -954,7 +988,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
/* True if HIGH range bound contains the number of elements in the
subrange. This affects how the final hight bound is computed. */
-@@ -776,7 +780,6 @@ struct main_type
+@@ -778,7 +782,6 @@ struct main_type
/* * Union member used for range types. */
struct range_bounds *bounds;
@@ -962,7 +996,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
} flds_bnds;
/* * Slot to point to additional language-specific fields of this
-@@ -1329,6 +1332,15 @@ extern bool set_type_align (struct type *, ULONGEST);
+@@ -1327,6 +1330,15 @@ extern bool set_type_align (struct type *, ULONGEST);
TYPE_RANGE_DATA(range_type)->high.kind
#define TYPE_LOW_BOUND_KIND(range_type) \
TYPE_RANGE_DATA(range_type)->low.kind
@@ -978,7 +1012,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
/* Property accessors for the type data location. */
#define TYPE_DATA_LOCATION(thistype) \
-@@ -1363,6 +1375,9 @@ extern bool set_type_align (struct type *, ULONGEST);
+@@ -1361,6 +1373,9 @@ extern bool set_type_align (struct type *, ULONGEST);
TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \
TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype))
@@ -988,7 +1022,7 @@ diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \
(TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype))))
-@@ -1892,6 +1907,7 @@ extern struct type *create_array_type_with_stride
+@@ -1896,6 +1911,7 @@ extern struct type *create_array_type_with_stride
struct dynamic_prop *, unsigned int);
extern struct type *create_range_type (struct type *, struct type *,
@@ -1038,7 +1072,7 @@ diff --git a/gdb/parse.c b/gdb/parse.c
diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
--- a/gdb/rust-exp.y
+++ b/gdb/rust-exp.y
-@@ -2478,24 +2478,28 @@ convert_ast_to_expression (struct parser_state *state,
+@@ -2475,24 +2475,28 @@ rust_parser::convert_ast_to_expression (const struct rust_op *operation,
case OP_RANGE:
{
@@ -1047,13 +1081,13 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
if (operation->left.op != NULL)
{
- convert_ast_to_expression (state, operation->left.op, top);
+ convert_ast_to_expression (operation->left.op, top);
- kind = HIGH_BOUND_DEFAULT;
+ kind = SUBARRAY_LOW_BOUND;
}
if (operation->right.op != NULL)
{
- convert_ast_to_expression (state, operation->right.op, top);
+ convert_ast_to_expression (operation->right.op, top);
- if (kind == BOTH_BOUND_DEFAULT)
- kind = (operation->inclusive
- ? LOW_BOUND_DEFAULT : LOW_BOUND_DEFAULT_EXCLUSIVE);
@@ -1078,7 +1112,7 @@ diff --git a/gdb/rust-exp.y b/gdb/rust-exp.y
diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
--- a/gdb/rust-lang.c
+++ b/gdb/rust-lang.c
-@@ -1149,13 +1149,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
+@@ -1193,13 +1193,11 @@ rust_range (struct expression *exp, int *pos, enum noside noside)
kind = (enum range_type) longest_to_int (exp->elts[*pos + 1].longconst);
*pos += 3;
@@ -1095,7 +1129,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
if (noside == EVAL_SKIP)
return value_from_longest (builtin_type (exp->gdbarch)->builtin_int, 1);
-@@ -1244,7 +1242,7 @@ rust_compute_range (struct type *type, struct value *range,
+@@ -1288,7 +1286,7 @@ rust_compute_range (struct type *type, struct value *range,
*low = 0;
*high = 0;
@@ -1104,7 +1138,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
if (TYPE_NFIELDS (type) == 0)
return;
-@@ -1252,15 +1250,14 @@ rust_compute_range (struct type *type, struct value *range,
+@@ -1296,15 +1294,14 @@ rust_compute_range (struct type *type, struct value *range,
i = 0;
if (strcmp (TYPE_FIELD_NAME (type, 0), "start") == 0)
{
@@ -1122,7 +1156,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
*high = value_as_long (value_field (range, i));
if (rust_inclusive_range_type_p (type))
-@@ -1278,7 +1275,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1322,7 +1319,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
struct type *rhstype;
LONGEST low, high_bound;
/* Initialized to appease the compiler. */
@@ -1131,7 +1165,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
LONGEST high = 0;
int want_slice = 0;
-@@ -1376,7 +1373,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1420,7 +1417,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
error (_("Cannot subscript non-array type"));
if (want_slice
@@ -1140,7 +1174,7 @@ diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
low = low_bound;
if (low < 0)
error (_("Index less than zero"));
-@@ -1394,7 +1391,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
+@@ -1438,7 +1435,7 @@ rust_subscript (struct expression *exp, int *pos, enum noside noside,
CORE_ADDR addr;
struct value *addrval, *tem;
@@ -1761,7 +1795,7 @@ diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f
diff --git a/gdb/valarith.c b/gdb/valarith.c
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
-@@ -187,10 +187,16 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
+@@ -187,11 +187,17 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
struct type *array_type = check_typedef (value_type (array));
struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type));
ULONGEST elt_size = type_length_units (elt_type);
@@ -1774,16 +1808,17 @@ diff --git a/gdb/valarith.c b/gdb/valarith.c
+ else
+ elt_offs *= elt_size;
- if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
-- && elt_offs >= type_length_units (array_type)))
-+ && abs (elt_offs) >= type_length_units (array_type)))
+ if (index < lowerbound
+ || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
+- && elt_offs >= type_length_units (array_type))
++ && abs (elt_offs) >= type_length_units (array_type))
+ || (VALUE_LVAL (array) != lval_memory
+ && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)))
{
- if (type_not_associated (array_type))
- error (_("no such vector element (vector not associated)"));
diff --git a/gdb/valops.c b/gdb/valops.c
--- a/gdb/valops.c
+++ b/gdb/valops.c
-@@ -3808,56 +3808,195 @@ value_of_this_silent (const struct language_defn *lang)
+@@ -3792,56 +3792,195 @@ value_of_this_silent (const struct language_defn *lang)
struct value *
value_slice (struct value *array, int lowbound, int length)
diff --git a/gdb-vla-intel-fortran-vla-strings.patch b/gdb-vla-intel-fortran-vla-strings.patch
index 49ab71c..16c24d1 100644
--- a/gdb-vla-intel-fortran-vla-strings.patch
+++ b/gdb-vla-intel-fortran-vla-strings.patch
@@ -33,7 +33,7 @@ git diff --stat -p gdb/master...gdb/users/bheckel/fortran-vla-strings
diff --git a/gdb/NEWS b/gdb/NEWS
--- a/gdb/NEWS
+++ b/gdb/NEWS
-@@ -109,6 +109,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd*
+@@ -335,6 +335,8 @@ SH-5/SH64 running OpenBSD SH-5/SH64 support in sh*-*-openbsd*
*** Changes in GDB 8.1
@@ -77,7 +77,7 @@ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
-@@ -1789,7 +1789,8 @@ static void read_signatured_type (struct signatured_type *);
+@@ -1833,7 +1833,8 @@ static void read_signatured_type (struct signatured_type *);
static int attr_to_dynamic_prop (const struct attribute *attr,
struct die_info *die, struct dwarf2_cu *cu,
@@ -87,7 +87,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
/* memory allocation interface */
-@@ -13648,7 +13649,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
+@@ -13757,7 +13758,7 @@ read_func_scope (struct die_info *die, struct dwarf2_cu *cu)
{
newobj->static_link
= XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
@@ -95,8 +95,8 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0);
}
- cu->list_in_scope = &local_symbols;
-@@ -16329,7 +16330,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
+ cu->list_in_scope = cu->get_builder ()->get_local_symbols ();
+@@ -16495,7 +16496,8 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu)
byte_stride_prop
= (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop));
@@ -106,7 +106,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
if (!stride_ok)
{
complaint (_("unable to read array DW_AT_byte_stride "
-@@ -17090,29 +17092,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17256,29 +17258,90 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu)
struct gdbarch *gdbarch = get_objfile_arch (objfile);
struct type *type, *range_type, *index_type, *char_type;
struct attribute *attr;
@@ -150,7 +150,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
+ operand. */
+ DW_OP_deref_size,
+ /* Operand for DW_OP_deref_size. */
-+ DW_UNSND(byte_size) };
++ (gdb_byte) DW_UNSND(byte_size) };
+
+ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops,
+ ARRAY_SIZE(append_ops)))
@@ -208,7 +208,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
char_type = language_string_char_type (cu->language_defn, gdbarch);
type = create_string_type (NULL, char_type, range_type);
-@@ -17460,7 +17523,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17646,7 +17709,8 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
static int
attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
@@ -218,7 +218,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
{
struct dwarf2_property_baton *baton;
struct obstack *obstack
-@@ -17471,14 +17535,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+@@ -17657,14 +17721,33 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
if (attr_form_is_block (attr))
{
@@ -256,7 +256,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
}
else if (attr_form_is_ref (attr))
{
-@@ -17511,8 +17594,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
+@@ -17697,8 +17780,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die,
baton = XOBNEW (obstack, struct dwarf2_property_baton);
baton->referenced_type = die_type (target_die, target_cu);
baton->locexpr.per_cu = cu->per_cu;
@@ -287,7 +287,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
prop->data.baton = baton;
prop->kind = PROP_LOCEXPR;
gdb_assert (prop->data.baton != NULL);
-@@ -17623,7 +17726,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17809,7 +17912,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
attr = dwarf2_attr (die, DW_AT_byte_stride, cu);
if (attr)
@@ -296,7 +296,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
complaint (_("Missing DW_AT_byte_stride "
"- DIE at 0x%s [in module %s]"),
sect_offset_str (die->sect_off),
-@@ -17631,7 +17734,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
+@@ -17817,7 +17920,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
attr = dwarf2_attr (die, DW_AT_lower_bound, cu);
if (attr)
@@ -305,20 +305,20 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
else if (!low_default_is_valid)
complaint (_("Missing DW_AT_lower_bound "
"- DIE at %s [in module %s]"),
-@@ -17639,10 +17742,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
- objfile_name (cu->per_cu->dwarf2_per_objfile->objfile));
+@@ -17826,10 +17929,10 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu)
- attr = dwarf2_attr (die, DW_AT_upper_bound, cu);
+ struct attribute *attr_ub, *attr_count;
+ attr = attr_ub = dwarf2_attr (die, DW_AT_upper_bound, cu);
- if (!attr_to_dynamic_prop (attr, die, cu, &high))
+ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
{
- attr = dwarf2_attr (die, DW_AT_count, cu);
+ attr = attr_count = dwarf2_attr (die, DW_AT_count, cu);
- if (attr_to_dynamic_prop (attr, die, cu, &high))
+ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0))
{
/* If bounds are constant do the final calculation here. */
if (low.kind == PROP_CONST && high.kind == PROP_CONST)
-@@ -25143,7 +25246,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -25396,7 +25499,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
attr = dwarf2_attr (die, DW_AT_allocated, cu);
if (attr_form_is_block (attr))
{
@@ -327,7 +327,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
}
else if (attr != NULL)
-@@ -25157,7 +25260,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -25410,7 +25513,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
attr = dwarf2_attr (die, DW_AT_associated, cu);
if (attr_form_is_block (attr))
{
@@ -336,7 +336,7 @@ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
}
else if (attr != NULL)
-@@ -25169,7 +25272,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
+@@ -25422,7 +25525,7 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu)
/* Read DW_AT_data_location and set in type. */
attr = dwarf2_attr (die, DW_AT_data_location, cu);
@@ -500,7 +500,7 @@ diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
-@@ -1904,7 +1904,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
+@@ -1913,7 +1913,8 @@ is_dynamic_type_internal (struct type *type, int top_level)
type = check_typedef (type);
/* We only want to recognize references at the outermost level. */
@@ -510,7 +510,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
type = check_typedef (TYPE_TARGET_TYPE (type));
/* Types that have a dynamic TYPE_DATA_LOCATION are considered
-@@ -1938,6 +1939,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
+@@ -1947,6 +1948,7 @@ is_dynamic_type_internal (struct type *type, int top_level)
}
case TYPE_CODE_ARRAY:
@@ -518,7 +518,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
{
gdb_assert (TYPE_NFIELDS (type) == 1);
-@@ -2056,7 +2058,8 @@ resolve_dynamic_array (struct type *type,
+@@ -2065,7 +2067,8 @@ resolve_dynamic_array (struct type *type,
struct dynamic_prop *prop;
unsigned int bit_stride = 0;
@@ -528,7 +528,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
type = copy_type (type);
-@@ -2081,11 +2084,15 @@ resolve_dynamic_array (struct type *type,
+@@ -2090,11 +2093,15 @@ resolve_dynamic_array (struct type *type,
ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type));
@@ -545,7 +545,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
prop = get_dyn_prop (DYN_PROP_BYTE_STRIDE, type);
if (prop != NULL)
{
-@@ -2240,6 +2247,28 @@ resolve_dynamic_struct (struct type *type,
+@@ -2249,6 +2256,28 @@ resolve_dynamic_struct (struct type *type,
return resolved_type;
}
@@ -574,7 +574,7 @@ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
/* Worker for resolved_dynamic_type. */
static struct type *
-@@ -2288,7 +2317,12 @@ resolve_dynamic_type_internal (struct type *type,
+@@ -2297,7 +2326,12 @@ resolve_dynamic_type_internal (struct type *type,
break;
}
@@ -1306,7 +1306,7 @@ diff --git a/gdb/typeprint.c b/gdb/typeprint.c
diff --git a/gdb/valops.c b/gdb/valops.c
--- a/gdb/valops.c
+++ b/gdb/valops.c
-@@ -1565,6 +1565,19 @@ value_ind (struct value *arg1)
+@@ -1553,6 +1553,19 @@ value_ind (struct value *arg1)
if (TYPE_CODE (base_type) == TYPE_CODE_PTR)
{
struct type *enc_type;
@@ -1326,7 +1326,7 @@ diff --git a/gdb/valops.c b/gdb/valops.c
/* We may be pointing to something embedded in a larger object.
Get the real type of the enclosing object. */
-@@ -1580,8 +1593,7 @@ value_ind (struct value *arg1)
+@@ -1568,8 +1581,7 @@ value_ind (struct value *arg1)
else
/* Retrieve the enclosing object pointed to. */
arg2 = value_at_lazy (enc_type,
diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch
index b2170f4..7ef64a5 100644
--- a/gdb-vla-intel-stringbt-fix.patch
+++ b/gdb-vla-intel-stringbt-fix.patch
@@ -38,7 +38,7 @@ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
#include "common/underlying.h"
#include "common/byte-vector.h"
-@@ -2348,6 +2349,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
+@@ -2158,6 +2159,20 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
ctx.per_cu = per_cu;
ctx.obj_address = 0;
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gdb.git/commitdiff/77d109980b515d9568e46bdd6f850bfe02b83d25
More information about the pld-cvs-commit
mailing list