diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 636e58c..f79804f 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -40,10 +40,15 @@ rpm compatibility patch by Panu Matilainen. -Index: gdb-6.8/gdb/Makefile.in -=================================================================== ---- gdb-6.8.orig/gdb/Makefile.in 2008-04-19 20:48:13.000000000 +0200 -+++ gdb-6.8/gdb/Makefile.in 2008-04-19 20:48:21.000000000 +0200 +2008-08-21 Jan Kratochvil + + Disable MI non-compliant message on the missing debuginfo printed on + reloaded exec file. + Fix found by Denys Vlasenko . + Fixes Red Hat Bug 459414. + +--- ./gdb/Makefile.in 2008-08-21 00:29:46.000000000 +0200 ++++ ./gdb/Makefile.in 2008-08-21 00:28:43.000000000 +0200 @@ -340,7 +340,7 @@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@ # your system doesn't have fcntl.h in /usr/include (which is where it # should be according to Posix). @@ -100,10 +105,8 @@ Index: gdb-6.8/gdb/Makefile.in $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-interp.c tui-io.o: $(srcdir)/tui/tui-io.c $(defs_h) $(target_h) \ $(event_loop_h) $(event_top_h) $(command_h) $(top_h) $(tui_h) \ -Index: gdb-6.8/gdb/corelow.c -=================================================================== ---- gdb-6.8.orig/gdb/corelow.c 2008-04-19 20:47:17.000000000 +0200 -+++ gdb-6.8/gdb/corelow.c 2008-04-19 20:48:21.000000000 +0200 +--- ./gdb/corelow.c 2008-02-09 14:45:33.000000000 +0100 ++++ ./gdb/corelow.c 2008-08-21 00:28:43.000000000 +0200 @@ -45,6 +45,10 @@ #include "exceptions.h" #include "solib.h" @@ -200,11 +203,9 @@ Index: gdb-6.8/gdb/corelow.c + NULL, NULL, NULL, + &setlist, &showlist); } -Index: gdb-6.8/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-6.8.orig/gdb/doc/gdb.texinfo 2008-04-19 20:48:13.000000000 +0200 -+++ gdb-6.8/gdb/doc/gdb.texinfo 2008-04-19 20:48:21.000000000 +0200 -@@ -12208,6 +12208,27 @@ information files. +--- ./gdb/doc/gdb.texinfo 2008-08-21 00:29:46.000000000 +0200 ++++ ./gdb/doc/gdb.texinfo 2008-08-21 00:28:43.000000000 +0200 +@@ -12195,6 +12195,27 @@ information files. @end table @@ -232,10 +233,8 @@ Index: gdb-6.8/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 -Index: gdb-6.8/gdb/event-top.c -=================================================================== ---- gdb-6.8.orig/gdb/event-top.c 2008-04-19 20:47:17.000000000 +0200 -+++ gdb-6.8/gdb/event-top.c 2008-04-19 20:48:21.000000000 +0200 +--- ./gdb/event-top.c 2008-01-01 23:53:09.000000000 +0100 ++++ ./gdb/event-top.c 2008-08-21 00:28:43.000000000 +0200 @@ -31,6 +31,7 @@ #include #include "exceptions.h" @@ -262,10 +261,8 @@ Index: gdb-6.8/gdb/event-top.c /* Each interpreter has its own rules on displaying the command prompt. */ if (!current_interp_display_prompt_p ()) -Index: gdb-6.8/gdb/solib-svr4.c -=================================================================== ---- gdb-6.8.orig/gdb/solib-svr4.c 2008-04-19 20:48:12.000000000 +0200 -+++ gdb-6.8/gdb/solib-svr4.c 2008-04-19 20:49:50.000000000 +0200 +--- ./gdb/solib-svr4.c 2008-08-21 00:29:46.000000000 +0200 ++++ ./gdb/solib-svr4.c 2008-08-21 00:28:43.000000000 +0200 @@ -764,9 +764,33 @@ svr4_current_sos (void) safe_strerror (errcode)); else @@ -303,10 +300,8 @@ Index: gdb-6.8/gdb/solib-svr4.c } xfree (buffer); -Index: gdb-6.8/gdb/symfile.c -=================================================================== ---- gdb-6.8.orig/gdb/symfile.c 2008-04-19 20:48:12.000000000 +0200 -+++ gdb-6.8/gdb/symfile.c 2008-04-19 20:48:21.000000000 +0200 +--- ./gdb/symfile.c 2008-08-21 00:29:46.000000000 +0200 ++++ ./gdb/symfile.c 2008-08-21 00:29:18.000000000 +0200 @@ -53,6 +53,9 @@ #include "varobj.h" #include "elf-bfd.h" @@ -791,7 +786,7 @@ Index: gdb-6.8/gdb/symfile.c if (retval != NULL && !build_id_verify (retval, build_id)) { -@@ -1314,9 +1714,432 @@ build_id_to_debug_filename (struct build +@@ -1314,9 +1714,437 @@ build_id_to_debug_filename (struct build retval = NULL; } @@ -1007,11 +1002,14 @@ Index: gdb-6.8/gdb/symfile.c +{ + char **array, **array_iter; + struct missing_rpm *list_iter; ++ struct cleanup *cleanups; + + if (missing_rpm_list_entries == 0) + return; + + array = xmalloc (sizeof (*array) * missing_rpm_list_entries); ++ cleanups = make_cleanup (xfree, array); ++ + array_iter = array; + for (list_iter = missing_rpm_list; list_iter != NULL; + list_iter = list_iter->next) @@ -1023,16 +1021,16 @@ Index: gdb-6.8/gdb/symfile.c + qsort (array, missing_rpm_list_entries, sizeof (*array), + (int (*) (const void *, const void *)) missing_rpm_list_compar); + -+ printf (_("Missing separate debuginfos, use: %s"), "debuginfo-install"); ++ printf_unfiltered (_("Missing separate debuginfos, use: %s"), ++ "debuginfo-install"); + for (array_iter = array; array_iter < array + missing_rpm_list_entries; + array_iter++) + { -+ putchar (' '); -+ fputs (*array_iter, stdout); ++ putchar_unfiltered (' '); ++ puts_unfiltered (*array_iter); + } -+ putchar ('\n'); ++ putchar_unfiltered ('\n'); + -+ xfree (array); + while (missing_rpm_list != NULL) + { + list_iter = missing_rpm_list; @@ -1040,6 +1038,8 @@ Index: gdb-6.8/gdb/symfile.c + xfree (list_iter); + } + missing_rpm_list_entries = 0; ++ ++ do_cleanups (cleanups); +} + +static void @@ -1224,7 +1224,7 @@ Index: gdb-6.8/gdb/symfile.c static char * get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out) { -@@ -1402,32 +2226,36 @@ static char * +@@ -1402,32 +2231,36 @@ static char * find_separate_debug_file (struct objfile *objfile) { asection *sect; @@ -1270,7 +1270,7 @@ Index: gdb-6.8/gdb/symfile.c } basename = get_debug_link_info (objfile, &crc32); -@@ -1435,7 +2263,7 @@ find_separate_debug_file (struct objfile +@@ -1435,7 +2268,7 @@ find_separate_debug_file (struct objfile if (basename == NULL) /* There's no separate debug info, hence there's no way we could load it => no warning. */ @@ -1279,7 +1279,7 @@ Index: gdb-6.8/gdb/symfile.c dir = xstrdup (objfile->name); -@@ -1451,23 +2279,19 @@ find_separate_debug_file (struct objfile +@@ -1451,23 +2284,19 @@ find_separate_debug_file (struct objfile gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i])); dir[i+1] = '\0'; @@ -1310,7 +1310,7 @@ Index: gdb-6.8/gdb/symfile.c /* Then try in the subdirectory named DEBUG_SUBDIRECTORY. */ strcpy (debugfile, dir); -@@ -1476,11 +2300,7 @@ find_separate_debug_file (struct objfile +@@ -1476,11 +2305,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -1323,7 +1323,7 @@ Index: gdb-6.8/gdb/symfile.c /* Then try in the global debugfile directory. */ strcpy (debugfile, debug_file_directory); -@@ -1489,11 +2309,7 @@ find_separate_debug_file (struct objfile +@@ -1489,11 +2314,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -1336,7 +1336,7 @@ Index: gdb-6.8/gdb/symfile.c /* If the file is in the sysroot, try using its base path in the global debugfile directory. */ -@@ -1508,20 +2324,18 @@ find_separate_debug_file (struct objfile +@@ -1508,20 +2329,18 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -1365,7 +1365,7 @@ Index: gdb-6.8/gdb/symfile.c } -@@ -4208,4 +5022,16 @@ the global debug-file directory prepende +@@ -4208,4 +5027,16 @@ the global debug-file directory prepende NULL, show_debug_file_directory, &setlist, &showlist); @@ -1382,10 +1382,8 @@ Index: gdb-6.8/gdb/symfile.c + + observer_attach_executable_changed (debug_print_executable_changed); } -Index: gdb-6.8/gdb/symfile.h -=================================================================== ---- gdb-6.8.orig/gdb/symfile.h 2008-04-19 20:47:17.000000000 +0200 -+++ gdb-6.8/gdb/symfile.h 2008-04-19 20:48:21.000000000 +0200 +--- ./gdb/symfile.h 2008-02-03 23:13:29.000000000 +0100 ++++ ./gdb/symfile.h 2008-08-21 00:28:43.000000000 +0200 @@ -358,6 +358,14 @@ extern int symfile_map_offsets_to_segmen struct symfile_segment_data *get_symfile_segment_data (bfd *abfd); void free_symfile_segment_data (struct symfile_segment_data *data); @@ -1401,31 +1399,8 @@ Index: gdb-6.8/gdb/symfile.h /* From dwarf2read.c */ extern int dwarf2_has_info (struct objfile *); -Index: gdb-6.8/gdb/tui/tui-interp.c -=================================================================== ---- gdb-6.8.orig/gdb/tui/tui-interp.c 2008-04-19 20:47:17.000000000 +0200 -+++ gdb-6.8/gdb/tui/tui-interp.c 2008-04-19 20:48:21.000000000 +0200 -@@ -30,6 +30,7 @@ - #include "tui/tui.h" - #include "tui/tui-io.h" - #include "exceptions.h" -+#include "symfile.h" - - /* Set to 1 when the TUI mode must be activated when we first start - gdb. */ -@@ -128,6 +129,8 @@ tui_command_loop (void *data) - char *a_prompt; - char *gdb_prompt = get_prompt (); - -+ debug_flush_missing (); -+ - /* Tell readline what the prompt to display is and what function - it will need to call after a whole line is read. This also - displays the first prompt. */ -Index: gdb-6.8/gdb/testsuite/lib/gdb.exp -=================================================================== ---- gdb-6.8.orig/gdb/testsuite/lib/gdb.exp 2008-04-19 20:48:11.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/lib/gdb.exp 2008-04-19 20:48:21.000000000 +0200 +--- ./gdb/testsuite/lib/gdb.exp 2008-08-21 00:29:46.000000000 +0200 ++++ ./gdb/testsuite/lib/gdb.exp 2008-08-21 00:28:43.000000000 +0200 @@ -1199,6 +1199,16 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } @@ -1443,3 +1418,22 @@ Index: gdb-6.8/gdb/testsuite/lib/gdb.exp return 0; } +--- ./gdb/tui/tui-interp.c 2008-01-01 23:53:22.000000000 +0100 ++++ ./gdb/tui/tui-interp.c 2008-08-21 00:28:43.000000000 +0200 +@@ -30,6 +30,7 @@ + #include "tui/tui.h" + #include "tui/tui-io.h" + #include "exceptions.h" ++#include "symfile.h" + + /* Set to 1 when the TUI mode must be activated when we first start + gdb. */ +@@ -128,6 +129,8 @@ tui_command_loop (void *data) + char *a_prompt; + char *gdb_prompt = get_prompt (); + ++ debug_flush_missing (); ++ + /* Tell readline what the prompt to display is and what function + it will need to call after a whole line is read. This also + displays the first prompt. */ diff --git a/gdb-6.8-bz377541-fortran-dynamic-arrays.patch b/gdb-6.8-bz377541-fortran-dynamic-arrays.patch index 44808ff..b140703 100644 --- a/gdb-6.8-bz377541-fortran-dynamic-arrays.patch +++ b/gdb-6.8-bz377541-fortran-dynamic-arrays.patch @@ -12,9 +12,13 @@ The last version posted upstream: Port to GDB-6.8pre. -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/Makefile.in gdb-6.8cvs20080219/gdb/Makefile.in ---- gdb-6.8cvs20080219-fortranless/gdb/Makefile.in 2008-02-22 08:19:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/Makefile.in 2008-02-22 16:59:22.000000000 +0100 +2008-08-23 Jan Kratochvil + + Include dynamic strings support. + +diff -up -ruNp gdb-6.8-0/gdb/Makefile.in gdb-6.8-1/gdb/Makefile.in +--- gdb-6.8-0/gdb/Makefile.in 2008-08-23 22:29:57.000000000 +0200 ++++ gdb-6.8-1/gdb/Makefile.in 2008-08-23 22:31:08.000000000 +0200 @@ -758,6 +758,7 @@ disasm_h = disasm.h doublest_h = doublest.h $(floatformat_h) dummy_frame_h = dummy-frame.h @@ -32,16 +36,17 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr ada-lang.o c-lang.o f-lang.o objc-lang.o \ ui-out.o cli-out.o \ varobj.o vec.o wrapper.o \ -@@ -2086,6 +2087,8 @@ dummy-frame.o: dummy-frame.c $(defs_h) $ +@@ -2086,6 +2087,9 @@ dummy-frame.o: dummy-frame.c $(defs_h) $ $(command_h) $(gdbcmd_h) $(gdb_string_h) dfp.o: dfp.c $(defs_h) $(expression_h) $(gdbtypes_h) $(value_h) $(dfp_h) \ $(decimal128_h) $(decimal64_h) $(decimal32_h) +dwarf2block.o: dwarf2block.c $(dwarf2block_h) $(defs_h) $(gdbcore_h) \ -+ $(dwarf2expr_h) $(exceptions_h) ++ $(dwarf2expr_h) $(exceptions_h) $(frame_h) $(regcache_h) $(value_h) \ ++ $(block_h) $(gdb_assert.h) $(dwarf2loc.h) dwarf2expr.o: dwarf2expr.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(value_h) \ $(gdbcore_h) $(elf_dwarf2_h) $(dwarf2expr_h) dwarf2-frame.o: dwarf2-frame.c $(defs_h) $(dwarf2expr_h) $(elf_dwarf2_h) \ -@@ -2096,13 +2099,14 @@ dwarf2-frame.o: dwarf2-frame.c $(defs_h) +@@ -2096,13 +2100,14 @@ dwarf2-frame.o: dwarf2-frame.c $(defs_h) dwarf2loc.o: dwarf2loc.c $(defs_h) $(ui_out_h) $(value_h) $(frame_h) \ $(gdbcore_h) $(target_h) $(inferior_h) $(ax_h) $(ax_gdb_h) \ $(regcache_h) $(objfiles_h) $(exceptions_h) $(elf_dwarf2_h) \ @@ -58,7 +63,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr elfread.o: elfread.c $(defs_h) $(bfd_h) $(gdb_string_h) $(elf_bfd_h) \ $(elf_mips_h) $(symtab_h) $(symfile_h) $(objfiles_h) $(buildsym_h) \ $(stabsread_h) $(gdb_stabs_h) $(complaints_h) $(demangle_h) \ -@@ -2138,10 +2142,10 @@ f-exp.o: f-exp.c $(defs_h) $(gdb_string_ +@@ -2138,10 +2143,10 @@ f-exp.o: f-exp.c $(defs_h) $(gdb_string_ findvar.o: findvar.c $(defs_h) $(symtab_h) $(gdbtypes_h) $(frame_h) \ $(value_h) $(gdbcore_h) $(inferior_h) $(target_h) $(gdb_string_h) \ $(gdb_assert_h) $(floatformat_h) $(symfile_h) $(regcache_h) \ @@ -71,7 +76,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr fork-child.o: fork-child.c $(defs_h) $(gdb_string_h) $(frame_h) \ $(inferior_h) $(target_h) $(gdb_wait_h) $(gdb_vfork_h) $(gdbcore_h) \ $(terminal_h) $(gdbthread_h) $(command_h) $(solib_h) -@@ -2166,7 +2170,7 @@ frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_s +@@ -2166,7 +2171,7 @@ frv-tdep.o: frv-tdep.c $(defs_h) $(gdb_s $(frv_tdep_h) f-typeprint.o: f-typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(target_h) \ @@ -80,7 +85,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr f-valprint.o: f-valprint.c $(defs_h) $(gdb_string_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(valprint_h) $(language_h) \ $(f_lang_h) $(frame_h) $(gdbcore_h) $(command_h) $(block_h) -@@ -2181,7 +2185,8 @@ gdb-events.o: gdb-events.c $(defs_h) $(g +@@ -2181,7 +2186,8 @@ gdb-events.o: gdb-events.c $(defs_h) $(g gdbtypes.o: gdbtypes.c $(defs_h) $(gdb_string_h) $(bfd_h) $(symtab_h) \ $(symfile_h) $(objfiles_h) $(gdbtypes_h) $(expression_h) \ $(language_h) $(target_h) $(value_h) $(demangle_h) $(complaints_h) \ @@ -90,7 +95,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr glibc-tdep.o: glibc-tdep.c $(defs_h) $(frame_h) $(symtab_h) $(symfile_h) \ $(objfiles_h) $(glibc_tdep_h) gnu-nat.o: gnu-nat.c $(gdb_string_h) $(defs_h) $(inferior_h) $(symtab_h) \ -@@ -2939,7 +2944,7 @@ tramp-frame.o: tramp-frame.c $(defs_h) $ +@@ -2939,7 +2945,7 @@ tramp-frame.o: tramp-frame.c $(defs_h) $ typeprint.o: typeprint.c $(defs_h) $(gdb_obstack_h) $(bfd_h) $(symtab_h) \ $(gdbtypes_h) $(expression_h) $(value_h) $(gdbcore_h) $(command_h) \ $(gdbcmd_h) $(target_h) $(language_h) $(cp_abi_h) $(typeprint_h) \ @@ -99,10 +104,10 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr ui-file.o: ui-file.c $(defs_h) $(ui_file_h) $(gdb_string_h) ui-out.o: ui-out.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ $(ui_out_h) $(gdb_assert_h) -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/ada-lang.c gdb-6.8cvs20080219/gdb/ada-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/ada-lang.c 2008-02-14 23:03:56.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/ada-lang.c 2008-02-22 16:47:53.000000000 +0100 -@@ -11012,6 +11012,7 @@ const struct language_defn ada_language_ +diff -up -ruNp gdb-6.8-0/gdb/ada-lang.c gdb-6.8-1/gdb/ada-lang.c +--- gdb-6.8-0/gdb/ada-lang.c 2008-08-23 22:29:57.000000000 +0200 ++++ gdb-6.8-1/gdb/ada-lang.c 2008-08-23 22:30:33.000000000 +0200 +@@ -11009,6 +11009,7 @@ const struct language_defn ada_language_ ada_language_arch_info, ada_print_array_index, default_pass_by_reference, @@ -110,9 +115,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/c-lang.c gdb-6.8cvs20080219/gdb/c-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/c-lang.c 2008-02-14 23:03:56.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/c-lang.c 2008-02-22 17:01:17.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/c-lang.c gdb-6.8-1/gdb/c-lang.c +--- gdb-6.8-0/gdb/c-lang.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/c-lang.c 2008-08-23 22:30:33.000000000 +0200 @@ -427,6 +427,7 @@ const struct language_defn c_language_de c_language_arch_info, default_print_array_index, @@ -145,10 +150,10 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/dwarf2block.c gdb-6.8cvs20080219/gdb/dwarf2block.c ---- gdb-6.8cvs20080219-fortranless/gdb/dwarf2block.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2block.c 2008-02-22 16:49:35.000000000 +0100 -@@ -0,0 +1,153 @@ +diff -up -ruNp gdb-6.8-0/gdb/dwarf2block.c gdb-6.8-1/gdb/dwarf2block.c +--- gdb-6.8-0/gdb/dwarf2block.c 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8-1/gdb/dwarf2block.c 2008-08-23 22:31:08.000000000 +0200 +@@ -0,0 +1,216 @@ +/* DWARF DW_FORM_block* expression evaluation. + + Copyright (C) 2007 Free Software Foundation, Inc. @@ -173,6 +178,12 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +#include "gdbcore.h" +#include "dwarf2expr.h" +#include "exceptions.h" ++#include "frame.h" ++#include "regcache.h" ++#include "value.h" ++#include "block.h" ++#include "gdb_assert.h" ++#include "dwarf2loc.h" + +/* This is the baton used when performing dwarf2 DW_BLOCK evaluation. */ +struct dwarf_block_baton @@ -200,17 +211,74 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + return debaton->address; +} + ++/* A copy from dwarf2-frame.c:read_reg() but without one unwind. */ ++ +static CORE_ADDR -+dwarf_block_read_reg (void *baton, int regnum) ++dwarf_block_read_reg (void *baton, int reg) +{ -+ error (_("Unsupported operation for DW_FORM_block*: %s"), "read_reg"); -+ return 0; ++ struct frame_info *frame = get_selected_frame ++ (_("Unsupported operation for DW_FORM_block: read_reg")); ++ struct gdbarch *gdbarch = get_frame_arch (frame); ++ int regnum; ++ gdb_byte *buf; ++ ++ regnum = gdbarch_dwarf2_reg_to_regnum (gdbarch, reg); ++ ++ buf = alloca (register_size (gdbarch, regnum)); ++ get_frame_register (frame, regnum, buf); ++ ++ /* Convert the register to an integer. This returns a LONGEST ++ rather than a CORE_ADDR, but unpack_pointer does the same thing ++ under the covers, and this makes more sense for non-pointer ++ registers. Maybe read_reg and the associated interfaces should ++ deal with "struct value" instead of CORE_ADDR. */ ++ return unpack_long (register_type (gdbarch, regnum), buf); +} + ++/* A copy from dwarf2loc.c:dwarf_expr_frame_base(). */ ++ +static void +dwarf_block_get_frame_base (void *baton, gdb_byte **start, size_t *length) +{ -+ error (_("Unsupported operation for DW_FORM_block*: %s"), "get_frame_base"); ++ struct frame_info *frame = get_selected_frame ++ (_("Unsupported operation for DW_FORM_block: read_reg")); ++ /* FIXME: cagney/2003-03-26: This code should be using ++ get_frame_base_address(), and then implement a dwarf2 specific ++ this_base method. */ ++ struct symbol *framefunc; ++ ++ /* Use block_linkage_function, which returns a real (not inlined) ++ function, instead of get_frame_function, which may return an ++ inlined function. */ ++ framefunc = block_linkage_function (get_frame_block (frame, NULL)); ++ ++ /* If we found a frame-relative symbol then it was certainly within ++ some function associated with a frame. If we can't find the frame, ++ something has gone wrong. */ ++ gdb_assert (framefunc != NULL); ++ ++ if (SYMBOL_LOCATION_BATON (framefunc) == NULL) ++ *start = NULL; ++ else if (SYMBOL_OPS (framefunc) == &dwarf2_loclist_funcs) ++ { ++ struct dwarf2_loclist_baton *symbaton; ++ ++ symbaton = SYMBOL_LOCATION_BATON (framefunc); ++ *start = find_location_expression (symbaton, length, ++ get_frame_address_in_block (frame)); ++ } ++ else ++ { ++ struct dwarf2_locexpr_baton *symbaton; ++ ++ symbaton = SYMBOL_LOCATION_BATON (framefunc); ++ *length = symbaton->size; ++ *start = symbaton->data; ++ } ++ ++ if (*start == NULL) ++ error (_("%s: Could not find the frame base for \"%s\"."), ++ "dwarf_block_get_frame_base", SYMBOL_NATURAL_NAME (framefunc)); +} + +static CORE_ADDR @@ -302,9 +370,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + + return retval; +} -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/dwarf2block.h gdb-6.8cvs20080219/gdb/dwarf2block.h ---- gdb-6.8cvs20080219-fortranless/gdb/dwarf2block.h 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2block.h 2008-02-22 16:49:35.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/dwarf2block.h gdb-6.8-1/gdb/dwarf2block.h +--- gdb-6.8-0/gdb/dwarf2block.h 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8-1/gdb/dwarf2block.h 2008-08-23 22:30:33.000000000 +0200 @@ -0,0 +1,36 @@ +/* DWARF DW_FORM_block* expression evaluation. + @@ -342,9 +410,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +extern CORE_ADDR object_address_get (void); + +#endif /* !defined(DWARF2BLOCK_H) */ -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/dwarf2expr.c gdb-6.8cvs20080219/gdb/dwarf2expr.c ---- gdb-6.8cvs20080219-fortranless/gdb/dwarf2expr.c 2008-02-22 08:19:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2expr.c 2008-02-22 16:49:35.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/dwarf2expr.c gdb-6.8-1/gdb/dwarf2expr.c +--- gdb-6.8-0/gdb/dwarf2expr.c 2008-08-23 22:29:56.000000000 +0200 ++++ gdb-6.8-1/gdb/dwarf2expr.c 2008-08-23 22:30:33.000000000 +0200 @@ -750,6 +750,13 @@ execute_stack_op (struct dwarf_expr_cont ctx->initialized = 0; goto no_push; @@ -359,9 +427,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr default: error (_("Unhandled dwarf expression opcode 0x%x"), op); } -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/dwarf2expr.h gdb-6.8cvs20080219/gdb/dwarf2expr.h ---- gdb-6.8cvs20080219-fortranless/gdb/dwarf2expr.h 2008-01-02 00:03:54.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2expr.h 2008-02-22 16:49:35.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/dwarf2expr.h gdb-6.8-1/gdb/dwarf2expr.h +--- gdb-6.8-0/gdb/dwarf2expr.h 2008-01-01 23:53:09.000000000 +0100 ++++ gdb-6.8-1/gdb/dwarf2expr.h 2008-08-23 22:30:33.000000000 +0200 @@ -61,10 +61,10 @@ struct dwarf_expr_context The result must be live until the current expression evaluation is complete. */ @@ -374,9 +442,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr /* The current depth of dwarf expression recursion, via DW_OP_call*, DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/dwarf2loc.c gdb-6.8cvs20080219/gdb/dwarf2loc.c ---- gdb-6.8cvs20080219-fortranless/gdb/dwarf2loc.c 2008-01-02 00:03:54.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2loc.c 2008-02-22 16:49:35.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/dwarf2loc.c gdb-6.8-1/gdb/dwarf2loc.c +--- gdb-6.8-0/gdb/dwarf2loc.c 2008-01-01 23:53:09.000000000 +0100 ++++ gdb-6.8-1/gdb/dwarf2loc.c 2008-08-23 22:31:08.000000000 +0200 @@ -35,6 +35,7 @@ #include "elf/dwarf2.h" #include "dwarf2expr.h" @@ -385,6 +453,15 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr #include "gdb_string.h" #include "gdb_assert.h" +@@ -47,7 +48,7 @@ + For now, only return the first matching location expression; there + can be more than one in the list. */ + +-static gdb_byte * ++gdb_byte * + find_location_expression (struct dwarf2_loclist_baton *baton, + size_t *locexpr_length, CORE_ADDR pc) + { @@ -252,6 +253,9 @@ dwarf2_evaluate_loc_desc (struct symbol { CORE_ADDR address = dwarf_expr_fetch (ctx, 0); @@ -395,9 +472,21 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr retval = allocate_value (SYMBOL_TYPE (var)); VALUE_LVAL (retval) = lval_memory; set_value_lazy (retval, 1); -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/dwarf2read.c gdb-6.8cvs20080219/gdb/dwarf2read.c ---- gdb-6.8cvs20080219-fortranless/gdb/dwarf2read.c 2008-02-22 08:19:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2read.c 2008-02-22 16:59:22.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/dwarf2loc.h gdb-6.8-1/gdb/dwarf2loc.h +--- gdb-6.8-0/gdb/dwarf2loc.h 2008-01-01 23:53:09.000000000 +0100 ++++ gdb-6.8-1/gdb/dwarf2loc.h 2008-08-23 22:31:08.000000000 +0200 +@@ -66,4 +66,8 @@ struct dwarf2_loclist_baton + extern const struct symbol_ops dwarf2_locexpr_funcs; + extern const struct symbol_ops dwarf2_loclist_funcs; + ++extern gdb_byte *find_location_expression (struct dwarf2_loclist_baton *baton, ++ size_t *locexpr_length, ++ CORE_ADDR pc); ++ + #endif /* dwarf2loc.h */ +diff -up -ruNp gdb-6.8-0/gdb/dwarf2read.c gdb-6.8-1/gdb/dwarf2read.c +--- gdb-6.8-0/gdb/dwarf2read.c 2008-08-23 22:29:57.000000000 +0200 ++++ gdb-6.8-1/gdb/dwarf2read.c 2008-08-23 22:31:08.000000000 +0200 @@ -46,6 +46,8 @@ #include "top.h" #include "command.h" @@ -590,7 +679,119 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr attr_byte_size = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr_byte_size) -@@ -5048,9 +5140,9 @@ read_subrange_type (struct die_info *die +@@ -4822,34 +4914,94 @@ read_tag_string_type (struct die_info *d + struct objfile *objfile = cu->objfile; + struct type *type, *range_type, *index_type, *char_type; + struct attribute *attr; +- unsigned int length; ++ union ++ { ++ unsigned u; ++ int i; ++ } length; + + if (die->type) + { + return; + } + ++ index_type = builtin_type_int32; ++ range_type = create_range_type_nfields (NULL, index_type, 2); ++ TYPE_FLAGS (range_type) |= TYPE_FLAG_UNSIGNED; ++ ++ /* C/C++ should probably have the low bound 0 but C/C++ does not use ++ DW_TAG_string_type. */ ++ TYPE_LOW_BOUND_RAW (range_type) = 1; ++ + attr = dwarf2_attr (die, DW_AT_string_length, cu); +- if (attr) ++ switch (dwarf2_get_attr_constant_value (attr, &length.i)) + { +- length = DW_UNSND (attr); +- } +- else +- { +- /* check for the DW_AT_byte_size attribute */ ++ case dwarf2_attr_const: ++ /* We currently do not support a constant address where the location ++ should be read from - DWARF2_ATTR_BLOCK is expected instead. */ ++ /* PASSTHRU */ ++ case dwarf2_attr_unknown: + attr = dwarf2_attr (die, DW_AT_byte_size, cu); +- if (attr) +- { +- length = DW_UNSND (attr); +- } +- else +- { +- length = 1; +- } ++ switch (dwarf2_get_attr_constant_value (attr, &length.i)) ++ { ++ case dwarf2_attr_unknown: ++ length.u = 1; ++ /* PASSTHRU */ ++ case dwarf2_attr_const: ++ TYPE_HIGH_BOUND_RAW (range_type) = length.u; ++ break; ++ case dwarf2_attr_block: ++ TYPE_BOUND_IS_DWARF_BLOCK_VAR (range_type, 1) ++ |= TYPE_BOUND_IS_DWARF_BLOCK_MASK; ++ TYPE_FIELD_DWARF_BLOCK (range_type, 1) = DW_BLOCK (attr); ++ break; ++ } ++ break; ++ case dwarf2_attr_block: ++ /* Security check for a size overflow. */ ++ if (DW_BLOCK (attr)->size + 2 < DW_BLOCK (attr)->size) ++ { ++ TYPE_HIGH_BOUND_RAW (range_type) = 1; ++ break; ++ } ++ /* Extend the DWARF block by a new DW_OP_deref/DW_OP_deref_size ++ instruction as DW_AT_string_length specifies the length location, not ++ its value. */ ++ { ++ struct dwarf_block *length_block = dwarf_alloc_block (cu); ++ struct attribute *size_attr; ++ ++ length_block->data = obstack_alloc (&cu->comp_unit_obstack, ++ DW_BLOCK (attr)->size + 2); ++ memcpy (length_block->data, DW_BLOCK (attr)->data, ++ DW_BLOCK (attr)->size); ++ ++ size_attr = dwarf2_attr (die, DW_AT_byte_size, cu); ++ if (size_attr) ++ { ++ length_block->size = DW_BLOCK (attr)->size + 2; ++ length_block->data[DW_BLOCK (attr)->size] = DW_OP_deref_size; ++ length_block->data[DW_BLOCK (attr)->size + 1] ++ = DW_UNSND (size_attr); ++ if (length_block->data[DW_BLOCK (attr)->size + 1] ++ != DW_UNSND (size_attr)) ++ complaint (&symfile_complaints, ++ _("DW_AT_string_length's DW_AT_byte_size integer " ++ "exceeds the byte size storage")); ++ } ++ else ++ { ++ length_block->size = DW_BLOCK (attr)->size + 1; ++ length_block->data[DW_BLOCK (attr)->size] = DW_OP_deref; ++ } ++ ++ TYPE_BOUND_IS_DWARF_BLOCK_VAR (range_type, 1) ++ |= TYPE_BOUND_IS_DWARF_BLOCK_MASK; ++ TYPE_FIELD_DWARF_BLOCK (range_type, 1) = length_block; ++ } ++ break; + } + +- index_type = builtin_type_int32; +- range_type = create_range_type (NULL, index_type, 1, length); + type = create_string_type (NULL, range_type); + + set_die_type (die, type, cu); +@@ -5048,9 +5200,9 @@ read_subrange_type (struct die_info *die { struct type *base_type; struct type *range_type; @@ -603,7 +804,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr char *name; /* If we have already decoded this die, then nothing more to do. */ -@@ -5067,42 +5159,99 @@ read_subrange_type (struct die_info *die +@@ -5067,42 +5219,99 @@ read_subrange_type (struct die_info *die 0, NULL, cu->objfile); } @@ -733,7 +934,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr name = dwarf2_name (die, cu); if (name) -@@ -9058,26 +9207,35 @@ dwarf2_get_ref_die_offset (struct attrib +@@ -9061,26 +9270,35 @@ dwarf2_get_ref_die_offset (struct attrib return result; } @@ -763,7 +964,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr - return default_value; + *val_return = DW_SND (attr); + return dwarf2_attr_const; -+ } + } + if (attr->form == DW_FORM_udata + || attr->form == DW_FORM_data1 + || attr->form == DW_FORM_data2 @@ -772,7 +973,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + { + *val_return = DW_UNSND (attr); + return dwarf2_attr_const; - } ++ } + if (attr->form == DW_FORM_block + || attr->form == DW_FORM_block1 + || attr->form == DW_FORM_block2 @@ -784,9 +985,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr } static struct die_info * -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/eval.c gdb-6.8cvs20080219/gdb/eval.c ---- gdb-6.8cvs20080219-fortranless/gdb/eval.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/eval.c 2008-02-22 16:59:22.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/eval.c gdb-6.8-1/gdb/eval.c +--- gdb-6.8-0/gdb/eval.c 2008-02-04 01:23:04.000000000 +0100 ++++ gdb-6.8-1/gdb/eval.c 2008-08-23 22:30:33.000000000 +0200 @@ -1643,9 +1643,12 @@ evaluate_subexp_standard (struct type *e { int subscript_array[MAX_FORTRAN_DIMS]; @@ -837,9 +1038,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr /* Construct a value node with the value of the offset */ -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/f-lang.c gdb-6.8cvs20080219/gdb/f-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/f-lang.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/f-lang.c 2008-02-22 16:59:22.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/f-lang.c gdb-6.8-1/gdb/f-lang.c +--- gdb-6.8-0/gdb/f-lang.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/f-lang.c 2008-08-23 22:30:33.000000000 +0200 @@ -31,6 +31,7 @@ #include "f-lang.h" #include "valprint.h" @@ -886,9 +1087,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/f-lang.h gdb-6.8cvs20080219/gdb/f-lang.h ---- gdb-6.8cvs20080219-fortranless/gdb/f-lang.h 2008-01-02 00:03:54.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/f-lang.h 2008-02-22 16:59:22.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/f-lang.h gdb-6.8-1/gdb/f-lang.h +--- gdb-6.8-0/gdb/f-lang.h 2008-01-01 23:53:09.000000000 +0100 ++++ gdb-6.8-1/gdb/f-lang.h 2008-08-23 22:30:33.000000000 +0200 @@ -28,6 +28,11 @@ extern void f_error (char *); /* Defined extern void f_print_type (struct type *, char *, struct ui_file *, int, int); @@ -934,9 +1135,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr struct common_entry { struct symbol *symbol; /* The symbol node corresponding -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/f-typeprint.c gdb-6.8cvs20080219/gdb/f-typeprint.c ---- gdb-6.8cvs20080219-fortranless/gdb/f-typeprint.c 2008-01-02 00:03:54.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/f-typeprint.c 2008-02-22 16:59:22.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/f-typeprint.c gdb-6.8-1/gdb/f-typeprint.c +--- gdb-6.8-0/gdb/f-typeprint.c 2008-01-01 23:53:09.000000000 +0100 ++++ gdb-6.8-1/gdb/f-typeprint.c 2008-08-23 22:30:33.000000000 +0200 @@ -31,6 +31,7 @@ #include "gdbcore.h" #include "target.h" @@ -1078,9 +1279,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr if (passed_a_ptr) fprintf_filtered (stream, ")"); -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/f-valprint.c gdb-6.8cvs20080219/gdb/f-valprint.c ---- gdb-6.8cvs20080219-fortranless/gdb/f-valprint.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/f-valprint.c 2008-02-22 16:59:22.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/f-valprint.c gdb-6.8-1/gdb/f-valprint.c +--- gdb-6.8-0/gdb/f-valprint.c 2008-01-11 14:34:14.000000000 +0100 ++++ gdb-6.8-1/gdb/f-valprint.c 2008-08-23 22:30:33.000000000 +0200 @@ -54,11 +54,11 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIM /* The following macro gives us the size of the nth dimension, Where n is 1 based. */ @@ -1203,9 +1404,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr CHECK_TYPEDEF (type); switch (TYPE_CODE (type)) { -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/findvar.c gdb-6.8cvs20080219/gdb/findvar.c ---- gdb-6.8cvs20080219-fortranless/gdb/findvar.c 2008-01-02 00:03:54.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/findvar.c 2008-02-22 16:50:29.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/findvar.c gdb-6.8-1/gdb/findvar.c +--- gdb-6.8-0/gdb/findvar.c 2008-01-01 23:53:09.000000000 +0100 ++++ gdb-6.8-1/gdb/findvar.c 2008-08-23 22:30:33.000000000 +0200 @@ -34,6 +34,7 @@ #include "regcache.h" #include "user-regs.h" @@ -1376,9 +1577,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr } /* Install default attributes for register values. */ -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/gdbtypes.c gdb-6.8cvs20080219/gdb/gdbtypes.c ---- gdb-6.8cvs20080219-fortranless/gdb/gdbtypes.c 2008-02-22 08:19:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/gdbtypes.c 2008-02-22 16:58:30.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/gdbtypes.c gdb-6.8-1/gdb/gdbtypes.c +--- gdb-6.8-0/gdb/gdbtypes.c 2008-08-23 22:29:56.000000000 +0200 ++++ gdb-6.8-1/gdb/gdbtypes.c 2008-08-23 22:31:08.000000000 +0200 @@ -38,6 +38,7 @@ #include "cp-abi.h" #include "gdb_assert.h" @@ -1487,7 +1688,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr TYPE_NFIELDS (result_type) = 1; TYPE_FIELDS (result_type) = (struct field *) TYPE_ALLOC (result_type, sizeof (struct field)); -@@ -1377,6 +1397,116 @@ stub_noname_complaint (void) +@@ -1377,6 +1397,117 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } @@ -1540,17 +1741,15 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + } +} + -+CORE_ADDR range_type_byte_stride_internal (struct type *range_type) ++CORE_ADDR range_type_byte_stride_internal (struct type *range_type, ++ struct type *element_type) +{ + if (TYPE_NFIELDS (range_type) >= 3) + return range_type_any_field_internal (range_type, 2); ++ else if (element_type == NULL) ++ return 0; + else -+ { -+ /* The caller will need to call something like -+ `TYPE_LENGTH (check_typedef (element_type)) -+ * TYPE_COUNT_BOUND (range_type) '. */ -+ return 0; -+ } ++ return TYPE_LENGTH (check_typedef (element_type)); +} + +/* Calculate the memory length of array TYPE. @@ -1568,7 +1767,8 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + CORE_ADDR byte_stride = 0; /* `= 0' for a false GCC warning. */ + CORE_ADDR element_size; + -+ if (TYPE_CODE (type) != TYPE_CODE_ARRAY) ++ if (TYPE_CODE (type) != TYPE_CODE_ARRAY ++ && TYPE_CODE (type) != TYPE_CODE_STRING) + return TYPE_LENGTH (type); + + /* Avoid executing TYPE_COUNT_BOUND for invalid (unallocated/unassociated) @@ -1585,6 +1785,8 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + return 0; + if (full_span || count > 1) + { ++ /* We do not use TYPE_ARRAY_BYTE_STRIDE_VALUE (type) here as we want to ++ force FULL_SPAN to 1. */ + byte_stride = TYPE_BYTE_STRIDE (range_type); + if (byte_stride == 0) + { @@ -1604,7 +1806,15 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989. If this is a stubbed struct (i.e. declared as struct foo *), see if -@@ -1520,19 +1650,8 @@ check_typedef (struct type *type) +@@ -1514,25 +1645,15 @@ check_typedef (struct type *type) + { + /* Empty. */ + } +- else if (TYPE_CODE (type) == TYPE_CODE_ARRAY ++ else if ((TYPE_CODE (type) == TYPE_CODE_ARRAY ++ || TYPE_CODE (type) == TYPE_CODE_STRING) + && TYPE_NFIELDS (type) == 1 + && (TYPE_CODE (range_type = TYPE_FIELD_TYPE (type, 0)) == TYPE_CODE_RANGE)) { /* Now recompute the length of the array type, based on its @@ -1626,9 +1836,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr TYPE_FLAGS (type) &= ~TYPE_FLAG_TARGET_STUB; } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/gdbtypes.h gdb-6.8cvs20080219/gdb/gdbtypes.h ---- gdb-6.8cvs20080219-fortranless/gdb/gdbtypes.h 2008-02-22 08:19:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/gdbtypes.h 2008-02-22 16:59:22.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/gdbtypes.h gdb-6.8-1/gdb/gdbtypes.h +--- gdb-6.8-0/gdb/gdbtypes.h 2008-08-23 22:29:56.000000000 +0200 ++++ gdb-6.8-1/gdb/gdbtypes.h 2008-08-23 22:31:08.000000000 +0200 @@ -417,6 +417,9 @@ struct main_type CORE_ADDR physaddr; @@ -1693,7 +1903,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +#define TYPE_COUNT_BOUND(range_type) \ + range_type_count_bound_internal ((range_type)) +#define TYPE_BYTE_STRIDE(type) \ -+ range_type_byte_stride_internal ((type)) ++ range_type_byte_stride_internal ((type), NULL) + +#define TYPE_BOUND_IS_DWARF_BLOCK_MASK 1 +#define TYPE_BOUND_IS_DWARF_BLOCK_VAR(range_type, fieldno) \ @@ -1704,7 +1914,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr /* Moto-specific stuff for FORTRAN arrays */ -@@ -792,11 +820,12 @@ extern void allocate_cplus_struct_type ( +@@ -792,11 +820,14 @@ extern void allocate_cplus_struct_type ( #define TYPE_ARRAY_LOWER_BOUND_TYPE(thistype) \ TYPE_MAIN_TYPE(thistype)->lower_bound_type @@ -1716,12 +1926,14 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + (TYPE_LOW_BOUND(TYPE_INDEX_TYPE(arraytype))) +#define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ + (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE(arraytype))) ++/* ELEMENT_TYPE-enhanced TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) */ +#define TYPE_ARRAY_BYTE_STRIDE_VALUE(arraytype) \ -+ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype))) ++ range_type_byte_stride_internal (TYPE_INDEX_TYPE (arraytype), \ ++ TYPE_TARGET_TYPE (arraytype)) /* C++ */ -@@ -812,6 +841,7 @@ extern void allocate_cplus_struct_type ( +@@ -812,6 +843,7 @@ extern void allocate_cplus_struct_type ( #define TYPE_TYPE_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific #define TYPE_CPLUS_SPECIFIC(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.cplus_stuff #define TYPE_FLOATFORMAT(thistype) TYPE_MAIN_TYPE(thistype)->type_specific.floatformat @@ -1729,7 +1941,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr #define TYPE_BASECLASS(thistype,index) TYPE_MAIN_TYPE(thistype)->fields[index].type #define TYPE_N_BASECLASSES(thistype) TYPE_CPLUS_SPECIFIC(thistype)->n_baseclasses #define TYPE_BASECLASS_NAME(thistype,index) TYPE_MAIN_TYPE(thistype)->fields[index].name -@@ -826,6 +856,7 @@ extern void allocate_cplus_struct_type ( +@@ -826,6 +858,7 @@ extern void allocate_cplus_struct_type ( #define FIELD_TYPE(thisfld) ((thisfld).type) #define FIELD_NAME(thisfld) ((thisfld).name) #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) @@ -1737,7 +1949,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr #define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial) #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize) #define FIELD_STATIC_KIND(thisfld) ((thisfld).static_kind) -@@ -839,6 +870,7 @@ extern void allocate_cplus_struct_type ( +@@ -839,6 +872,7 @@ extern void allocate_cplus_struct_type ( #define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n)) #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n)) @@ -1745,7 +1957,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0) -@@ -1251,12 +1283,25 @@ extern struct type *make_function_type ( +@@ -1251,12 +1285,26 @@ extern struct type *make_function_type ( extern struct type *lookup_function_type (struct type *); @@ -1766,14 +1978,15 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + +extern int range_type_count_bound_internal (struct type *range_type); + -+extern CORE_ADDR range_type_byte_stride_internal (struct type *range_type); ++extern CORE_ADDR range_type_byte_stride_internal (struct type *range_type, ++ struct type *element_type); + extern struct type *create_string_type (struct type *, struct type *); extern struct type *create_set_type (struct type *, struct type *); -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/jv-lang.c gdb-6.8cvs20080219/gdb/jv-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/jv-lang.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/jv-lang.c 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/jv-lang.c gdb-6.8-1/gdb/jv-lang.c +--- gdb-6.8-0/gdb/jv-lang.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/jv-lang.c 2008-08-23 22:30:33.000000000 +0200 @@ -1083,6 +1083,7 @@ const struct language_defn java_language c_language_arch_info, default_print_array_index, @@ -1782,9 +1995,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/language.c gdb-6.8cvs20080219/gdb/language.c ---- gdb-6.8cvs20080219-fortranless/gdb/language.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/language.c 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/language.c gdb-6.8-1/gdb/language.c +--- gdb-6.8-0/gdb/language.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/language.c 2008-08-23 22:30:33.000000000 +0200 @@ -1087,6 +1087,15 @@ default_print_array_index (struct value fprintf_filtered (stream, "] = "); } @@ -1825,9 +2038,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/language.h gdb-6.8cvs20080219/gdb/language.h ---- gdb-6.8cvs20080219-fortranless/gdb/language.h 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/language.h 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/language.h gdb-6.8-1/gdb/language.h +--- gdb-6.8-0/gdb/language.h 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/language.h 2008-08-23 22:30:33.000000000 +0200 @@ -268,6 +268,13 @@ struct language_defn reference at the language level. */ int (*la_pass_by_reference) (struct type *type); @@ -1860,9 +2073,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + CORE_ADDR *address_return); + #endif /* defined (LANGUAGE_H) */ -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/m2-lang.c gdb-6.8cvs20080219/gdb/m2-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/m2-lang.c 2008-02-14 23:03:58.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/m2-lang.c 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/m2-lang.c gdb-6.8-1/gdb/m2-lang.c +--- gdb-6.8-0/gdb/m2-lang.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/m2-lang.c 2008-08-23 22:30:33.000000000 +0200 @@ -388,6 +388,7 @@ const struct language_defn m2_language_d m2_language_arch_info, default_print_array_index, @@ -1871,9 +2084,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/objc-lang.c gdb-6.8cvs20080219/gdb/objc-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/objc-lang.c 2008-02-14 23:03:59.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/objc-lang.c 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/objc-lang.c gdb-6.8-1/gdb/objc-lang.c +--- gdb-6.8-0/gdb/objc-lang.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/objc-lang.c 2008-08-23 22:30:33.000000000 +0200 @@ -522,6 +522,7 @@ const struct language_defn objc_language c_language_arch_info, default_print_array_index, @@ -1882,9 +2095,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/p-lang.c gdb-6.8cvs20080219/gdb/p-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/p-lang.c 2008-02-14 23:03:59.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/p-lang.c 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/p-lang.c gdb-6.8-1/gdb/p-lang.c +--- gdb-6.8-0/gdb/p-lang.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/p-lang.c 2008-08-23 22:30:33.000000000 +0200 @@ -427,6 +427,7 @@ const struct language_defn pascal_langua pascal_language_arch_info, default_print_array_index, @@ -1893,9 +2106,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/printcmd.c gdb-6.8cvs20080219/gdb/printcmd.c ---- gdb-6.8cvs20080219-fortranless/gdb/printcmd.c 2008-02-22 08:19:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/printcmd.c 2008-02-22 16:49:35.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/printcmd.c gdb-6.8-1/gdb/printcmd.c +--- gdb-6.8-0/gdb/printcmd.c 2008-08-23 22:29:55.000000000 +0200 ++++ gdb-6.8-1/gdb/printcmd.c 2008-08-23 22:30:33.000000000 +0200 @@ -888,6 +888,11 @@ print_command_1 (char *exp, int inspect, else val = access_value_history (0); @@ -1908,9 +2121,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr if (voidprint || (val && value_type (val) && TYPE_CODE (value_type (val)) != TYPE_CODE_VOID)) { -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/scm-lang.c gdb-6.8cvs20080219/gdb/scm-lang.c ---- gdb-6.8cvs20080219-fortranless/gdb/scm-lang.c 2008-02-14 23:04:00.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/scm-lang.c 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/scm-lang.c gdb-6.8-1/gdb/scm-lang.c +--- gdb-6.8-0/gdb/scm-lang.c 2008-02-05 23:17:40.000000000 +0100 ++++ gdb-6.8-1/gdb/scm-lang.c 2008-08-23 22:30:33.000000000 +0200 @@ -266,6 +266,7 @@ const struct language_defn scm_language_ c_language_arch_info, default_print_array_index, @@ -1919,10 +2132,10 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr LANG_MAGIC }; -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/testsuite/gdb.fortran/dynamic.exp gdb-6.8cvs20080219/gdb/testsuite/gdb.fortran/dynamic.exp ---- gdb-6.8cvs20080219-fortranless/gdb/testsuite/gdb.fortran/dynamic.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/testsuite/gdb.fortran/dynamic.exp 2008-02-22 16:59:42.000000000 +0100 -@@ -0,0 +1,145 @@ +diff -up -ruNp gdb-6.8-0/gdb/testsuite/gdb.fortran/dynamic.exp gdb-6.8-1/gdb/testsuite/gdb.fortran/dynamic.exp +--- gdb-6.8-0/gdb/testsuite/gdb.fortran/dynamic.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8-1/gdb/testsuite/gdb.fortran/dynamic.exp 2008-08-23 22:31:08.000000000 +0200 +@@ -0,0 +1,141 @@ +# Copyright 2007 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -1946,10 +2159,6 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +# It depends on the GCC dynamic Fortran arrays DWARF support: +# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244 + -+if $tracelevel then { -+ strace $tracelevel -+} -+ +set testfile "dynamic" +set srcfile ${testfile}.f90 +set binfile ${objdir}/${subdir}/${testfile} @@ -1980,7 +2189,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +gdb_breakpoint [gdb_get_line_number "varx-allocated"] +gdb_continue_to_breakpoint "varx-allocated" +# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...) -+gdb_test "ptype varx" "type = real\\*4 \\(6,5:15,17:28\\)" ++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" +# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. +gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" + @@ -2000,9 +2209,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" +# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. +gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" -+gdb_test "ptype varx" "type = real\\*4 \\(6,5:15,17:28\\)" ++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" +# Intel Fortran Compiler 10.1.008 uses the pointer type. -+gdb_test "ptype varv" "type = (PTR TO -> \\( )?real\\*4 \\(6,5:15,17:28\\)\\)?" ++gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" + +gdb_breakpoint [gdb_get_line_number "varv-filled"] +gdb_continue_to_breakpoint "varv-filled" @@ -2033,7 +2242,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + +gdb_breakpoint [gdb_get_line_number "vary-filled"] +gdb_continue_to_breakpoint "vary-filled" -+gdb_test "ptype vary" "type = real\\*4 \\(10,10\\)" ++gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)" +gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8" +gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9" +gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10" @@ -2042,7 +2251,7 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + +gdb_breakpoint [gdb_get_line_number "varw-almostfilled"] +gdb_continue_to_breakpoint "varw-almostfilled" -+gdb_test "ptype varw" "type = real\\*4 \\(5,4,3\\)" ++gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)" +gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1" +# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...) +gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" @@ -2057,10 +2266,10 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +gdb_breakpoint [gdb_get_line_number "varz-almostfilled"] +gdb_continue_to_breakpoint "varz-almostfilled" +# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not. -+gdb_test "ptype varz" "type = (PTR TO -> \\( )?real\\*4 \\(\\*\\)\\)?" ++gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?" +# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7) +# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7. -+gdb_test "ptype vart" "type = (PTR TO -> \\( )?real\\*4 \\(2:11,7:\\*\\)\\)?" ++gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?" +gdb_test "p varz(3)" "\\$\[0-9\]* = 4" +# maps to foo::vary(1,1) +gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8" @@ -2068,9 +2277,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" +# maps to foo::vary(1,3) +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/testsuite/gdb.fortran/dynamic.f90 gdb-6.8cvs20080219/gdb/testsuite/gdb.fortran/dynamic.f90 ---- gdb-6.8cvs20080219-fortranless/gdb/testsuite/gdb.fortran/dynamic.f90 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/testsuite/gdb.fortran/dynamic.f90 2008-02-22 16:59:42.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/testsuite/gdb.fortran/dynamic.f90 gdb-6.8-1/gdb/testsuite/gdb.fortran/dynamic.f90 +--- gdb-6.8-0/gdb/testsuite/gdb.fortran/dynamic.f90 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8-1/gdb/testsuite/gdb.fortran/dynamic.f90 2008-08-23 22:30:33.000000000 +0200 @@ -0,0 +1,97 @@ +! Copyright 2007 Free Software Foundation, Inc. +! @@ -2169,9 +2378,113 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort + if (x (3, 1) .ne. 10) call abort +end -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/typeprint.c gdb-6.8cvs20080219/gdb/typeprint.c ---- gdb-6.8cvs20080219-fortranless/gdb/typeprint.c 2008-02-14 23:04:00.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/typeprint.c 2008-02-22 16:49:35.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/testsuite/gdb.fortran/string.exp gdb-6.8-1/gdb/testsuite/gdb.fortran/string.exp +--- gdb-6.8-0/gdb/testsuite/gdb.fortran/string.exp 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8-1/gdb/testsuite/gdb.fortran/string.exp 2008-08-23 22:31:08.000000000 +0200 +@@ -0,0 +1,59 @@ ++# Copyright 2008 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 2 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, write to the Free Software ++# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++ ++# This file was written by Jan Kratochvil . ++ ++# This file is part of the gdb testsuite. It contains tests for Fortran ++# strings with dynamic length. ++ ++set testfile "string" ++set srcfile ${testfile}.f90 ++set binfile ${objdir}/${subdir}/${testfile} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f77 quiet}] != "" } { ++ untested "Couldn't compile ${srcfile}" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_breakpoint [gdb_get_line_number "var-init"] ++gdb_continue_to_breakpoint "var-init" ++gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)" ++gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)" ++gdb_test "ptype e" "type = REF TO -> \\( character(\\(kind=4\\)|\\*4) \\)" ++gdb_test "ptype f" "type = PTR TO -> \\( character(\\(kind=4\\)|\\*4) \\(7,8:10\\)\\)" ++gdb_test "ptype *e" "type = character(\\(kind=4\\)|\\*4)" ++gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)" ++gdb_test "p c" "\\$\[0-9\]* = 'c'" ++gdb_test "p d" "\\$\[0-9\]* = 'd '" ++gdb_test "p e" "\\$\[0-9\]* = \\(REF TO -> \\( character(\\(kind=4\\)|\\*4) \\)\\) @0x\[0-9a-f\]+: 'g '" ++gdb_test "p f" "\\$\[0-9\]* = \\(PTR TO -> \\( character(\\(kind=4\\)|\\*4) \\(7,8:10\\)\\)\\) 0x\[0-9a-f\]+" ++gdb_test "p *e" "Attempt to take contents of a non-pointer value." ++gdb_test "p *f" "\\$\[0-9\]* = \\(\\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\)" ++ ++gdb_breakpoint [gdb_get_line_number "var-finish"] ++gdb_continue_to_breakpoint "var-finish" ++gdb_test "p e" "\\$\[0-9\]* = \\(REF TO -> \\( character(\\(kind=4\\)|\\*4) \\)\\) @0x\[0-9a-f\]+: 'e '" "p e re-set" ++gdb_test "p *f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set" +diff -up -ruNp gdb-6.8-0/gdb/testsuite/gdb.fortran/string.f90 gdb-6.8-1/gdb/testsuite/gdb.fortran/string.f90 +--- gdb-6.8-0/gdb/testsuite/gdb.fortran/string.f90 1970-01-01 01:00:00.000000000 +0100 ++++ gdb-6.8-1/gdb/testsuite/gdb.fortran/string.f90 2008-08-23 22:31:08.000000000 +0200 +@@ -0,0 +1,37 @@ ++! Copyright 2008 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 2 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, write to the Free Software ++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++subroutine foo (e, f) ++ character (len=1) :: c ++ character (len=8) :: d ++ character (len=*) :: e ++ character (len=*) :: f (1:7, 8:10) ++ c = 'c' ++ d = 'd' ++ e = 'e' ! var-init ++ f = 'f' ++ f(1,9) = 'f2' ++ c = 'c' ! var-finish ++end subroutine foo ++ character (len=4) :: g, h (1:7, 8:10) ++ g = 'g' ++ h = 'h' ++ call foo (g, h) ++end +diff -up -ruNp gdb-6.8-0/gdb/typeprint.c gdb-6.8-1/gdb/typeprint.c +--- gdb-6.8-0/gdb/typeprint.c 2008-02-03 02:02:47.000000000 +0100 ++++ gdb-6.8-1/gdb/typeprint.c 2008-08-23 22:30:33.000000000 +0200 @@ -33,6 +33,7 @@ #include "cp-abi.h" #include "typeprint.h" @@ -2188,9 +2501,9 @@ diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortr if (objectprint) { -diff -u -X /home/jkratoch/.diffi.list -ruNp -x Makefile gdb-6.8cvs20080219-fortranless/gdb/valops.c gdb-6.8cvs20080219/gdb/valops.c ---- gdb-6.8cvs20080219-fortranless/gdb/valops.c 2008-02-22 08:19:37.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/valops.c 2008-02-22 16:47:53.000000000 +0100 +diff -up -ruNp gdb-6.8-0/gdb/valops.c gdb-6.8-1/gdb/valops.c +--- gdb-6.8-0/gdb/valops.c 2008-08-23 22:29:56.000000000 +0200 ++++ gdb-6.8-1/gdb/valops.c 2008-08-23 22:30:33.000000000 +0200 @@ -571,12 +571,21 @@ value_at_lazy (struct type *type, CORE_A int value_fetch_lazy (struct value *val) diff --git a/gdb.spec b/gdb.spec index e317a4e..1b02c2a 100644 --- a/gdb.spec +++ b/gdb.spec @@ -13,7 +13,7 @@ Version: 6.8 # 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: 20%{?_with_upstream:.upstream}%{?dist} +Release: 21%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -843,6 +843,10 @@ fi %endif %changelog +* Sat Aug 23 2008 Jan Kratochvil - 6.8-21 +- Fix MI debuginfo print on reloaded exec, found by Denys Vlasenko (BZ 459414). +- Extend the Fortran dynamic variables patch also for dynamic Fortran strings. + * Wed Aug 13 2008 Jan Kratochvil - 6.8-20 - Temporarily disable attaching to a stopped process (BZ 453688) - To be reintroduced after a fix of the kernel BZ 454404.