diff --git a/.gitignore b/.gitignore index 0e177ad..5d4f4b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /gdb-libstdc++-v3-python-r155978.tar.bz2 -/gdb-7.5.1.tar.bz2 +/gdb-7.5.50.20130118.tar.bz2 diff --git a/gdb-6.3-bz231832-obstack-2gb.patch b/gdb-6.3-bz231832-obstack-2gb.patch index 0b08cee..44971ae 100644 --- a/gdb-6.3-bz231832-obstack-2gb.patch +++ b/gdb-6.3-bz231832-obstack-2gb.patch @@ -1,25 +1,29 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832 -Index: gdb-7.4.50.20111218/gdb/symmisc.c +Index: gdb-7.5.50.20130118/gdb/symmisc.c =================================================================== ---- gdb-7.4.50.20111218.orig/gdb/symmisc.c 2011-04-04 17:19:59.000000000 +0200 -+++ gdb-7.4.50.20111218/gdb/symmisc.c 2011-12-19 00:28:18.189232014 +0100 -@@ -147,8 +147,8 @@ print_objfile_statistics (void) +--- gdb-7.5.50.20130118.orig/gdb/symmisc.c 2013-01-18 23:54:57.478974289 +0100 ++++ gdb-7.5.50.20130118/gdb/symmisc.c 2013-01-18 23:55:41.650930254 +0100 +@@ -148,10 +148,10 @@ print_objfile_statistics (void) if (OBJSTAT (objfile, sz_strtab) > 0) printf_filtered (_(" Space used by a.out string tables: %d\n"), OBJSTAT (objfile, sz_strtab)); - printf_filtered (_(" Total memory used for objfile obstack: %d\n"), - obstack_memory_used (&objfile->objfile_obstack)); +- printf_filtered (_(" Total memory used for BFD obstack: %d\n"), +- obstack_memory_used (&objfile->per_bfd->storage_obstack)); + printf_filtered (_(" Total memory used for objfile obstack: %ld\n"), + (long) obstack_memory_used (&objfile->objfile_obstack)); ++ printf_filtered (_(" Total memory used for BFD obstack: %ld\n"), ++ (long) obstack_memory_used (&objfile->per_bfd->storage_obstack)); printf_filtered (_(" Total memory used for psymbol cache: %d\n"), bcache_memory_used (psymbol_bcache_get_bcache (objfile->psymbol_cache))); -Index: gdb-7.4.50.20111218/include/obstack.h +Index: gdb-7.5.50.20130118/include/obstack.h =================================================================== ---- gdb-7.4.50.20111218.orig/include/obstack.h 2011-10-22 03:35:29.000000000 +0200 -+++ gdb-7.4.50.20111218/include/obstack.h 2011-12-19 00:28:18.189232014 +0100 +--- gdb-7.5.50.20130118.orig/include/obstack.h 2013-01-18 23:54:57.478974289 +0100 ++++ gdb-7.5.50.20130118/include/obstack.h 2013-01-18 23:55:10.256999188 +0100 @@ -188,31 +188,31 @@ struct obstack /* control current objec /* Declare the external functions we use; they are in obstack.c. */ @@ -125,10 +129,10 @@ Index: gdb-7.4.50.20111218/include/obstack.h if (__o->chunk_limit - __o->next_free < __len) \ _obstack_newchunk (__o, __len); \ obstack_blank_fast (__o, __len); \ -Index: gdb-7.4.50.20111218/libiberty/obstack.c +Index: gdb-7.5.50.20130118/libiberty/obstack.c =================================================================== ---- gdb-7.4.50.20111218.orig/libiberty/obstack.c 2005-05-10 17:33:33.000000000 +0200 -+++ gdb-7.4.50.20111218/libiberty/obstack.c 2011-12-19 00:28:18.191232006 +0100 +--- gdb-7.5.50.20130118.orig/libiberty/obstack.c 2013-01-18 23:54:57.478974289 +0100 ++++ gdb-7.5.50.20130118/libiberty/obstack.c 2013-01-18 23:55:10.256999188 +0100 @@ -44,9 +44,11 @@ #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 #include diff --git a/gdb-6.3-ia64-gcore-page0-20050421.patch b/gdb-6.3-ia64-gcore-page0-20050421.patch index ecdfbae..c2c0026 100644 --- a/gdb-6.3-ia64-gcore-page0-20050421.patch +++ b/gdb-6.3-ia64-gcore-page0-20050421.patch @@ -1,8 +1,8 @@ -Index: gdb-7.2.50.20110107/gdb/gcore.c +Index: gdb-7.5.50.20130118/gdb/gcore.c =================================================================== ---- gdb-7.2.50.20110107.orig/gdb/gcore.c 2011-01-05 23:22:49.000000000 +0100 -+++ gdb-7.2.50.20110107/gdb/gcore.c 2011-01-07 09:04:28.000000000 +0100 -@@ -534,8 +534,14 @@ gcore_copy_callback (bfd *obfd, asection +--- gdb-7.5.50.20130118.orig/gdb/gcore.c 2013-01-18 23:50:56.698573186 +0100 ++++ gdb-7.5.50.20130118/gdb/gcore.c 2013-01-18 23:52:29.636705040 +0100 +@@ -549,8 +549,14 @@ gcore_copy_callback (bfd *obfd, asection if (size > total_size) size = total_size; @@ -12,7 +12,7 @@ Index: gdb-7.2.50.20110107/gdb/gcore.c if (target_read_memory (bfd_section_vma (obfd, osec) + offset, - memhunk, size) != 0) + memhunk, size) != 0 -+ && (strcmp (gdbarch_bfd_arch_info (target_gdbarch)->arch_name, ++ && (strcmp (gdbarch_bfd_arch_info (target_gdbarch ())->arch_name, + "ia64") + || bfd_section_vma (obfd, osec) != 0)) { diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index 7728070..314be44 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -11,11 +11,11 @@ * gdb.texinfo (File Options): Document --readnever. -Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo +Index: gdb-7.5.50.20130118/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/doc/gdb.texinfo 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/doc/gdb.texinfo 2012-07-03 17:31:40.695642449 +0200 -@@ -1023,6 +1023,12 @@ Read each symbol file's entire symbol ta +--- gdb-7.5.50.20130118.orig/gdb/doc/gdb.texinfo 2013-01-18 22:54:22.521155527 +0100 ++++ gdb-7.5.50.20130118/gdb/doc/gdb.texinfo 2013-01-18 22:58:15.064596580 +0100 +@@ -1026,6 +1026,12 @@ Read each symbol file's entire symbol ta the default, which is to read it incrementally as it is needed. This makes startup slower, but makes future operations faster. @@ -28,11 +28,11 @@ Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo @end table @node Mode Options -Index: gdb-7.4.50.20120703/gdb/main.c +Index: gdb-7.5.50.20130118/gdb/main.c =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/main.c 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/main.c 2012-07-03 17:31:40.696642448 +0200 -@@ -414,6 +414,7 @@ captured_main (void *data) +--- gdb-7.5.50.20130118.orig/gdb/main.c 2013-01-18 22:54:22.523155531 +0100 ++++ gdb-7.5.50.20130118/gdb/main.c 2013-01-18 22:58:15.065596598 +0100 +@@ -445,6 +445,7 @@ captured_main (void *data) {"xdb", no_argument, &xdb_commands, 1}, {"dbx", no_argument, &dbx_commands, 1}, {"readnow", no_argument, &readnow_symbol_files, 1}, @@ -40,7 +40,7 @@ Index: gdb-7.4.50.20120703/gdb/main.c {"r", no_argument, &readnow_symbol_files, 1}, {"quiet", no_argument, &quiet, 1}, {"q", no_argument, &quiet, 1}, -@@ -1131,6 +1132,7 @@ Options:\n\n\ +@@ -1164,6 +1165,7 @@ Options:\n\n\ fputs_unfiltered (_("\ --quiet Do not print version number on startup.\n\ --readnow Fully read symbol files on first access.\n\ @@ -48,31 +48,31 @@ Index: gdb-7.4.50.20120703/gdb/main.c "), stream); fputs_unfiltered (_("\ --se=FILE Use FILE as symbol file and executable file.\n\ -Index: gdb-7.4.50.20120703/gdb/symfile.c +Index: gdb-7.5.50.20130118/gdb/symfile.c =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/symfile.c 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/symfile.c 2012-07-03 17:31:40.697642447 +0200 +--- gdb-7.5.50.20130118.orig/gdb/symfile.c 2013-01-18 22:58:15.065596598 +0100 ++++ gdb-7.5.50.20130118/gdb/symfile.c 2013-01-18 22:58:31.249619597 +0100 @@ -81,6 +81,7 @@ static void clear_symtab_users_cleanup ( /* Global variables owned by this file. */ int readnow_symbol_files; /* Read full symbols immediately. */ +int readnever_symbol_files; /* Never read full symbols. */ - /* External variables and functions referenced. */ + /* Functions this file defines. */ -Index: gdb-7.4.50.20120703/gdb/dwarf2read.c +Index: gdb-7.5.50.20130118/gdb/dwarf2read.c =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/dwarf2read.c 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/dwarf2read.c 2012-07-03 17:31:53.421627153 +0200 -@@ -65,6 +65,7 @@ - #include "gdb/gdb-index.h" +--- gdb-7.5.50.20130118.orig/gdb/dwarf2read.c 2013-01-18 22:54:22.528155545 +0100 ++++ gdb-7.5.50.20130118/gdb/dwarf2read.c 2013-01-18 22:59:08.940674035 +0100 +@@ -67,6 +67,7 @@ #include #include "gdb_bfd.h" + #include "f-lang.h" +#include "top.h" #include #include "gdb_string.h" -@@ -1587,8 +1588,9 @@ dwarf2_has_info (struct objfile *objfile +@@ -1782,8 +1783,9 @@ dwarf2_has_info (struct objfile *objfile (void *) names); dwarf2_per_objfile->objfile = objfile; } @@ -84,11 +84,11 @@ Index: gdb-7.4.50.20120703/gdb/dwarf2read.c } /* When loading sections, we look either for uncompressed section or for -Index: gdb-7.4.50.20120703/gdb/top.h +Index: gdb-7.5.50.20130118/gdb/top.h =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/top.h 2012-01-23 18:12:30.000000000 +0100 -+++ gdb-7.4.50.20120703/gdb/top.h 2012-07-03 17:31:40.700642444 +0200 -@@ -60,6 +60,7 @@ extern void set_prompt (const char *s); +--- gdb-7.5.50.20130118.orig/gdb/top.h 2013-01-18 22:54:22.528155545 +0100 ++++ gdb-7.5.50.20130118/gdb/top.h 2013-01-18 22:58:15.069596657 +0100 +@@ -58,6 +58,7 @@ extern void set_prompt (const char *s); /* From random places. */ extern int readnow_symbol_files; diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch index 082b9a0..6839678 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -1,11 +1,11 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 -Index: gdb-7.2.50.20110117/gdb/symtab.c +Index: gdb-7.5.50.20130118/gdb/symtab.c =================================================================== ---- gdb-7.2.50.20110117.orig/gdb/symtab.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/symtab.c 2011-01-17 15:51:48.000000000 +0100 -@@ -2015,6 +2015,13 @@ find_pc_sect_line (CORE_ADDR pc, struct +--- gdb-7.5.50.20130118.orig/gdb/symtab.c 2013-01-18 23:53:22.009797788 +0100 ++++ gdb-7.5.50.20130118/gdb/symtab.c 2013-01-18 23:53:51.044846777 +0100 +@@ -2356,6 +2356,13 @@ find_pc_sect_line (CORE_ADDR pc, struct SYMBOL_LINKAGE_NAME (msymbol)); */ ; /* fall through */ @@ -14,7 +14,7 @@ Index: gdb-7.2.50.20110117/gdb/symtab.c + Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop. + Red Hat Bug 218379. */ + else if (SYMBOL_VALUE (mfunsym) == pc) -+ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", SYMBOL_LINKAGE_NAME (msymbol), paddress (target_gdbarch, pc)); ++ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", SYMBOL_LINKAGE_NAME (msymbol), paddress (target_gdbarch (), pc)); + /* fall through */ else return find_pc_line (SYMBOL_VALUE_ADDRESS (mfunsym), 0); diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch index bfc8e96..1132449 100644 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ b/gdb-6.6-scheduler_locking-step-is-default.patch @@ -1,8 +1,8 @@ -Index: gdb-7.4.50.20120703/gdb/infrun.c +Index: gdb-7.5.50.20130118/gdb/infrun.c =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/infrun.c 2012-07-03 20:26:25.060940765 +0200 -+++ gdb-7.4.50.20120703/gdb/infrun.c 2012-07-03 20:26:32.808929860 +0200 -@@ -1591,7 +1591,7 @@ static const char *const scheduler_enums +--- gdb-7.5.50.20130118.orig/gdb/infrun.c 2013-01-19 20:56:34.142917416 +0100 ++++ gdb-7.5.50.20130118/gdb/infrun.c 2013-01-19 20:56:34.662918474 +0100 +@@ -1628,7 +1628,7 @@ static const char *const scheduler_enums schedlock_step, NULL }; @@ -11,11 +11,46 @@ Index: gdb-7.4.50.20120703/gdb/infrun.c static void show_scheduler_mode (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.mi/mi-cli.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:25.060940765 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:32.809929858 +0200 -@@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2013-01-01 07:41:24.000000000 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.mi/mi-cli.exp 2013-01-19 20:56:34.662918474 +0100 +@@ -163,7 +163,7 @@ mi_execute_to "exec-continue" "breakpoin + # Test that the token is output even for CLI commands + # Also test that *stopped includes frame information. + mi_gdb_test "34 next" \ +- ".*34\\\^running.*\\*running,thread-id=\"all\"" \ ++ ".*34\\\^running.*\\*running,thread-id=\"1\"" \ + "34 next: run" + + if {!$async} { +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.mi/mi-logging.exp +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2013-01-01 07:41:24.000000000 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.mi/mi-logging.exp 2013-01-19 20:56:34.662918474 +0100 +@@ -53,7 +53,7 @@ close $chan + + set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+" + +-if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { ++if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { + pass "Log file contents" + } else { + fail "Log file contents" +@@ -76,7 +76,7 @@ set chan [open $milogfile] + set logcontent [read $chan] + close $chan + +-if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { ++if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { + pass "Redirect log file contents" + } else { + fail "Redirect log file contents" +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.mi/mi-console.exp +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.mi/mi-console.exp 2013-01-01 07:41:24.000000000 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.mi/mi-console.exp 2013-01-19 20:56:55.783961145 +0100 +@@ -45,6 +45,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ mi_run_to_main @@ -25,52 +60,3 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp # Next over the hello() call which will produce lots of output mi_gdb_test "220-exec-next" \ "220\\^running(\r\n\\*running,thread-id=\"all\")?" \ -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp -=================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:25.060940765 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:32.809929858 +0200 -@@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ - - mi_run_to_main - -+# thread-id=\"all\" vs. thread-id=\"1\" below: -+mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off" -+ - # Next over the hello() call which will produce lots of output - mi_gdb_test "220-exec-next" "220\\^running(\r\n)?(\\*running,thread-id=\"all\")?" \ - "Started step over hello" -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp -=================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:25.060940765 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:32.810929856 +0200 -@@ -175,7 +175,7 @@ mi_execute_to "exec-continue" "breakpoin - # Test that the token is output even for CLI commands - # Also test that *stopped includes frame information. - mi_gdb_test "34 next" \ -- ".*34\\\^running.*\\*running,thread-id=\"all\"" \ -+ ".*34\\\^running.*\\*running,thread-id=\"1\"" \ - "34 next: run" - - if {!$async} { -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp -=================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2012-06-29 00:11:23.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp 2012-07-03 20:29:03.573717651 +0200 -@@ -56,7 +56,7 @@ close $chan - - set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+" - --if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { -+if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { - pass "Log file contents" - } else { - fail "Log file contents" -@@ -79,7 +79,7 @@ set chan [open $milogfile] - set logcontent [read $chan] - close $chan - --if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { -+if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] { - pass "Redirect log file contents" - } else { - fail "Redirect log file contents" diff --git a/gdb-6.8-bz254229-gcore-prpsinfo.patch b/gdb-6.8-bz254229-gcore-prpsinfo.patch index 51071f4..037556f 100644 --- a/gdb-6.8-bz254229-gcore-prpsinfo.patch +++ b/gdb-6.8-bz254229-gcore-prpsinfo.patch @@ -1,8 +1,8 @@ -Index: gdb-7.4.50.20120602/bfd/elf-bfd.h +Index: gdb-7.5.50.20130118/bfd/elf-bfd.h =================================================================== ---- gdb-7.4.50.20120602.orig/bfd/elf-bfd.h 2012-06-02 21:26:09.928717069 +0200 -+++ gdb-7.4.50.20120602/bfd/elf-bfd.h 2012-06-02 21:27:21.727689625 +0200 -@@ -2221,8 +2221,10 @@ extern Elf_Internal_Phdr * _bfd_elf_find +--- gdb-7.5.50.20130118.orig/bfd/elf-bfd.h 2013-01-18 23:02:54.809004473 +0100 ++++ gdb-7.5.50.20130118/bfd/elf-bfd.h 2013-01-18 23:02:59.316010755 +0100 +@@ -2242,8 +2242,10 @@ extern Elf_Internal_Phdr * _bfd_elf_find /* Exported interface for writing elf corefile notes. */ extern char *elfcore_write_note (bfd *, char *, int *, const char *, int, const void *, int); @@ -14,11 +14,11 @@ Index: gdb-7.4.50.20120602/bfd/elf-bfd.h extern char *elfcore_write_prstatus (bfd *, char *, int *, long, int, const void *); extern char * elfcore_write_pstatus -Index: gdb-7.4.50.20120602/bfd/elf.c +Index: gdb-7.5.50.20130118/bfd/elf.c =================================================================== ---- gdb-7.4.50.20120602.orig/bfd/elf.c 2012-06-02 21:26:09.928717069 +0200 -+++ gdb-7.4.50.20120602/bfd/elf.c 2012-06-02 21:27:21.732689623 +0200 -@@ -8917,56 +8917,61 @@ char * +--- gdb-7.5.50.20130118.orig/bfd/elf.c 2013-01-18 23:02:54.812004479 +0100 ++++ gdb-7.5.50.20130118/bfd/elf.c 2013-01-18 23:02:59.319010836 +0100 +@@ -9103,56 +9103,61 @@ char * elfcore_write_prpsinfo (bfd *abfd, char *buf, int *bufsiz, @@ -103,11 +103,11 @@ Index: gdb-7.4.50.20120602/bfd/elf.c free (buf); return NULL; -Index: gdb-7.4.50.20120602/gdb/procfs.c +Index: gdb-7.5.50.20130118/gdb/procfs.c =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/procfs.c 2012-06-02 21:26:09.928717069 +0200 -+++ gdb-7.4.50.20120602/gdb/procfs.c 2012-06-02 21:27:21.745689618 +0200 -@@ -5541,6 +5541,7 @@ procfs_make_note_section (bfd *obfd, int +--- gdb-7.5.50.20130118.orig/gdb/procfs.c 2013-01-18 23:02:54.815004487 +0100 ++++ gdb-7.5.50.20130118/gdb/procfs.c 2013-01-18 23:02:59.320010861 +0100 +@@ -5502,6 +5502,7 @@ procfs_make_note_section (bfd *obfd, int note_data = (char *) elfcore_write_prpsinfo (obfd, note_data, note_size, @@ -115,19 +115,19 @@ Index: gdb-7.4.50.20120602/gdb/procfs.c fname, psargs); -Index: gdb-7.4.50.20120602/gdb/linux-tdep.c +Index: gdb-7.5.50.20130118/gdb/linux-tdep.c =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/linux-tdep.c 2012-06-02 21:26:09.928717069 +0200 -+++ gdb-7.4.50.20120602/gdb/linux-tdep.c 2012-06-02 21:31:12.051601510 +0200 -@@ -30,6 +30,7 @@ - #include "elf-bfd.h" /* for elfcore_write_* */ - #include "inferior.h" +--- gdb-7.5.50.20130118.orig/gdb/linux-tdep.c 2013-01-18 23:02:54.816004489 +0100 ++++ gdb-7.5.50.20130118/gdb/linux-tdep.c 2013-01-18 23:03:10.727027317 +0100 +@@ -32,6 +32,7 @@ #include "cli/cli-utils.h" + #include "arch-utils.h" + #include "gdb_obstack.h" +#include #include -@@ -769,6 +770,131 @@ linux_corefile_thread_callback (struct t +@@ -1153,6 +1154,131 @@ linux_corefile_thread_callback (struct t return !args->note_data; } @@ -259,7 +259,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-tdep.c /* Fills the "to_make_corefile_note" target vector. Builds the note section for a corefile, and returns it in a malloc buffer. */ -@@ -784,16 +910,9 @@ linux_make_corefile_notes (struct gdbarc +@@ -1168,16 +1294,9 @@ linux_make_corefile_notes (struct gdbarc /* Process information. */ if (get_exec_file (0)) { diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch deleted file mode 100644 index d71557f..0000000 --- a/gdb-6.8-quit-never-aborts.patch +++ /dev/null @@ -1,72 +0,0 @@ -We may abort the process of detaching threads with multiple SIGINTs - which are -being sent during a testcase terminating its child GDB. - -Some of the threads may not be properly PTRACE_DETACHed which hurts if they -should have been detached with SIGSTOP (as they are accidentally left running -on the debugger termination). - -Index: gdb-7.2.50.20110117/gdb/defs.h -=================================================================== ---- gdb-7.2.50.20110117.orig/gdb/defs.h 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/defs.h 2011-01-17 15:53:05.000000000 +0100 -@@ -165,6 +165,7 @@ extern char *python_libdir; - extern char *debug_file_directory; - - extern int quit_flag; -+extern int quit_flag_cleanup; - extern int immediate_quit; - extern int sevenbit_strings; - -@@ -178,7 +179,7 @@ extern void quit (void); - needed. */ - - #define QUIT { \ -- if (quit_flag) quit (); \ -+ if (quit_flag && !quit_flag_cleanup) quit (); \ - if (deprecated_interactive_hook) deprecated_interactive_hook (); \ - } - -Index: gdb-7.2.50.20110117/gdb/event-top.c -=================================================================== ---- gdb-7.2.50.20110117.orig/gdb/event-top.c 2011-01-17 15:52:39.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/event-top.c 2011-01-17 15:52:49.000000000 +0100 -@@ -904,7 +904,7 @@ async_request_quit (gdb_client_data arg) - is no reason to call quit again here, unless immediate_quit is - set. */ - -- if (quit_flag || immediate_quit) -+ if ((quit_flag || immediate_quit) && !quit_flag_cleanup) - quit (); - } - -Index: gdb-7.2.50.20110117/gdb/top.c -=================================================================== ---- gdb-7.2.50.20110117.orig/gdb/top.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/top.c 2011-01-17 15:52:49.000000000 +0100 -@@ -1257,7 +1257,9 @@ quit_force (char *args, int from_tty) - qt.args = args; - qt.from_tty = from_tty; - -- /* We want to handle any quit errors and exit regardless. */ -+ /* We want to handle any quit errors and exit regardless but we should never -+ get user-interrupted to properly detach the inferior. */ -+ quit_flag_cleanup = 1; - catch_errors (quit_target, &qt, - "Quitting: ", RETURN_MASK_ALL); - -Index: gdb-7.2.50.20110117/gdb/utils.c -=================================================================== ---- gdb-7.2.50.20110117.orig/gdb/utils.c 2011-01-17 15:47:37.000000000 +0100 -+++ gdb-7.2.50.20110117/gdb/utils.c 2011-01-17 15:52:49.000000000 +0100 -@@ -121,6 +121,11 @@ int job_control; - - int quit_flag; - -+/* Nonzero means we are already processing the quitting cleanups and we should -+ no longer get aborted. */ -+ -+int quit_flag_cleanup; -+ - /* Nonzero means quit immediately if Control-C is typed now, rather - than waiting until QUIT is executed. Be careful in setting this; - code which executes with immediate_quit set has to be very careful diff --git a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch index becf80e..d53ef03 100644 --- a/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +++ b/gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch @@ -1,8 +1,8 @@ -Index: gdb-7.4.50.20120703/gdb/gdb_bfd.c +Index: gdb-7.5.50.20130118/gdb/gdb_bfd.c =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/gdb_bfd.c 2012-07-03 17:30:07.356754655 +0200 -+++ gdb-7.4.50.20120703/gdb/gdb_bfd.c 2012-07-03 17:43:52.565762454 +0200 -@@ -26,12 +26,14 @@ +--- gdb-7.5.50.20130118.orig/gdb/gdb_bfd.c 2013-01-18 23:11:18.158718709 +0100 ++++ gdb-7.5.50.20130118/gdb/gdb_bfd.c 2013-01-18 23:12:06.841787893 +0100 +@@ -27,12 +27,14 @@ #ifdef HAVE_ZLIB_H #include #endif @@ -17,7 +17,7 @@ Index: gdb-7.4.50.20120703/gdb/gdb_bfd.c /* An object of this type is stored in the section's user data when mapping a section. */ -@@ -181,6 +183,7 @@ free_one_bfd_section (bfd *abfd, asectio +@@ -205,6 +207,7 @@ free_one_bfd_section (bfd *abfd, asectio if (sect != NULL && sect->data != NULL) { @@ -25,7 +25,7 @@ Index: gdb-7.4.50.20120703/gdb/gdb_bfd.c #ifdef HAVE_MMAP if (sect->map_addr != NULL) { -@@ -191,6 +194,7 @@ free_one_bfd_section (bfd *abfd, asectio +@@ -215,6 +218,7 @@ free_one_bfd_section (bfd *abfd, asectio } else #endif @@ -33,19 +33,19 @@ Index: gdb-7.4.50.20120703/gdb/gdb_bfd.c xfree (sect->data); } } -@@ -425,6 +429,7 @@ gdb_bfd_map_section (asection *sectp, bf - } - } +@@ -360,6 +364,7 @@ gdb_bfd_map_section (asection *sectp, bf + if (descriptor->data != NULL) + goto done; +#ifndef __sparc__ #ifdef HAVE_MMAP - { - /* The page size, used when mmapping. */ -@@ -458,6 +463,7 @@ gdb_bfd_map_section (asection *sectp, bf - } - } + if (!bfd_is_section_compressed (abfd, sectp)) + { +@@ -394,6 +399,7 @@ gdb_bfd_map_section (asection *sectp, bf + } + } #endif /* HAVE_MMAP */ +#endif - /* If we get here, we are a normal, not-compressed section. */ - + /* Handle compressed sections, or ordinary uncompressed sections in + the no-mmap case. */ diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 41b9b46..e6ad356 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -1,9 +1,9 @@ -Index: gdb-7.4.50.20120602/gdb/breakpoint.c +Index: gdb-7.5.50.20130118/gdb/breakpoint.c =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/breakpoint.c 2012-06-02 19:11:54.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/breakpoint.c 2012-06-02 19:52:58.161226506 +0200 -@@ -15495,6 +15495,50 @@ initialize_breakpoint_ops (void) - } +--- gdb-7.5.50.20130118.orig/gdb/breakpoint.c 2013-01-18 23:09:53.727597584 +0100 ++++ gdb-7.5.50.20130118/gdb/breakpoint.c 2013-01-18 23:10:20.158635065 +0100 +@@ -15993,6 +15993,50 @@ initialize_breakpoint_ops (void) + static struct cmd_list_element *enablebreaklist = NULL; void +breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta) @@ -53,11 +53,11 @@ Index: gdb-7.4.50.20120602/gdb/breakpoint.c _initialize_breakpoint (void) { struct cmd_list_element *c; -Index: gdb-7.4.50.20120602/gdb/breakpoint.h +Index: gdb-7.5.50.20130118/gdb/breakpoint.h =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/breakpoint.h 2012-05-16 16:35:03.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/breakpoint.h 2012-06-02 19:53:09.268223263 +0200 -@@ -1503,4 +1503,7 @@ extern struct gdbarch *get_sal_arch (str +--- gdb-7.5.50.20130118.orig/gdb/breakpoint.h 2013-01-18 23:09:51.671594585 +0100 ++++ gdb-7.5.50.20130118/gdb/breakpoint.h 2013-01-18 23:09:53.728597586 +0100 +@@ -1550,4 +1550,7 @@ extern struct gdbarch *get_sal_arch (str extern void handle_solib_event (void); @@ -65,11 +65,11 @@ Index: gdb-7.4.50.20120602/gdb/breakpoint.h + struct section_offsets *delta); + #endif /* !defined (BREAKPOINT_H) */ -Index: gdb-7.4.50.20120602/gdb/objfiles.c +Index: gdb-7.5.50.20130118/gdb/objfiles.c =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/objfiles.c 2012-05-10 21:50:08.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/objfiles.c 2012-06-02 19:52:58.202226502 +0200 -@@ -802,6 +802,11 @@ objfile_relocate1 (struct objfile *objfi +--- gdb-7.5.50.20130118.orig/gdb/objfiles.c 2013-01-18 23:09:51.671594585 +0100 ++++ gdb-7.5.50.20130118/gdb/objfiles.c 2013-01-18 23:09:53.729597588 +0100 +@@ -826,6 +826,11 @@ objfile_relocate1 (struct objfile *objfi objfile->sf->sym_probe_fns->sym_relocate_probe (objfile, new_offsets, delta); diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index f811964..d099b5b 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -1,61 +1,8 @@ -Index: gdb-7.4.50.20120602/gdb/dwarf2read.c +Index: gdb-7.5.50.20130118/gdb/gdbtypes.h =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/dwarf2read.c 2012-06-02 19:14:38.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/dwarf2read.c 2012-06-02 19:51:29.977252338 +0200 -@@ -9746,7 +9746,12 @@ read_common_block (struct die_info *die, - { - struct attribute *attr; - struct symbol *sym; -- CORE_ADDR base = (CORE_ADDR) 0; -+ struct objfile *objfile = cu->objfile; -+ CORE_ADDR baseaddr = ANOFFSET (objfile->section_offsets, -+ SECT_OFF_TEXT (objfile)); -+ /* This is used only for DW_AT_data_member_location entries. */ -+ CORE_ADDR base = 0; -+ int base_p = 0; - - attr = dwarf2_attr (die, DW_AT_location, cu); - if (attr) -@@ -9755,6 +9760,7 @@ read_common_block (struct die_info *die, - if (attr_form_is_block (attr)) - { - base = decode_locdesc (DW_BLOCK (attr), cu); -+ base_p = 1; - } - else if (attr_form_is_section_offset (attr)) - { -@@ -9807,12 +9813,15 @@ read_common_block (struct die_info *die, - if (sym != NULL - && handle_data_member_location (child_die, cu, &offset)) - { -- SYMBOL_VALUE_ADDRESS (sym) = base + offset; -+ if (!base_p) -+ dwarf2_invalid_attrib_class_complaint -+ ("DW_AT_data_member_location", "common block member"); -+ SYMBOL_VALUE_ADDRESS (sym) = base + offset + baseaddr; - add_symbol_to_list (sym, &global_symbols); - } - - if (SYMBOL_CLASS (sym) == LOC_STATIC) -- SET_FIELD_PHYSADDR (*field, SYMBOL_VALUE_ADDRESS (sym)); -+ SET_FIELD_PHYSADDR (*field, SYMBOL_VALUE_ADDRESS (sym) - baseaddr); - else - SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym)); - FIELD_TYPE (*field) = SYMBOL_TYPE (sym); -@@ -9826,7 +9835,7 @@ read_common_block (struct die_info *die, - - sym = new_symbol (die, type, cu); - /* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */ -- SYMBOL_VALUE_ADDRESS (sym) = base; -+ SYMBOL_VALUE_ADDRESS (sym) = base + baseaddr; - - set_die_type (die, type, cu); - } -Index: gdb-7.4.50.20120602/gdb/gdbtypes.h -=================================================================== ---- gdb-7.4.50.20120602.orig/gdb/gdbtypes.h 2012-06-02 19:11:54.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/gdbtypes.h 2012-06-02 19:52:44.990230200 +0200 -@@ -401,6 +401,7 @@ enum field_loc_kind +--- gdb-7.5.50.20130118.orig/gdb/gdbtypes.h 2013-01-18 23:07:03.488358315 +0100 ++++ gdb-7.5.50.20130118/gdb/gdbtypes.h 2013-01-18 23:08:10.286451570 +0100 +@@ -420,6 +420,7 @@ enum field_loc_kind { FIELD_LOC_KIND_BITPOS, /* bitpos */ FIELD_LOC_KIND_ENUMVAL, /* enumval */ @@ -63,7 +10,7 @@ Index: gdb-7.4.50.20120602/gdb/gdbtypes.h FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSNAME, /* physname */ FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ -@@ -595,6 +596,7 @@ struct main_type +@@ -614,6 +615,7 @@ struct main_type is the location (in the target) of the static field. Otherwise, physname is the mangled label of the static field. */ @@ -71,7 +18,7 @@ Index: gdb-7.4.50.20120602/gdb/gdbtypes.h CORE_ADDR physaddr; const char *physname; -@@ -1200,6 +1202,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1237,6 +1239,7 @@ extern void allocate_gnat_aux_type (stru #define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval) #define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) @@ -79,7 +26,7 @@ Index: gdb-7.4.50.20120602/gdb/gdbtypes.h #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ -@@ -1211,6 +1214,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1248,6 +1251,7 @@ extern void allocate_gnat_aux_type (stru #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -87,7 +34,7 @@ Index: gdb-7.4.50.20120602/gdb/gdbtypes.h #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -@@ -1227,6 +1231,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1264,6 +1268,7 @@ extern void allocate_gnat_aux_type (stru #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) @@ -95,11 +42,11 @@ Index: gdb-7.4.50.20120602/gdb/gdbtypes.h #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) -Index: gdb-7.4.50.20120602/gdb/jv-lang.c +Index: gdb-7.5.50.20130118/gdb/jv-lang.c =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/jv-lang.c 2012-05-10 21:59:12.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/jv-lang.c 2012-06-02 19:51:53.286245280 +0200 -@@ -431,7 +431,8 @@ java_link_class_type (struct gdbarch *gd +--- gdb-7.5.50.20130118.orig/gdb/jv-lang.c 2013-01-18 23:07:03.488358315 +0100 ++++ gdb-7.5.50.20130118/gdb/jv-lang.c 2013-01-18 23:08:10.286451570 +0100 +@@ -430,7 +430,8 @@ java_link_class_type (struct gdbarch *gd fields = NULL; nfields--; /* First set up dummy "class" field. */ @@ -109,7 +56,7 @@ Index: gdb-7.4.50.20120602/gdb/jv-lang.c TYPE_FIELD_NAME (type, nfields) = "class"; TYPE_FIELD_TYPE (type, nfields) = value_type (clas); SET_TYPE_FIELD_PRIVATE (type, nfields); -@@ -479,7 +480,8 @@ java_link_class_type (struct gdbarch *gd +@@ -478,7 +479,8 @@ java_link_class_type (struct gdbarch *gd SET_TYPE_FIELD_PROTECTED (type, i); } if (accflags & 0x0008) /* ACC_STATIC */ @@ -119,11 +66,11 @@ Index: gdb-7.4.50.20120602/gdb/jv-lang.c else SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset); if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */ -Index: gdb-7.4.50.20120602/gdb/value.c +Index: gdb-7.5.50.20130118/gdb/value.c =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/value.c 2012-06-02 19:11:55.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/value.c 2012-06-02 19:51:30.031252317 +0200 -@@ -2592,7 +2592,8 @@ value_static_field (struct type *type, i +--- gdb-7.5.50.20130118.orig/gdb/value.c 2013-01-18 23:07:03.490358319 +0100 ++++ gdb-7.5.50.20130118/gdb/value.c 2013-01-18 23:08:10.287451543 +0100 +@@ -2624,7 +2624,8 @@ value_static_field (struct type *type, i { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), diff --git a/gdb-archer.patch b/gdb-archer.patch index 80e3cf2..d04ac2e 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,46 +2,18 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 897686c0aedb7a6da59b823f22b1d24ec5a1d2ba +commit f1f762361e5e8a4fabdab16463ecb1fd9ba1e5e9 branch `archer' - the merge of branches: archer-jankratochvil-vla archer-tromey-python -archer-tromey-dwz-multifile-rebase (but from post-7.5 FSF GDB commits) diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index a41cff9..d7786a6 100644 +index 7305e6d..fff8cb2 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -704,7 +704,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \ - exceptions.c expprint.c \ - f-exp.y f-lang.c f-typeprint.c f-valprint.c filesystem.c \ - findcmd.c findvar.c frame.c frame-base.c frame-unwind.c \ -- gdbarch.c arch-utils.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \ -+ gdbarch.c arch-utils.c gdb_bfd.c gdbtypes.c gnu-v2-abi.c gnu-v3-abi.c \ - go-exp.y go-lang.c go-typeprint.c go-valprint.c \ - inf-loop.c \ - infcall.c \ -@@ -829,7 +829,7 @@ gnulib/import/extra/snippet/warn-on-use.h \ - gnulib/import/stddef.in.h gnulib/import/inttypes.in.h inline-frame.h skip.h \ - common/common-utils.h common/xml-utils.h common/buffer.h common/ptid.h \ - common/format.h \ --common/linux-osdata.h gdb-dlfcn.h auto-load.h probe.h stap-probe.h -+common/linux-osdata.h gdb-dlfcn.h auto-load.h probe.h stap-probe.h gdb_bfd.h - - # Header files that already have srcdir in them, or which are in objdir. - -@@ -879,7 +879,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \ - macrotab.o macrocmd.o macroexp.o macroscope.o \ - mi-common.o \ - event-loop.o event-top.o inf-loop.o completer.o \ -- gdbarch.o arch-utils.o gdbtypes.o osabi.o copying.o \ -+ gdbarch.o arch-utils.o gdbtypes.o gdb_bfd.o osabi.o copying.o \ - memattr.o mem-break.o target.o parse.o language.o buildsym.o \ - findcmd.o \ - std-regs.o \ -@@ -1307,6 +1307,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -1308,6 +1308,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -54,29 +26,11 @@ index a41cff9..d7786a6 100644 config.status: $(srcdir)/configure configure.tgt configure.host $(SHELL) config.status --recheck -diff --git a/gdb/NEWS b/gdb/NEWS -index b281824..4da886c 100644 ---- a/gdb/NEWS -+++ b/gdb/NEWS -@@ -1,6 +1,13 @@ - What has changed in GDB? - (Organized release by release) - -+*** Changes since GDB 7.5 -+ -+* New commands (for set/show, see "New options" below) -+ -+maint info bfds -+ List the BFDs known to GDB. -+ - *** Changes in GDB 7.5 - - * GDB now supports x32 ABI. Visit diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c -index aa090af..e672731 100644 +index b4849a9..a6e6ca2 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c -@@ -12037,6 +12037,7 @@ ada_operator_length (const struct expression *exp, int pc, int *oplenp, +@@ -12263,6 +12263,7 @@ ada_operator_length (const struct expression *exp, int pc, int *oplenp, static int ada_operator_check (struct expression *exp, int pos, @@ -84,7 +38,7 @@ index aa090af..e672731 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data) { -@@ -12051,12 +12052,15 @@ ada_operator_check (struct expression *exp, int pos, +@@ -12277,12 +12278,15 @@ ada_operator_check (struct expression *exp, int pos, break; default: @@ -102,54 +56,8 @@ index aa090af..e672731 100644 && (*objfile_func) (TYPE_OBJFILE (type), data)) return 1; -diff --git a/gdb/bfd-target.c b/gdb/bfd-target.c -index 6728800..455d3e6 100644 ---- a/gdb/bfd-target.c -+++ b/gdb/bfd-target.c -@@ -21,6 +21,7 @@ - #include "target.h" - #include "bfd-target.h" - #include "exec.h" -+#include "gdb_bfd.h" - - /* The object that is stored in the target_ops->to_data field has this - type. */ -@@ -70,7 +71,7 @@ target_bfd_xclose (struct target_ops *t, int quitting) - { - struct target_bfd_data *data = t->to_data; - -- bfd_close (data->bfd); -+ gdb_bfd_unref (data->bfd); - xfree (data->table.sections); - xfree (data); - xfree (t); -@@ -84,6 +85,7 @@ target_bfd_reopen (struct bfd *abfd) - - data = XZALLOC (struct target_bfd_data); - data->bfd = abfd; -+ gdb_bfd_ref (abfd); - build_section_table (abfd, &data->table.sections, &data->table.sections_end); - - t = XZALLOC (struct target_ops); -diff --git a/gdb/bfd-target.h b/gdb/bfd-target.h -index 71001c5..7f4e628 100644 ---- a/gdb/bfd-target.h -+++ b/gdb/bfd-target.h -@@ -23,9 +23,9 @@ - struct bfd; - struct target_ops; - --/* Given an existing BFD, re-open it as a "struct target_ops". On -- close, it will also close the corresponding BFD (which is like -- freopen and fdopen). */ -+/* Given an existing BFD, re-open it as a "struct target_ops". This -+ acquires a new reference to the BFD. This reference will be -+ released when the target is closed. */ - struct target_ops *target_bfd_reopen (struct bfd *bfd); - - #endif diff --git a/gdb/block.c b/gdb/block.c -index a0f82ec..097dbf6 100644 +index 2638de8..b296ae0 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -692,3 +692,21 @@ block_iter_match_next (const char *name, @@ -175,7 +83,7 @@ index a0f82ec..097dbf6 100644 + return SYMBOL_SYMTAB (func)->objfile; +} diff --git a/gdb/block.h b/gdb/block.h -index 99c4788..6ceb704 100644 +index 02e7e8b..2931401 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -279,4 +279,6 @@ extern struct symbol *block_iter_match_next (const char *name, @@ -186,10 +94,10 @@ index 99c4788..6ceb704 100644 + #endif /* BLOCK_H */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 78fffd3..224ba49 100644 +index 3ad9885..e28b44e 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c -@@ -15519,6 +15519,24 @@ all_tracepoints (void) +@@ -15641,6 +15641,24 @@ all_tracepoints (void) return tp_vec; } @@ -214,7 +122,7 @@ index 78fffd3..224ba49 100644 /* This help string is used for the break, hbreak, tbreak and thbreak commands. It is defined as a macro to prevent duplication. -@@ -16484,4 +16502,7 @@ agent-printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\ +@@ -16612,4 +16630,7 @@ agent-printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\ automatic_hardware_breakpoints = 1; observer_attach_about_to_proceed (breakpoint_about_to_proceed); @@ -222,80 +130,15 @@ index 78fffd3..224ba49 100644 + observer_attach_mark_used (breakpoint_types_mark_used); +#endif } -diff --git a/gdb/buildsym.c b/gdb/buildsym.c -index d547012..e4882fb 100644 ---- a/gdb/buildsym.c -+++ b/gdb/buildsym.c -@@ -966,11 +966,14 @@ reset_symtab_globals (void) - file's text. - - If EXPANDABLE is non-zero the STATIC_BLOCK dictionary is made -- expandable. */ -+ expandable. -+ -+ If REQUIRED is non-zero, then a symtab is created even if it does -+ not contain any symbols. */ - - struct block * - end_symtab_get_static_block (CORE_ADDR end_addr, struct objfile *objfile, -- int expandable) -+ int expandable, int required) - { - /* Finish the lexical context of the last function in the file; pop - the context stack. */ -@@ -1038,7 +1041,8 @@ end_symtab_get_static_block (CORE_ADDR end_addr, struct objfile *objfile, - cleanup_undefined_stabs_types (objfile); - finish_global_stabs (objfile); - -- if (pending_blocks == NULL -+ if (!required -+ && pending_blocks == NULL - && file_symbols == NULL - && global_symbols == NULL - && have_line_numbers == 0 -@@ -1296,7 +1300,7 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section) - { - struct block *static_block; - -- static_block = end_symtab_get_static_block (end_addr, objfile, 0); -+ static_block = end_symtab_get_static_block (end_addr, objfile, 0, 0); - return end_symtab_from_static_block (static_block, objfile, section, 0); - } - -@@ -1308,7 +1312,7 @@ end_expandable_symtab (CORE_ADDR end_addr, struct objfile *objfile, - { - struct block *static_block; - -- static_block = end_symtab_get_static_block (end_addr, objfile, 1); -+ static_block = end_symtab_get_static_block (end_addr, objfile, 1, 0); - return end_symtab_from_static_block (static_block, objfile, section, 1); - } - -diff --git a/gdb/buildsym.h b/gdb/buildsym.h -index 162ee8c..33b34c8 100644 ---- a/gdb/buildsym.h -+++ b/gdb/buildsym.h -@@ -260,7 +260,8 @@ extern char *pop_subfile (void); - - extern struct block *end_symtab_get_static_block (CORE_ADDR end_addr, - struct objfile *objfile, -- int expandable); -+ int expandable, -+ int required); - - extern struct symtab *end_symtab_from_static_block (struct block *static_block, - struct objfile *objfile, diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c -index a5892b5..2944c2d 100644 +index a6db162..ddfc6a9 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c -@@ -624,9 +624,14 @@ c_type_print_varspec_suffix (struct type *type, - fprintf_filtered (stream, ")"); +@@ -692,7 +692,13 @@ c_type_print_varspec_suffix (struct type *type, - fprintf_filtered (stream, "["); + fprintf_filtered (stream, (is_vector ? + " __attribute__ ((vector_size(" : "[")); - if (get_array_bounds (type, &low_bound, &high_bound)) -- fprintf_filtered (stream, "%d", -- (int) (high_bound - low_bound + 1)); + if (TYPE_RANGE_DATA (TYPE_INDEX_TYPE (type))->high.kind + != RANGE_BOUND_KIND_CONSTANT) + { @@ -303,516 +146,14 @@ index a5892b5..2944c2d 100644 + fprintf_filtered (stream, "variable"); + } + else if (get_array_bounds (type, &low_bound, &high_bound)) -+ fprintf_filtered (stream, "%d", (int) (high_bound - low_bound + 1)); - fprintf_filtered (stream, "]"); - - c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, -diff --git a/gdb/cc-with-dwz.sh b/gdb/cc-with-dwz.sh -deleted file mode 100755 -index f66deb1..0000000 ---- a/gdb/cc-with-dwz.sh -+++ /dev/null -@@ -1,80 +0,0 @@ --#! /bin/sh --# Wrapper around gcc to run 'dwz' when running the testsuite. -- --# Copyright (C) 2010-2012 Free Software Foundation, Inc. --# This program is free software; you can redistribute it and/or modify --# it under the terms of the GNU General Public License as published by --# the Free Software Foundation; either version 3 of the License, or --# (at your option) any later version. --# --# This program is distributed in the hope that it will be useful, --# but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU General Public License for more details. --# --# You should have received a copy of the GNU General Public License --# along with this program. If not, see . -- --# This program requires dwz in addition to gcc. --# --# Example usage: --# --# bash$ cd $objdir/gdb/testsuite --# bash$ runtest \ --# CC_FOR_TARGET="/bin/sh $srcdir/cc-with-dwz.sh gcc" \ --# CXX_FOR_TARGET="/bin/sh $srcdir/cc-with-dwz.sh g++" --# -- --myname=cc-with-dwz.sh -- --DWZ=${DWZ:-dwz} -- --have_link=unknown --next_is_output_file=no --output_file=a.out -- --for arg in "$@" --do -- if [ "$next_is_output_file" = "yes" ] -- then -- output_file="$arg" -- next_is_output_file=no -- continue -- fi -- -- # Poor man's gcc argument parser. -- # We don't need to handle all arguments, we just need to know if we're -- # doing a link and what the output file is. -- # It's not perfect, but it seems to work well enough for the task at hand. -- case "$arg" in -- "-c") have_link=no ;; -- "-E") have_link=no ;; -- "-S") have_link=no ;; -- "-o") next_is_output_file=yes ;; -- esac --done -- --if [ "$next_is_output_file" = "yes" ] --then -- echo "$myname: Unable to find output file" >&2 -- exit 1 --fi -- --if [ "$have_link" = "no" ] --then -- "$@" -- exit $? --fi -- --"$@" --rc=$? --[ $rc != 0 ] && exit $rc --if [ ! -f "$output_file" ] --then -- echo "$myname: Internal error: $output_file missing." >&2 -- exit 1 --fi -- --$DWZ "$output_file" > /dev/null 2>&1 -- --exit 0 -diff --git a/gdb/cc-with-index.sh b/gdb/cc-with-index.sh -deleted file mode 100644 -index 644ba34..0000000 ---- a/gdb/cc-with-index.sh -+++ /dev/null -@@ -1,126 +0,0 @@ --#! /bin/sh --# Wrapper around gcc to add the .gdb_index section when running the testsuite. -- --# Copyright (C) 2010-2012 Free Software Foundation, Inc. --# This program is free software; you can redistribute it and/or modify --# it under the terms of the GNU General Public License as published by --# the Free Software Foundation; either version 3 of the License, or --# (at your option) any later version. --# --# This program is distributed in the hope that it will be useful, --# but WITHOUT ANY WARRANTY; without even the implied warranty of --# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --# GNU General Public License for more details. --# --# You should have received a copy of the GNU General Public License --# along with this program. If not, see . -- --# This program requires gdb and objcopy in addition to gcc. --# The default values are gdb from the build tree and objcopy from $PATH. --# They may be overridden by setting environment variables GDB and OBJCOPY --# respectively. --# We assume the current directory is either $obj/gdb or $obj/gdb/testsuite. --# --# Example usage: --# --# bash$ cd $objdir/gdb/testsuite --# bash$ runtest \ --# CC_FOR_TARGET="/bin/sh $srcdir/cc-with-index.sh gcc" \ --# CXX_FOR_TARGET="/bin/sh $srcdir/cc-with-index.sh g++" --# --# For documentation on index files: info -f gdb.info -n "Index Files" -- --myname=cc-with-index.sh -- --if [ -z "$GDB" ] --then -- if [ -f ./gdb ] -- then -- GDB="./gdb" -- elif [ -f ../gdb ] -- then -- GDB="../gdb" -- elif [ -f ../../gdb ] -- then -- GDB="../../gdb" -- else -- echo "$myname: unable to find usable gdb" >&2 -- exit 1 -- fi --fi -- --OBJCOPY=${OBJCOPY:-objcopy} -- --have_link=unknown --next_is_output_file=no --output_file=a.out -- --for arg in "$@" --do -- if [ "$next_is_output_file" = "yes" ] -- then -- output_file="$arg" -- next_is_output_file=no -- continue -- fi -- -- # Poor man's gcc argument parser. -- # We don't need to handle all arguments, we just need to know if we're -- # doing a link and what the output file is. -- # It's not perfect, but it seems to work well enough for the task at hand. -- case "$arg" in -- "-c") have_link=no ;; -- "-E") have_link=no ;; -- "-S") have_link=no ;; -- "-o") next_is_output_file=yes ;; -- esac --done -- --if [ "$next_is_output_file" = "yes" ] --then -- echo "$myname: Unable to find output file" >&2 -- exit 1 --fi -- --if [ "$have_link" = "no" ] --then -- "$@" -- exit $? --fi -- --index_file="${output_file}.gdb-index" --if [ -f "$index_file" ] --then -- echo "$myname: Index file $index_file exists, won't clobber." >&2 -- exit 1 --fi -- --output_dir="${output_file%/*}" --[ "$output_dir" = "$output_file" ] && output_dir="." -- --"$@" --rc=$? --[ $rc != 0 ] && exit $rc --if [ ! -f "$output_file" ] --then -- echo "$myname: Internal error: $output_file missing." >&2 -- exit 1 --fi -- --$GDB --batch-silent -nx -ex "set auto-load no" -ex "file $output_file" -ex "save gdb-index $output_dir" --rc=$? --[ $rc != 0 ] && exit $rc -- --# GDB might not always create an index. Cope. --if [ -f "$index_file" ] --then -- $OBJCOPY --add-section .gdb_index="$index_file" \ -- --set-section-flags .gdb_index=readonly \ -- "$output_file" "$output_file" -- rc=$? --else -- rc=0 --fi -- --rm -f "$index_file" --exit $rc -diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c -index 4a8b5d1..7341f00 100644 ---- a/gdb/cli/cli-dump.c -+++ b/gdb/cli/cli-dump.c -@@ -32,6 +32,7 @@ - #include "readline/readline.h" - #include "gdbcore.h" - #include "cli/cli-utils.h" -+#include "gdb_bfd.h" - - #define XMALLOC(TYPE) ((TYPE*) xmalloc (sizeof (TYPE))) - -@@ -111,12 +112,12 @@ bfd_openr_with_cleanup (const char *filename, const char *target) - { - bfd *ibfd; - -- ibfd = bfd_openr (filename, target); -+ ibfd = gdb_bfd_openr (filename, target); - if (ibfd == NULL) - error (_("Failed to open %s: %s."), filename, - bfd_errmsg (bfd_get_error ())); - -- make_cleanup_bfd_close (ibfd); -+ make_cleanup_bfd_unref (ibfd); - if (!bfd_check_format (ibfd, bfd_object)) - error (_("'%s' is not a recognized file format."), filename); - -@@ -131,11 +132,11 @@ bfd_openw_with_cleanup (const char *filename, const char *target, - - if (*mode == 'w') /* Write: create new file */ - { -- obfd = bfd_openw (filename, target); -+ obfd = gdb_bfd_openw (filename, target); - if (obfd == NULL) - error (_("Failed to open %s: %s."), filename, - bfd_errmsg (bfd_get_error ())); -- make_cleanup_bfd_close (obfd); -+ make_cleanup_bfd_unref (obfd); - if (!bfd_set_format (obfd, bfd_object)) - error (_("bfd_openw_with_cleanup: %s."), bfd_errmsg (bfd_get_error ())); - } -diff --git a/gdb/coffread.c b/gdb/coffread.c -index b0a8b82..0c7e6d9 100644 ---- a/gdb/coffread.c -+++ b/gdb/coffread.c -@@ -653,13 +653,14 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags) - char *debugfile; - - debugfile = find_separate_debug_file_by_debuglink (objfile); -+ make_cleanup (xfree, debugfile); - - if (debugfile) - { - bfd *abfd = symfile_bfd_open (debugfile); - -+ make_cleanup_bfd_unref (abfd); - symbol_file_add_separate (abfd, symfile_flags, objfile); -- xfree (debugfile); - } - } - -diff --git a/gdb/contrib/cc-with-tweaks.sh b/gdb/contrib/cc-with-tweaks.sh -new file mode 100755 -index 0000000..7d7932c ---- /dev/null -+++ b/gdb/contrib/cc-with-tweaks.sh -@@ -0,0 +1,162 @@ -+#! /bin/sh -+# Wrapper around gcc to tweak the output in various ways when running -+# the testsuite. -+ -+# Copyright (C) 2010-2012 Free Software Foundation, Inc. -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# This program requires gdb and objcopy in addition to gcc. -+# The default values are gdb from the build tree and objcopy from $PATH. -+# They may be overridden by setting environment variables GDB and OBJCOPY -+# respectively. -+# We assume the current directory is either $obj/gdb or $obj/gdb/testsuite. -+# -+# Example usage: -+# -+# bash$ cd $objdir/gdb/testsuite -+# bash$ runtest \ -+# CC_FOR_TARGET="/bin/sh $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS gcc" \ -+# CXX_FOR_TARGET="/bin/sh $srcdir/gdb/contrib/cc-with-tweaks.sh ARGS g++" -+# -+# For documentation on index files: info -f gdb.info -n "Index Files" -+# For information about 'dwz', see the announcement: -+# http://gcc.gnu.org/ml/gcc/2012-04/msg00686.html -+# (More documentation is to come.) -+ -+# ARGS determine what is done. They can be: -+# -z compress using dwz -+# -m compress using dwz -m -+# -i make an index -+# If nothing is given, no changes are made -+ -+myname=cc-with-tweaks.sh -+ -+if [ -z "$GDB" ] -+then -+ if [ -f ./gdb ] -+ then -+ GDB="./gdb" -+ elif [ -f ../gdb ] -+ then -+ GDB="../gdb" -+ elif [ -f ../../gdb ] -+ then -+ GDB="../../gdb" -+ else -+ echo "$myname: unable to find usable gdb" >&2 -+ exit 1 -+ fi -+fi -+ -+OBJCOPY=${OBJCOPY:-objcopy} -+ -+DWZ=${DWZ:-dwz} -+ -+have_link=unknown -+next_is_output_file=no -+output_file=a.out -+ -+want_index=false -+want_dwz=false -+want_multi=false -+ -+while [ $# -gt 0 ]; do -+ case "$1" in -+ -z) want_dwz=true ;; -+ -i) want_index=true ;; -+ -m) want_multi=true ;; -+ *) break ;; -+ esac -+ shift -+done -+ -+for arg in "$@" -+do -+ if [ "$next_is_output_file" = "yes" ] -+ then -+ output_file="$arg" -+ next_is_output_file=no -+ continue -+ fi -+ -+ # Poor man's gcc argument parser. -+ # We don't need to handle all arguments, we just need to know if we're -+ # doing a link and what the output file is. -+ # It's not perfect, but it seems to work well enough for the task at hand. -+ case "$arg" in -+ "-c") have_link=no ;; -+ "-E") have_link=no ;; -+ "-S") have_link=no ;; -+ "-o") next_is_output_file=yes ;; -+ esac -+done -+ -+if [ "$next_is_output_file" = "yes" ] -+then -+ echo "$myname: Unable to find output file" >&2 -+ exit 1 -+fi -+ -+if [ "$have_link" = "no" ] -+then -+ "$@" -+ exit $? -+fi -+ -+index_file="${output_file}.gdb-index" -+if [ "$want_index" = true ] && [ -f "$index_file" ] -+then -+ echo "$myname: Index file $index_file exists, won't clobber." >&2 -+ exit 1 -+fi -+ -+output_dir="${output_file%/*}" -+[ "$output_dir" = "$output_file" ] && output_dir="." -+ -+"$@" -+rc=$? -+[ $rc != 0 ] && exit $rc -+if [ ! -f "$output_file" ] -+then -+ echo "$myname: Internal error: $output_file missing." >&2 -+ exit 1 -+fi -+ -+if [ "$want_index" = true ]; then -+ $GDB --batch-silent -nx -ex "set auto-load no" -ex "file $output_file" -ex "save gdb-index $output_dir" -+ rc=$? -+ [ $rc != 0 ] && exit $rc -+ -+ # GDB might not always create an index. Cope. -+ if [ -f "$index_file" ] -+ then -+ $OBJCOPY --add-section .gdb_index="$index_file" \ -+ --set-section-flags .gdb_index=readonly \ -+ "$output_file" "$output_file" -+ rc=$? -+ else -+ rc=0 -+ fi -+ [ $rc != 0 ] && exit $rc -+fi -+ -+if [ "$want_dwz" = true ]; then -+ $DWZ "$output_file" > /dev/null 2>&1 -+elif [ "$want_multi" = true ]; then -+ cp $output_file ${output_file}.alt -+ $DWZ -m ${output_file}.dwz "$output_file" ${output_file}.alt > /dev/null 2>&1 -+fi -+ -+rm -f "$index_file" -+exit $rc -diff --git a/gdb/corelow.c b/gdb/corelow.c -index dd62560..340b149 100644 ---- a/gdb/corelow.c -+++ b/gdb/corelow.c -@@ -46,6 +46,7 @@ - #include "filenames.h" - #include "progspace.h" - #include "objfiles.h" -+#include "gdb_bfd.h" - - #ifndef O_LARGEFILE - #define O_LARGEFILE 0 -@@ -215,9 +216,7 @@ core_close (int quitting) - core_data = NULL; - } - -- name = bfd_get_filename (core_bfd); -- gdb_bfd_close_or_warn (core_bfd); -- xfree (name); -+ gdb_bfd_unref (core_bfd); - core_bfd = NULL; - } - core_vec = NULL; -@@ -319,9 +318,9 @@ core_open (char *filename, int from_tty) - if (scratch_chan < 0) - perror_with_name (filename); - -- temp_bfd = bfd_fopen (filename, gnutarget, -- write_files ? FOPEN_RUB : FOPEN_RB, -- scratch_chan); -+ temp_bfd = gdb_bfd_fopen (filename, gnutarget, -+ write_files ? FOPEN_RUB : FOPEN_RB, -+ scratch_chan); - if (temp_bfd == NULL) - perror_with_name (filename); - -@@ -332,7 +331,7 @@ core_open (char *filename, int from_tty) - /* FIXME: should be checking for errors from bfd_close (for one - thing, on error it does not free all the storage associated - with the bfd). */ -- make_cleanup_bfd_close (temp_bfd); -+ make_cleanup_bfd_unref (temp_bfd); - error (_("\"%s\" is not a core dump: %s"), - filename, bfd_errmsg (bfd_get_error ())); - } -@@ -340,7 +339,7 @@ core_open (char *filename, int from_tty) - /* Looks semi-reasonable. Toss the old core file and work on the - new. */ - -- discard_cleanups (old_chain); /* Don't free filename any more */ -+ do_cleanups (old_chain); - unpush_target (&core_ops); - core_bfd = temp_bfd; - old_chain = make_cleanup (core_close_cleanup, 0 /*ignore*/); + fprintf_filtered (stream, "%s", + plongest (high_bound - low_bound + 1)); + fprintf_filtered (stream, (is_vector ? ")))" : "]")); diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in -index 87c6dd4..1c26652 100644 +index d98ac77..e248399 100644 --- a/gdb/data-directory/Makefile.in +++ b/gdb/data-directory/Makefile.in -@@ -52,14 +52,25 @@ SYSCALLS_FILES = \ +@@ -52,17 +52,28 @@ SYSCALLS_FILES = \ PYTHON_DIR = python PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR) PYTHON_FILES = \ @@ -827,10 +168,13 @@ index 87c6dd4..1c26652 100644 + gdb/command/backtrace.py \ + gdb/command/ignore_errors.py \ + gdb/command/pahole.py \ + gdb/command/type_printers.py \ gdb/command/pretty_printers.py \ gdb/command/prompt.py \ -- gdb/command/explore.py -+ gdb/command/explore.py \ + gdb/command/explore.py \ + gdb/function/__init__.py \ +- gdb/function/strfns.py ++ gdb/function/strfns.py \ + gdb/command/require.py \ + gdb/command/upto.py \ + gdb/function/__init__.py \ @@ -842,33 +186,11 @@ index 87c6dd4..1c26652 100644 FLAGS_TO_PASS = \ "prefix=$(prefix)" \ -diff --git a/gdb/defs.h b/gdb/defs.h -index 1c6fa79..ec08348 100644 ---- a/gdb/defs.h -+++ b/gdb/defs.h -@@ -315,7 +315,7 @@ extern struct cleanup *make_cleanup_close (int fd); - - extern struct cleanup *make_cleanup_fclose (FILE *file); - --extern struct cleanup *make_cleanup_bfd_close (bfd *abfd); -+extern struct cleanup *make_cleanup_bfd_unref (bfd *abfd); - - struct obstack; - extern struct cleanup *make_cleanup_obstack_free (struct obstack *obstack); -@@ -353,6 +353,8 @@ extern struct cleanup *make_cleanup_restore_page_info (void); - extern struct cleanup * - set_batch_flag_and_make_cleanup_restore_page_info (void); - -+extern struct cleanup *make_cleanup_restore_selected_frame (void); -+ - extern char *gdb_realpath (const char *); - extern char *xfullpath (const char *); - diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 68ea817..5945bac 100644 +index 728e44b..3659139 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -1200,6 +1200,16 @@ for remote debugging. +@@ -1217,6 +1217,16 @@ for remote debugging. Run using @var{device} for your program's standard input and output. @c FIXME: kingdon thinks there is more to -tty. Investigate. @@ -885,7 +207,7 @@ index 68ea817..5945bac 100644 @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -@@ -22563,8 +22573,6 @@ containing @code{end}. For example: +@@ -22738,8 +22748,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -894,7 +216,7 @@ index 68ea817..5945bac 100644 >print 23 >end 23 -@@ -22578,6 +22586,14 @@ controlled using @code{set python print-stack}: if @code{full}, then +@@ -22753,6 +22761,14 @@ controlled using @code{set python print-stack}: if @code{full}, then full Python stack printing is enabled; if @code{none}, then Python stack and message printing is disabled; if @code{message}, the default, only the message component of the error is printed. @@ -909,7 +231,7 @@ index 68ea817..5945bac 100644 @end table It is also possible to execute a Python script from the @value{GDBN} -@@ -22599,6 +22615,14 @@ and thus is always available. +@@ -22774,6 +22790,14 @@ and thus is always available. @cindex python api @cindex programming in python @@ -924,23 +246,11 @@ index 68ea817..5945bac 100644 @cindex python stdout @cindex python pagination At startup, @value{GDBN} overrides Python's @code{sys.stdout} and -@@ -34536,6 +34560,11 @@ Shared library events. - - @end table - -+@kindex maint info bfds -+@item maint info bfds -+This prints information about each @code{bfd} object that is known to -+@value{GDBN}. @xref{Top, , BFD, bfd, The Binary File Descriptor Library}. -+ - @kindex set displaced-stepping - @kindex show displaced-stepping - @cindex displaced stepping support diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo -index 5e00f1f..c5c432b 100644 +index 4a75c26..91446fe 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo -@@ -2102,6 +2102,18 @@ time, and so we attempt to handle symbols incrementally. For instance, +@@ -2101,6 +2101,18 @@ time, and so we attempt to handle symbols incrementally. For instance, we create @dfn{partial symbol tables} consisting of only selected symbols, and only expand them to full symbol tables when necessary. @@ -959,7 +269,7 @@ index 5e00f1f..c5c432b 100644 @section Symbol Reading @cindex symbol reading -@@ -2194,6 +2206,7 @@ symtab. Upon return, @code{pst->readin} should have been set to 1, and +@@ -2193,6 +2205,7 @@ symtab. Upon return, @code{pst->readin} should have been set to 1, and zero if there were no symbols in that part of the symbol file. @end table @@ -967,7 +277,7 @@ index 5e00f1f..c5c432b 100644 @section Partial Symbol Tables @value{GDBN} has three types of symbol tables: -@@ -2295,6 +2308,7 @@ and partial symbol tables behind a set of function pointers known as +@@ -2294,6 +2307,7 @@ and partial symbol tables behind a set of function pointers known as the @dfn{quick symbol functions}. These are documented in @file{symfile.h}. @@ -975,7 +285,7 @@ index 5e00f1f..c5c432b 100644 @section Types @unnumberedsubsec Fundamental Types (e.g., @code{FT_VOID}, @code{FT_BOOLEAN}). -@@ -2317,6 +2331,7 @@ types map to one @code{TYPE_CODE_*} type, and are distinguished by +@@ -2316,6 +2330,7 @@ types map to one @code{TYPE_CODE_*} type, and are distinguished by other members of the type struct, such as whether the type is signed or unsigned, and how many bits it uses. @@ -983,7 +293,7 @@ index 5e00f1f..c5c432b 100644 @unnumberedsubsec Builtin Types (e.g., @code{builtin_type_void}, @code{builtin_type_char}). These are instances of type structs that roughly correspond to -@@ -2331,6 +2346,7 @@ only one instance exists, while @file{c-lang.c} builds as many +@@ -2330,6 +2345,7 @@ only one instance exists, while @file{c-lang.c} builds as many @code{TYPE_CODE_INT} types as needed, with each one associated with some particular objfile. @@ -991,7 +301,7 @@ index 5e00f1f..c5c432b 100644 @section Object File Formats @cindex object file formats -@@ -2416,6 +2432,7 @@ SOM, which is a cross-language ABI). +@@ -2415,6 +2431,7 @@ SOM, which is a cross-language ABI). The SOM reader is in @file{somread.c}. @@ -999,7 +309,7 @@ index 5e00f1f..c5c432b 100644 @section Debugging File Formats This section describes characteristics of debugging information that -@@ -2487,6 +2504,7 @@ DWARF 3 is an improved version of DWARF 2. +@@ -2486,6 +2503,7 @@ DWARF 3 is an improved version of DWARF 2. @cindex SOM debugging info Like COFF, the SOM definition includes debugging information. @@ -1007,7 +317,7 @@ index 5e00f1f..c5c432b 100644 @section Adding a New Symbol Reader to @value{GDBN} @cindex adding debugging info reader -@@ -2509,6 +2527,7 @@ will only ever be implemented by one object file format may be called +@@ -2508,6 +2526,7 @@ will only ever be implemented by one object file format may be called directly. This interface should be described in a file @file{bfd/lib@var{xyz}.h}, which is included by @value{GDBN}. @@ -1015,7 +325,7 @@ index 5e00f1f..c5c432b 100644 @section Memory Management for Symbol Files Most memory associated with a loaded symbol file is stored on -@@ -2520,10 +2539,45 @@ released when the objfile is unloaded or reloaded. Therefore one +@@ -2519,10 +2538,45 @@ released when the objfile is unloaded or reloaded. Therefore one objfile must not reference symbol or type data from another objfile; they could be unloaded at different times. @@ -1066,11 +376,11 @@ index 5e00f1f..c5c432b 100644 @node Language Support diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi -index 6827ed8..c63b901 100644 +index 87c08e1..cc8f498 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi -@@ -230,6 +230,11 @@ the current top-level prompt. - Variable gdb_datadir has been set. The value may not necessarily change. +@@ -246,6 +246,11 @@ The trace state variable @var{name} is deleted. If @var{name} is + @code{NULL}, all trace state variables are deleted. @end deftypefun +@c @deftypefun void mark_used (void) @@ -1081,55 +391,11 @@ index 6827ed8..c63b901 100644 @deftypefun void test_notification (int @var{somearg}) This observer is used for internal testing. Do not use. See testsuite/gdb.gdb/observer.exp. -diff --git a/gdb/dsrec.c b/gdb/dsrec.c -index d2c99b2..f39d0ed 100644 ---- a/gdb/dsrec.c -+++ b/gdb/dsrec.c -@@ -23,6 +23,7 @@ - #include - #include "gdb_assert.h" - #include "gdb_string.h" -+#include "gdb_bfd.h" - - extern void report_transfer_performance (unsigned long, time_t, time_t); - -@@ -56,19 +57,22 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset, - int reclen; - time_t start_time, end_time; - unsigned long data_count = 0; -+ struct cleanup *cleanup; - - srec = (char *) alloca (maxrecsize + 1); - -- abfd = bfd_openr (file, 0); -+ abfd = gdb_bfd_openr (file, 0); - if (!abfd) - { - printf_filtered (_("Unable to open file %s\n"), file); - return; - } - -+ cleanup = make_cleanup_bfd_unref (abfd); - if (bfd_check_format (abfd, bfd_object) == 0) - { - printf_filtered (_("File is not an object file\n")); -+ do_cleanups (cleanup); - return; - } - -@@ -170,6 +174,7 @@ load_srec (struct serial *desc, const char *file, bfd_vma load_offset, - serial_flush_input (desc); - - report_transfer_performance (data_count, start_time, end_time); -+ do_cleanups (cleanup); - } - - /* diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c -index 214b371..d9b3751 100644 +index 752d782..ab0a3eb 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c -@@ -1480,6 +1480,14 @@ execute_stack_op (struct dwarf_expr_context *ctx, +@@ -1479,6 +1479,14 @@ execute_stack_op (struct dwarf_expr_context *ctx, } break; @@ -1145,10 +411,10 @@ index 214b371..d9b3751 100644 error (_("Unhandled dwarf expression opcode 0x%x"), op); } diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h -index 19efbfd..0e0e498 100644 +index e85486a..e7ac799 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h -@@ -78,12 +78,8 @@ struct dwarf_expr_context_funcs +@@ -77,12 +77,8 @@ struct dwarf_expr_context_funcs This can throw an exception if the index is out of range. */ CORE_ADDR (*get_addr_index) (void *baton, unsigned int index); @@ -1162,7 +428,7 @@ index 19efbfd..0e0e498 100644 /* The location of a value. */ diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 38e4814..46a033d 100644 +index 2282feb..13e7bbc 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -293,6 +293,9 @@ struct dwarf_expr_baton @@ -1175,7 +441,7 @@ index 38e4814..46a033d 100644 }; /* Helper functions for dwarf2_evaluate_loc_desc. */ -@@ -352,16 +355,14 @@ static void +@@ -356,16 +359,14 @@ static void dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc, const gdb_byte **start, size_t *length) { @@ -1194,7 +460,7 @@ index 38e4814..46a033d 100644 { struct dwarf2_locexpr_baton *symbaton; -@@ -374,10 +375,23 @@ dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc, +@@ -378,10 +379,23 @@ dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc, else *length = 0; } @@ -1219,7 +485,7 @@ index 38e4814..46a033d 100644 } /* Helper function for dwarf2_evaluate_loc_desc. Computes the CFA for -@@ -445,6 +459,85 @@ dwarf_expr_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset) +@@ -448,6 +462,85 @@ dwarf_expr_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset) ctx->funcs->get_frame_pc, ctx->baton); } @@ -1305,7 +571,7 @@ index 38e4814..46a033d 100644 /* Callback function for dwarf2_evaluate_loc_desc. */ static struct type * -@@ -1139,10 +1232,12 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, +@@ -1150,10 +1243,12 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, saved_ctx.gdbarch = ctx->gdbarch; saved_ctx.addr_size = ctx->addr_size; @@ -1318,7 +584,7 @@ index 38e4814..46a033d 100644 ctx->offset = dwarf2_per_cu_text_offset (baton_local.per_cu); ctx->baton = &baton_local; -@@ -1150,10 +1245,95 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, +@@ -1161,10 +1256,95 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, ctx->gdbarch = saved_ctx.gdbarch; ctx->addr_size = saved_ctx.addr_size; @@ -1414,7 +680,7 @@ index 38e4814..46a033d 100644 /* Callback function for dwarf2_evaluate_loc_desc. Fetch the address indexed by DW_OP_GNU_addr_index. */ -@@ -2088,22 +2268,6 @@ invalid_synthetic_pointer (void) +@@ -2100,22 +2280,6 @@ invalid_synthetic_pointer (void) "referenced via synthetic pointer")); } @@ -1437,7 +703,7 @@ index 38e4814..46a033d 100644 /* Evaluate a location description, starting at DATA and with length SIZE, to find the current location of variable of TYPE in the context of FRAME. BYTE_OFFSET is applied after the contents are -@@ -2116,7 +2280,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, +@@ -2128,7 +2292,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, LONGEST byte_offset) { struct value *retval; @@ -1445,7 +711,7 @@ index 38e4814..46a033d 100644 struct dwarf_expr_context *ctx; struct cleanup *old_chain, *value_chain; struct objfile *objfile = dwarf2_per_cu_objfile (per_cu); -@@ -2128,29 +2291,18 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, +@@ -2140,29 +2303,18 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, if (size == 0) return allocate_optimized_out_value (type); @@ -1476,7 +742,7 @@ index 38e4814..46a033d 100644 retval = allocate_value (type); mark_value_bytes_unavailable (retval, 0, TYPE_LENGTH (type)); return retval; -@@ -2214,6 +2366,16 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, +@@ -2226,6 +2378,16 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); do_cleanups (value_chain); @@ -1493,7 +759,7 @@ index 38e4814..46a033d 100644 retval = allocate_value_lazy (type); VALUE_LVAL (retval) = lval_memory; if (in_stack_memory) -@@ -4130,8 +4292,7 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, +@@ -4143,8 +4305,7 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, dlbaton->per_cu); } @@ -1503,7 +769,7 @@ index 38e4814..46a033d 100644 const struct symbol_computed_ops dwarf2_loclist_funcs = { loclist_read_variable, loclist_read_variable_at_entry, -@@ -4140,6 +4301,48 @@ const struct symbol_computed_ops dwarf2_loclist_funcs = { +@@ -4153,6 +4314,48 @@ const struct symbol_computed_ops dwarf2_loclist_funcs = { loclist_tracepoint_var_ref }; @@ -1553,10 +819,10 @@ index 38e4814..46a033d 100644 extern initialize_file_ftype _initialize_dwarf2loc; diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h -index e9d06a3..bfa6776 100644 +index 36641b3..1394578 100644 --- a/gdb/dwarf2loc.h +++ b/gdb/dwarf2loc.h -@@ -127,6 +127,15 @@ struct dwarf2_loclist_baton +@@ -132,6 +132,15 @@ struct dwarf2_loclist_baton extern const struct symbol_computed_ops dwarf2_locexpr_funcs; extern const struct symbol_computed_ops dwarf2_loclist_funcs; @@ -1573,145 +839,10 @@ index e9d06a3..bfa6776 100644 /* Compile a DWARF location expression to an agent expression. diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index deee5a2..b2f052b 100644 +index 7a58c45..98aebad 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -64,20 +64,12 @@ - #include "gdbcore.h" /* for gnutarget */ - #include "gdb/gdb-index.h" - #include -+#include "gdb_bfd.h" - - #include - #include "gdb_string.h" - #include "gdb_assert.h" - #include --#ifdef HAVE_ZLIB_H --#include --#endif --#ifdef HAVE_MMAP --#include --#ifndef MAP_FAILED --#define MAP_FAILED ((void *) -1) --#endif --#endif - - typedef struct symbol *symbolp; - DEF_VEC_P (symbolp); -@@ -95,8 +87,6 @@ static int check_physname = 0; - /* When non-zero, do not reject deprecated .gdb_index sections. */ - static int use_deprecated_index_sections = 0; - --static int pagesize; -- - /* When set, the file that we're processing is known to have debugging - info for C++ namespaces. GCC 3.3.x did not produce this information, - but later versions do. */ -@@ -110,10 +100,6 @@ struct dwarf2_section_info - asection *asection; - gdb_byte *buffer; - bfd_size_type size; -- /* Not NULL if the section was actually mmapped. */ -- void *map_addr; -- /* Page aligned size of mmapped area. */ -- bfd_size_type map_len; - /* True if we have tried to read this section. */ - int readin; - }; -@@ -247,6 +233,10 @@ struct dwarf2_per_objfile - This is NULL if the table hasn't been allocated yet. */ - htab_t dwo_files; - -+ /* The shared '.dwz' file, if one exists. This is used when the -+ original data was compressed using 'dwz -m'. */ -+ struct dwz_file *dwz_file; -+ - /* A flag indicating wether this objfile has a section loaded at a - VMA of 0. */ - int has_section_at_zero; -@@ -505,15 +495,13 @@ struct dwarf2_cu - - struct dwarf2_per_cu_data - { -- /* The start offset and length of this compilation unit. 2**29-1 -- bytes should suffice to store the length of any compilation unit -- - if it doesn't, GDB will fall over anyway. -+ /* The start offset and length of this compilation unit. - NOTE: Unlike comp_unit_head.length, this length includes - initial_length_size. - If the DIE refers to a DWO file, this is always of the original die, - not the DWO file. */ - sect_offset offset; -- unsigned int length : 29; -+ unsigned int length; - - /* Flag indicating this compilation unit will be read in before - any of the current compilation units are processed. */ -@@ -528,6 +516,9 @@ struct dwarf2_per_cu_data - /* Non-zero if this CU is from .debug_types. */ - unsigned int is_debug_types : 1; - -+ /* Non-zero if this CU is from the .dwz file. */ -+ unsigned int is_dwz : 1; -+ - /* The section this CU/TU lives in. - If the DIE refers to a DWO file, this is always the original die, - not the DWO file. */ -@@ -715,6 +706,22 @@ struct dwo_file - htab_t tus; - }; - -+/* This represents a '.dwz' file. */ -+ -+struct dwz_file -+{ -+ /* A dwz file can only contain a few sections. */ -+ struct dwarf2_section_info abbrev; -+ struct dwarf2_section_info info; -+ struct dwarf2_section_info str; -+ struct dwarf2_section_info line; -+ struct dwarf2_section_info macro; -+ struct dwarf2_section_info gdb_index; -+ -+ /* The dwz's BFD. */ -+ bfd *dwz_bfd; -+}; -+ - /* Struct used to pass misc. parameters to read_die_and_children, et - al. which are used for both .debug_info and .debug_types dies. - All parameters here are unchanging for the life of the call. This -@@ -828,6 +835,12 @@ struct partial_die_info - /* Flag set if fixup_partial_die has been called on this die. */ - unsigned int fixup_called : 1; - -+ /* Flag set if DW_TAG_imported_unit uses DW_FORM_GNU_ref_alt. */ -+ unsigned int is_dwz : 1; -+ -+ /* Flag set if spec_offset uses DW_FORM_GNU_ref_alt. */ -+ unsigned int spec_is_dwz : 1; -+ - /* The name of this DIE. Normally the value of DW_AT_name, but - sometimes a default name for unnamed DIEs. */ - char *name; -@@ -1213,7 +1226,7 @@ static gdb_byte *read_partial_die (const struct die_reader_specs *, - unsigned int, - gdb_byte *); - --static struct partial_die_info *find_partial_die (sect_offset, -+static struct partial_die_info *find_partial_die (sect_offset, int, - struct dwarf2_cu *); - - static void fixup_partial_die (struct partial_die_info *, -@@ -1258,6 +1271,8 @@ static char *read_indirect_string (bfd *, gdb_byte *, - const struct comp_unit_head *, - unsigned int *); - -+static char *read_indirect_string_from_dwz (struct dwz_file *, LONGEST); -+ - static ULONGEST read_unsigned_leb128 (bfd *, gdb_byte *, unsigned int *); - - static LONGEST read_signed_leb128 (bfd *, gdb_byte *, unsigned int *); -@@ -1509,6 +1524,9 @@ static void fill_in_loclist_baton (struct dwarf2_cu *cu, +@@ -1613,6 +1613,9 @@ static void fill_in_loclist_baton (struct dwarf2_cu *cu, struct dwarf2_loclist_baton *baton, struct attribute *attr); @@ -1721,16 +852,7 @@ index deee5a2..b2f052b 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu); -@@ -1524,7 +1542,7 @@ static hashval_t partial_die_hash (const void *item); - static int partial_die_eq (const void *item_lhs, const void *item_rhs); - - static struct dwarf2_per_cu_data *dwarf2_find_containing_comp_unit -- (sect_offset offset, struct objfile *objfile); -+ (sect_offset offset, unsigned int offset_in_dwz, struct objfile *objfile); - - static void init_one_comp_unit (struct dwarf2_cu *cu, - struct dwarf2_per_cu_data *per_cu); -@@ -1541,6 +1559,9 @@ static void age_cached_comp_units (void); +@@ -1645,6 +1648,9 @@ static void age_cached_comp_units (void); static void free_one_cached_comp_unit (struct dwarf2_per_cu_data *); @@ -1740,7 +862,7 @@ index deee5a2..b2f052b 100644 static struct type *set_die_type (struct die_info *, struct type *, struct dwarf2_cu *); -@@ -1569,6 +1590,9 @@ static struct type *get_die_type_at_offset (sect_offset, +@@ -1673,6 +1679,9 @@ static struct type *get_die_type_at_offset (sect_offset, static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu); @@ -1750,861 +872,7 @@ index deee5a2..b2f052b 100644 static void dwarf2_release_queue (void *dummy); static void queue_comp_unit (struct dwarf2_per_cu_data *per_cu, -@@ -1587,6 +1611,12 @@ static void find_file_and_directory (struct die_info *die, - static char *file_full_name (int file, struct line_header *lh, - const char *comp_dir); - -+static gdb_byte *read_and_check_comp_unit_head -+ (struct comp_unit_head *header, -+ struct dwarf2_section_info *section, -+ struct dwarf2_section_info *abbrev_section, gdb_byte *info_ptr, -+ int is_debug_types_section); -+ - static void init_cutu_and_read_dies - (struct dwarf2_per_cu_data *this_cu, struct abbrev_table *abbrev_table, - int use_existing_cu, int keep, -@@ -1608,8 +1638,6 @@ static struct dwo_unit *lookup_dwo_type_unit - - static void free_dwo_file_cleanup (void *); - --static void munmap_section_buffer (struct dwarf2_section_info *); -- - static void process_cu_includes (void); - - #if WORDS_BIGENDIAN -@@ -1779,85 +1807,6 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *vnames) - dwarf2_per_objfile->has_section_at_zero = 1; - } - --/* Decompress a section that was compressed using zlib. Store the -- decompressed buffer, and its size, in OUTBUF and OUTSIZE. */ -- --static void --zlib_decompress_section (struct objfile *objfile, asection *sectp, -- gdb_byte **outbuf, bfd_size_type *outsize) --{ -- bfd *abfd = sectp->owner; --#ifndef HAVE_ZLIB_H -- error (_("Support for zlib-compressed DWARF data (from '%s') " -- "is disabled in this copy of GDB"), -- bfd_get_filename (abfd)); --#else -- bfd_size_type compressed_size = bfd_get_section_size (sectp); -- gdb_byte *compressed_buffer = xmalloc (compressed_size); -- struct cleanup *cleanup = make_cleanup (xfree, compressed_buffer); -- bfd_size_type uncompressed_size; -- gdb_byte *uncompressed_buffer; -- z_stream strm; -- int rc; -- int header_size = 12; -- -- if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 -- || bfd_bread (compressed_buffer, -- compressed_size, abfd) != compressed_size) -- error (_("Dwarf Error: Can't read DWARF data from '%s'"), -- bfd_get_filename (abfd)); -- -- /* Read the zlib header. In this case, it should be "ZLIB" followed -- by the uncompressed section size, 8 bytes in big-endian order. */ -- if (compressed_size < header_size -- || strncmp (compressed_buffer, "ZLIB", 4) != 0) -- error (_("Dwarf Error: Corrupt DWARF ZLIB header from '%s'"), -- bfd_get_filename (abfd)); -- uncompressed_size = compressed_buffer[4]; uncompressed_size <<= 8; -- uncompressed_size += compressed_buffer[5]; uncompressed_size <<= 8; -- uncompressed_size += compressed_buffer[6]; uncompressed_size <<= 8; -- uncompressed_size += compressed_buffer[7]; uncompressed_size <<= 8; -- uncompressed_size += compressed_buffer[8]; uncompressed_size <<= 8; -- uncompressed_size += compressed_buffer[9]; uncompressed_size <<= 8; -- uncompressed_size += compressed_buffer[10]; uncompressed_size <<= 8; -- uncompressed_size += compressed_buffer[11]; -- -- /* It is possible the section consists of several compressed -- buffers concatenated together, so we uncompress in a loop. */ -- strm.zalloc = NULL; -- strm.zfree = NULL; -- strm.opaque = NULL; -- strm.avail_in = compressed_size - header_size; -- strm.next_in = (Bytef*) compressed_buffer + header_size; -- strm.avail_out = uncompressed_size; -- uncompressed_buffer = obstack_alloc (&objfile->objfile_obstack, -- uncompressed_size); -- rc = inflateInit (&strm); -- while (strm.avail_in > 0) -- { -- if (rc != Z_OK) -- error (_("Dwarf Error: setting up DWARF uncompression in '%s': %d"), -- bfd_get_filename (abfd), rc); -- strm.next_out = ((Bytef*) uncompressed_buffer -- + (uncompressed_size - strm.avail_out)); -- rc = inflate (&strm, Z_FINISH); -- if (rc != Z_STREAM_END) -- error (_("Dwarf Error: zlib error uncompressing from '%s': %d"), -- bfd_get_filename (abfd), rc); -- rc = inflateReset (&strm); -- } -- rc = inflateEnd (&strm); -- if (rc != Z_OK -- || strm.avail_out != 0) -- error (_("Dwarf Error: concluding DWARF uncompression in '%s': %d"), -- bfd_get_filename (abfd), rc); -- -- do_cleanups (cleanup); -- *outbuf = uncompressed_buffer; -- *outsize = uncompressed_size; --#endif --} -- - /* A helper function that decides whether a section is empty, - or not present. */ - -@@ -1884,56 +1833,27 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) - if (info->readin) - return; - info->buffer = NULL; -- info->map_addr = NULL; - info->readin = 1; - - if (dwarf2_section_empty_p (info)) - return; - -- /* Note that ABFD may not be from OBJFILE, e.g. a DWO section. */ - abfd = sectp->owner; - -- /* Check if the file has a 4-byte header indicating compression. */ -- if (info->size > sizeof (header) -- && bfd_seek (abfd, sectp->filepos, SEEK_SET) == 0 -- && bfd_bread (header, sizeof (header), abfd) == sizeof (header)) -- { -- /* Upon decompression, update the buffer and its size. */ -- if (strncmp (header, "ZLIB", sizeof (header)) == 0) -- { -- zlib_decompress_section (objfile, sectp, &info->buffer, -- &info->size); -- return; -- } -- } -- --#ifdef HAVE_MMAP -- if (pagesize == 0) -- pagesize = getpagesize (); -- -- /* Only try to mmap sections which are large enough: we don't want to -- waste space due to fragmentation. Also, only try mmap for sections -- without relocations. */ -- -- if (info->size > 4 * pagesize && (sectp->flags & SEC_RELOC) == 0) -+ /* If the section has relocations, we must read it ourselves. -+ Otherwise we attach it to the BFD. */ -+ if ((sectp->flags & SEC_RELOC) == 0) - { -- info->buffer = bfd_mmap (abfd, 0, info->size, PROT_READ, -- MAP_PRIVATE, sectp->filepos, -- &info->map_addr, &info->map_len); -+ const gdb_byte *bytes = gdb_bfd_map_section (sectp, &info->size); - -- if ((caddr_t)info->buffer != MAP_FAILED) -- { --#if HAVE_POSIX_MADVISE -- posix_madvise (info->map_addr, info->map_len, POSIX_MADV_WILLNEED); --#endif -- return; -- } -+ /* We have to cast away const here for historical reasons. -+ Fixing dwarf2read to be const-correct would be quite nice. */ -+ info->buffer = (gdb_byte *) bytes; -+ return; - } --#endif - -- /* If we get here, we are a normal, not-compressed section. */ -- info->buffer = buf -- = obstack_alloc (&objfile->objfile_obstack, info->size); -+ buf = obstack_alloc (&objfile->objfile_obstack, info->size); -+ info->buffer = buf; - - /* When debugging .o files, we may need to apply relocations; see - http://sourceware.org/ml/gdb-patches/2002-04/msg00136.html . -@@ -2009,6 +1929,111 @@ dwarf2_get_section_info (struct objfile *objfile, - *sizep = info->size; - } - -+/* A helper function to find the sections for a .dwz file. */ -+ -+static void -+locate_dwz_sections (bfd *abfd, asection *sectp, void *arg) -+{ -+ struct dwz_file *dwz_file = arg; -+ -+ /* Note that we only support the standard ELF names, because .dwz -+ is ELF-only (at the time of writing). */ -+ if (section_is_p (sectp->name, &dwarf2_elf_names.abbrev)) -+ { -+ dwz_file->abbrev.asection = sectp; -+ dwz_file->abbrev.size = bfd_get_section_size (sectp); -+ } -+ else if (section_is_p (sectp->name, &dwarf2_elf_names.info)) -+ { -+ dwz_file->info.asection = sectp; -+ dwz_file->info.size = bfd_get_section_size (sectp); -+ } -+ else if (section_is_p (sectp->name, &dwarf2_elf_names.str)) -+ { -+ dwz_file->str.asection = sectp; -+ dwz_file->str.size = bfd_get_section_size (sectp); -+ } -+ else if (section_is_p (sectp->name, &dwarf2_elf_names.line)) -+ { -+ dwz_file->line.asection = sectp; -+ dwz_file->line.size = bfd_get_section_size (sectp); -+ } -+ else if (section_is_p (sectp->name, &dwarf2_elf_names.macro)) -+ { -+ dwz_file->macro.asection = sectp; -+ dwz_file->macro.size = bfd_get_section_size (sectp); -+ } -+ else if (section_is_p (sectp->name, &dwarf2_elf_names.gdb_index)) -+ { -+ dwz_file->gdb_index.asection = sectp; -+ dwz_file->gdb_index.size = bfd_get_section_size (sectp); -+ } -+} -+ -+/* Open the separate '.dwz' debug file, if needed. Error if the file -+ cannot be found. */ -+ -+static struct dwz_file * -+dwarf2_get_dwz_file (void) -+{ -+ bfd *abfd, *dwz_bfd; -+ asection *section; -+ gdb_byte *data; -+ struct cleanup *cleanup; -+ const char *filename; -+ struct dwz_file *result; -+ -+ if (dwarf2_per_objfile->dwz_file != NULL) -+ return dwarf2_per_objfile->dwz_file; -+ -+ abfd = dwarf2_per_objfile->objfile->obfd; -+ section = bfd_get_section_by_name (abfd, ".gnu_debugaltlink"); -+ if (section == NULL) -+ error (_("could not find '.gnu_debugaltlink' section")); -+ if (!bfd_malloc_and_get_section (abfd, section, &data)) -+ error (_("could not read '.gnu_debugaltlink' section: %s"), -+ bfd_errmsg (bfd_get_error ())); -+ cleanup = make_cleanup (xfree, data); -+ -+ filename = data; -+ if (!IS_ABSOLUTE_PATH (filename)) -+ { -+ char *abs = gdb_realpath (dwarf2_per_objfile->objfile->name); -+ char *rel; -+ -+ make_cleanup (xfree, abs); -+ abs = ldirname (abs); -+ make_cleanup (xfree, abs); -+ -+ rel = concat (abs, SLASH_STRING, filename, (char *) NULL); -+ make_cleanup (xfree, rel); -+ filename = rel; -+ } -+ -+ /* The format is just a NUL-terminated file name, followed by the -+ build-id. For now, though, we ignore the build-id. */ -+ dwz_bfd = gdb_bfd_open (filename, gnutarget, -1); -+ if (dwz_bfd == NULL) -+ error (_("could not read '%s': %s"), filename, -+ bfd_errmsg (bfd_get_error ())); -+ -+ if (!bfd_check_format (dwz_bfd, bfd_object)) -+ { -+ gdb_bfd_unref (dwz_bfd); -+ error (_("file '%s' was not usable: %s"), filename, -+ bfd_errmsg (bfd_get_error ())); -+ } -+ -+ result = OBSTACK_ZALLOC (&dwarf2_per_objfile->objfile->objfile_obstack, -+ struct dwz_file); -+ result->dwz_bfd = dwz_bfd; -+ -+ bfd_map_over_sections (dwz_bfd, locate_dwz_sections, result); -+ -+ do_cleanups (cleanup); -+ -+ return result; -+} - - /* DWARF quick_symbols_functions support. */ - -@@ -2279,23 +2304,19 @@ extract_cu_value (const char *bytes, ULONGEST *result) - return 1; - } - --/* Read the CU list from the mapped index, and use it to create all -- the CU objects for this objfile. Return 0 if something went wrong, -- 1 if everything went ok. */ -+/* A helper for create_cus_from_index that handles a given list of -+ CUs. */ - - static int --create_cus_from_index (struct objfile *objfile, const gdb_byte *cu_list, -- offset_type cu_list_elements) -+create_cus_from_index_list (struct objfile *objfile, -+ const gdb_byte *cu_list, offset_type n_elements, -+ struct dwarf2_section_info *section, -+ int is_dwz, -+ int base_offset) - { - offset_type i; - -- dwarf2_per_objfile->n_comp_units = cu_list_elements / 2; -- dwarf2_per_objfile->all_comp_units -- = obstack_alloc (&objfile->objfile_obstack, -- dwarf2_per_objfile->n_comp_units -- * sizeof (struct dwarf2_per_cu_data *)); -- -- for (i = 0; i < cu_list_elements; i += 2) -+ for (i = 0; i < n_elements; i += 2) - { - struct dwarf2_per_cu_data *the_cu; - ULONGEST offset, length; -@@ -2310,15 +2331,45 @@ create_cus_from_index (struct objfile *objfile, const gdb_byte *cu_list, - the_cu->offset.sect_off = offset; - the_cu->length = length; - the_cu->objfile = objfile; -- the_cu->info_or_types_section = &dwarf2_per_objfile->info; -+ the_cu->info_or_types_section = section; - the_cu->v.quick = OBSTACK_ZALLOC (&objfile->objfile_obstack, - struct dwarf2_per_cu_quick_data); -- dwarf2_per_objfile->all_comp_units[i / 2] = the_cu; -+ the_cu->is_dwz = is_dwz; -+ dwarf2_per_objfile->all_comp_units[base_offset + i / 2] = the_cu; - } - - return 1; - } - -+/* Read the CU list from the mapped index, and use it to create all -+ the CU objects for this objfile. Return 0 if something went wrong, -+ 1 if everything went ok. */ -+ -+static int -+create_cus_from_index (struct objfile *objfile, -+ const gdb_byte *cu_list, offset_type cu_list_elements, -+ const gdb_byte *dwz_list, offset_type dwz_elements) -+{ -+ struct dwz_file *dwz; -+ -+ dwarf2_per_objfile->n_comp_units = (cu_list_elements + dwz_elements) / 2; -+ dwarf2_per_objfile->all_comp_units -+ = obstack_alloc (&objfile->objfile_obstack, -+ dwarf2_per_objfile->n_comp_units -+ * sizeof (struct dwarf2_per_cu_data *)); -+ -+ if (!create_cus_from_index_list (objfile, cu_list, cu_list_elements, -+ &dwarf2_per_objfile->info, 0, 0)) -+ return 0; -+ -+ if (dwz_elements == 0) -+ return 1; -+ -+ dwz = dwarf2_get_dwz_file (); -+ return create_cus_from_index_list (objfile, dwz_list, dwz_elements, -+ &dwz->info, 1, cu_list_elements / 2); -+} -+ - /* Create the signatured type hash table from the index. */ - - static int -@@ -2508,33 +2559,44 @@ find_slot_in_mapped_hash (struct mapped_index *index, const char *name, - } - } - --/* Read the index file. If everything went ok, initialize the "quick" -- elements of all the CUs and return 1. Otherwise, return 0. */ -+/* A helper function that reads the .gdb_index from SECTION and fills -+ in MAP. FILENAME is the name of the file containing the section; -+ it is used for error reporting. DEPRECATED_OK is nonzero if it is -+ ok to use deprecated sections. -+ -+ CU_LIST, CU_LIST_ELEMENTS, TYPES_LIST, and TYPES_LIST_ELEMENTS are -+ out parameters that are filled in with information about the CU and -+ TU lists in the section. -+ -+ Returns 1 if all went well, 0 otherwise. */ - - static int --dwarf2_read_index (struct objfile *objfile) -+read_index_from_section (struct objfile *objfile, -+ const char *filename, -+ int deprecated_ok, -+ struct dwarf2_section_info *section, -+ struct mapped_index *map, -+ const gdb_byte **cu_list, -+ offset_type *cu_list_elements, -+ const gdb_byte **types_list, -+ offset_type *types_list_elements) - { - char *addr; -- struct mapped_index *map; -+ offset_type version; - offset_type *metadata; -- const gdb_byte *cu_list; -- const gdb_byte *types_list = NULL; -- offset_type version, cu_list_elements; -- offset_type types_list_elements = 0; - int i; - -- if (dwarf2_section_empty_p (&dwarf2_per_objfile->gdb_index)) -+ if (dwarf2_section_empty_p (section)) - return 0; - - /* Older elfutils strip versions could keep the section in the main - executable while splitting it for the separate debug info file. */ -- if ((bfd_get_file_flags (dwarf2_per_objfile->gdb_index.asection) -- & SEC_HAS_CONTENTS) == 0) -+ if ((bfd_get_file_flags (section->asection) & SEC_HAS_CONTENTS) == 0) - return 0; - -- dwarf2_read_section (objfile, &dwarf2_per_objfile->gdb_index); -+ dwarf2_read_section (objfile, section); - -- addr = dwarf2_per_objfile->gdb_index.buffer; -+ addr = section->buffer; - /* Version check. */ - version = MAYBE_SWAP (*(offset_type *) addr); - /* Versions earlier than 3 emitted every copy of a psymbol. This -@@ -2547,7 +2609,7 @@ dwarf2_read_index (struct objfile *objfile) - if (!warning_printed) - { - warning (_("Skipping obsolete .gdb_index section in %s."), -- objfile->name); -+ filename); - warning_printed = 1; - } - return 0; -@@ -2560,7 +2622,7 @@ dwarf2_read_index (struct objfile *objfile) - set breakpoints on inlined functions by name, so we ignore these - indices unless the user has done - "set use-deprecated-index-sections on". */ -- if (version < 6 && !use_deprecated_index_sections) -+ if (version < 6 && !deprecated_ok) - { - static int warning_printed = 0; - if (!warning_printed) -@@ -2569,7 +2631,7 @@ dwarf2_read_index (struct objfile *objfile) - Skipping deprecated .gdb_index section in %s.\n\ - Do \"set use-deprecated-index-sections on\" before the file is read\n\ - to use the section anyway."), -- objfile->name); -+ filename); - warning_printed = 1; - } - return 0; -@@ -2579,22 +2641,21 @@ to use the section anyway."), - if (version > 7) - return 0; - -- map = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct mapped_index); - map->version = version; -- map->total_size = dwarf2_per_objfile->gdb_index.size; -+ map->total_size = section->size; - - metadata = (offset_type *) (addr + sizeof (offset_type)); - - i = 0; -- cu_list = addr + MAYBE_SWAP (metadata[i]); -- cu_list_elements = ((MAYBE_SWAP (metadata[i + 1]) - MAYBE_SWAP (metadata[i])) -- / 8); -+ *cu_list = addr + MAYBE_SWAP (metadata[i]); -+ *cu_list_elements = ((MAYBE_SWAP (metadata[i + 1]) - MAYBE_SWAP (metadata[i])) -+ / 8); - ++i; - -- types_list = addr + MAYBE_SWAP (metadata[i]); -- types_list_elements = ((MAYBE_SWAP (metadata[i + 1]) -- - MAYBE_SWAP (metadata[i])) -- / 8); -+ *types_list = addr + MAYBE_SWAP (metadata[i]); -+ *types_list_elements = ((MAYBE_SWAP (metadata[i + 1]) -+ - MAYBE_SWAP (metadata[i])) -+ / 8); - ++i; - - map->address_table = addr + MAYBE_SWAP (metadata[i]); -@@ -2610,11 +2671,55 @@ to use the section anyway."), - - map->constant_pool = addr + MAYBE_SWAP (metadata[i]); - -+ return 1; -+} -+ -+ -+/* Read the index file. If everything went ok, initialize the "quick" -+ elements of all the CUs and return 1. Otherwise, return 0. */ -+ -+static int -+dwarf2_read_index (struct objfile *objfile) -+{ -+ struct mapped_index local_map, *map; -+ const gdb_byte *cu_list, *types_list, *dwz_list = NULL; -+ offset_type cu_list_elements, types_list_elements, dwz_list_elements = 0; -+ -+ if (!read_index_from_section (objfile, objfile->name, -+ use_deprecated_index_sections, -+ &dwarf2_per_objfile->gdb_index, &local_map, -+ &cu_list, &cu_list_elements, -+ &types_list, &types_list_elements)) -+ return 0; -+ - /* Don't use the index if it's empty. */ -- if (map->symbol_table_slots == 0) -+ if (local_map.symbol_table_slots == 0) - return 0; - -- if (!create_cus_from_index (objfile, cu_list, cu_list_elements)) -+ /* If there is a .dwz file, read it so we can get its CU list as -+ well. */ -+ if (bfd_get_section_by_name (objfile->obfd, ".gnu_debugaltlink") != NULL) -+ { -+ struct dwz_file *dwz = dwarf2_get_dwz_file (); -+ struct mapped_index dwz_map; -+ const gdb_byte *dwz_types_ignore; -+ offset_type dwz_types_elements_ignore; -+ -+ if (!read_index_from_section (objfile, bfd_get_filename (dwz->dwz_bfd), -+ 1, -+ &dwz->gdb_index, &dwz_map, -+ &dwz_list, &dwz_list_elements, -+ &dwz_types_ignore, -+ &dwz_types_elements_ignore)) -+ { -+ warning (_("could not read '.gdb_index' section from %s; skipping"), -+ bfd_get_filename (dwz->dwz_bfd)); -+ return 0; -+ } -+ } -+ -+ if (!create_cus_from_index (objfile, cu_list, cu_list_elements, -+ dwz_list, dwz_list_elements)) - return 0; - - if (types_list_elements) -@@ -2635,7 +2740,10 @@ to use the section anyway."), - return 0; - } - -- create_addrmap_from_index (objfile, map); -+ create_addrmap_from_index (objfile, &local_map); -+ -+ map = obstack_alloc (&objfile->objfile_obstack, sizeof (struct mapped_index)); -+ *map = local_map; - - dwarf2_per_objfile->index_table = map; - dwarf2_per_objfile->using_index = 1; -@@ -3686,6 +3794,22 @@ read_comp_unit_head (struct comp_unit_head *cu_header, - return info_ptr; - } - -+/* Helper function that returns the proper abbrev section for -+ THIS_CU. */ -+ -+static struct dwarf2_section_info * -+get_abbrev_section_for_cu (struct dwarf2_per_cu_data *this_cu) -+{ -+ struct dwarf2_section_info *abbrev; -+ -+ if (this_cu->is_dwz) -+ abbrev = &dwarf2_get_dwz_file ()->abbrev; -+ else -+ abbrev = &dwarf2_per_objfile->abbrev; -+ -+ return abbrev; -+} -+ - /* Subroutine of read_and_check_comp_unit_head and - read_and_check_type_unit_head to simplify them. - Perform various error checking on the header. */ -@@ -3704,8 +3828,7 @@ error_check_comp_unit_head (struct comp_unit_head *header, - filename); - - if (header->abbrev_offset.sect_off -- >= dwarf2_section_size (dwarf2_per_objfile->objfile, -- &dwarf2_per_objfile->abbrev)) -+ >= dwarf2_section_size (dwarf2_per_objfile->objfile, abbrev_section)) - error (_("Dwarf Error: bad offset (0x%lx) in compilation unit header " - "(offset 0x%lx + 6) [in module %s]"), - (long) header->abbrev_offset.sect_off, (long) header->offset.sect_off, -@@ -3942,6 +4065,7 @@ create_debug_types_hash_table (struct dwo_file *dwo_file, - { - bfd *abfd; - gdb_byte *info_ptr, *end_ptr; -+ struct dwarf2_section_info *abbrev_section; - - dwarf2_read_section (objfile, section); - info_ptr = section->buffer; -@@ -3953,6 +4077,11 @@ create_debug_types_hash_table (struct dwo_file *dwo_file, - not present, in which case section->asection will be NULL. */ - abfd = section->asection->owner; - -+ if (dwo_file) -+ abbrev_section = &dwo_file->sections.abbrev; -+ else -+ abbrev_section = &dwarf2_per_objfile->abbrev; -+ - if (types_htab == NULL) - { - if (dwo_file) -@@ -4192,7 +4321,8 @@ init_cutu_and_read_dies (struct dwarf2_per_cu_data *this_cu, - dwarf2_read_section (objfile, section); - - begin_info_ptr = info_ptr = section->buffer + this_cu->offset.sect_off; -- abbrev_section = &dwarf2_per_objfile->abbrev; -+ -+ abbrev_section = get_abbrev_section_for_cu (this_cu); - - if (use_existing_cu && this_cu->cu != NULL) - { -@@ -4574,7 +4704,7 @@ init_cutu_and_read_dies_simple (struct dwarf2_per_cu_data *this_cu, - void *data) - { - init_cutu_and_read_dies_no_follow (this_cu, -- &dwarf2_per_objfile->abbrev, -+ get_abbrev_section_for_cu (this_cu), - NULL, - die_reader_func, data); - } -@@ -5202,6 +5332,9 @@ set_partial_user (struct objfile *objfile) - struct partial_symtab *pst = per_cu->v.psymtab; - int j; - -+ if (pst == NULL) -+ continue; -+ - for (j = 0; j < pst->number_of_dependencies; ++j) - { - /* Set the 'user' field only if it is not already set. */ -@@ -5296,38 +5429,32 @@ load_partial_comp_unit (struct dwarf2_per_cu_data *this_cu) - load_partial_comp_unit_reader, NULL); - } - --/* Create a list of all compilation units in OBJFILE. -- This is only done for -readnow and building partial symtabs. */ -- - static void --create_all_comp_units (struct objfile *objfile) -+read_comp_units_from_section (struct objfile *objfile, -+ struct dwarf2_section_info *section, -+ unsigned int is_dwz, -+ int *n_allocated, -+ int *n_comp_units, -+ struct dwarf2_per_cu_data ***all_comp_units) - { -- int n_allocated; -- int n_comp_units; -- struct dwarf2_per_cu_data **all_comp_units; - gdb_byte *info_ptr; -+ bfd *abfd = section->asection->owner; - -- dwarf2_read_section (objfile, &dwarf2_per_objfile->info); -- info_ptr = dwarf2_per_objfile->info.buffer; -+ dwarf2_read_section (objfile, section); - -- n_comp_units = 0; -- n_allocated = 10; -- all_comp_units = xmalloc (n_allocated -- * sizeof (struct dwarf2_per_cu_data *)); -+ info_ptr = section->buffer; - -- while (info_ptr < dwarf2_per_objfile->info.buffer -- + dwarf2_per_objfile->info.size) -+ while (info_ptr < section->buffer + section->size) - { - unsigned int length, initial_length_size; - struct dwarf2_per_cu_data *this_cu; - sect_offset offset; - -- offset.sect_off = info_ptr - dwarf2_per_objfile->info.buffer; -+ offset.sect_off = info_ptr - section->buffer; - - /* Read just enough information to find out where the next - compilation unit is. */ -- length = read_initial_length (objfile->obfd, info_ptr, -- &initial_length_size); -+ length = read_initial_length (abfd, info_ptr, &initial_length_size); - - /* Save the compilation unit for later lookup. */ - this_cu = obstack_alloc (&objfile->objfile_obstack, -@@ -5335,20 +5462,50 @@ create_all_comp_units (struct objfile *objfile) - memset (this_cu, 0, sizeof (*this_cu)); - this_cu->offset = offset; - this_cu->length = length + initial_length_size; -+ this_cu->is_dwz = is_dwz; - this_cu->objfile = objfile; -- this_cu->info_or_types_section = &dwarf2_per_objfile->info; -+ this_cu->info_or_types_section = section; - -- if (n_comp_units == n_allocated) -+ if (*n_comp_units == *n_allocated) - { -- n_allocated *= 2; -- all_comp_units = xrealloc (all_comp_units, -- n_allocated -- * sizeof (struct dwarf2_per_cu_data *)); -+ *n_allocated *= 2; -+ *all_comp_units = xrealloc (*all_comp_units, -+ *n_allocated -+ * sizeof (struct dwarf2_per_cu_data *)); - } -- all_comp_units[n_comp_units++] = this_cu; -+ (*all_comp_units)[*n_comp_units] = this_cu; -+ ++*n_comp_units; - - info_ptr = info_ptr + this_cu->length; - } -+} -+ -+/* Create a list of all compilation units in OBJFILE. -+ This is only done for -readnow and building partial symtabs. */ -+ -+static void -+create_all_comp_units (struct objfile *objfile) -+{ -+ int n_allocated; -+ int n_comp_units; -+ struct dwarf2_per_cu_data **all_comp_units; -+ -+ n_comp_units = 0; -+ n_allocated = 10; -+ all_comp_units = xmalloc (n_allocated -+ * sizeof (struct dwarf2_per_cu_data *)); -+ -+ read_comp_units_from_section (objfile, &dwarf2_per_objfile->info, 0, -+ &n_allocated, &n_comp_units, &all_comp_units); -+ -+ if (bfd_get_section_by_name (objfile->obfd, ".gnu_debugaltlink") != NULL) -+ { -+ struct dwz_file *dwz = dwarf2_get_dwz_file (); -+ -+ read_comp_units_from_section (objfile, &dwz->info, 1, -+ &n_allocated, &n_comp_units, -+ &all_comp_units); -+ } - - dwarf2_per_objfile->all_comp_units - = obstack_alloc (&objfile->objfile_obstack, -@@ -5441,6 +5598,7 @@ scan_partial_symbols (struct partial_die_info *first_die, CORE_ADDR *lowpc, - } - - per_cu = dwarf2_find_containing_comp_unit (pdi->d.offset, -+ pdi->is_dwz, - cu->objfile); - - /* Go read the partial unit, if needed. */ -@@ -5498,7 +5656,8 @@ partial_die_parent_scope (struct partial_die_info *pdi, - - real_pdi = pdi; - while (real_pdi->has_specification) -- real_pdi = find_partial_die (real_pdi->spec_offset, cu); -+ real_pdi = find_partial_die (real_pdi->spec_offset, -+ real_pdi->spec_is_dwz, cu); - - parent = real_pdi->die_parent; - if (parent == NULL) -@@ -5998,6 +6157,9 @@ skip_one_die (const struct die_reader_specs *reader, gdb_byte *info_ptr, - else - info_ptr += cu->header.offset_size; - break; -+ case DW_FORM_GNU_ref_alt: -+ info_ptr += cu->header.offset_size; -+ break; - case DW_FORM_addr: - info_ptr += cu->header.addr_size; - break; -@@ -6027,6 +6189,7 @@ skip_one_die (const struct die_reader_specs *reader, gdb_byte *info_ptr, - break; - case DW_FORM_sec_offset: - case DW_FORM_strp: -+ case DW_FORM_GNU_strp_alt: - info_ptr += cu->header.offset_size; - break; - case DW_FORM_exprloc: -@@ -6694,7 +6857,9 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu, - it, by scanning the DIE's below the compilation unit. */ - get_scope_pc_bounds (cu->dies, &lowpc, &highpc, cu); - -- static_block = end_symtab_get_static_block (highpc + baseaddr, objfile, 0); -+ static_block -+ = end_symtab_get_static_block (highpc + baseaddr, objfile, 0, -+ per_cu->s.imported_symtabs != NULL); - - /* If the comp unit has DW_AT_ranges, it may have discontiguous ranges. - Also, DW_AT_ranges may record ranges not belonging to any child DIEs -@@ -6845,9 +7010,11 @@ process_imported_unit_die (struct die_info *die, struct dwarf2_cu *cu) - struct dwarf2_per_cu_data *per_cu; - struct symtab *imported_symtab; - sect_offset offset; -+ int is_dwz; - - offset = dwarf2_get_ref_die_offset (attr); -- per_cu = dwarf2_find_containing_comp_unit (offset, cu->objfile); -+ is_dwz = (attr->form == DW_FORM_GNU_ref_alt || cu->per_cu->is_dwz); -+ per_cu = dwarf2_find_containing_comp_unit (offset, is_dwz, cu->objfile); - - /* Queue the unit, if needed. */ - if (maybe_queue_comp_unit (cu, per_cu, cu->language)) -@@ -8116,24 +8283,21 @@ try_open_dwo_file (const char *file_name) - if (desc < 0) - return NULL; - -- sym_bfd = bfd_fopen (absolute_name, gnutarget, FOPEN_RB, desc); -+ sym_bfd = gdb_bfd_open (absolute_name, gnutarget, desc); - if (!sym_bfd) - { - xfree (absolute_name); - return NULL; - } -+ xfree (absolute_name); - bfd_set_cacheable (sym_bfd, 1); - - if (!bfd_check_format (sym_bfd, bfd_object)) - { -- bfd_close (sym_bfd); /* This also closes desc. */ -- xfree (absolute_name); -+ gdb_bfd_unref (sym_bfd); /* This also closes desc. */ - return NULL; - } - -- /* bfd_usrdata exists for applications and libbfd must not touch it. */ -- gdb_assert (bfd_usrdata (sym_bfd) == NULL); -- - return sym_bfd; - } - -@@ -8325,20 +8489,7 @@ free_dwo_file (struct dwo_file *dwo_file, struct objfile *objfile) - struct dwarf2_section_info *section; - - gdb_assert (dwo_file->dwo_bfd != objfile->obfd); -- bfd_close (dwo_file->dwo_bfd); -- -- munmap_section_buffer (&dwo_file->sections.abbrev); -- munmap_section_buffer (&dwo_file->sections.info); -- munmap_section_buffer (&dwo_file->sections.line); -- munmap_section_buffer (&dwo_file->sections.loc); -- munmap_section_buffer (&dwo_file->sections.str); -- munmap_section_buffer (&dwo_file->sections.str_offsets); -- -- for (ix = 0; -- VEC_iterate (dwarf2_section_info_def, dwo_file->sections.types, -- ix, section); -- ++ix) -- munmap_section_buffer (section); -+ gdb_bfd_unref (dwo_file->dwo_bfd); - - VEC_free (dwarf2_section_info_def, dwo_file->sections.types); - } -@@ -10721,6 +10872,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) +@@ -11677,6 +11686,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -2634,7 +902,7 @@ index deee5a2..b2f052b 100644 /* Extract all information from a DW_TAG_array_type DIE and put it in the DIE's type field. For now, this only handles one dimensional arrays. */ -@@ -10734,7 +10908,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -11690,7 +11722,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) struct type *element_type, *range_type, *index_type; struct type **range_types = NULL; struct attribute *attr; @@ -2643,7 +911,7 @@ index deee5a2..b2f052b 100644 struct cleanup *back_to; char *name; -@@ -10787,17 +10961,19 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -11743,17 +11775,19 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) type = element_type; if (read_array_order (die, cu) == DW_ORD_col_major) @@ -2674,7 +942,7 @@ index deee5a2..b2f052b 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -11281,29 +11457,114 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -12379,29 +12413,114 @@ 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; @@ -2802,7 +1070,7 @@ index deee5a2..b2f052b 100644 char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -11607,7 +11868,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -12705,7 +12824,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; struct attribute *attr; @@ -2811,7 +1079,7 @@ index deee5a2..b2f052b 100644 int low_default_is_valid; char *name; LONGEST negative_mask; -@@ -11663,42 +11924,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -12761,42 +12880,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) "- DIE at 0x%x [in module %s]"), die->offset.sect_off, cu->objfile->name); @@ -2854,7 +1122,7 @@ index deee5a2..b2f052b 100644 /* Dwarf-2 specifications explicitly allows to create subrange types without specifying a base type. In that case, the base type must be set to the type of -@@ -11737,24 +11962,163 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -12835,24 +12918,163 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) } } @@ -2896,10 +1164,7 @@ index deee5a2..b2f052b 100644 + struct die_info *target_die; + struct dwarf2_cu *target_cu = cu; + struct attribute *target_loc_attr; - -- /* Ada expects an empty array on no boundary attributes. */ -- if (attr == NULL && cu->language != language_ada) -- TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; ++ + target_die = follow_die_ref_or_sig (die, attr, &target_cu); + gdb_assert (target_cu->objfile == cu->objfile); + target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu); @@ -2937,7 +1202,10 @@ index deee5a2..b2f052b 100644 + if (low >= 0) + TYPE_UNSIGNED (range_type) = 1; + } -+ + +- /* Ada expects an empty array on no boundary attributes. */ +- if (attr == NULL && cu->language != language_ada) +- TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; + attr = dwarf2_attr (die, DW_AT_upper_bound, cu); + if (!attr || (!attr_form_is_block (attr) && !attr_form_is_constant (attr) + && !is_ref_attr (attr))) @@ -3032,214 +1300,7 @@ index deee5a2..b2f052b 100644 name = dwarf2_name (die, cu); if (name) -@@ -12544,6 +12908,8 @@ read_partial_die (const struct die_reader_specs *reader, - case DW_AT_extension: - part_die->has_specification = 1; - part_die->spec_offset = dwarf2_get_ref_die_offset (&attr); -+ part_die->spec_is_dwz = (attr.form == DW_FORM_GNU_ref_alt -+ || cu->per_cu->is_dwz); - break; - case DW_AT_sibling: - /* Ignore absolute siblings, they might point outside of -@@ -12590,7 +12956,11 @@ read_partial_die (const struct die_reader_specs *reader, - - case DW_AT_import: - if (part_die->tag == DW_TAG_imported_unit) -- part_die->d.offset = dwarf2_get_ref_die_offset (&attr); -+ { -+ part_die->d.offset = dwarf2_get_ref_die_offset (&attr); -+ part_die->is_dwz = (attr.form == DW_FORM_GNU_ref_alt -+ || cu->per_cu->is_dwz); -+ } - break; - - default: -@@ -12661,13 +13031,14 @@ find_partial_die_in_comp_unit (sect_offset offset, struct dwarf2_cu *cu) - DW_FORM_ref_sig8). */ - - static struct partial_die_info * --find_partial_die (sect_offset offset, struct dwarf2_cu *cu) -+find_partial_die (sect_offset offset, int offset_in_dwz, struct dwarf2_cu *cu) - { - struct objfile *objfile = cu->objfile; - struct dwarf2_per_cu_data *per_cu = NULL; - struct partial_die_info *pd = NULL; - -- if (offset_in_cu_p (&cu->header, offset)) -+ if (offset_in_dwz == cu->per_cu->is_dwz -+ && offset_in_cu_p (&cu->header, offset)) - { - pd = find_partial_die_in_comp_unit (offset, cu); - if (pd != NULL) -@@ -12686,7 +13057,8 @@ find_partial_die (sect_offset offset, struct dwarf2_cu *cu) - (long) cu->header.offset.sect_off, (long) offset.sect_off, - bfd_get_filename (objfile->obfd)); - } -- per_cu = dwarf2_find_containing_comp_unit (offset, objfile); -+ per_cu = dwarf2_find_containing_comp_unit (offset, offset_in_dwz, -+ objfile); - - if (per_cu->cu == NULL || per_cu->cu->partial_dies == NULL) - load_partial_comp_unit (per_cu); -@@ -12744,7 +13116,8 @@ guess_partial_die_structure_name (struct partial_die_info *struct_pdi, - - real_pdi = struct_pdi; - while (real_pdi->has_specification) -- real_pdi = find_partial_die (real_pdi->spec_offset, cu); -+ real_pdi = find_partial_die (real_pdi->spec_offset, -+ real_pdi->spec_is_dwz, cu); - - if (real_pdi->die_parent != NULL) - return; -@@ -12792,7 +13165,8 @@ fixup_partial_die (struct partial_die_info *part_die, - { - struct partial_die_info *spec_die; - -- spec_die = find_partial_die (part_die->spec_offset, cu); -+ spec_die = find_partial_die (part_die->spec_offset, -+ part_die->spec_is_dwz, cu); - - fixup_partial_die (spec_die, cu); - -@@ -12880,6 +13254,10 @@ read_attribute_value (const struct die_reader_specs *reader, - &cu->header, &bytes_read); - info_ptr += bytes_read; - break; -+ case DW_FORM_GNU_ref_alt: -+ DW_UNSND (attr) = read_offset (abfd, info_ptr, &cu->header, &bytes_read); -+ info_ptr += bytes_read; -+ break; - case DW_FORM_addr: - DW_ADDR (attr) = read_address (abfd, info_ptr, cu, &bytes_read); - info_ptr += bytes_read; -@@ -12922,10 +13300,25 @@ read_attribute_value (const struct die_reader_specs *reader, - info_ptr += bytes_read; - break; - case DW_FORM_strp: -- DW_STRING (attr) = read_indirect_string (abfd, info_ptr, cu_header, -- &bytes_read); -- DW_STRING_IS_CANONICAL (attr) = 0; -- info_ptr += bytes_read; -+ if (!cu->per_cu->is_dwz) -+ { -+ DW_STRING (attr) = read_indirect_string (abfd, info_ptr, cu_header, -+ &bytes_read); -+ DW_STRING_IS_CANONICAL (attr) = 0; -+ info_ptr += bytes_read; -+ break; -+ } -+ /* FALLTHROUGH */ -+ case DW_FORM_GNU_strp_alt: -+ { -+ struct dwz_file *dwz = dwarf2_get_dwz_file (); -+ LONGEST str_offset = read_offset (abfd, info_ptr, cu_header, -+ &bytes_read); -+ -+ DW_STRING (attr) = read_indirect_string_from_dwz (dwz, str_offset); -+ DW_STRING_IS_CANONICAL (attr) = 0; -+ info_ptr += bytes_read; -+ } - break; - case DW_FORM_exprloc: - case DW_FORM_block: -@@ -13037,6 +13430,10 @@ read_attribute_value (const struct die_reader_specs *reader, - bfd_get_filename (abfd)); - } - -+ /* Super hack. */ -+ if (cu->per_cu->is_dwz && is_ref_attr (attr)) -+ attr->form = DW_FORM_GNU_ref_alt; -+ - /* We have seen instances where the compiler tried to emit a byte - size attribute of -1 which ended up being encoded as an unsigned - 0xffffffff. Although 0xffffffff is technically a valid size value, -@@ -13333,6 +13730,30 @@ read_indirect_string_at_offset (bfd *abfd, LONGEST str_offset) - return (char *) (dwarf2_per_objfile->str.buffer + str_offset); - } - -+/* Read a string at offset STR_OFFSET in the .debug_str section from -+ the .dwz file DWZ. Throw an error if the offset is too large. If -+ the string consists of a single NUL byte, return NULL; otherwise -+ return a pointer to the string. */ -+ -+static char * -+read_indirect_string_from_dwz (struct dwz_file *dwz, LONGEST str_offset) -+{ -+ dwarf2_read_section (dwarf2_per_objfile->objfile, &dwz->str); -+ -+ if (dwz->str.buffer == NULL) -+ error (_("DW_FORM_GNU_strp_alt used without .debug_str " -+ "section [in module %s]"), -+ bfd_get_filename (dwz->dwz_bfd)); -+ if (str_offset >= dwz->str.size) -+ error (_("DW_FORM_GNU_strp_alt pointing outside of " -+ ".debug_str section [in module %s]"), -+ bfd_get_filename (dwz->dwz_bfd)); -+ gdb_assert (HOST_CHAR_BIT == 8); -+ if (dwz->str.buffer[str_offset] == '\0') -+ return NULL; -+ return (char *) (dwz->str.buffer + str_offset); -+} -+ - static char * - read_indirect_string (bfd *abfd, gdb_byte *buf, - const struct comp_unit_head *cu_header, -@@ -13804,6 +14225,30 @@ add_file_name (struct line_header *lh, - fe->symtab = NULL; - } - -+/* A convenience function to find the proper .debug_line section for a -+ CU. */ -+ -+static struct dwarf2_section_info * -+get_debug_line_section (struct dwarf2_cu *cu) -+{ -+ struct dwarf2_section_info *section; -+ -+ /* For TUs in DWO files, the DW_AT_stmt_list attribute lives in the -+ DWO file. */ -+ if (cu->dwo_unit && cu->per_cu->is_debug_types) -+ section = &cu->dwo_unit->dwo_file->sections.line; -+ else if (cu->per_cu->is_dwz) -+ { -+ struct dwz_file *dwz = dwarf2_get_dwz_file (); -+ -+ section = &dwz->line; -+ } -+ else -+ section = &dwarf2_per_objfile->line; -+ -+ return section; -+} -+ - /* Read the statement program header starting at OFFSET in - .debug_line, or .debug_line.dwo. Return a pointer - to a struct line_header, allocated using xmalloc. -@@ -13824,13 +14269,7 @@ dwarf_decode_line_header (unsigned int offset, struct dwarf2_cu *cu) - struct dwarf2_section_info *section; - bfd *abfd; - -- /* For TUs in DWO files, the DW_AT_stmt_list attribute lives in the -- DWO file. */ -- if (cu->dwo_unit && cu->per_cu->is_debug_types) -- section = &cu->dwo_unit->dwo_file->sections.line; -- else -- section = &dwarf2_per_objfile->line; -- -+ section = get_debug_line_section (cu); - dwarf2_read_section (dwarf2_per_objfile->objfile, section); - if (section->buffer == NULL) - { -@@ -14155,7 +14594,7 @@ dwarf_decode_lines_1 (struct line_header *lh, const char *comp_dir, - GCd by the linker. Ignore it. PR gdb/12528 */ - - long line_offset -- = line_ptr - dwarf2_per_objfile->line.buffer; -+ = line_ptr - get_debug_line_section (cu)->buffer; - - complaint (&symfile_complaints, - _(".debug_line address at offset 0x%lx is 0 " -@@ -14534,10 +14973,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, +@@ -15712,10 +15934,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, (i.e. when the value of a register or memory location is referenced, or a thread-local block, etc.). Then again, it might not be worthwhile. I'm assuming that it isn't unless performance @@ -3254,7 +1315,7 @@ index deee5a2..b2f052b 100644 if (SYMBOL_COMPUTED_OPS (sym) == &dwarf2_loclist_funcs) cu->has_loclist = 1; -@@ -14578,6 +15019,8 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +@@ -15756,6 +15980,8 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, else sym = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symbol); OBJSTAT (objfile, n_syms++); @@ -3263,32 +1324,7 @@ index deee5a2..b2f052b 100644 /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language); -@@ -15001,6 +15444,7 @@ dwarf2_const_value_attr (struct attribute *attr, struct type *type, - case DW_FORM_string: - case DW_FORM_strp: - case DW_FORM_GNU_str_index: -+ case DW_FORM_GNU_strp_alt: - /* DW_STRING is already allocated on the objfile obstack, point - directly to it. */ - *bytes = (gdb_byte *) DW_STRING (attr); -@@ -15187,7 +15631,15 @@ lookup_die_type (struct die_info *die, struct attribute *attr, - - /* First see if we have it cached. */ - -- if (is_ref_attr (attr)) -+ if (attr->form == DW_FORM_GNU_ref_alt) -+ { -+ struct dwarf2_per_cu_data *per_cu; -+ sect_offset offset = dwarf2_get_ref_die_offset (attr); -+ -+ per_cu = dwarf2_find_containing_comp_unit (offset, 1, cu->objfile); -+ this_type = get_die_type_at_offset (offset, per_cu); -+ } -+ else if (is_ref_attr (attr)) - { - sect_offset offset = dwarf2_get_ref_die_offset (attr); - -@@ -15352,6 +15804,9 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu) +@@ -16565,6 +16791,9 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -3298,213 +1334,7 @@ index deee5a2..b2f052b 100644 return this_type; } -@@ -15960,6 +16415,10 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) - fprintf_unfiltered (f, "ref address: "); - fputs_filtered (hex_string (DW_UNSND (&die->attrs[i])), f); - break; -+ case DW_FORM_GNU_ref_alt: -+ fprintf_unfiltered (f, "alt ref address: "); -+ fputs_filtered (hex_string (DW_UNSND (&die->attrs[i])), f); -+ break; - case DW_FORM_ref1: - case DW_FORM_ref2: - case DW_FORM_ref4: -@@ -15991,6 +16450,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die) - case DW_FORM_string: - case DW_FORM_strp: - case DW_FORM_GNU_str_index: -+ case DW_FORM_GNU_strp_alt: - fprintf_unfiltered (f, "string: \"%s\" (%s canonicalized)", - DW_STRING (&die->attrs[i]) - ? DW_STRING (&die->attrs[i]) : "", -@@ -16094,6 +16554,7 @@ is_ref_attr (struct attribute *attr) - case DW_FORM_ref4: - case DW_FORM_ref8: - case DW_FORM_ref_udata: -+ case DW_FORM_GNU_ref_alt: - return 1; - default: - return 0; -@@ -16171,7 +16632,8 @@ follow_die_ref_or_sig (struct die_info *src_die, struct attribute *attr, - Returns NULL if OFFSET is invalid. */ - - static struct die_info * --follow_die_offset (sect_offset offset, struct dwarf2_cu **ref_cu) -+follow_die_offset (sect_offset offset, int offset_in_dwz, -+ struct dwarf2_cu **ref_cu) - { - struct die_info temp_die; - struct dwarf2_cu *target_cu, *cu = *ref_cu; -@@ -16188,11 +16650,13 @@ follow_die_offset (sect_offset offset, struct dwarf2_cu **ref_cu) - if (! offset_in_cu_p (&cu->header, offset)) - return NULL; - } -- else if (! offset_in_cu_p (&cu->header, offset)) -+ else if (offset_in_dwz != cu->per_cu->is_dwz -+ || ! offset_in_cu_p (&cu->header, offset)) - { - struct dwarf2_per_cu_data *per_cu; - -- per_cu = dwarf2_find_containing_comp_unit (offset, cu->objfile); -+ per_cu = dwarf2_find_containing_comp_unit (offset, offset_in_dwz, -+ cu->objfile); - - /* If necessary, add it to the queue and load its DIEs. */ - if (maybe_queue_comp_unit (cu, per_cu, cu->language)) -@@ -16224,7 +16688,10 @@ follow_die_ref (struct die_info *src_die, struct attribute *attr, - struct dwarf2_cu *cu = *ref_cu; - struct die_info *die; - -- die = follow_die_offset (offset, ref_cu); -+ die = follow_die_offset (offset, -+ (attr->form == DW_FORM_GNU_ref_alt -+ || cu->per_cu->is_dwz), -+ ref_cu); - if (!die) - error (_("Dwarf Error: Cannot find DIE at 0x%x referenced from DIE " - "at 0x%x [in module %s]"), -@@ -16255,7 +16722,7 @@ dwarf2_fetch_die_location_block (cu_offset offset_in_cu, - load_cu (per_cu); - cu = per_cu->cu; - -- die = follow_die_offset (offset, &cu); -+ die = follow_die_offset (offset, per_cu->is_dwz, &cu); - if (!die) - error (_("Dwarf Error: Cannot find DIE at 0x%x referenced in module %s"), - offset.sect_off, per_cu->objfile->name); -@@ -17049,6 +17516,7 @@ skip_form_bytes (bfd *abfd, gdb_byte *bytes, gdb_byte *buffer_end, - - case DW_FORM_sec_offset: - case DW_FORM_strp: -+ case DW_FORM_GNU_strp_alt: - bytes += offset_size; - break; - -@@ -17204,7 +17672,7 @@ dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end, - struct macro_source_file *current_file, - struct line_header *lh, char *comp_dir, - struct dwarf2_section_info *section, -- int section_is_gnu, -+ int section_is_gnu, int section_is_dwz, - unsigned int offset_size, - struct objfile *objfile, - htab_t include_hash) -@@ -17255,6 +17723,8 @@ dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end, - case DW_MACRO_GNU_undef: - case DW_MACRO_GNU_define_indirect: - case DW_MACRO_GNU_undef_indirect: -+ case DW_MACRO_GNU_define_indirect_alt: -+ case DW_MACRO_GNU_undef_indirect_alt: - { - unsigned int bytes_read; - int line; -@@ -17277,11 +17747,21 @@ dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end, - str_offset = read_offset_1 (abfd, mac_ptr, offset_size); - mac_ptr += offset_size; - -- body = read_indirect_string_at_offset (abfd, str_offset); -+ if (macinfo_type == DW_MACRO_GNU_define_indirect_alt -+ || macinfo_type == DW_MACRO_GNU_undef_indirect_alt -+ || section_is_dwz) -+ { -+ struct dwz_file *dwz = dwarf2_get_dwz_file (); -+ -+ body = read_indirect_string_from_dwz (dwz, str_offset); -+ } -+ else -+ body = read_indirect_string_at_offset (abfd, str_offset); - } - - is_define = (macinfo_type == DW_MACRO_GNU_define -- || macinfo_type == DW_MACRO_GNU_define_indirect); -+ || macinfo_type == DW_MACRO_GNU_define_indirect -+ || macinfo_type == DW_MACRO_GNU_define_indirect_alt); - if (! current_file) - { - /* DWARF violation as no main source is present. */ -@@ -17305,7 +17785,8 @@ dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end, - else - { - gdb_assert (macinfo_type == DW_MACRO_GNU_undef -- || macinfo_type == DW_MACRO_GNU_undef_indirect); -+ || macinfo_type == DW_MACRO_GNU_undef_indirect -+ || macinfo_type == DW_MACRO_GNU_undef_indirect_alt); - macro_undef (current_file, line, body); - } - } -@@ -17380,6 +17861,7 @@ dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end, - break; - - case DW_MACRO_GNU_transparent_include: -+ case DW_MACRO_GNU_transparent_include_alt: - { - LONGEST offset; - void **slot; -@@ -17398,13 +17880,32 @@ dwarf_decode_macro_bytes (bfd *abfd, gdb_byte *mac_ptr, gdb_byte *mac_end, - } - else - { -+ bfd *include_bfd = abfd; -+ struct dwarf2_section_info *include_section = section; -+ struct dwarf2_section_info alt_section; -+ gdb_byte *include_mac_end = mac_end; -+ int is_dwz = section_is_dwz; -+ - *slot = mac_ptr; - -- dwarf_decode_macro_bytes (abfd, -- section->buffer + offset, -- mac_end, current_file, -+ if (macinfo_type == DW_MACRO_GNU_transparent_include_alt) -+ { -+ struct dwz_file *dwz = dwarf2_get_dwz_file (); -+ -+ dwarf2_read_section (dwarf2_per_objfile->objfile, -+ &dwz->macro); -+ -+ include_bfd = dwz->macro.asection->owner; -+ include_section = &dwz->macro; -+ include_mac_end = dwz->macro.buffer + dwz->macro.size; -+ is_dwz = 1; -+ } -+ -+ dwarf_decode_macro_bytes (include_bfd, -+ include_section->buffer + offset, -+ include_mac_end, current_file, - lh, comp_dir, -- section, section_is_gnu, -+ section, section_is_gnu, is_dwz, - offset_size, objfile, include_hash); - - htab_remove_elt (include_hash, mac_ptr); -@@ -17571,6 +18072,8 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, - - case DW_MACRO_GNU_define_indirect: - case DW_MACRO_GNU_undef_indirect: -+ case DW_MACRO_GNU_define_indirect_alt: -+ case DW_MACRO_GNU_undef_indirect_alt: - { - unsigned int bytes_read; - -@@ -17581,6 +18084,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, - break; - - case DW_MACRO_GNU_transparent_include: -+ case DW_MACRO_GNU_transparent_include_alt: - /* Note that, according to the spec, a transparent include - chain cannot call DW_MACRO_GNU_start_file. So, we can just - skip this opcode. */ -@@ -17623,7 +18127,8 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, - slot = htab_find_slot (include_hash, mac_ptr, INSERT); - *slot = mac_ptr; - dwarf_decode_macro_bytes (abfd, mac_ptr, mac_end, -- current_file, lh, comp_dir, section, section_is_gnu, -+ current_file, lh, comp_dir, section, -+ section_is_gnu, 0, - offset_size, objfile, include_hash); - do_cleanups (cleanup); - } -@@ -17721,62 +18226,100 @@ fill_in_loclist_baton (struct dwarf2_cu *cu, +@@ -18999,62 +19228,100 @@ fill_in_loclist_baton (struct dwarf2_cu *cu, baton->from_dwo = cu->dwo_unit != NULL; } @@ -3544,15 +1374,15 @@ index deee5a2..b2f052b 100644 struct objfile *objfile = dwarf2_per_objfile->objfile; struct dwarf2_section_info *section = cu_debug_loc_section (cu); + struct dwarf2_loclist_baton *baton; -+ + +- if (attr_form_is_section_offset (attr) + /* DW_AT_location of the referenced DIE may be missing if the referenced + variable has been optimized out. */ + if (!attr) + return NULL; + + dwarf2_read_section (dwarf2_per_objfile->objfile, section); - -- if (attr_form_is_section_offset (attr) ++ + if (!(attr_form_is_section_offset (attr) /* .debug_loc{,.dwo} may not exist at all, or the offset may be outside the section. If so, fall through to the complaint in the @@ -3643,48 +1473,7 @@ index deee5a2..b2f052b 100644 } } -@@ -17878,28 +18421,35 @@ dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *per_cu) - - static struct dwarf2_per_cu_data * - dwarf2_find_containing_comp_unit (sect_offset offset, -+ unsigned int offset_in_dwz, - struct objfile *objfile) - { - struct dwarf2_per_cu_data *this_cu; - int low, high; -+ const sect_offset *cu_off; - - low = 0; - high = dwarf2_per_objfile->n_comp_units - 1; - while (high > low) - { -+ struct dwarf2_per_cu_data *mid_cu; - int mid = low + (high - low) / 2; - -- if (dwarf2_per_objfile->all_comp_units[mid]->offset.sect_off -- >= offset.sect_off) -+ mid_cu = dwarf2_per_objfile->all_comp_units[mid]; -+ cu_off = &mid_cu->offset; -+ if (mid_cu->is_dwz > offset_in_dwz -+ || (mid_cu->is_dwz == offset_in_dwz -+ && cu_off->sect_off >= offset.sect_off)) - high = mid; - else - low = mid + 1; - } - gdb_assert (low == high); -- if (dwarf2_per_objfile->all_comp_units[low]->offset.sect_off -- > offset.sect_off) -+ this_cu = dwarf2_per_objfile->all_comp_units[low]; -+ cu_off = &this_cu->offset; -+ if (this_cu->is_dwz != offset_in_dwz || cu_off->sect_off > offset.sect_off) - { -- if (low == 0) -+ if (low == 0 || this_cu->is_dwz != offset_in_dwz) - error (_("Dwarf Error: could not find partial DIE containing " - "offset 0x%lx [in module %s]"), - (long) offset.sect_off, bfd_get_filename (objfile->obfd)); -@@ -18140,6 +18690,25 @@ per_cu_offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -19425,6 +19692,25 @@ per_cu_offset_and_type_eq (const void *item_lhs, const void *item_rhs) && ofs_lhs->offset.sect_off == ofs_rhs->offset.sect_off); } @@ -3710,7 +1499,7 @@ index deee5a2..b2f052b 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. -@@ -18164,6 +18733,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) +@@ -19449,6 +19735,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) struct dwarf2_per_cu_offset_and_type **slot, ofs; struct objfile *objfile = cu->objfile; @@ -3719,117 +1508,8 @@ index deee5a2..b2f052b 100644 /* For Ada types, make sure that the gnat-specific data is always initialized (if not already set). There are a few types where we should not be doing so, because the type-specific area is -@@ -18341,53 +18912,13 @@ show_dwarf2_cmd (char *args, int from_tty) - cmd_show_list (show_dwarf2_cmdlist, from_tty, ""); - } - --/* If section described by INFO was mmapped, munmap it now. */ -- --static void --munmap_section_buffer (struct dwarf2_section_info *info) --{ -- if (info->map_addr != NULL) -- { --#ifdef HAVE_MMAP -- int res; -- -- res = munmap (info->map_addr, info->map_len); -- gdb_assert (res == 0); --#else -- /* Without HAVE_MMAP, we should never be here to begin with. */ -- gdb_assert_not_reached ("no mmap support"); --#endif -- } --} -- --/* munmap debug sections for OBJFILE, if necessary. */ -+/* Free data associated with OBJFILE, if necessary. */ - - static void - dwarf2_per_objfile_free (struct objfile *objfile, void *d) - { - struct dwarf2_per_objfile *data = d; - int ix; -- struct dwarf2_section_info *section; -- -- /* This is sorted according to the order they're defined in to make it easier -- to keep in sync. */ -- munmap_section_buffer (&data->info); -- munmap_section_buffer (&data->abbrev); -- munmap_section_buffer (&data->line); -- munmap_section_buffer (&data->loc); -- munmap_section_buffer (&data->macinfo); -- munmap_section_buffer (&data->macro); -- munmap_section_buffer (&data->str); -- munmap_section_buffer (&data->ranges); -- munmap_section_buffer (&data->addr); -- munmap_section_buffer (&data->frame); -- munmap_section_buffer (&data->eh_frame); -- munmap_section_buffer (&data->gdb_index); -- -- for (ix = 0; -- VEC_iterate (dwarf2_section_info_def, data->types, ix, section); -- ++ix) -- munmap_section_buffer (section); - - for (ix = 0; ix < dwarf2_per_objfile->n_comp_units; ++ix) - VEC_free (dwarf2_per_cu_ptr, -@@ -18397,6 +18928,9 @@ dwarf2_per_objfile_free (struct objfile *objfile, void *d) - - if (data->dwo_files) - free_dwo_files (data->dwo_files, objfile); -+ -+ if (data->dwz_file && data->dwz_file->dwz_bfd) -+ gdb_bfd_unref (data->dwz_file->dwz_bfd); - } - - -diff --git a/gdb/elfread.c b/gdb/elfread.c -index 1edfb27..0b54b8a 100644 ---- a/gdb/elfread.c -+++ b/gdb/elfread.c -@@ -44,6 +44,7 @@ - #include "gdbthread.h" - #include "regcache.h" - #include "bcache.h" -+#include "gdb_bfd.h" - - extern void _initialize_elfread (void); - -@@ -1108,7 +1109,7 @@ build_id_verify (const char *filename, struct build_id *check) - int retval = 0; - - /* We expect to be silent on the non-existing files. */ -- abfd = bfd_open_maybe_remote (filename); -+ abfd = gdb_bfd_open_maybe_remote (filename); - if (abfd == NULL) - return 0; - -@@ -1123,7 +1124,7 @@ build_id_verify (const char *filename, struct build_id *check) - else - retval = 1; - -- gdb_bfd_close_or_warn (abfd); -+ gdb_bfd_unref (abfd); - - xfree (found); - -@@ -1444,10 +1445,12 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags) - - if (debugfile) - { -+ struct cleanup *cleanup = make_cleanup (xfree, debugfile); - bfd *abfd = symfile_bfd_open (debugfile); - -+ make_cleanup_bfd_unref (abfd); - symbol_file_add_separate (abfd, symfile_flags, objfile); -- xfree (debugfile); -+ do_cleanups (cleanup); - } - } - diff --git a/gdb/eval.c b/gdb/eval.c -index 7d3a8b9..f69dff0 100644 +index c9630df..b797189 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -41,6 +41,7 @@ @@ -3840,7 +1520,7 @@ index 7d3a8b9..f69dff0 100644 #include "gdb_assert.h" -@@ -500,27 +501,217 @@ init_array_element (struct value *array, struct value *element, +@@ -393,27 +394,217 @@ init_array_element (struct value *array, struct value *element, } static struct value * @@ -4074,7 +1754,7 @@ index 7d3a8b9..f69dff0 100644 } -@@ -818,6 +1009,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -710,6 +901,7 @@ evaluate_subexp_standard (struct type *expect_type, int save_pos1; struct symbol *function = NULL; char *function_name = NULL; @@ -4082,7 +1762,7 @@ index 7d3a8b9..f69dff0 100644 pc = (*pos)++; op = exp->elts[pc].opcode; -@@ -1892,6 +2084,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1779,6 +1971,8 @@ evaluate_subexp_standard (struct type *expect_type, /* First determine the type code we are dealing with. */ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); @@ -4091,7 +1771,7 @@ index 7d3a8b9..f69dff0 100644 type = check_typedef (value_type (arg1)); code = TYPE_CODE (type); -@@ -1912,23 +2106,13 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1799,23 +1993,13 @@ evaluate_subexp_standard (struct type *expect_type, code = TYPE_CODE (type); } } @@ -4117,7 +1797,7 @@ index 7d3a8b9..f69dff0 100644 case TYPE_CODE_PTR: case TYPE_CODE_FUNC: -@@ -2361,49 +2545,6 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2242,49 +2426,6 @@ evaluate_subexp_standard (struct type *expect_type, } return (arg1); @@ -4157,8 +1837,8 @@ index 7d3a8b9..f69dff0 100644 - struct type *array_type = check_typedef (value_type (array)); - LONGEST index = subscript_array[i - 1]; - -- lower = f77_get_lowerbound (array_type); -- array = value_subscripted_rvalue (array, index, lower); +- array = value_subscripted_rvalue (array, index, +- f77_get_lowerbound (array_type)); - } - - return array; @@ -4167,7 +1847,7 @@ index 7d3a8b9..f69dff0 100644 case BINOP_LOGICAL_AND: arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); if (noside == EVAL_SKIP) -@@ -2635,15 +2776,23 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2516,15 +2657,23 @@ evaluate_subexp_standard (struct type *expect_type, if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR) expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type)); arg1 = evaluate_subexp (expect_type, exp, pos, noside); @@ -4193,7 +1873,7 @@ index 7d3a8b9..f69dff0 100644 else if (noside == EVAL_AVOID_SIDE_EFFECTS) { type = check_typedef (value_type (arg1)); -@@ -2652,12 +2801,18 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2533,12 +2682,18 @@ evaluate_subexp_standard (struct type *expect_type, /* In C you can dereference an array to get the 1st elt. */ || TYPE_CODE (type) == TYPE_CODE_ARRAY ) @@ -4217,7 +1897,7 @@ index 7d3a8b9..f69dff0 100644 else error (_("Attempt to take contents of a non-pointer value.")); } -@@ -2667,9 +2822,14 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2548,9 +2703,14 @@ evaluate_subexp_standard (struct type *expect_type, do. "long long" variables are rare enough that BUILTIN_TYPE_LONGEST would seem to be a mistake. */ if (TYPE_CODE (type) == TYPE_CODE_INT) @@ -4235,7 +1915,7 @@ index 7d3a8b9..f69dff0 100644 case UNOP_ADDR: /* C++: check for and handle pointer to members. */ -@@ -3011,7 +3171,7 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -2963,7 +3123,7 @@ evaluate_subexp_with_coercion (struct expression *exp, { enum exp_opcode op; int pc; @@ -4244,7 +1924,7 @@ index 7d3a8b9..f69dff0 100644 struct symbol *var; struct type *type; -@@ -3022,13 +3182,18 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -2974,13 +3134,18 @@ evaluate_subexp_with_coercion (struct expression *exp, { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; @@ -4264,7 +1944,7 @@ index 7d3a8b9..f69dff0 100644 return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val); } -@@ -3080,9 +3245,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) +@@ -3038,9 +3203,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) case OP_VAR_VALUE: (*pos) += 4; @@ -4281,7 +1961,7 @@ index 7d3a8b9..f69dff0 100644 default: val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); -@@ -3113,18 +3282,25 @@ parse_and_eval_type (char *p, int length) +@@ -3071,18 +3240,25 @@ parse_and_eval_type (char *p, int length) int calc_f77_array_dims (struct type *array_type) { @@ -4317,95 +1997,11 @@ index 7d3a8b9..f69dff0 100644 - return ndimen; + } -diff --git a/gdb/exec.c b/gdb/exec.c -index 6ba1986..e076609 100644 ---- a/gdb/exec.c -+++ b/gdb/exec.c -@@ -33,6 +33,7 @@ - #include "arch-utils.h" - #include "gdbthread.h" - #include "progspace.h" -+#include "gdb_bfd.h" - - #include - #include "readline/readline.h" -@@ -98,10 +99,8 @@ exec_close (void) - if (exec_bfd) - { - bfd *abfd = exec_bfd; -- char *name = bfd_get_filename (abfd); - -- gdb_bfd_close_or_warn (abfd); -- xfree (name); -+ gdb_bfd_unref (abfd); - - /* Removing target sections may close the exec_ops target. - Clear exec_bfd before doing so to prevent recursion. */ -@@ -128,17 +127,13 @@ exec_close_1 (int quitting) - vp = nxt; - nxt = vp->nxt; - -- /* if there is an objfile associated with this bfd, -- free_objfile() will do proper cleanup of objfile *and* bfd. */ -- - if (vp->objfile) - { - free_objfile (vp->objfile); - need_symtab_cleanup = 1; - } -- else if (vp->bfd != exec_bfd) -- /* FIXME-leak: We should be freeing vp->name too, I think. */ -- gdb_bfd_close_or_warn (vp->bfd); -+ -+ gdb_bfd_unref (vp->bfd); - - xfree (vp); - } -@@ -230,11 +225,14 @@ exec_file_attach (char *filename, int from_tty) - &scratch_pathname); - } - #endif -+ -+ cleanups = make_cleanup (xfree, scratch_pathname); -+ - if (scratch_chan < 0) - perror_with_name (filename); -- exec_bfd = bfd_fopen (scratch_pathname, gnutarget, -- write_files ? FOPEN_RUB : FOPEN_RB, -- scratch_chan); -+ exec_bfd = gdb_bfd_fopen (scratch_pathname, gnutarget, -+ write_files ? FOPEN_RUB : FOPEN_RB, -+ scratch_chan); - - if (!exec_bfd) - { -@@ -242,13 +240,6 @@ exec_file_attach (char *filename, int from_tty) - scratch_pathname, bfd_errmsg (bfd_get_error ())); - } - -- /* At this point, scratch_pathname and exec_bfd->name both point to the -- same malloc'd string. However exec_close() will attempt to free it -- via the exec_bfd->name pointer, so we need to make another copy and -- leave exec_bfd as the new owner of the original copy. */ -- scratch_pathname = xstrdup (scratch_pathname); -- cleanups = make_cleanup (xfree, scratch_pathname); -- - if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) - { - /* Make sure to close exec_bfd, or else "run" might try to use -@@ -554,6 +545,7 @@ map_vmap (bfd *abfd, bfd *arch) - memset ((char *) vp, '\0', sizeof (*vp)); - vp->nxt = 0; - vp->bfd = abfd; -+ gdb_bfd_ref (abfd); - vp->name = bfd_get_filename (arch ? arch : abfd); - vp->member = arch ? bfd_get_filename (abfd) : ""; - diff --git a/gdb/f-exp.y b/gdb/f-exp.y -index 33c7418..4db1bfa 100644 +index 846cc02..9283183 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y -@@ -298,7 +298,9 @@ arglist : subrange +@@ -297,7 +297,9 @@ arglist : subrange { arglist_len = 1; } ; @@ -4417,12 +2013,12 @@ index 33c7418..4db1bfa 100644 ; diff --git a/gdb/f-lang.h b/gdb/f-lang.h -index 4aae3c5..51a4e1e 100644 +index 4ef1acf..8da016b 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h -@@ -28,6 +28,10 @@ extern void f_error (char *); /* Defined in f-exp.y */ +@@ -29,6 +29,10 @@ extern void f_error (char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, const char *, struct ui_file *, int, - int); + int, const struct type_print_options *); +extern const char *f_object_address_data_valid_print_to_stream + (struct type *type, struct ui_file *stream); @@ -4432,10 +2028,10 @@ index 4aae3c5..51a4e1e 100644 struct ui_file *, int, const struct value *, diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c -index a95ef84..830917d 100644 +index aa33231..df998c4 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c -@@ -31,7 +31,7 @@ +@@ -30,7 +30,7 @@ #include "gdbcore.h" #include "target.h" #include "f-lang.h" @@ -4444,7 +2040,7 @@ index a95ef84..830917d 100644 #include "gdb_string.h" #include -@@ -48,6 +48,34 @@ void f_type_print_varspec_prefix (struct type *, struct ui_file *, +@@ -47,6 +47,34 @@ void f_type_print_varspec_prefix (struct type *, struct ui_file *, void f_type_print_base (struct type *, struct ui_file *, int, int); @@ -4479,7 +2075,7 @@ index a95ef84..830917d 100644 /* LEVEL is the depth to indent lines by. */ void -@@ -57,6 +85,9 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, +@@ -56,6 +84,9 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, enum type_code code; int demangled_args; @@ -4489,7 +2085,7 @@ index a95ef84..830917d 100644 f_type_print_base (type, stream, show, level); code = TYPE_CODE (type); if ((varstring != NULL && *varstring != '\0') -@@ -164,6 +195,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, +@@ -162,6 +193,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, QUIT; @@ -4500,10 +2096,10 @@ index a95ef84..830917d 100644 { case TYPE_CODE_ARRAY: diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index 4359f6f..8ff834b 100644 +index 22cca83..b2a2cc3 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c -@@ -54,15 +54,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; +@@ -51,15 +51,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; /* The following macro gives us the size of the nth dimension, Where n is 1 based. */ @@ -4524,7 +2120,7 @@ index 4359f6f..8ff834b 100644 if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) error (_("Lower bound may not be '*' in F77")); -@@ -72,14 +74,17 @@ f77_get_lowerbound (struct type *type) +@@ -69,14 +71,17 @@ f77_get_lowerbound (struct type *type) int f77_get_upperbound (struct type *type) { @@ -4547,7 +2143,7 @@ index 4359f6f..8ff834b 100644 } return TYPE_ARRAY_UPPER_BOUND_VALUE (type); -@@ -135,24 +140,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) +@@ -132,24 +137,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) upper = f77_get_upperbound (tmp_type); lower = f77_get_lowerbound (tmp_type); @@ -4583,7 +2179,7 @@ index 4359f6f..8ff834b 100644 } } -@@ -174,37 +184,35 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, +@@ -171,37 +181,35 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, if (nss != ndimensions) { @@ -4628,7 +2224,7 @@ index 4359f6f..8ff834b 100644 fprintf_filtered (stream, "..."); } } -@@ -270,6 +278,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +@@ -267,6 +275,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR addr; int index; @@ -4639,10 +2235,10 @@ index 4359f6f..8ff834b 100644 switch (TYPE_CODE (type)) { diff --git a/gdb/findvar.c b/gdb/findvar.c -index 66bcebe..e59e5f2 100644 +index fb66e0f..45684f0 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c -@@ -35,6 +35,7 @@ +@@ -34,6 +34,7 @@ #include "block.h" #include "objfiles.h" #include "language.h" @@ -4650,7 +2246,7 @@ index 66bcebe..e59e5f2 100644 /* Basic byte-swapping routines. All 'extract' functions return a host-format integer from a target-format integer at ADDR which is -@@ -438,7 +439,10 @@ minsym_lookup_iterator_cb (struct objfile *objfile, void *cb_data) +@@ -437,7 +438,10 @@ minsym_lookup_iterator_cb (struct objfile *objfile, void *cb_data) } /* A default implementation for the "la_read_var_value" hook in @@ -4662,12 +2258,10 @@ index 66bcebe..e59e5f2 100644 struct value * default_read_var_value (struct symbol *var, struct frame_info *frame) -@@ -446,16 +450,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) - struct value *v; +@@ -446,13 +450,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) struct type *type = SYMBOL_TYPE (var); CORE_ADDR addr; -- int len; -- + - /* Call check_typedef on our type to make sure that, if TYPE is - a TYPE_CODE_TYPEDEF, its length is set to the length of the target type - instead of zero. However, we do not replace the typedef type by the @@ -4675,27 +2269,10 @@ index 66bcebe..e59e5f2 100644 - set the returned value type description correctly. */ - check_typedef (type); - -- len = TYPE_LENGTH (type); - if (symbol_read_needs_frame (var)) gdb_assert (frame); -@@ -465,7 +459,7 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) - case LOC_CONST: - /* Put the constant back in target format. */ - v = allocate_value (type); -- store_signed_integer (value_contents_raw (v), len, -+ store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type), - gdbarch_byte_order (get_type_arch (type)), - (LONGEST) SYMBOL_VALUE (var)); - VALUE_LVAL (v) = not_lval; -@@ -490,12 +484,12 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) - case LOC_CONST_BYTES: - v = allocate_value (type); -- memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len); -+ memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), -+ TYPE_LENGTH (type)); - VALUE_LVAL (v) = not_lval; +@@ -492,7 +489,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) return v; case LOC_STATIC: @@ -4703,7 +2280,7 @@ index 66bcebe..e59e5f2 100644 if (overlay_debugging) addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), SYMBOL_OBJ_SECTION (var)); -@@ -509,7 +503,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) +@@ -506,7 +502,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) error (_("Unknown argument list address for `%s'."), SYMBOL_PRINT_NAME (var)); addr += SYMBOL_VALUE (var); @@ -4711,7 +2288,7 @@ index 66bcebe..e59e5f2 100644 break; case LOC_REF_ARG: -@@ -524,14 +517,12 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) +@@ -521,14 +516,12 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) argref += SYMBOL_VALUE (var); ref = value_at (lookup_pointer_type (type), argref); addr = value_as_address (ref); @@ -4726,7 +2303,7 @@ index 66bcebe..e59e5f2 100644 break; case LOC_TYPEDEF: -@@ -540,7 +531,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) +@@ -537,7 +530,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) break; case LOC_BLOCK: @@ -4734,7 +2311,7 @@ index 66bcebe..e59e5f2 100644 if (overlay_debugging) addr = symbol_overlayed_address (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var)); -@@ -566,7 +556,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) +@@ -563,7 +555,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) SYMBOL_PRINT_NAME (var)); addr = value_as_address (regval); @@ -4742,7 +2319,7 @@ index 66bcebe..e59e5f2 100644 } else { -@@ -615,7 +604,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) +@@ -612,7 +603,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) if (obj_section && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0) addr = target_translate_tls_address (obj_section->objfile, addr); @@ -4750,7 +2327,7 @@ index 66bcebe..e59e5f2 100644 } break; -@@ -628,6 +616,10 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) +@@ -625,6 +615,10 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) break; } @@ -4761,7 +2338,7 @@ index 66bcebe..e59e5f2 100644 VALUE_LVAL (v) = lval_memory; set_value_address (v, addr); return v; -@@ -723,10 +715,11 @@ struct value * +@@ -729,10 +723,11 @@ struct value * value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -4775,7 +2352,7 @@ index 66bcebe..e59e5f2 100644 { int optim, unavail, ok; -@@ -741,7 +734,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) +@@ -747,7 +742,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) VALUE_LVAL (v) = lval_register; VALUE_FRAME_ID (v) = get_frame_id (frame); VALUE_REGNUM (v) = regnum; @@ -4784,45 +2361,6 @@ index 66bcebe..e59e5f2 100644 value_contents_raw (v), &optim, &unavail); -diff --git a/gdb/gcore.c b/gdb/gcore.c -index aedda41..a45e787 100644 ---- a/gdb/gcore.c -+++ b/gdb/gcore.c -@@ -33,6 +33,7 @@ - #include - #include "regcache.h" - #include "regset.h" -+#include "gdb_bfd.h" - - /* The largest amount of memory to read from the target at once. We - must throttle it to limit the amount of memory used by GDB during -@@ -50,7 +51,7 @@ static int gcore_memory_sections (bfd *); - bfd * - create_gcore_bfd (char *filename) - { -- bfd *obfd = bfd_openw (filename, default_gcore_target ()); -+ bfd *obfd = gdb_bfd_openw (filename, default_gcore_target ()); - - if (!obfd) - error (_("Failed to open '%s' for output."), filename); -@@ -110,7 +111,7 @@ do_bfd_delete_cleanup (void *arg) - bfd *obfd = arg; - const char *filename = obfd->filename; - -- bfd_close (arg); -+ gdb_bfd_unref (arg); - unlink (filename); - } - -@@ -154,7 +155,7 @@ gcore_command (char *args, int from_tty) - fprintf_filtered (gdb_stdout, "Saved corefile %s\n", corefilename); - - discard_cleanups (old_chain); -- bfd_close (obfd); -+ gdb_bfd_unref (obfd); - } - - static unsigned long diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in index ffb7f53..a2e7e94 100644 --- a/gdb/gdb-gdb.gdb.in @@ -4843,796 +2381,8 @@ index ffb7f53..a2e7e94 100644 set complaints 1 b internal_error -diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c -new file mode 100644 -index 0000000..fac8776 ---- /dev/null -+++ b/gdb/gdb_bfd.c -@@ -0,0 +1,670 @@ -+/* Definitions for BFD wrappers used by GDB. -+ -+ Copyright (C) 2011, 2012 -+ Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include "defs.h" -+#include "gdb_bfd.h" -+#include "gdb_assert.h" -+#include "gdb_string.h" -+#include "ui-out.h" -+#include "gdbcmd.h" -+#include "hashtab.h" -+#ifdef HAVE_ZLIB_H -+#include -+#endif -+#ifdef HAVE_MMAP -+#include -+#ifndef MAP_FAILED -+#define MAP_FAILED ((void *) -1) -+#endif -+#endif -+ -+/* An object of this type is stored in the section's user data when -+ mapping a section. */ -+ -+struct gdb_bfd_section_data -+{ -+ /* Size of the data. */ -+ bfd_size_type size; -+ /* If the data was mmapped, this is the length of the map. */ -+ bfd_size_type map_len; -+ /* The data. If NULL, the section data has not been read. */ -+ void *data; -+ /* If the data was mmapped, this is the map address. */ -+ void *map_addr; -+}; -+ -+/* A hash table holding every BFD that gdb knows about. This is not -+ to be confused with 'gdb_bfd_cache', which is used for sharing -+ BFDs; in contrast, this hash is used just to implement -+ "maint info bfd". */ -+ -+static htab_t all_bfds; -+ -+/* See gdb_bfd.h. */ -+ -+void -+gdb_bfd_stash_filename (struct bfd *abfd) -+{ -+ char *name = bfd_get_filename (abfd); -+ char *data; -+ -+ data = bfd_alloc (abfd, strlen (name) + 1); -+ strcpy (data, name); -+ -+ /* Unwarranted chumminess with BFD. */ -+ abfd->filename = data; -+} -+ -+/* An object of this type is stored in each BFD's user data. */ -+ -+struct gdb_bfd_data -+{ -+ /* The reference count. */ -+ int refc; -+ -+ /* The mtime of the BFD at the point the cache entry was made. */ -+ time_t mtime; -+}; -+ -+/* A hash table storing all the BFDs maintained in the cache. */ -+ -+static htab_t gdb_bfd_cache; -+ -+/* The type of an object being looked up in gdb_bfd_cache. We use -+ htab's capability of storing one kind of object (BFD in this case) -+ and using a different sort of object for searching. */ -+ -+struct gdb_bfd_cache_search -+{ -+ /* The filename. */ -+ const char *filename; -+ /* The mtime. */ -+ time_t mtime; -+}; -+ -+/* A hash function for BFDs. */ -+ -+static hashval_t -+hash_bfd (const void *b) -+{ -+ const bfd *abfd = b; -+ -+ /* It is simplest to just hash the filename. */ -+ return htab_hash_string (bfd_get_filename (abfd)); -+} -+ -+/* An equality function for BFDs. Note that this expects the caller -+ to search using struct gdb_bfd_cache_search only, not BFDs. */ -+ -+static int -+eq_bfd (const void *a, const void *b) -+{ -+ const bfd *abfd = a; -+ const struct gdb_bfd_cache_search *s = b; -+ struct gdb_bfd_data *gdata = bfd_usrdata (abfd); -+ -+ return (gdata->mtime == s->mtime -+ && strcmp (bfd_get_filename (abfd), s->filename) == 0); -+} -+ -+/* See gdb_bfd.h. */ -+ -+struct bfd * -+gdb_bfd_open (const char *name, const char *target, int fd) -+{ -+ hashval_t hash; -+ void **slot; -+ bfd *abfd; -+ struct gdb_bfd_cache_search search; -+ struct stat st; -+ -+ if (gdb_bfd_cache == NULL) -+ gdb_bfd_cache = htab_create_alloc (1, hash_bfd, eq_bfd, NULL, -+ xcalloc, xfree); -+ -+ if (fd == -1) -+ { -+ fd = open (name, O_RDONLY | O_BINARY); -+ if (fd == -1) -+ { -+ bfd_set_error (bfd_error_system_call); -+ return NULL; -+ } -+ } -+ -+ search.filename = name; -+ if (fstat (fd, &st) < 0) -+ { -+ /* Weird situation here. */ -+ search.mtime = 0; -+ } -+ else -+ search.mtime = st.st_mtime; -+ -+ /* Note that this must compute the same result as hash_bfd. */ -+ hash = htab_hash_string (name); -+ /* Note that we cannot use htab_find_slot_with_hash here, because -+ opening the BFD may fail; and this would violate hashtab -+ invariants. */ -+ abfd = htab_find_with_hash (gdb_bfd_cache, &search, hash); -+ if (abfd != NULL) -+ { -+ close (fd); -+ gdb_bfd_ref (abfd); -+ return abfd; -+ } -+ -+ abfd = bfd_fopen (name, target, FOPEN_RB, fd); -+ if (abfd == NULL) -+ return NULL; -+ -+ slot = htab_find_slot_with_hash (gdb_bfd_cache, &search, hash, INSERT); -+ gdb_assert (!*slot); -+ *slot = abfd; -+ -+ gdb_bfd_stash_filename (abfd); -+ gdb_bfd_ref (abfd); -+ return abfd; -+} -+ -+/* A helper function that releases any section data attached to the -+ BFD. */ -+ -+static void -+free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore) -+{ -+ struct gdb_bfd_section_data *sect = bfd_get_section_userdata (abfd, sectp); -+ -+ if (sect != NULL && sect->data != NULL) -+ { -+#ifdef HAVE_MMAP -+ if (sect->map_addr != NULL) -+ { -+ int res; -+ -+ res = munmap (sect->map_addr, sect->map_len); -+ gdb_assert (res == 0); -+ } -+ else -+#endif -+ xfree (sect->data); -+ } -+} -+ -+/* Close ABFD, and warn if that fails. */ -+ -+static int -+gdb_bfd_close_or_warn (struct bfd *abfd) -+{ -+ int ret; -+ char *name = bfd_get_filename (abfd); -+ -+ bfd_map_over_sections (abfd, free_one_bfd_section, NULL); -+ -+ ret = bfd_close (abfd); -+ -+ if (!ret) -+ warning (_("cannot close \"%s\": %s"), -+ name, bfd_errmsg (bfd_get_error ())); -+ -+ return ret; -+} -+ -+/* See gdb_bfd.h. */ -+ -+void -+gdb_bfd_ref (struct bfd *abfd) -+{ -+ struct gdb_bfd_data *gdata; -+ void **slot; -+ -+ if (abfd == NULL) -+ return; -+ -+ gdata = bfd_usrdata (abfd); -+ -+ if (gdata != NULL) -+ { -+ gdata->refc += 1; -+ return; -+ } -+ -+ gdata = bfd_zalloc (abfd, sizeof (struct gdb_bfd_data)); -+ gdata->refc = 1; -+ gdata->mtime = bfd_get_mtime (abfd); -+ bfd_usrdata (abfd) = gdata; -+ -+ /* This is the first we've seen it, so add it to the hash table. */ -+ slot = htab_find_slot (all_bfds, abfd, INSERT); -+ gdb_assert (slot && !*slot); -+ *slot = abfd; -+} -+ -+/* See gdb_bfd.h. */ -+ -+void -+gdb_bfd_unref (struct bfd *abfd) -+{ -+ struct gdb_bfd_data *gdata; -+ struct gdb_bfd_cache_search search; -+ void **slot; -+ -+ if (abfd == NULL) -+ return; -+ -+ gdata = bfd_usrdata (abfd); -+ gdb_assert (gdata->refc >= 1); -+ -+ gdata->refc -= 1; -+ if (gdata->refc > 0) -+ return; -+ -+ search.filename = bfd_get_filename (abfd); -+ -+ if (gdb_bfd_cache && search.filename) -+ { -+ hashval_t hash = htab_hash_string (search.filename); -+ void **slot; -+ -+ search.mtime = gdata->mtime; -+ slot = htab_find_slot_with_hash (gdb_bfd_cache, &search, hash, -+ NO_INSERT); -+ -+ if (slot && *slot) -+ htab_clear_slot (gdb_bfd_cache, slot); -+ } -+ -+ bfd_usrdata (abfd) = NULL; /* Paranoia. */ -+ -+ htab_remove_elt (all_bfds, abfd); -+ -+ gdb_bfd_close_or_warn (abfd); -+} -+ -+/* A helper function that returns the section data descriptor -+ associated with SECTION. If no such descriptor exists, a new one -+ is allocated and cleared. */ -+ -+static struct gdb_bfd_section_data * -+get_section_descriptor (asection *section) -+{ -+ struct gdb_bfd_section_data *result; -+ -+ result = bfd_get_section_userdata (section->owner, section); -+ -+ if (result == NULL) -+ { -+ result = bfd_zalloc (section->owner, sizeof (*result)); -+ bfd_set_section_userdata (section->owner, section, result); -+ } -+ -+ return result; -+} -+ -+/* Decompress a section that was compressed using zlib. Store the -+ decompressed buffer, and its size, in DESCRIPTOR. */ -+ -+static void -+zlib_decompress_section (asection *sectp, -+ struct gdb_bfd_section_data *descriptor) -+{ -+ bfd *abfd = sectp->owner; -+#ifndef HAVE_ZLIB_H -+ error (_("Support for zlib-compressed data (from '%s', section '%s') " -+ "is disabled in this copy of GDB"), -+ bfd_get_filename (abfd), -+ bfd_get_section_name (sectp)); -+#else -+ bfd_size_type compressed_size = bfd_get_section_size (sectp); -+ gdb_byte *compressed_buffer = xmalloc (compressed_size); -+ struct cleanup *cleanup = make_cleanup (xfree, compressed_buffer); -+ struct cleanup *inner_cleanup; -+ bfd_size_type uncompressed_size; -+ gdb_byte *uncompressed_buffer; -+ z_stream strm; -+ int rc; -+ int header_size = 12; -+ struct dwarf2_per_bfd_section *section_data; -+ -+ if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 -+ || bfd_bread (compressed_buffer, -+ compressed_size, abfd) != compressed_size) -+ error (_("can't read data from '%s', section '%s'"), -+ bfd_get_filename (abfd), -+ bfd_get_section_name (abfd, sectp)); -+ -+ /* Read the zlib header. In this case, it should be "ZLIB" followed -+ by the uncompressed section size, 8 bytes in big-endian order. */ -+ if (compressed_size < header_size -+ || strncmp (compressed_buffer, "ZLIB", 4) != 0) -+ error (_("corrupt ZLIB header from '%s', section '%s'"), -+ bfd_get_filename (abfd), -+ bfd_get_section_name (abfd, sectp)); -+ uncompressed_size = compressed_buffer[4]; uncompressed_size <<= 8; -+ uncompressed_size += compressed_buffer[5]; uncompressed_size <<= 8; -+ uncompressed_size += compressed_buffer[6]; uncompressed_size <<= 8; -+ uncompressed_size += compressed_buffer[7]; uncompressed_size <<= 8; -+ uncompressed_size += compressed_buffer[8]; uncompressed_size <<= 8; -+ uncompressed_size += compressed_buffer[9]; uncompressed_size <<= 8; -+ uncompressed_size += compressed_buffer[10]; uncompressed_size <<= 8; -+ uncompressed_size += compressed_buffer[11]; -+ -+ /* It is possible the section consists of several compressed -+ buffers concatenated together, so we uncompress in a loop. */ -+ strm.zalloc = NULL; -+ strm.zfree = NULL; -+ strm.opaque = NULL; -+ strm.avail_in = compressed_size - header_size; -+ strm.next_in = (Bytef*) compressed_buffer + header_size; -+ strm.avail_out = uncompressed_size; -+ uncompressed_buffer = xmalloc (uncompressed_size); -+ inner_cleanup = make_cleanup (xfree, uncompressed_buffer); -+ rc = inflateInit (&strm); -+ while (strm.avail_in > 0) -+ { -+ if (rc != Z_OK) -+ error (_("setting up uncompression in '%s', section '%s': %d"), -+ bfd_get_filename (abfd), -+ bfd_get_section_name (abfd, sectp), -+ rc); -+ strm.next_out = ((Bytef*) uncompressed_buffer -+ + (uncompressed_size - strm.avail_out)); -+ rc = inflate (&strm, Z_FINISH); -+ if (rc != Z_STREAM_END) -+ error (_("zlib error uncompressing from '%s', section '%s': %d"), -+ bfd_get_filename (abfd), -+ bfd_get_section_name (abfd, sectp), -+ rc); -+ rc = inflateReset (&strm); -+ } -+ rc = inflateEnd (&strm); -+ if (rc != Z_OK -+ || strm.avail_out != 0) -+ error (_("concluding uncompression in '%s', section '%s': %d"), -+ bfd_get_filename (abfd), -+ bfd_get_section_name (abfd, sectp), -+ rc); -+ -+ discard_cleanups (inner_cleanup); -+ do_cleanups (cleanup); -+ -+ /* Attach the data to the BFD section. */ -+ descriptor->data = uncompressed_buffer; -+ descriptor->size = uncompressed_size; -+#endif -+} -+ -+/* See gdb_bfd.h. */ -+ -+const gdb_byte * -+gdb_bfd_map_section (asection *sectp, bfd_size_type *size) -+{ -+ bfd *abfd; -+ gdb_byte *buf, *retbuf; -+ unsigned char header[4]; -+ struct gdb_bfd_section_data *descriptor; -+ -+ gdb_assert ((sectp->flags & SEC_RELOC) == 0); -+ gdb_assert (size != NULL); -+ -+ abfd = sectp->owner; -+ -+ descriptor = get_section_descriptor (sectp); -+ -+ /* If the data was already read for this BFD, just reuse it. */ -+ if (descriptor->data != NULL) -+ goto done; -+ -+ /* Check if the file has a 4-byte header indicating compression. */ -+ if (bfd_get_section_size (sectp) > sizeof (header) -+ && bfd_seek (abfd, sectp->filepos, SEEK_SET) == 0 -+ && bfd_bread (header, sizeof (header), abfd) == sizeof (header)) -+ { -+ /* Upon decompression, update the buffer and its size. */ -+ if (strncmp (header, "ZLIB", sizeof (header)) == 0) -+ { -+ zlib_decompress_section (sectp, descriptor); -+ goto done; -+ } -+ } -+ -+#ifdef HAVE_MMAP -+ { -+ /* The page size, used when mmapping. */ -+ static int pagesize; -+ -+ if (pagesize == 0) -+ pagesize = getpagesize (); -+ -+ /* Only try to mmap sections which are large enough: we don't want -+ to waste space due to fragmentation. */ -+ -+ if (bfd_get_section_size (sectp) > 4 * pagesize) -+ { -+ descriptor->size = bfd_get_section_size (sectp); -+ descriptor->data = bfd_mmap (abfd, 0, descriptor->size, PROT_READ, -+ MAP_PRIVATE, sectp->filepos, -+ &descriptor->map_addr, -+ &descriptor->map_len); -+ -+ if ((caddr_t)descriptor->data != MAP_FAILED) -+ { -+#if HAVE_POSIX_MADVISE -+ posix_madvise (descriptor->map_addr, descriptor->map_len, -+ POSIX_MADV_WILLNEED); -+#endif -+ goto done; -+ } -+ -+ /* On failure, clear out the section data and try again. */ -+ memset (descriptor, 0, sizeof (*descriptor)); -+ } -+ } -+#endif /* HAVE_MMAP */ -+ -+ /* If we get here, we are a normal, not-compressed section. */ -+ -+ descriptor->size = bfd_get_section_size (sectp); -+ descriptor->data = xmalloc (descriptor->size); -+ -+ if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 -+ || bfd_bread (descriptor->data, bfd_get_section_size (sectp), -+ abfd) != bfd_get_section_size (sectp)) -+ { -+ xfree (descriptor->data); -+ descriptor->data = NULL; -+ error (_("Can't read data for section '%s'"), -+ bfd_get_filename (abfd)); -+ } -+ -+ done: -+ gdb_assert (descriptor->data != NULL); -+ *size = descriptor->size; -+ return descriptor->data; -+} -+ -+ -+ -+/* See gdb_bfd.h. */ -+ -+bfd * -+gdb_bfd_fopen (const char *filename, const char *target, const char *mode, -+ int fd) -+{ -+ bfd *result = bfd_fopen (filename, target, mode, fd); -+ -+ if (result) -+ { -+ gdb_bfd_stash_filename (result); -+ gdb_bfd_ref (result); -+ } -+ -+ return result; -+} -+ -+/* See gdb_bfd.h. */ -+ -+bfd * -+gdb_bfd_openr (const char *filename, const char *target) -+{ -+ bfd *result = bfd_openr (filename, target); -+ -+ if (result) -+ { -+ gdb_bfd_stash_filename (result); -+ gdb_bfd_ref (result); -+ } -+ -+ return result; -+} -+ -+/* See gdb_bfd.h. */ -+ -+bfd * -+gdb_bfd_openw (const char *filename, const char *target) -+{ -+ bfd *result = bfd_openw (filename, target); -+ -+ if (result) -+ { -+ gdb_bfd_stash_filename (result); -+ gdb_bfd_ref (result); -+ } -+ -+ return result; -+} -+ -+/* See gdb_bfd.h. */ -+ -+bfd * -+gdb_bfd_openr_iovec (const char *filename, const char *target, -+ void *(*open_func) (struct bfd *nbfd, -+ void *open_closure), -+ void *open_closure, -+ file_ptr (*pread_func) (struct bfd *nbfd, -+ void *stream, -+ void *buf, -+ file_ptr nbytes, -+ file_ptr offset), -+ int (*close_func) (struct bfd *nbfd, -+ void *stream), -+ int (*stat_func) (struct bfd *abfd, -+ void *stream, -+ struct stat *sb)) -+{ -+ bfd *result = bfd_openr_iovec (filename, target, -+ open_func, open_closure, -+ pread_func, close_func, stat_func); -+ -+ if (result) -+ { -+ gdb_bfd_ref (result); -+ gdb_bfd_stash_filename (result); -+ } -+ -+ return result; -+} -+ -+/* See gdb_bfd.h. */ -+ -+bfd * -+gdb_bfd_openr_next_archived_file (bfd *archive, bfd *previous) -+{ -+ bfd *result = bfd_openr_next_archived_file (archive, previous); -+ -+ if (result) -+ { -+ gdb_bfd_ref (result); -+ /* No need to stash the filename here. */ -+ } -+ -+ return result; -+} -+ -+/* See gdb_bfd.h. */ -+ -+bfd * -+gdb_bfd_fdopenr (const char *filename, const char *target, int fd) -+{ -+ bfd *result = bfd_fdopenr (filename, target, fd); -+ -+ if (result) -+ { -+ gdb_bfd_ref (result); -+ gdb_bfd_stash_filename (result); -+ } -+ -+ return result; -+} -+ -+ -+ -+/* A callback for htab_traverse that prints a single BFD. */ -+ -+static int -+print_one_bfd (void **slot, void *data) -+{ -+ bfd *abfd = *slot; -+ struct gdb_bfd_data *gdata = bfd_usrdata (abfd); -+ struct ui_out *uiout = data; -+ struct cleanup *inner; -+ -+ inner = make_cleanup_ui_out_tuple_begin_end (uiout, NULL); -+ ui_out_field_int (uiout, "refcount", gdata->refc); -+ ui_out_field_string (uiout, "addr", host_address_to_string (abfd)); -+ ui_out_field_string (uiout, "filename", bfd_get_filename (abfd)); -+ ui_out_text (uiout, "\n"); -+ do_cleanups (inner); -+ -+ return 1; -+} -+ -+/* Implement the 'maint info bfd' command. */ -+ -+static void -+maintenance_info_bfds (char *arg, int from_tty) -+{ -+ struct cleanup *cleanup; -+ struct ui_out *uiout = current_uiout; -+ -+ cleanup = make_cleanup_ui_out_table_begin_end (uiout, 3, -1, "bfds"); -+ ui_out_table_header (uiout, 10, ui_left, "refcount", "Refcount"); -+ ui_out_table_header (uiout, 18, ui_left, "addr", "Address"); -+ ui_out_table_header (uiout, 40, ui_left, "filename", "Filename"); -+ -+ ui_out_table_body (uiout); -+ htab_traverse (all_bfds, print_one_bfd, uiout); -+ -+ do_cleanups (cleanup); -+} -+ -+/* -Wmissing-prototypes */ -+extern initialize_file_ftype _initialize_gdb_bfd; -+ -+void -+_initialize_gdb_bfd (void) -+{ -+ all_bfds = htab_create_alloc (10, htab_hash_pointer, htab_eq_pointer, -+ NULL, xcalloc, xfree); -+ -+ add_cmd ("bfds", class_maintenance, maintenance_info_bfds, _("\ -+List the BFDs that are currently open."), -+ &maintenanceinfolist); -+} -diff --git a/gdb/gdb_bfd.h b/gdb/gdb_bfd.h -new file mode 100644 -index 0000000..f131ba7 ---- /dev/null -+++ b/gdb/gdb_bfd.h -@@ -0,0 +1,106 @@ -+/* Definitions for BFD wrappers used by GDB. -+ -+ Copyright (C) 2011, 2012 -+ Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#ifndef GDB_BFD_H -+#define GDB_BFD_H -+ -+/* Make a copy ABFD's filename using bfd_alloc, and reassign it to the -+ BFD. This ensures that the BFD's filename has the same lifetime as -+ the BFD itself. */ -+ -+void gdb_bfd_stash_filename (struct bfd *abfd); -+ -+/* Open a read-only (FOPEN_RB) BFD given arguments like bfd_fopen. -+ Returns NULL on error. On success, returns a new reference to the -+ BFD, which must be freed with gdb_bfd_unref. BFDs returned by this -+ call are shared among all callers opening the same file. If FD is -+ not -1, then after this call it is owned by BFD. */ -+ -+struct bfd *gdb_bfd_open (const char *name, const char *target, int fd); -+ -+/* Increment the reference count of ABFD. It is fine for ABFD to be -+ NULL; in this case the function does nothing. */ -+ -+void gdb_bfd_ref (struct bfd *abfd); -+ -+/* Decrement the reference count of ABFD. If this is the last -+ reference, ABFD will be freed. If ABFD is NULL, this function does -+ nothing. */ -+ -+void gdb_bfd_unref (struct bfd *abfd); -+ -+/* Try to read or map the contents of the section SECT. If -+ successful, the section data is returned and *SIZE is set to the -+ size of the section data; this may not be the same as the size -+ according to bfd_get_section_size if the section was compressed. -+ The returned section data is associated with the BFD and will be -+ destroyed when the BFD is destroyed. There is no other way to free -+ it; for temporary uses of section data, see -+ bfd_malloc_and_get_section. SECT may not have relocations. This -+ function will throw on error. */ -+ -+const gdb_byte *gdb_bfd_map_section (asection *section, bfd_size_type *size); -+ -+ -+ -+/* A wrapper for bfd_fopen that initializes the gdb-specific reference -+ count and calls gdb_bfd_stash_filename. */ -+ -+bfd *gdb_bfd_fopen (const char *, const char *, const char *, int); -+ -+/* A wrapper for bfd_openr that initializes the gdb-specific reference -+ count and calls gdb_bfd_stash_filename. */ -+ -+bfd *gdb_bfd_openr (const char *, const char *); -+ -+/* A wrapper for bfd_openw that initializes the gdb-specific reference -+ count and calls gdb_bfd_stash_filename. */ -+ -+bfd *gdb_bfd_openw (const char *, const char *); -+ -+/* A wrapper for bfd_openr_iovec that initializes the gdb-specific -+ reference count and calls gdb_bfd_stash_filename. */ -+ -+bfd *gdb_bfd_openr_iovec (const char *filename, const char *target, -+ void *(*open_func) (struct bfd *nbfd, -+ void *open_closure), -+ void *open_closure, -+ file_ptr (*pread_func) (struct bfd *nbfd, -+ void *stream, -+ void *buf, -+ file_ptr nbytes, -+ file_ptr offset), -+ int (*close_func) (struct bfd *nbfd, -+ void *stream), -+ int (*stat_func) (struct bfd *abfd, -+ void *stream, -+ struct stat *sb)); -+ -+/* A wrapper for bfd_openr_next_archived_file that initializes the -+ gdb-specific reference count and calls gdb_bfd_stash_filename. */ -+ -+bfd *gdb_bfd_openr_next_archived_file (bfd *archive, bfd *previous); -+ -+/* A wrapper for bfd_fdopenr that initializes the gdb-specific -+ reference count and calls gdb_bfd_stash_filename. */ -+ -+bfd *gdb_bfd_fdopenr (const char *filename, const char *target, int fd); -+ -+#endif /* GDB_BFD_H */ diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 8142ab9..a2953cc 100644 +index 5885241..a3db66a 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -37,6 +37,9 @@ @@ -5645,24 +2395,7 @@ index 8142ab9..a2953cc 100644 /* Initialize BADNESS constants. */ -@@ -141,7 +144,16 @@ static void print_bit_vector (B_TYPE *, int); - static void print_arg_types (struct field *, int, int); - static void dump_fn_fieldlists (struct type *, int); - static void print_cplus_stuff (struct type *, int); -+static LONGEST type_length_get (struct type *type, struct type *target_type, -+ int full_span); - -+#if 0 -+/* The hash table holding all discardable `struct type *' references. */ -+static htab_t type_discardable_table; -+ -+/* Current type_discardable_check pass used for TYPE_DISCARDABLE_AGE. */ -+static int type_discardable_age_current; -+#endif - - /* Allocate a new OBJFILE-associated type structure and fill it - with some defaults. Space for the type structure is allocated -@@ -172,6 +184,43 @@ alloc_type (struct objfile *objfile) +@@ -185,6 +188,43 @@ alloc_type (struct objfile *objfile) return type; } @@ -5706,7 +2439,7 @@ index 8142ab9..a2953cc 100644 /* Allocate a new GDBARCH-associated type structure and fill it with some defaults. Space for the type structure is allocated on the heap. */ -@@ -297,7 +346,7 @@ make_pointer_type (struct type *type, struct type **typeptr) +@@ -310,7 +350,7 @@ make_pointer_type (struct type *type, struct type **typeptr) if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ { @@ -5715,7 +2448,7 @@ index 8142ab9..a2953cc 100644 if (typeptr) *typeptr = ntype; } -@@ -374,7 +423,7 @@ make_reference_type (struct type *type, struct type **typeptr) +@@ -383,7 +423,7 @@ make_reference_type (struct type *type, struct type **typeptr) if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ { @@ -5724,7 +2457,7 @@ index 8142ab9..a2953cc 100644 if (typeptr) *typeptr = ntype; } -@@ -784,6 +833,7 @@ create_range_type (struct type *result_type, struct type *index_type, +@@ -806,6 +846,7 @@ create_range_type (struct type *result_type, struct type *index_type, TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); TYPE_LOW_BOUND (result_type) = low_bound; TYPE_HIGH_BOUND (result_type) = high_bound; @@ -5732,7 +2465,18 @@ index 8142ab9..a2953cc 100644 if (low_bound >= 0) TYPE_UNSIGNED (result_type) = 1; -@@ -927,26 +977,31 @@ create_array_type (struct type *result_type, +@@ -926,6 +967,10 @@ get_array_bounds (struct type *type, LONGEST *low_bound, LONGEST *high_bound) + return 1; + } + ++static LONGEST type_length_get (struct type *type, struct type *target_type, ++ int full_span); ++ ++ + /* Create an array type using either a blank type supplied in + RESULT_TYPE, or creating a new type, inheriting the objfile from + RANGE_TYPE. +@@ -949,26 +994,31 @@ create_array_type (struct type *result_type, TYPE_CODE (result_type) = TYPE_CODE_ARRAY; TYPE_TARGET_TYPE (result_type) = element_type; @@ -5777,7 +2521,7 @@ index 8142ab9..a2953cc 100644 return result_type; } -@@ -1468,6 +1523,105 @@ stub_noname_complaint (void) +@@ -1489,6 +1539,105 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } @@ -5883,7 +2627,7 @@ index 8142ab9..a2953cc 100644 /* Find the real type of TYPE. This function returns the real type, after removing all layers of typedefs, and completing opaque or stub types. Completion changes the TYPE argument, but stripping of -@@ -1634,52 +1788,37 @@ check_typedef (struct type *type) +@@ -1655,52 +1804,37 @@ check_typedef (struct type *type) } } @@ -5957,7 +2701,7 @@ index 8142ab9..a2953cc 100644 TYPE_TARGET_STUB (type) = 0; } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -@@ -1687,6 +1826,7 @@ check_typedef (struct type *type) +@@ -1708,6 +1842,7 @@ check_typedef (struct type *type) TYPE_LENGTH (type) = TYPE_LENGTH (target_type); TYPE_TARGET_STUB (type) = 0; } @@ -5965,7 +2709,7 @@ index 8142ab9..a2953cc 100644 } type = make_qualified_type (type, instance_flags, NULL); -@@ -3345,33 +3485,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) +@@ -3387,33 +3522,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) } /* Allocate the hash table used by copy_type_recursive to walk @@ -6023,7 +2767,7 @@ index 8142ab9..a2953cc 100644 return type; /* This type shouldn't be pointing to any types in other objfiles; -@@ -3386,9 +3535,10 @@ copy_type_recursive (struct objfile *objfile, +@@ -3428,9 +3572,10 @@ copy_type_recursive (struct objfile *objfile, new_type = alloc_type_arch (get_type_arch (type)); /* We must add the new type to the hash table immediately, in case @@ -6037,7 +2781,7 @@ index 8142ab9..a2953cc 100644 stored->old = type; stored->new = new_type; *slot = stored; -@@ -3399,6 +3549,21 @@ copy_type_recursive (struct objfile *objfile, +@@ -3441,6 +3586,21 @@ copy_type_recursive (struct objfile *objfile, TYPE_OBJFILE_OWNED (new_type) = 0; TYPE_OWNER (new_type).gdbarch = get_type_arch (type); @@ -6059,7 +2803,7 @@ index 8142ab9..a2953cc 100644 if (TYPE_NAME (type)) TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); if (TYPE_TAG_NAME (type)) -@@ -3407,12 +3572,48 @@ copy_type_recursive (struct objfile *objfile, +@@ -3449,12 +3609,48 @@ copy_type_recursive (struct objfile *objfile, TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); TYPE_LENGTH (new_type) = TYPE_LENGTH (type); @@ -6108,7 +2852,7 @@ index 8142ab9..a2953cc 100644 TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field); for (i = 0; i < nfields; i++) { -@@ -3421,8 +3622,8 @@ copy_type_recursive (struct objfile *objfile, +@@ -3463,8 +3659,8 @@ copy_type_recursive (struct objfile *objfile, TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i); if (TYPE_FIELD_TYPE (type, i)) TYPE_FIELD_TYPE (new_type, i) @@ -6119,7 +2863,7 @@ index 8142ab9..a2953cc 100644 if (TYPE_FIELD_NAME (type, i)) TYPE_FIELD_NAME (new_type, i) = xstrdup (TYPE_FIELD_NAME (type, i)); -@@ -3453,24 +3654,184 @@ copy_type_recursive (struct objfile *objfile, +@@ -3495,24 +3691,184 @@ copy_type_recursive (struct objfile *objfile, } } @@ -6311,7 +3055,7 @@ index 8142ab9..a2953cc 100644 /* Maybe copy the type_specific bits. NOTE drow/2005-12-09: We do not copy the C++-specific bits like -@@ -3487,6 +3848,17 @@ copy_type_recursive (struct objfile *objfile, +@@ -3529,6 +3885,17 @@ copy_type_recursive (struct objfile *objfile, return new_type; } @@ -6329,209 +3073,7 @@ index 8142ab9..a2953cc 100644 /* Make a copy of the given TYPE, except that the pointer & reference types are not preserved. -@@ -3509,6 +3881,201 @@ copy_type (const struct type *type) - return new_type; - } - -+#if 0 -+/* Callback type for main_type_crawl. */ -+typedef int (*main_type_crawl_iter) (struct type *type, void *data); -+ -+/* Iterate all main_type structures reachable through any `struct type *' from -+ TYPE. ITER will be called only for one type of each main_type, use -+ TYPE_CHAIN traversal to find all the type instances. ITER is being called -+ for each main_type found. ITER returns non-zero if main_type_crawl should -+ depth-first enter the specific type. ITER must provide some detection for -+ reentering the same main_type as this function would otherwise endlessly -+ loop. */ -+ -+static void -+main_type_crawl (struct type *type, main_type_crawl_iter iter, void *data) -+{ -+ struct type *type_iter; -+ int i; -+ -+ if (!type) -+ return; -+ -+ gdb_assert (TYPE_OBJFILE (type) == NULL); -+ -+ /* `struct cplus_struct_type' handling is unsupported by this function. */ -+ gdb_assert ((TYPE_CODE (type) != TYPE_CODE_STRUCT -+ && TYPE_CODE (type) != TYPE_CODE_UNION) -+ || !HAVE_CPLUS_STRUCT (type)); -+ -+ if (!(*iter) (type, data)) -+ return; -+ -+ /* Iterate all the type instances of this main_type. */ -+ type_iter = type; -+ do -+ { -+ gdb_assert (TYPE_MAIN_TYPE (type_iter) == TYPE_MAIN_TYPE (type)); -+ -+ main_type_crawl (TYPE_POINTER_TYPE (type), iter, data); -+ main_type_crawl (TYPE_REFERENCE_TYPE (type), iter, data); -+ -+ type_iter = TYPE_CHAIN (type_iter); -+ } -+ while (type_iter != type); -+ -+ for (i = 0; i < TYPE_NFIELDS (type); i++) -+ main_type_crawl (TYPE_FIELD_TYPE (type, i), iter, data); -+ -+ main_type_crawl (TYPE_TARGET_TYPE (type), iter, data); -+ main_type_crawl (TYPE_VPTR_BASETYPE (type), iter, data); -+} -+ -+/* A helper for delete_type which deletes a main_type and the things to which -+ it refers. TYPE is a type whose main_type we wish to destroy. */ -+ -+static void -+delete_main_type (struct type *type) -+{ -+ int i; -+ -+ gdb_assert (TYPE_DISCARDABLE (type)); -+ gdb_assert (TYPE_OBJFILE (type) == NULL); -+ -+ xfree (TYPE_NAME (type)); -+ xfree (TYPE_TAG_NAME (type)); -+ -+ for (i = 0; i < TYPE_NFIELDS (type); ++i) -+ { -+ xfree (TYPE_FIELD_NAME (type, i)); -+ -+ if (TYPE_FIELD_LOC_KIND (type, i) == FIELD_LOC_KIND_PHYSNAME) -+ xfree (TYPE_FIELD_STATIC_PHYSNAME (type, i)); -+ } -+ xfree (TYPE_FIELDS (type)); -+ -+ gdb_assert (!HAVE_CPLUS_STRUCT (type)); -+ -+ xfree (TYPE_MAIN_TYPE (type)); -+} -+ -+/* Delete all the instances on TYPE_CHAIN of TYPE, including their referenced -+ main_type. TYPE must be a reclaimable type - neither permanent nor objfile -+ associated. */ -+ -+static void -+delete_type_chain (struct type *type) -+{ -+ struct type *type_iter, *type_iter_to_free; -+ -+ gdb_assert (TYPE_DISCARDABLE (type)); -+ gdb_assert (TYPE_OBJFILE (type) == NULL); -+ -+ delete_main_type (type); -+ -+ type_iter = type; -+ do -+ { -+ type_iter_to_free = type_iter; -+ type_iter = TYPE_CHAIN (type_iter); -+ xfree (type_iter_to_free); -+ } -+ while (type_iter != type); -+} -+ -+/* Hash function for type_discardable_table. */ -+ -+static hashval_t -+type_discardable_hash (const void *p) -+{ -+ const struct type *type = p; -+ -+ return htab_hash_pointer (TYPE_MAIN_TYPE (type)); -+} -+ -+/* Equality function for type_discardable_table. */ -+ -+static int -+type_discardable_equal (const void *a, const void *b) -+{ -+ const struct type *left = a; -+ const struct type *right = b; -+ -+ return TYPE_MAIN_TYPE (left) == TYPE_MAIN_TYPE (right); -+} -+ -+/* A helper for type_mark_used. */ -+ -+static int -+type_mark_used_crawl (struct type *type, void *unused) -+{ -+ if (!TYPE_DISCARDABLE (type)) -+ return 0; -+ -+ if (TYPE_DISCARDABLE_AGE (type) == type_discardable_age_current) -+ return 0; -+ -+ TYPE_DISCARDABLE_AGE (type) = type_discardable_age_current; -+ -+ /* Continue the traversal. */ -+ return 1; -+} -+ -+/* Mark TYPE and its connected types as used in this free_all_types pass. */ -+ -+void -+type_mark_used (struct type *type) -+{ -+ if (type == NULL) -+ return; -+ -+ if (!TYPE_DISCARDABLE (type)) -+ return; -+ -+ main_type_crawl (type, type_mark_used_crawl, NULL); -+} -+ -+/* A traverse callback for type_discardable_table which removes any -+ type_discardable whose reference count is now zero (unused link). */ -+ -+static int -+type_discardable_remove (void **slot, void *unused) -+{ -+ struct type *type = *slot; -+ -+ gdb_assert (TYPE_DISCARDABLE (type)); -+ -+ if (TYPE_DISCARDABLE_AGE (type) != type_discardable_age_current) -+ { -+ delete_type_chain (type); -+ -+ htab_clear_slot (type_discardable_table, slot); -+ } -+ -+ return 1; -+} -+ -+/* Free all the reclaimable types that have been allocated and that have -+ currently zero reference counter. -+ -+ This function is called after each command, successful or not. Use this -+ cleanup only in the GDB idle state as GDB only marks those types used by -+ globally tracked objects (with no autovariable references tracking). */ -+ -+void -+free_all_types (void) -+{ -+ /* Mark a new pass. As GDB checks all the entries were visited after each -+ pass there cannot be any stale entries already containing the changed -+ value. */ -+ type_discardable_age_current ^= 1; -+ -+ observer_notify_mark_used (); -+ -+ htab_traverse (type_discardable_table, type_discardable_remove, NULL); -+} -+#endif - - /* Helper functions to initialize architecture-specific types. */ - -@@ -4042,6 +4609,13 @@ void +@@ -4093,6 +4460,13 @@ void _initialize_gdbtypes (void) { gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); @@ -6544,12 +3086,12 @@ index 8142ab9..a2953cc 100644 + objfile_type_data = register_objfile_data (); - add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, + add_setshow_zuinteger_cmd ("overload", no_class, &overload_debug, diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index 17bfbc5..72e9cc5 100644 +index 8b340a3..aea1c96 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -228,6 +228,11 @@ enum type_instance_flag_value +@@ -226,6 +226,11 @@ enum type_instance_flag_value #define TYPE_TARGET_STUB(t) (TYPE_MAIN_TYPE (t)->flag_target_stub) @@ -6561,7 +3103,7 @@ index 17bfbc5..72e9cc5 100644 /* Static type. If this is set, the corresponding type had a static modifier. Note: This may be unnecessary, since static data members -@@ -311,6 +316,50 @@ enum type_instance_flag_value +@@ -309,6 +314,50 @@ enum type_instance_flag_value #define TYPE_FLAG_ENUM(t) (TYPE_MAIN_TYPE (t)->flag_flag_enum) @@ -6612,7 +3154,7 @@ index 17bfbc5..72e9cc5 100644 /* Constant type. If this is set, the corresponding type has a const modifier. */ -@@ -421,6 +470,15 @@ struct main_type +@@ -425,6 +474,15 @@ struct main_type /* True if this type was declared with "class" rather than "struct". */ unsigned int flag_declared_class : 1; @@ -6628,7 +3170,7 @@ index 17bfbc5..72e9cc5 100644 /* True if this is an enum type with disjoint values. This affects how the enum is printed. */ -@@ -501,6 +559,20 @@ struct main_type +@@ -505,6 +563,20 @@ struct main_type struct type *target_type; @@ -6649,7 +3191,7 @@ index 17bfbc5..72e9cc5 100644 /* For structure and union types, a description of each field. For set and pascal array types, there is one "field", whose type is the domain type of the set or array. -@@ -583,13 +655,34 @@ struct main_type +@@ -587,13 +659,34 @@ struct main_type struct range_bounds { @@ -6689,7 +3231,7 @@ index 17bfbc5..72e9cc5 100644 /* Flags indicating whether the values of low and high are valid. When true, the respective range value is -@@ -1054,9 +1147,9 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -1053,9 +1146,9 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type #define TYPE_CHAIN(thistype) (thistype)->chain @@ -6702,7 +3244,7 @@ index 17bfbc5..72e9cc5 100644 calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ #define TYPE_LENGTH(thistype) (thistype)->length /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real -@@ -1064,11 +1157,16 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -1063,11 +1156,16 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields @@ -6721,7 +3263,7 @@ index 17bfbc5..72e9cc5 100644 #define TYPE_LOW_BOUND_UNDEFINED(range_type) \ TYPE_RANGE_DATA(range_type)->low_undefined #define TYPE_HIGH_BOUND_UNDEFINED(range_type) \ -@@ -1085,7 +1183,14 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -1084,7 +1182,14 @@ extern void allocate_gnat_aux_type (struct type *); (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \ @@ -6737,9 +3279,9 @@ index 17bfbc5..72e9cc5 100644 /* C++ */ -@@ -1531,6 +1636,18 @@ extern struct type *create_array_type (struct type *, struct type *, +@@ -1529,6 +1634,18 @@ extern struct type *create_array_type (struct type *, struct type *, struct type *); - extern struct type *lookup_array_range_type (struct type *, int, int); + extern struct type *lookup_array_range_type (struct type *, LONGEST, LONGEST); +extern CORE_ADDR type_range_any_field_internal (struct type *range_type, + int fieldno); @@ -6755,8 +3297,8 @@ index 17bfbc5..72e9cc5 100644 + extern struct type *create_string_type (struct type *, struct type *, struct type *); - extern struct type *lookup_string_range_type (struct type *, int, int); -@@ -1576,6 +1693,10 @@ extern int is_public_ancestor (struct type *, struct type *); + extern struct type *lookup_string_range_type (struct type *, LONGEST, LONGEST); +@@ -1574,6 +1691,10 @@ extern int is_public_ancestor (struct type *, struct type *); extern int is_unique_ancestor (struct type *, struct value *); @@ -6767,7 +3309,7 @@ index 17bfbc5..72e9cc5 100644 /* Overload resolution */ #define LENGTH_MATCH(bv) ((bv)->rank[0]) -@@ -1651,10 +1772,13 @@ extern void maintenance_print_type (char *, int); +@@ -1652,8 +1773,7 @@ extern void maintenance_print_type (char *, int); extern htab_t create_copied_types_hash (struct objfile *objfile); @@ -6777,332 +3319,8 @@ index 17bfbc5..72e9cc5 100644 htab_t copied_types); extern struct type *copy_type (const struct type *type); - -+#if 0 -+extern void free_all_types (void); -+#endif -+ - #endif /* GDBTYPES_H */ -diff --git a/gdb/jit.c b/gdb/jit.c -index 568d17b..cdd9f49 100644 ---- a/gdb/jit.c -+++ b/gdb/jit.c -@@ -38,6 +38,7 @@ - #include "gdb-dlfcn.h" - #include "gdb_stat.h" - #include "exceptions.h" -+#include "gdb_bfd.h" - - static const char *jit_reader_dir = NULL; - -@@ -132,17 +133,16 @@ mem_bfd_iovec_stat (struct bfd *abfd, void *stream, struct stat *sb) - static struct bfd * - bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size, char *target) - { -- const char *filename = xstrdup (""); - struct target_buffer *buffer = xmalloc (sizeof (struct target_buffer)); - - buffer->base = addr; - buffer->size = size; -- return bfd_openr_iovec (filename, target, -- mem_bfd_iovec_open, -- buffer, -- mem_bfd_iovec_pread, -- mem_bfd_iovec_close, -- mem_bfd_iovec_stat); -+ return gdb_bfd_openr_iovec ("", target, -+ mem_bfd_iovec_open, -+ buffer, -+ mem_bfd_iovec_pread, -+ mem_bfd_iovec_close, -+ mem_bfd_iovec_stat); - } - - /* One reader that has been loaded successfully, and can potentially be used to -@@ -868,7 +868,7 @@ jit_bfd_try_read_symtab (struct jit_code_entry *code_entry, - { - printf_unfiltered (_("\ - JITed symbol file is not an object file, ignoring it.\n")); -- bfd_close (nbfd); -+ gdb_bfd_unref (nbfd); - return; - } - -@@ -896,7 +896,8 @@ JITed symbol file is not an object file, ignoring it.\n")); - ++i; - } - -- /* This call takes ownership of NBFD. It does not take ownership of SAI. */ -+ /* This call does not take ownership of SAI. */ -+ make_cleanup_bfd_unref (nbfd); - objfile = symbol_file_add_from_bfd (nbfd, 0, sai, OBJF_SHARED, NULL); - - do_cleanups (old_cleanups); -diff --git a/gdb/m32r-rom.c b/gdb/m32r-rom.c -index 76e4bf1..9a2f5aa 100644 ---- a/gdb/m32r-rom.c -+++ b/gdb/m32r-rom.c -@@ -40,6 +40,7 @@ - #include "inferior.h" - #include - #include "regcache.h" -+#include "gdb_bfd.h" - - /* - * All this stuff just to get my host computer's IP address! -@@ -124,13 +125,15 @@ m32r_load (char *filename, int from_tty) - bfd *abfd; - unsigned int data_count = 0; - struct timeval start_time, end_time; -+ struct cleanup *cleanup; - - if (filename == NULL || filename[0] == 0) - filename = get_exec_file (1); - -- abfd = bfd_openr (filename, 0); -+ abfd = gdb_bfd_openr (filename, 0); - if (!abfd) - error (_("Unable to open file %s."), filename); -+ cleanup = make_cleanup_bfd_unref (abfd); - if (bfd_check_format (abfd, bfd_object) == 0) - error (_("File is not an object file.")); - gettimeofday (&start_time, NULL); -@@ -188,6 +191,7 @@ m32r_load (char *filename, int from_tty) - confused... */ - - clear_symtab_users (0); -+ do_cleanups (cleanup); - } - - static void -@@ -434,6 +438,7 @@ m32r_upload_command (char *args, int from_tty) - char buf[1024]; - struct hostent *hostent; - struct in_addr inet_addr; -+ struct cleanup *cleanup; - - /* First check to see if there's an ethernet port! */ - monitor_printf ("ust\r"); -@@ -524,7 +529,8 @@ m32r_upload_command (char *args, int from_tty) - printf_filtered (" -- Ethernet load complete.\n"); - - gettimeofday (&end_time, NULL); -- abfd = bfd_openr (args, 0); -+ abfd = gdb_bfd_openr (args, 0); -+ cleanup = make_cleanup_bfd_unref (abfd); - if (abfd != NULL) - { /* Download is done -- print section statistics. */ - if (bfd_check_format (abfd, bfd_object) == 0) -@@ -565,6 +571,7 @@ m32r_upload_command (char *args, int from_tty) - confused... */ - - clear_symtab_users (0); -+ do_cleanups (cleanup); - } - - /* Provide a prototype to silence -Wmissing-prototypes. */ -diff --git a/gdb/machoread.c b/gdb/machoread.c -index 22530ab..0d7578a 100644 ---- a/gdb/machoread.c -+++ b/gdb/machoread.c -@@ -454,6 +454,7 @@ macho_add_oso_symfile (oso_el *oso, bfd *abfd, - asymbol **symp; - struct bfd_hash_table table; - int nbr_sections; -+ struct cleanup *cleanup; - - /* Per section flag to mark which section have been rebased. */ - unsigned char *sections_rebased; -@@ -466,14 +467,14 @@ macho_add_oso_symfile (oso_el *oso, bfd *abfd, - { - warning (_("`%s': can't read symbols: %s."), oso->name, - bfd_errmsg (bfd_get_error ())); -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return; - } - - if (abfd->my_archive == NULL && oso->mtime != bfd_get_mtime (abfd)) - { - warning (_("`%s': file time stamp mismatch."), oso->name); -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return; - } - -@@ -482,7 +483,7 @@ macho_add_oso_symfile (oso_el *oso, bfd *abfd, - oso->nbr_syms)) - { - warning (_("`%s': can't create hash table"), oso->name); -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return; - } - -@@ -629,18 +630,15 @@ macho_add_oso_symfile (oso_el *oso, bfd *abfd, - - bfd_hash_table_free (&table); - -- /* Make sure that the filename was malloc'ed. The current filename comes -- either from an OSO symbol name or from an archive name. Memory for both -- is not managed by gdb. */ -- abfd->filename = xstrdup (abfd->filename); -- - /* We need to clear SYMFILE_MAINLINE to avoid interractive question - from symfile.c:symbol_file_add_with_addrs_or_offsets. */ -+ cleanup = make_cleanup_bfd_unref (abfd); - symbol_file_add_from_bfd - (abfd, symfile_flags & ~(SYMFILE_MAINLINE | SYMFILE_VERBOSE), NULL, - main_objfile->flags & (OBJF_REORDERED | OBJF_SHARED - | OBJF_READNOW | OBJF_USERLOADED), - main_objfile); -+ do_cleanups (cleanup); - } - - /* Read symbols from the vector of oso files. */ -@@ -651,6 +649,7 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags) - int ix; - VEC (oso_el) *vec; - oso_el *oso; -+ struct cleanup *cleanup = make_cleanup (null_cleanup, NULL); - - vec = oso_vector; - oso_vector = NULL; -@@ -677,6 +676,8 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags) - memcpy (archive_name, oso->name, pfx_len); - archive_name[pfx_len] = '\0'; - -+ make_cleanup (xfree, archive_name); -+ - /* Compute number of oso for this archive. */ - for (last_ix = ix; - VEC_iterate (oso_el, vec, last_ix, oso2); last_ix++) -@@ -686,7 +687,7 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags) - } - - /* Open the archive and check the format. */ -- archive_bfd = bfd_openr (archive_name, gnutarget); -+ archive_bfd = gdb_bfd_openr (archive_name, gnutarget); - if (archive_bfd == NULL) - { - warning (_("Could not open OSO archive file \"%s\""), -@@ -698,17 +699,18 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags) - { - warning (_("OSO archive file \"%s\" not an archive."), - archive_name); -- bfd_close (archive_bfd); -+ gdb_bfd_unref (archive_bfd); - ix = last_ix; - continue; - } -- member_bfd = bfd_openr_next_archived_file (archive_bfd, NULL); -+ -+ member_bfd = gdb_bfd_openr_next_archived_file (archive_bfd, NULL); - - if (member_bfd == NULL) - { - warning (_("Could not read archive members out of " - "OSO archive \"%s\""), archive_name); -- bfd_close (archive_bfd); -+ gdb_bfd_unref (archive_bfd); - ix = last_ix; - continue; - } -@@ -738,12 +740,12 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags) - } - - prev = member_bfd; -- member_bfd = bfd_openr_next_archived_file -- (archive_bfd, member_bfd); -+ member_bfd = gdb_bfd_openr_next_archived_file (archive_bfd, -+ member_bfd); - - /* Free previous member if not referenced by an oso. */ - if (ix2 >= last_ix) -- bfd_close (prev); -+ gdb_bfd_unref (prev); - } - for (ix2 = ix; ix2 < last_ix; ix2++) - { -@@ -759,7 +761,7 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags) - { - bfd *abfd; - -- abfd = bfd_openr (oso->name, gnutarget); -+ abfd = gdb_bfd_openr (oso->name, gnutarget); - if (!abfd) - warning (_("`%s': can't open to read symbols: %s."), oso->name, - bfd_errmsg (bfd_get_error ())); -@@ -771,6 +773,7 @@ macho_symfile_read_all_oso (struct objfile *main_objfile, int symfile_flags) - } - - VEC_free (oso_el, vec); -+ do_cleanups (cleanup); - } - - /* DSYM (debug symbols) files contain the debug info of an executable. -@@ -808,20 +811,17 @@ macho_check_dsym (struct objfile *objfile) - warning (_("can't find UUID in %s"), objfile->name); - return NULL; - } -- dsym_filename = xstrdup (dsym_filename); -- dsym_bfd = bfd_openr (dsym_filename, gnutarget); -+ dsym_bfd = gdb_bfd_openr (dsym_filename, gnutarget); - if (dsym_bfd == NULL) - { - warning (_("can't open dsym file %s"), dsym_filename); -- xfree (dsym_filename); - return NULL; - } - - if (!bfd_check_format (dsym_bfd, bfd_object)) - { -- bfd_close (dsym_bfd); -+ gdb_bfd_unref (dsym_bfd); - warning (_("bad dsym file format: %s"), bfd_errmsg (bfd_get_error ())); -- xfree (dsym_filename); - return NULL; - } - -@@ -829,16 +829,14 @@ macho_check_dsym (struct objfile *objfile) - BFD_MACH_O_LC_UUID, &dsym_uuid) == 0) - { - warning (_("can't find UUID in %s"), dsym_filename); -- bfd_close (dsym_bfd); -- xfree (dsym_filename); -+ gdb_bfd_unref (dsym_bfd); - return NULL; - } - if (memcmp (dsym_uuid->command.uuid.uuid, main_uuid->command.uuid.uuid, - sizeof (main_uuid->command.uuid.uuid))) - { - warning (_("dsym file UUID doesn't match the one in %s"), objfile->name); -- bfd_close (dsym_bfd); -- xfree (dsym_filename); -+ gdb_bfd_unref (dsym_bfd); - return NULL; - } - return dsym_bfd; -@@ -902,6 +900,7 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags) - int ix; - oso_el *oso; - struct bfd_section *asect, *dsect; -+ struct cleanup *cleanup; - - if (mach_o_debug_level > 0) - printf_unfiltered (_("dsym file found\n")); -@@ -922,7 +921,9 @@ macho_symfile_read (struct objfile *objfile, int symfile_flags) - } - - /* Add the dsym file as a separate file. */ -+ cleanup = make_cleanup_bfd_unref (dsym_bfd); - symbol_file_add_separate (dsym_bfd, symfile_flags, objfile); -+ do_cleanups (cleanup); - - /* Don't try to read dwarf2 from main file or shared libraries. */ - return; diff --git a/gdb/main.c b/gdb/main.c -index d075694..e4da3f1 100644 +index c9439bb..6c4acc4 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -37,6 +37,7 @@ @@ -7113,7 +3331,7 @@ index d075694..e4da3f1 100644 #include "source.h" #include "cli/cli-cmds.h" #include "python/python.h" -@@ -283,6 +284,8 @@ captured_main (void *data) +@@ -314,6 +315,8 @@ captured_main (void *data) char *cdarg = NULL; char *ttyarg = NULL; @@ -7122,7 +3340,7 @@ index d075694..e4da3f1 100644 /* These are static so that we can take their address in an initializer. */ static int print_help; -@@ -471,10 +474,14 @@ captured_main (void *data) +@@ -502,10 +505,14 @@ captured_main (void *data) {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, @@ -7138,7 +3356,7 @@ index d075694..e4da3f1 100644 { int option_index; -@@ -492,6 +499,9 @@ captured_main (void *data) +@@ -523,6 +530,9 @@ captured_main (void *data) case 0: /* Long option that just sets a flag. */ break; @@ -7148,7 +3366,7 @@ index d075694..e4da3f1 100644 case OPT_SE: symarg = optarg; execarg = optarg; -@@ -699,7 +709,31 @@ captured_main (void *data) +@@ -731,7 +741,31 @@ captured_main (void *data) /* Now that gdb_init has created the initial inferior, we're in position to set args for that inferior. */ @@ -7181,7 +3399,7 @@ index d075694..e4da3f1 100644 { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -979,7 +1013,8 @@ captured_main (void *data) +@@ -1011,7 +1045,8 @@ captured_main (void *data) /* Read in the old history after all the command files have been read. */ @@ -7191,7 +3409,7 @@ index d075694..e4da3f1 100644 if (batch_flag) { -@@ -990,13 +1025,25 @@ captured_main (void *data) +@@ -1022,13 +1057,25 @@ captured_main (void *data) /* Show time and/or space usage. */ do_cleanups (pre_stat_chain); @@ -7223,7 +3441,7 @@ index d075694..e4da3f1 100644 } /* No exit -- exit is through quit_command. */ } -@@ -1028,7 +1075,12 @@ print_gdb_help (struct ui_file *stream) +@@ -1060,7 +1107,12 @@ print_gdb_help (struct ui_file *stream) fputs_unfiltered (_("\ This is the GNU debugger. Usage:\n\n\ gdb [options] [executable-file [core-file or process-id]]\n\ @@ -7237,12 +3455,12 @@ index d075694..e4da3f1 100644 Options:\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -1068,7 +1120,13 @@ Options:\n\n\ - --nw Do not use a window interface.\n\ - --nx Do not read "), stream); +@@ -1103,7 +1155,13 @@ Options:\n\n\ + fputs_unfiltered (_(" files.\n\ + --nh Do not read "), stream); fputs_unfiltered (gdbinit, stream); -- fputs_unfiltered (_(" file.\n\ -+ fputs_unfiltered (_(" file.\n"), stream); +- fputs_unfiltered (_(" file from home directory.\n\ ++ fputs_unfiltered (_(" file from home directory.\n"), stream); +#if HAVE_PYTHON + fputs_unfiltered (_("\ + --python, -P Following argument is Python script file; remaining\n\ @@ -7252,124 +3470,11 @@ index d075694..e4da3f1 100644 --quiet Do not print version number on startup.\n\ --readnow Fully read symbol files on first access.\n\ "), stream); -diff --git a/gdb/objfiles.c b/gdb/objfiles.c -index f5e5c75..411618f 100644 ---- a/gdb/objfiles.c -+++ b/gdb/objfiles.c -@@ -53,6 +53,7 @@ - #include "complaints.h" - #include "psymtab.h" - #include "solist.h" -+#include "gdb_bfd.h" - - /* Prototypes for local functions */ - -@@ -195,7 +196,8 @@ allocate_objfile (bfd *abfd, int flags) - that any data that is reference is saved in the per-objfile data - region. */ - -- objfile->obfd = gdb_bfd_ref (abfd); -+ objfile->obfd = abfd; -+ gdb_bfd_ref (abfd); - if (abfd != NULL) - { - /* Look up the gdbarch associated with the BFD. */ -@@ -1456,75 +1458,6 @@ objfiles_changed (void) - get_objfile_pspace_data (current_program_space)->objfiles_changed_p = 1; - } - --/* Close ABFD, and warn if that fails. */ -- --int --gdb_bfd_close_or_warn (struct bfd *abfd) --{ -- int ret; -- char *name = bfd_get_filename (abfd); -- -- ret = bfd_close (abfd); -- -- if (!ret) -- warning (_("cannot close \"%s\": %s"), -- name, bfd_errmsg (bfd_get_error ())); -- -- return ret; --} -- --/* Add reference to ABFD. Returns ABFD. */ --struct bfd * --gdb_bfd_ref (struct bfd *abfd) --{ -- int *p_refcount; -- -- if (abfd == NULL) -- return NULL; -- -- p_refcount = bfd_usrdata (abfd); -- -- if (p_refcount != NULL) -- { -- *p_refcount += 1; -- return abfd; -- } -- -- p_refcount = xmalloc (sizeof (*p_refcount)); -- *p_refcount = 1; -- bfd_usrdata (abfd) = p_refcount; -- -- return abfd; --} -- --/* Unreference and possibly close ABFD. */ --void --gdb_bfd_unref (struct bfd *abfd) --{ -- int *p_refcount; -- char *name; -- -- if (abfd == NULL) -- return; -- -- p_refcount = bfd_usrdata (abfd); -- -- /* Valid range for p_refcount: a pointer to int counter, which has a -- value of 1 (single owner) or 2 (shared). */ -- gdb_assert (*p_refcount == 1 || *p_refcount == 2); -- -- *p_refcount -= 1; -- if (*p_refcount > 0) -- return; -- -- xfree (p_refcount); -- bfd_usrdata (abfd) = NULL; /* Paranoia. */ -- -- name = bfd_get_filename (abfd); -- gdb_bfd_close_or_warn (abfd); -- xfree (name); --} -- - /* The default implementation for the "iterate_over_objfiles_in_search_order" - gdbarch method. It is equivalent to use the ALL_OBJFILES macro, - searching the objfiles in the order they are stored internally, -diff --git a/gdb/objfiles.h b/gdb/objfiles.h -index 01c3aea..0df5798 100644 ---- a/gdb/objfiles.h -+++ b/gdb/objfiles.h -@@ -522,10 +522,6 @@ extern void set_objfile_data (struct objfile *objfile, - extern void *objfile_data (struct objfile *objfile, - const struct objfile_data *data); - --extern struct bfd *gdb_bfd_ref (struct bfd *abfd); --extern void gdb_bfd_unref (struct bfd *abfd); --extern int gdb_bfd_close_or_warn (struct bfd *abfd); -- - extern void default_iterate_over_objfiles_in_search_order - (struct gdbarch *gdbarch, - iterate_over_objfiles_in_search_order_cb_ftype *cb, diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c -index b8434ed..98a076d 100644 +index bcc055e..8a9d645 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c -@@ -39,6 +39,7 @@ +@@ -38,6 +38,7 @@ #include "cp-abi.h" #include "cp-support.h" #include "exceptions.h" @@ -7377,7 +3482,7 @@ index b8434ed..98a076d 100644 /* Decorations for Pascal. */ -@@ -74,8 +75,31 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -73,8 +74,31 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, struct type *char_type; CORE_ADDR addr; int want_space = 0; @@ -7410,7 +3515,7 @@ index b8434ed..98a076d 100644 switch (TYPE_CODE (type)) { case TYPE_CODE_ARRAY: -@@ -131,8 +155,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -130,8 +154,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, { i = 0; } @@ -7421,7 +3526,7 @@ index b8434ed..98a076d 100644 original_value, options, i); fprintf_filtered (stream, "}"); } -@@ -170,6 +194,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -169,6 +193,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, { /* Try to print what function it points to. */ print_address_demangle (options, gdbarch, addr, stream, demangle); @@ -7429,7 +3534,7 @@ index b8434ed..98a076d 100644 return; } -@@ -271,6 +296,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -270,6 +295,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, } } @@ -7437,7 +3542,7 @@ index b8434ed..98a076d 100644 return; case TYPE_CODE_REF: -@@ -421,6 +447,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -410,6 +436,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, TYPE_CODE (type)); } gdb_flush (stream); @@ -7446,10 +3551,10 @@ index b8434ed..98a076d 100644 void diff --git a/gdb/parse.c b/gdb/parse.c -index 529c517..6326a01 100644 +index 09c378b..93c434f 100644 --- a/gdb/parse.c +++ b/gdb/parse.c -@@ -1708,6 +1708,7 @@ parser_fprintf (FILE *x, const char *y, ...) +@@ -1757,6 +1757,7 @@ parser_fprintf (FILE *x, const char *y, ...) int operator_check_standard (struct expression *exp, int pos, @@ -7457,7 +3562,7 @@ index 529c517..6326a01 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data) -@@ -1749,7 +1750,7 @@ operator_check_standard (struct expression *exp, int pos, +@@ -1796,7 +1797,7 @@ operator_check_standard (struct expression *exp, int pos, struct type *type = elts[pos + 2 + arg].type; struct objfile *objfile = TYPE_OBJFILE (type); @@ -7466,7 +3571,7 @@ index 529c517..6326a01 100644 return 1; } } -@@ -1767,7 +1768,8 @@ operator_check_standard (struct expression *exp, int pos, +@@ -1814,7 +1815,8 @@ operator_check_standard (struct expression *exp, int pos, /* Check objfile where the variable itself is placed. SYMBOL_OBJ_SECTION (symbol) may be NULL. */ @@ -7476,7 +3581,7 @@ index 529c517..6326a01 100644 return 1; /* Check objfile where is placed the code touching the variable. */ -@@ -1780,24 +1782,27 @@ operator_check_standard (struct expression *exp, int pos, +@@ -1827,24 +1829,27 @@ operator_check_standard (struct expression *exp, int pos, /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL. */ @@ -7512,7 +3617,7 @@ index 529c517..6326a01 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data) { -@@ -1812,7 +1817,9 @@ exp_iterate (struct expression *exp, +@@ -1859,7 +1864,9 @@ exp_iterate (struct expression *exp, pos = endpos - oplen; if (exp->language_defn->la_exp_desc->operator_check (exp, pos, @@ -7523,7 +3628,7 @@ index 529c517..6326a01 100644 return 1; endpos = pos; -@@ -1843,8 +1850,29 @@ exp_uses_objfile (struct expression *exp, struct objfile *objfile) +@@ -1890,8 +1897,29 @@ exp_uses_objfile (struct expression *exp, struct objfile *objfile) { gdb_assert (objfile->separate_debug_objfile_backlink == NULL); @@ -7555,10 +3660,10 @@ index 529c517..6326a01 100644 void _initialize_parse (void) diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h -index 86f3bdf..f908a61 100644 +index 8d25311..233ed46 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h -@@ -245,6 +245,8 @@ extern void operator_length_standard (const struct expression *, int, int *, +@@ -244,6 +244,8 @@ extern void operator_length_standard (const struct expression *, int, int *, int *); extern int operator_check_standard (struct expression *exp, int pos, @@ -7567,7 +3672,7 @@ index 86f3bdf..f908a61 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data); -@@ -331,6 +333,7 @@ struct exp_descriptor +@@ -330,6 +332,7 @@ struct exp_descriptor value should be immediately returned to the caller. Otherwise zero should be returned. */ int (*operator_check) (struct expression *exp, int pos, @@ -7575,19 +3680,8 @@ index 86f3bdf..f908a61 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data); -@@ -369,4 +372,10 @@ extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3); - - extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile); - -+extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile); -+ -+#if 0 -+extern void exp_types_mark_used (struct expression *exp); -+#endif -+ - #endif /* PARSER_DEFS_H */ diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index d5b5b63..4bc2b5b 100644 +index a576d88..273a5e1 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -50,6 +50,7 @@ @@ -7598,7 +3692,7 @@ index d5b5b63..4bc2b5b 100644 #ifdef TUI #include "tui/tui.h" /* For tui_active et al. */ -@@ -968,6 +969,11 @@ print_command_1 (char *exp, int inspect, int voidprint) +@@ -966,6 +967,11 @@ print_command_1 (char *exp, int voidprint) else val = access_value_history (0); @@ -7610,7 +3704,7 @@ index d5b5b63..4bc2b5b 100644 if (voidprint || (val && value_type (val) && TYPE_CODE (value_type (val)) != TYPE_CODE_VOID)) { -@@ -1056,6 +1062,9 @@ output_command (char *exp, int from_tty) +@@ -1038,6 +1044,9 @@ output_command (char *exp, int from_tty) val = evaluate_expression (expr); @@ -7620,7 +3714,7 @@ index d5b5b63..4bc2b5b 100644 annotate_value_begin (value_type (val)); get_formatted_print_options (&opts, format); -@@ -1485,6 +1494,24 @@ x_command (char *exp, int from_tty) +@@ -1466,6 +1475,24 @@ x_command (char *exp, int from_tty) set_internalvar (lookup_internalvar ("__"), last_examine_value); } } @@ -7645,7 +3739,7 @@ index d5b5b63..4bc2b5b 100644 /* Add an expression to the auto-display chain. -@@ -1982,6 +2009,10 @@ print_variable_and_value (const char *name, struct symbol *var, +@@ -1963,6 +1990,10 @@ print_variable_and_value (const char *name, struct symbol *var, struct value_print_options opts; val = read_var_value (var, frame); @@ -7656,7 +3750,7 @@ index d5b5b63..4bc2b5b 100644 get_user_print_options (&opts); opts.deref_ref = 1; common_val_print (val, stream, indent, &opts, current_language); -@@ -2626,4 +2657,8 @@ Show printing of source filename and line number with ."), NULL, +@@ -2602,4 +2633,8 @@ Show printing of source filename and line number with ."), NULL, add_com ("eval", no_class, eval_command, _("\ Convert \"printf format string\", arg1, arg2, arg3, ..., argn to\n\ a command line, and call it.")); @@ -7665,46 +3759,6 @@ index d5b5b63..4bc2b5b 100644 + observer_attach_mark_used (print_types_mark_used); +#endif } -diff --git a/gdb/procfs.c b/gdb/procfs.c -index 774df2e..4409e5b 100644 ---- a/gdb/procfs.c -+++ b/gdb/procfs.c -@@ -3486,7 +3486,7 @@ insert_dbx_link_bpt_in_file (int fd, CORE_ADDR ignored) - long storage_needed; - CORE_ADDR sym_addr; - -- abfd = bfd_fdopenr ("unamed", 0, fd); -+ abfd = gdb_bfd_fdopenr ("unamed", 0, fd); - if (abfd == NULL) - { - warning (_("Failed to create a bfd: %s."), bfd_errmsg (bfd_get_error ())); -@@ -3497,7 +3497,7 @@ insert_dbx_link_bpt_in_file (int fd, CORE_ADDR ignored) - { - /* Not the correct format, so we can not possibly find the dbx_link - symbol in it. */ -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return 0; - } - -@@ -3511,14 +3511,14 @@ insert_dbx_link_bpt_in_file (int fd, CORE_ADDR ignored) - if (dbx_link_bpt == NULL) - { - warning (_("Failed to insert dbx_link breakpoint.")); -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return 0; - } -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return 1; - } - -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return 0; - } - diff --git a/gdb/python/lib/gdb/FrameIterator.py b/gdb/python/lib/gdb/FrameIterator.py new file mode 100644 index 0000000..5654546 @@ -8067,13 +4121,13 @@ index 0000000..6fa48ff +IgnoreErrorsCommand () diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py new file mode 100644 -index 0000000..21a0bf0 +index 0000000..636f99d --- /dev/null +++ b/gdb/python/lib/gdb/command/pahole.py -@@ -0,0 +1,75 @@ +@@ -0,0 +1,81 @@ +# pahole command for gdb + -+# Copyright (C) 2008, 2009 Free Software Foundation, Inc. ++# Copyright (C) 2008, 2009, 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by @@ -8099,6 +4153,11 @@ index 0000000..21a0bf0 + super (Pahole, self).__init__ ("pahole", gdb.COMMAND_NONE, + gdb.COMPLETE_SYMBOL) + ++ def maybe_print_hole(self, bitpos, field_bitpos): ++ if bitpos != field_bitpos: ++ hole = field_bitpos - bitpos ++ print ' /* XXX %d bit hole, try to pack */' % hole ++ + def pahole (self, type, level, name): + if name is None: + name = '' @@ -8114,10 +4173,8 @@ index 0000000..21a0bf0 + + ftype = field.type.strip_typedefs() + -+ if bitpos != field.bitpos: -+ hole = field.bitpos - bitpos -+ print ' /* XXX %d bit hole, try to pack */' % hole -+ bitpos = field.bitpos ++ self.maybe_print_hole(bitpos, field.bitpos) ++ bitpos = field.bitpos + if field.bitsize > 0: + fieldsize = field.bitsize + else: @@ -8134,6 +4191,9 @@ index 0000000..21a0bf0 + print ' ' * (2 + 2 * level), + print '%s %s' % (str (ftype), field.name) + ++ if level == 0: ++ self.maybe_print_hole(bitpos, 8 * type.sizeof) ++ + print ' ' * (14 + 2 * level), + print '} %s' % name + @@ -8344,13 +4404,6 @@ index 0000000..faf54ed +UptoSourceCommand () +UptoObjectCommand () +UptoWhereCommand () -diff --git a/gdb/python/lib/gdb/function/__init__.py b/gdb/python/lib/gdb/function/__init__.py -new file mode 100644 -index 0000000..8b13789 ---- /dev/null -+++ b/gdb/python/lib/gdb/function/__init__.py -@@ -0,0 +1 @@ -+ diff --git a/gdb/python/lib/gdb/function/caller_is.py b/gdb/python/lib/gdb/function/caller_is.py new file mode 100644 index 0000000..2b9c5c7 @@ -8469,19 +4522,19 @@ index 0000000..debb3bb + +InScope () diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c -index 98030a6..9870eec 100644 +index 31b7776..56085d1 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c -@@ -30,6 +30,8 @@ - #include "vec.h" +@@ -31,6 +31,8 @@ #include "bcache.h" #include "dwarf2loc.h" + #include "typeprint.h" +#include "observer.h" +#include "gdb_assert.h" typedef struct pyty_type_object { -@@ -38,11 +40,19 @@ typedef struct pyty_type_object +@@ -39,11 +41,19 @@ typedef struct pyty_type_object /* If a Type object is associated with an objfile, it is kept on a doubly-linked list, rooted in the objfile. This lets us copy the @@ -8502,7 +4555,7 @@ index 98030a6..9870eec 100644 static PyTypeObject type_object_type; /* A Field object. */ -@@ -1166,8 +1176,63 @@ typy_richcompare (PyObject *self, PyObject *other, int op) +@@ -1192,8 +1202,63 @@ typy_richcompare (PyObject *self, PyObject *other, int op) @@ -8566,7 +4619,7 @@ index 98030a6..9870eec 100644 static void save_objfile_types (struct objfile *objfile, void *datum) { -@@ -1185,12 +1250,13 @@ save_objfile_types (struct objfile *objfile, void *datum) +@@ -1211,12 +1276,13 @@ save_objfile_types (struct objfile *objfile, void *datum) { type_object *next = obj->next; @@ -8584,7 +4637,7 @@ index 98030a6..9870eec 100644 obj = next; } -@@ -1201,43 +1267,28 @@ save_objfile_types (struct objfile *objfile, void *datum) +@@ -1227,43 +1293,28 @@ save_objfile_types (struct objfile *objfile, void *datum) } static void @@ -8632,7 +4685,7 @@ index 98030a6..9870eec 100644 - type->next->prev = type->prev; + type_object *type_obj; -- type->ob_type->tp_free (type); +- Py_TYPE (type)->tp_free (type); + for (type_obj = pyty_objects_discardable; + type_obj != NULL; + type_obj = type_obj->next) @@ -8642,7 +4695,7 @@ index 98030a6..9870eec 100644 /* Return number of fields ("length" of the field dictionary). */ -@@ -1457,7 +1508,10 @@ type_to_type_object (struct type *type) +@@ -1483,7 +1534,10 @@ type_to_type_object (struct type *type) type_obj = PyObject_New (type_object, &type_object_type); if (type_obj) @@ -8654,7 +4707,7 @@ index 98030a6..9870eec 100644 return (PyObject *) type_obj; } -@@ -1537,6 +1591,10 @@ gdbpy_initialize_types (void) +@@ -1563,6 +1617,10 @@ gdbpy_initialize_types (void) Py_INCREF (&field_object_type); PyModule_AddObject (gdb_module, "Field", (PyObject *) &field_object_type); @@ -8666,7 +4719,7 @@ index 98030a6..9870eec 100644 diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c -index 6f67bdb..5ddd6bc 100644 +index 11cc038..ef238f6 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -29,6 +29,7 @@ @@ -8677,7 +4730,7 @@ index 6f67bdb..5ddd6bc 100644 #ifdef HAVE_PYTHON -@@ -1378,6 +1379,19 @@ gdbpy_is_value_object (PyObject *obj) +@@ -1385,6 +1386,19 @@ gdbpy_is_value_object (PyObject *obj) return PyObject_TypeCheck (obj, &value_object_type); } @@ -8697,7 +4750,7 @@ index 6f67bdb..5ddd6bc 100644 void gdbpy_initialize_values (void) { -@@ -1388,6 +1402,10 @@ gdbpy_initialize_values (void) +@@ -1395,6 +1409,10 @@ gdbpy_initialize_values (void) PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type); values_in_python = NULL; @@ -8709,10 +4762,10 @@ index 6f67bdb..5ddd6bc 100644 diff --git a/gdb/python/python.c b/gdb/python/python.c -index c66efe4..0211fcb 100644 +index b0f71a2..d2248c1 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c -@@ -66,10 +66,13 @@ static const char *gdbpy_should_print_stack = python_excp_message; +@@ -66,6 +66,8 @@ static const char *gdbpy_should_print_stack = python_excp_message; #include "linespec.h" #include "source.h" #include "version.h" @@ -8721,12 +4774,7 @@ index c66efe4..0211fcb 100644 #include "target.h" #include "gdbthread.h" #include "observer.h" - #include "interps.h" -+#include "event-top.h" - - static PyMethodDef GdbMethods[]; - -@@ -979,6 +982,53 @@ gdbpy_print_stack (void) +@@ -1082,6 +1084,53 @@ gdbpy_print_stack (void) /* Return the current Progspace. There always is one. */ @@ -8780,7 +4828,7 @@ index c66efe4..0211fcb 100644 static PyObject * gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2) -@@ -1420,6 +1470,8 @@ static PyMethodDef GdbMethods[] = +@@ -1734,6 +1783,8 @@ static PyMethodDef GdbMethods[] = "Get a value from history" }, { "execute", (PyCFunction) execute_gdb_command, METH_VARARGS | METH_KEYWORDS, "Execute a gdb command" }, @@ -8790,10 +4838,10 @@ index c66efe4..0211fcb 100644 "Return a gdb parameter's value" }, diff --git a/gdb/python/python.h b/gdb/python/python.h -index dd7066f..f0f6e90 100644 +index 24e3077..0443087 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h -@@ -30,6 +30,8 @@ void eval_python_from_control_command (struct command_line *); +@@ -34,6 +34,8 @@ void eval_python_from_control_command (struct command_line *); void source_python_script (FILE *file, const char *filename); @@ -8802,698 +4850,11 @@ index dd7066f..f0f6e90 100644 int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, -diff --git a/gdb/record.c b/gdb/record.c -index bb0fe52..ec42aac 100644 ---- a/gdb/record.c -+++ b/gdb/record.c -@@ -32,6 +32,7 @@ - #include "gcore.h" - #include "event-loop.h" - #include "inf-loop.h" -+#include "gdb_bfd.h" - - #include - -@@ -2638,7 +2639,7 @@ record_save_cleanups (void *data) - bfd *obfd = data; - char *pathname = xstrdup (bfd_get_filename (obfd)); - -- bfd_close (obfd); -+ gdb_bfd_unref (obfd); - unlink (pathname); - xfree (pathname); - } -@@ -2854,7 +2855,7 @@ cmd_record_save (char *args, int from_tty) - } - - do_cleanups (set_cleanups); -- bfd_close (obfd); -+ gdb_bfd_unref (obfd); - discard_cleanups (old_cleanups); - - /* Succeeded. */ -diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c -index 47f4405..85268b6 100644 ---- a/gdb/remote-m32r-sdi.c -+++ b/gdb/remote-m32r-sdi.c -@@ -39,6 +39,7 @@ - #include - #include - #include -+#include "gdb_bfd.h" - - - #include "serial.h" -@@ -1257,13 +1258,13 @@ m32r_load (char *args, int from_tty) - if (!filename) - filename = get_exec_file (1); - -- pbfd = bfd_openr (filename, gnutarget); -+ pbfd = gdb_bfd_openr (filename, gnutarget); - if (pbfd == NULL) - { - perror_with_name (filename); - return; - } -- old_chain = make_cleanup_bfd_close (pbfd); -+ old_chain = make_cleanup_bfd_unref (pbfd); - - if (!bfd_check_format (pbfd, bfd_object)) - error (_("\"%s\" is not an object file: %s"), filename, -diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c -index babbf19..db4381b 100644 ---- a/gdb/remote-mips.c -+++ b/gdb/remote-mips.c -@@ -36,6 +36,7 @@ - #include - #include "mips-tdep.h" - #include "gdbthread.h" -+#include "gdb_bfd.h" - - - /* Breakpoint types. Values 0, 1, and 2 must agree with the watch -@@ -2783,20 +2784,23 @@ mips_load_srec (char *args) - unsigned int i; - unsigned int srec_frame = 200; - int reclen; -+ struct cleanup *cleanup; - static int hashmark = 1; - - buffer = alloca (srec_frame * 2 + 256); - -- abfd = bfd_openr (args, 0); -+ abfd = gdb_bfd_openr (args, 0); - if (!abfd) - { - printf_filtered ("Unable to open file %s\n", args); - return; - } - -+ cleanup = make_cleanup_bfd_unref (abfd); - if (bfd_check_format (abfd, bfd_object) == 0) - { - printf_filtered ("File is not an object file\n"); -+ do_cleanups (cleanup); - return; - } - -@@ -2850,6 +2854,7 @@ mips_load_srec (char *args) - send_srec (srec, reclen, abfd->start_address); - - serial_flush_input (mips_desc); -+ do_cleanups (cleanup); - } - - /* -@@ -3366,20 +3371,23 @@ pmon_load_fast (char *file) - int bintotal = 0; - int final = 0; - int finished = 0; -+ struct cleanup *cleanup; - - buffer = (char *) xmalloc (MAXRECSIZE + 1); - binbuf = (unsigned char *) xmalloc (BINCHUNK); - -- abfd = bfd_openr (file, 0); -+ abfd = gdb_bfd_openr (file, 0); - if (!abfd) - { - printf_filtered ("Unable to open file %s\n", file); - return; - } -+ cleanup = make_cleanup_bfd_unref (abfd); - - if (bfd_check_format (abfd, bfd_object) == 0) - { - printf_filtered ("File is not an object file\n"); -+ do_cleanups (cleanup); - return; - } - -@@ -3503,6 +3511,7 @@ pmon_load_fast (char *file) - pmon_end_download (final, bintotal); - } - -+ do_cleanups (cleanup); - return; - } - -diff --git a/gdb/remote.c b/gdb/remote.c -index 1c9367d..f2b5e7b 100644 ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -42,6 +42,7 @@ - #include "cli/cli-decode.h" - #include "cli/cli-setshow.h" - #include "target-descriptions.h" -+#include "gdb_bfd.h" - - #include - #include -@@ -9823,11 +9824,13 @@ remote_filename_p (const char *filename) - bfd * - remote_bfd_open (const char *remote_file, const char *target) - { -- return bfd_openr_iovec (remote_file, target, -- remote_bfd_iovec_open, NULL, -- remote_bfd_iovec_pread, -- remote_bfd_iovec_close, -- remote_bfd_iovec_stat); -+ bfd *abfd = gdb_bfd_openr_iovec (remote_file, target, -+ remote_bfd_iovec_open, NULL, -+ remote_bfd_iovec_pread, -+ remote_bfd_iovec_close, -+ remote_bfd_iovec_stat); -+ -+ return abfd; - } - - void -diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c -index 0a2000a..9b8efd3 100644 ---- a/gdb/rs6000-nat.c -+++ b/gdb/rs6000-nat.c -@@ -730,7 +730,7 @@ static struct vmap * - add_vmap (LdInfo *ldi) - { - bfd *abfd, *last; -- char *mem, *objname, *filename; -+ char *mem, *filename; - struct objfile *obj; - struct vmap *vp; - int fd; -@@ -743,19 +743,18 @@ add_vmap (LdInfo *ldi) - filename = LDI_FILENAME (ldi, arch64); - mem = filename + strlen (filename) + 1; - mem = xstrdup (mem); -- objname = xstrdup (filename); - - fd = LDI_FD (ldi, arch64); - if (fd < 0) - /* Note that this opens it once for every member; a possible - enhancement would be to only open it once for every object. */ -- abfd = bfd_openr (objname, gnutarget); -+ abfd = gdb_bfd_openr (filename, gnutarget); - else -- abfd = bfd_fdopenr (objname, gnutarget, fd); -+ abfd = gdb_bfd_fdopenr (filename, gnutarget, fd); - if (!abfd) - { - warning (_("Could not open `%s' as an executable file: %s"), -- objname, bfd_errmsg (bfd_get_error ())); -+ filename, bfd_errmsg (bfd_get_error ())); - return NULL; - } - -@@ -766,35 +765,44 @@ add_vmap (LdInfo *ldi) - - else if (bfd_check_format (abfd, bfd_archive)) - { -- last = 0; -- /* FIXME??? am I tossing BFDs? bfd? */ -- while ((last = bfd_openr_next_archived_file (abfd, last))) -- if (strcmp (mem, last->filename) == 0) -- break; -+ last = gdb_bfd_openr_next_archived_file (abfd, NULL); -+ while (last != NULL) -+ { -+ bfd *next; -+ -+ if (strcmp (mem, last->filename) == 0) -+ break; -+ -+ next = gdb_bfd_openr_next_archived_file (abfd, last); -+ gdb_bfd_unref (last); -+ } - - if (!last) - { -- warning (_("\"%s\": member \"%s\" missing."), objname, mem); -- bfd_close (abfd); -+ warning (_("\"%s\": member \"%s\" missing."), filename, mem); -+ gdb_bfd_unref (abfd); - return NULL; - } - - if (!bfd_check_format (last, bfd_object)) - { - warning (_("\"%s\": member \"%s\" not in executable format: %s."), -- objname, mem, bfd_errmsg (bfd_get_error ())); -- bfd_close (last); -- bfd_close (abfd); -+ filename, mem, bfd_errmsg (bfd_get_error ())); -+ gdb_bfd_unref (last); -+ gdb_bfd_unref (abfd); - return NULL; - } - - vp = map_vmap (last, abfd); -+ /* map_vmap acquired a reference to LAST, so we can release -+ ours. */ -+ gdb_bfd_unref (last); - } - else - { - warning (_("\"%s\": not in executable format: %s."), -- objname, bfd_errmsg (bfd_get_error ())); -- bfd_close (abfd); -+ filename, bfd_errmsg (bfd_get_error ())); -+ gdb_bfd_unref (abfd); - return NULL; - } - obj = allocate_objfile (vp->bfd, 0); -@@ -803,6 +811,11 @@ add_vmap (LdInfo *ldi) - /* Always add symbols for the main objfile. */ - if (vp == vmap || auto_solib_add) - vmap_add_symbols (vp); -+ -+ /* Anything needing a reference to ABFD has already acquired it, so -+ release our local reference. */ -+ gdb_bfd_unref (abfd); -+ - return vp; - } - -diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c -index d52fb46..db8f187 100644 ---- a/gdb/solib-darwin.c -+++ b/gdb/solib-darwin.c -@@ -28,6 +28,7 @@ - #include "inferior.h" - #include "regcache.h" - #include "gdbthread.h" -+#include "gdb_bfd.h" - - #include "gdb_assert.h" - -@@ -356,6 +357,7 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info) - gdb_byte *interp_name; - CORE_ADDR load_addr = 0; - bfd *dyld_bfd = NULL; -+ struct cleanup *cleanup; - - /* This method doesn't work with an attached process. */ - if (current_inferior ()->attach_flag) -@@ -366,24 +368,31 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info) - if (!interp_name) - return; - -+ cleanup = make_cleanup (null_cleanup, NULL); -+ - /* Create a bfd for the interpreter. */ -- dyld_bfd = bfd_openr (interp_name, gnutarget); -+ dyld_bfd = gdb_bfd_openr (interp_name, gnutarget); - if (dyld_bfd) - { - bfd *sub; - -+ make_cleanup_bfd_unref (dyld_bfd); - sub = bfd_mach_o_fat_extract (dyld_bfd, bfd_object, - gdbarch_bfd_arch_info (target_gdbarch)); - if (sub) -- dyld_bfd = sub; -- else - { -- bfd_close (dyld_bfd); -- dyld_bfd = NULL; -+ dyld_bfd = sub; -+ gdb_bfd_ref (sub); -+ make_cleanup_bfd_unref (sub); - } -+ else -+ dyld_bfd = NULL; - } - if (!dyld_bfd) -- return; -+ { -+ do_cleanups (cleanup); -+ return; -+ } - - /* We find the dynamic linker's base address by examining - the current pc (which should point at the entry point for the -@@ -395,7 +404,7 @@ darwin_solib_get_all_image_info_addr_at_init (struct darwin_info *info) - info->all_image_addr = - lookup_symbol_from_bfd (dyld_bfd, "_dyld_all_image_infos"); - -- bfd_close (dyld_bfd); -+ do_cleanups (cleanup); - - if (info->all_image_addr == 0) - return; -@@ -509,17 +518,10 @@ darwin_bfd_open (char *pathname) - gdbarch_bfd_arch_info (target_gdbarch)); - if (!res) - { -- bfd_close (abfd); -- make_cleanup (xfree, found_pathname); -+ make_cleanup_bfd_unref (abfd); - error (_("`%s': not a shared-library: %s"), -- found_pathname, bfd_errmsg (bfd_get_error ())); -+ bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ())); - } -- -- /* Make sure that the filename is malloc'ed. The current filename -- for fat-binaries BFDs is a name that was generated by BFD, usually -- a static string containing the name of the architecture. */ -- res->filename = xstrdup (pathname); -- - return res; - } - -diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c -index 2500c1f..fcc01a8 100644 ---- a/gdb/solib-dsbt.c -+++ b/gdb/solib-dsbt.c -@@ -30,6 +30,7 @@ - #include "gdbcmd.h" - #include "elf-bfd.h" - #include "exceptions.h" -+#include "gdb_bfd.h" - - #define GOT_MODULE_OFFSET 4 - -@@ -899,7 +900,7 @@ enable_break2 (void) - { - warning (_("Could not find symbol _dl_debug_addr in dynamic linker")); - enable_break_failure_warning (); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return 0; - } - -@@ -948,13 +949,13 @@ enable_break2 (void) - "(at address %s) from dynamic linker"), - hex_string_custom (addr + 8, 8)); - enable_break_failure_warning (); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return 0; - } - addr = extract_unsigned_integer (addr_buf, sizeof addr_buf, byte_order); - - /* We're done with the temporary bfd. */ -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - - /* We're also done with the loadmap. */ - xfree (ldm); -diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c -index 2f2c8b0..0f59535 100644 ---- a/gdb/solib-frv.c -+++ b/gdb/solib-frv.c -@@ -31,6 +31,7 @@ - #include "gdbcmd.h" - #include "elf/frv.h" - #include "exceptions.h" -+#include "gdb_bfd.h" - - /* Flag which indicates whether internal debug messages should be printed. */ - static int solib_frv_debug; -@@ -574,7 +575,7 @@ enable_break2 (void) - { - warning (_("Unable to determine dynamic linker loadmap address.")); - enable_break_failure_warning (); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return 0; - } - -@@ -589,7 +590,7 @@ enable_break2 (void) - warning (_("Unable to load dynamic linker loadmap at address %s."), - hex_string_custom (interp_loadmap_addr, 8)); - enable_break_failure_warning (); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return 0; - } - -@@ -623,7 +624,7 @@ enable_break2 (void) - warning (_("Could not find symbol _dl_debug_addr " - "in dynamic linker")); - enable_break_failure_warning (); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return 0; - } - -@@ -674,7 +675,7 @@ enable_break2 (void) - "(at address %s) from dynamic linker"), - hex_string_custom (addr + 8, 8)); - enable_break_failure_warning (); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return 0; - } - addr = extract_unsigned_integer (addr_buf, sizeof addr_buf, byte_order); -@@ -686,13 +687,13 @@ enable_break2 (void) - "(at address %s) from dynamic linker"), - hex_string_custom (addr, 8)); - enable_break_failure_warning (); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return 0; - } - addr = extract_unsigned_integer (addr_buf, sizeof addr_buf, byte_order); - - /* We're done with the temporary bfd. */ -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - - /* We're also done with the loadmap. */ - xfree (ldm); -diff --git a/gdb/solib-pa64.c b/gdb/solib-pa64.c -index 2b8d061..00ed8a5 100644 ---- a/gdb/solib-pa64.c -+++ b/gdb/solib-pa64.c -@@ -362,7 +362,7 @@ manpage for methods to privately map shared library text.")); - to find any magic formula to find it for Solaris (appears to - be trivial on GNU/Linux). Therefore, we have to try an alternate - mechanism to find the dynamic linker's base address. */ -- tmp_bfd = bfd_openr (buf, gnutarget); -+ tmp_bfd = gdb_bfd_openr (buf, gnutarget); - if (tmp_bfd == NULL) - return; - -@@ -371,7 +371,7 @@ manpage for methods to privately map shared library text.")); - { - warning (_("Unable to grok dynamic linker %s as an object file"), - buf); -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - return; - } - -@@ -401,7 +401,7 @@ manpage for methods to privately map shared library text.")); - } - - /* We're done with the temporary bfd. */ -- bfd_close (tmp_bfd); -+ gdb_bfd_unref (tmp_bfd); - } - } - -diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c -index b5454e7..f62d96c 100644 ---- a/gdb/solib-spu.c -+++ b/gdb/solib-spu.c -@@ -36,6 +36,7 @@ - #include "breakpoint.h" - #include "gdbthread.h" - #include "exceptions.h" -+#include "gdb_bfd.h" - - #include "spu-tdep.h" - -@@ -325,16 +326,16 @@ spu_bfd_fopen (char *name, CORE_ADDR addr) - CORE_ADDR *open_closure = xmalloc (sizeof (CORE_ADDR)); - *open_closure = addr; - -- nbfd = bfd_openr_iovec (xstrdup (name), "elf32-spu", -- spu_bfd_iovec_open, open_closure, -- spu_bfd_iovec_pread, spu_bfd_iovec_close, -- spu_bfd_iovec_stat); -+ nbfd = gdb_bfd_openr_iovec (name, "elf32-spu", -+ spu_bfd_iovec_open, open_closure, -+ spu_bfd_iovec_pread, spu_bfd_iovec_close, -+ spu_bfd_iovec_stat); - if (!nbfd) - return NULL; - - if (!bfd_check_format (nbfd, bfd_object)) - { -- bfd_close (nbfd); -+ gdb_bfd_unref (nbfd); - return NULL; - } - -diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c -index 307e483..76bd872 100644 ---- a/gdb/solib-svr4.c -+++ b/gdb/solib-svr4.c -@@ -46,6 +46,7 @@ - #include "exec.h" - #include "auxv.h" - #include "exceptions.h" -+#include "gdb_bfd.h" - - static struct link_map_offsets *svr4_fetch_link_map_offsets (void); - static int svr4_have_link_map_offsets (void); -@@ -1558,9 +1559,11 @@ enable_break (struct svr4_info *info, int from_tty) - goto bkpt_at_symbol; - - /* Now convert the TMP_BFD into a target. That way target, as -- well as BFD operations can be used. Note that closing the -- target will also close the underlying bfd. */ -+ well as BFD operations can be used. */ - tmp_bfd_target = target_bfd_reopen (tmp_bfd); -+ /* target_bfd_reopen acquired its own reference, so we can -+ release ours now. */ -+ gdb_bfd_unref (tmp_bfd); - - /* On a running target, we can get the dynamic linker's base - address from the shared library table. */ -@@ -1670,8 +1673,9 @@ enable_break (struct svr4_info *info, int from_tty) - sym_addr, - tmp_bfd_target); - -- /* We're done with both the temporary bfd and target. Remember, -- closing the target closes the underlying bfd. */ -+ /* We're done with both the temporary bfd and target. Closing -+ the target closes the underlying bfd, because it holds the -+ only remaining reference. */ - target_close (tmp_bfd_target, 0); - - if (sym_addr != 0) -diff --git a/gdb/solib.c b/gdb/solib.c -index 90439ba..73773f1 100644 ---- a/gdb/solib.c -+++ b/gdb/solib.c -@@ -46,6 +46,7 @@ - #include "solib.h" - #include "interps.h" - #include "filesystem.h" -+#include "gdb_bfd.h" - - /* Architecture-specific operations. */ - -@@ -360,9 +361,9 @@ solib_find (char *in_pathname, int *fd) - it is used as file handle to open the file. Throws an error if the file - could not be opened. Handles both local and remote file access. - -- PATHNAME must be malloc'ed by the caller. If successful, the new BFD's -- name will point to it. If unsuccessful, PATHNAME will be freed and the -- FD will be closed (unless FD was -1). */ -+ PATHNAME must be malloc'ed by the caller. It will be freed by this -+ function. If unsuccessful, the FD will be closed (unless FD was -+ -1). */ - - bfd * - solib_bfd_fopen (char *pathname, int fd) -@@ -376,7 +377,7 @@ solib_bfd_fopen (char *pathname, int fd) - } - else - { -- abfd = bfd_fopen (pathname, gnutarget, FOPEN_RB, fd); -+ abfd = gdb_bfd_fopen (pathname, gnutarget, FOPEN_RB, fd); - - if (abfd) - bfd_set_cacheable (abfd, 1); -@@ -389,6 +390,8 @@ solib_bfd_fopen (char *pathname, int fd) - pathname, bfd_errmsg (bfd_get_error ())); - } - -+ xfree (pathname); -+ - return abfd; - } - -@@ -420,17 +423,16 @@ solib_bfd_open (char *pathname) - /* Check bfd format. */ - if (!bfd_check_format (abfd, bfd_object)) - { -- bfd_close (abfd); -- make_cleanup (xfree, found_pathname); -+ make_cleanup_bfd_unref (abfd); - error (_("`%s': not in executable format: %s"), -- found_pathname, bfd_errmsg (bfd_get_error ())); -+ bfd_get_filename (abfd), bfd_errmsg (bfd_get_error ())); - } - - /* Check bfd arch. */ - b = gdbarch_bfd_arch_info (target_gdbarch); - if (!b->compatible (b, bfd_get_arch_info (abfd))) - warning (_("`%s': Shared library architecture %s is not compatible " -- "with target architecture %s."), found_pathname, -+ "with target architecture %s."), bfd_get_filename (abfd), - bfd_get_arch_info (abfd)->printable_name, b->printable_name); - - return abfd; -@@ -466,7 +468,7 @@ solib_map_sections (struct so_list *so) - return 0; - - /* Leave bfd open, core_xfer_memory and "info files" need it. */ -- so->abfd = gdb_bfd_ref (abfd); -+ so->abfd = abfd; - - /* copy full path name into so_name, so that later symbol_file_add - can find it. */ -@@ -1233,7 +1235,7 @@ reload_shared_libraries_1 (int from_tty) - { - found_pathname = xstrdup (bfd_get_filename (abfd)); - make_cleanup (xfree, found_pathname); -- gdb_bfd_close_or_warn (abfd); -+ gdb_bfd_unref (abfd); - } - - /* If this shared library is no longer associated with its previous -diff --git a/gdb/spu-linux-nat.c b/gdb/spu-linux-nat.c -index 2dfec8c..999f1ab 100644 ---- a/gdb/spu-linux-nat.c -+++ b/gdb/spu-linux-nat.c -@@ -315,16 +315,16 @@ spu_bfd_open (ULONGEST addr) - ULONGEST *open_closure = xmalloc (sizeof (ULONGEST)); - *open_closure = addr; - -- nbfd = bfd_openr_iovec (xstrdup (""), "elf32-spu", -- spu_bfd_iovec_open, open_closure, -- spu_bfd_iovec_pread, spu_bfd_iovec_close, -- spu_bfd_iovec_stat); -+ nbfd = gdb_bfd_openr_iovec ("", "elf32-spu", -+ spu_bfd_iovec_open, open_closure, -+ spu_bfd_iovec_pread, spu_bfd_iovec_close, -+ spu_bfd_iovec_stat); - if (!nbfd) - return NULL; - - if (!bfd_check_format (nbfd, bfd_object)) - { -- bfd_close (nbfd); -+ gdb_bfd_unref (nbfd); - return NULL; - } - -@@ -374,8 +374,13 @@ spu_symbol_file_add_from_memory (int inferior_fd) - /* Open BFD representing SPE executable and read its symbols. */ - nbfd = spu_bfd_open (addr); - if (nbfd) -- symbol_file_add_from_bfd (nbfd, SYMFILE_VERBOSE | SYMFILE_MAINLINE, -- NULL, 0, NULL); -+ { -+ struct cleanup *cleanup = make_cleanup_bfd_unref (nbfd); -+ -+ symbol_file_add_from_bfd (nbfd, SYMFILE_VERBOSE | SYMFILE_MAINLINE, -+ NULL, 0, NULL); -+ do_cleanups (cleanup); -+ } - } - - diff --git a/gdb/stack.c b/gdb/stack.c -index 35d379d..04aab5e 100644 +index a9dabb5..6c78436 100644 --- a/gdb/stack.c +++ b/gdb/stack.c -@@ -509,6 +509,10 @@ print_frame_args (struct symbol *func, struct frame_info *frame, +@@ -510,6 +510,10 @@ print_frame_args (struct symbol *func, struct frame_info *frame, stb = mem_fileopen (); old_chain = make_cleanup_ui_file_delete (stb); @@ -9504,290 +4865,11 @@ index 35d379d..04aab5e 100644 if (func) { struct block *b = SYMBOL_BLOCK_VALUE (func); -diff --git a/gdb/symfile-mem.c b/gdb/symfile-mem.c -index e80fd25..2e53be0 100644 ---- a/gdb/symfile-mem.c -+++ b/gdb/symfile-mem.c -@@ -54,6 +54,7 @@ - #include "observer.h" - #include "auxv.h" - #include "elf/common.h" -+#include "gdb_bfd.h" - - /* Verify parameters of target_read_memory_bfd and target_read_memory are - compatible. */ -@@ -100,23 +101,24 @@ symbol_file_add_from_memory (struct bfd *templ, CORE_ADDR addr, char *name, - if (nbfd == NULL) - error (_("Failed to read a valid object file image from memory.")); - -+ gdb_bfd_ref (nbfd); - if (name == NULL) -- nbfd->filename = xstrdup ("shared object read from target memory"); -+ nbfd->filename = "shared object read from target memory"; - else -- nbfd->filename = name; -- -- if (!bfd_check_format (nbfd, bfd_object)) - { -- /* FIXME: should be checking for errors from bfd_close (for one thing, -- on error it does not free all the storage associated with the -- bfd). */ -- bfd_close (nbfd); -- error (_("Got object file from memory but can't read symbols: %s."), -- bfd_errmsg (bfd_get_error ())); -+ nbfd->filename = name; -+ gdb_bfd_stash_filename (nbfd); -+ xfree (name); - } - -+ cleanup = make_cleanup_bfd_unref (nbfd); -+ -+ if (!bfd_check_format (nbfd, bfd_object)) -+ error (_("Got object file from memory but can't read symbols: %s."), -+ bfd_errmsg (bfd_get_error ())); -+ - sai = alloc_section_addr_info (bfd_count_sections (nbfd)); -- cleanup = make_cleanup (xfree, sai); -+ make_cleanup (xfree, sai); - i = 0; - for (sec = nbfd->sections; sec != NULL; sec = sec->next) - if ((bfd_get_section_flags (nbfd, sec) & (SEC_ALLOC|SEC_LOAD)) != 0) -diff --git a/gdb/symfile.c b/gdb/symfile.c -index 01252e2..95ed480 100644 ---- a/gdb/symfile.c -+++ b/gdb/symfile.c -@@ -55,6 +55,7 @@ - #include "solib.h" - #include "remote.h" - #include "stack.h" -+#include "gdb_bfd.h" - - #include - #include -@@ -1036,7 +1037,7 @@ new_symfile_objfile (struct objfile *objfile, int add_flags) - loaded file. - - ABFD is a BFD already open on the file, as from symfile_bfd_open. -- This BFD will be closed on error, and is always consumed by this function. -+ A new reference is acquired by this function. - - ADD_FLAGS encodes verbosity, whether this is main symbol file or - extra, such as dynamically loaded code, and what to do with breakpoins. -@@ -1060,7 +1061,6 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, - int flags, struct objfile *parent) - { - struct objfile *objfile; -- struct cleanup *my_cleanups; - const char *name = bfd_get_filename (abfd); - const int from_tty = add_flags & SYMFILE_VERBOSE; - const int mainline = add_flags & SYMFILE_MAINLINE; -@@ -1074,8 +1074,6 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, - add_flags &= ~SYMFILE_NO_READ; - } - -- my_cleanups = make_cleanup_bfd_close (abfd); -- - /* Give user a chance to burp if we'd be - interactively wiping out any existing symbols. */ - -@@ -1086,7 +1084,6 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, - error (_("Not confirmed.")); - - objfile = allocate_objfile (abfd, flags | (mainline ? OBJF_MAINLINE : 0)); -- discard_cleanups (my_cleanups); - - if (parent) - add_separate_debug_objfile (objfile, parent); -@@ -1207,8 +1204,13 @@ struct objfile * - symbol_file_add (char *name, int add_flags, struct section_addr_info *addrs, - int flags) - { -- return symbol_file_add_from_bfd (symfile_bfd_open (name), add_flags, addrs, -- flags, NULL); -+ bfd *bfd = symfile_bfd_open (name); -+ struct cleanup *cleanup = make_cleanup_bfd_unref (bfd); -+ struct objfile *objf; -+ -+ objf = symbol_file_add_from_bfd (bfd, add_flags, addrs, flags, NULL); -+ do_cleanups (cleanup); -+ return objf; - } - - -@@ -1350,7 +1352,7 @@ separate_debug_file_exists (const char *name, unsigned long crc, - if (filename_cmp (name, parent_objfile->name) == 0) - return 0; - -- abfd = bfd_open_maybe_remote (name); -+ abfd = gdb_bfd_open_maybe_remote (name); - - if (!abfd) - return 0; -@@ -1372,7 +1374,7 @@ separate_debug_file_exists (const char *name, unsigned long crc, - if (abfd_stat.st_dev == parent_stat.st_dev - && abfd_stat.st_ino == parent_stat.st_ino) - { -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return 0; - } - verified_as_different = 1; -@@ -1382,7 +1384,7 @@ separate_debug_file_exists (const char *name, unsigned long crc, - - file_crc_p = get_file_crc (abfd, &file_crc); - -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - - if (!file_crc_p) - return 0; -@@ -1690,15 +1692,20 @@ set_initial_language (void) - } - - /* If NAME is a remote name open the file using remote protocol, otherwise -- open it normally. */ -+ open it normally. Returns a new reference to the BFD. On error, -+ returns NULL with the BFD error set. */ - - bfd * --bfd_open_maybe_remote (const char *name) -+gdb_bfd_open_maybe_remote (const char *name) - { -+ bfd *result; -+ - if (remote_filename_p (name)) -- return remote_bfd_open (name, gnutarget); -+ result = remote_bfd_open (name, gnutarget); - else -- return bfd_openr (name, gnutarget); -+ result = gdb_bfd_openr (name, gnutarget); -+ -+ return result; - } - - -@@ -1716,19 +1723,14 @@ symfile_bfd_open (char *name) - - if (remote_filename_p (name)) - { -- name = xstrdup (name); - sym_bfd = remote_bfd_open (name, gnutarget); - if (!sym_bfd) -- { -- make_cleanup (xfree, name); -- error (_("`%s': can't open to read symbols: %s."), name, -- bfd_errmsg (bfd_get_error ())); -- } -+ error (_("`%s': can't open to read symbols: %s."), name, -+ bfd_errmsg (bfd_get_error ())); - - if (!bfd_check_format (sym_bfd, bfd_object)) - { -- bfd_close (sym_bfd); -- make_cleanup (xfree, name); -+ make_cleanup_bfd_unref (sym_bfd); - error (_("`%s': can't read symbols: %s."), name, - bfd_errmsg (bfd_get_error ())); - } -@@ -1757,12 +1759,11 @@ symfile_bfd_open (char *name) - perror_with_name (name); - } - -- /* Free 1st new malloc'd copy, but keep the 2nd malloc'd copy in -- bfd. It'll be freed in free_objfile(). */ - xfree (name); - name = absolute_name; -+ make_cleanup (xfree, name); - -- sym_bfd = bfd_fopen (name, gnutarget, FOPEN_RB, desc); -+ sym_bfd = gdb_bfd_fopen (name, gnutarget, FOPEN_RB, desc); - if (!sym_bfd) - { - make_cleanup (xfree, name); -@@ -1773,18 +1774,11 @@ symfile_bfd_open (char *name) - - if (!bfd_check_format (sym_bfd, bfd_object)) - { -- /* FIXME: should be checking for errors from bfd_close (for one -- thing, on error it does not free all the storage associated -- with the bfd). */ -- bfd_close (sym_bfd); /* This also closes desc. */ -- make_cleanup (xfree, name); -+ make_cleanup_bfd_unref (sym_bfd); - error (_("`%s': can't read symbols: %s."), name, - bfd_errmsg (bfd_get_error ())); - } - -- /* bfd_usrdata exists for applications and libbfd must not touch it. */ -- gdb_assert (bfd_usrdata (sym_bfd) == NULL); -- - return sym_bfd; - } - -@@ -2109,17 +2103,14 @@ generic_load (char *args, int from_tty) - } - - /* Open the file for loading. */ -- loadfile_bfd = bfd_openr (filename, gnutarget); -+ loadfile_bfd = gdb_bfd_openr (filename, gnutarget); - if (loadfile_bfd == NULL) - { - perror_with_name (filename); - return; - } - -- /* FIXME: should be checking for errors from bfd_close (for one thing, -- on error it does not free all the storage associated with the -- bfd). */ -- make_cleanup_bfd_close (loadfile_bfd); -+ make_cleanup_bfd_unref (loadfile_bfd); - - if (!bfd_check_format (loadfile_bfd, bfd_object)) - { -@@ -2518,15 +2509,18 @@ reread_symbols (void) - /* Clean up any state BFD has sitting around. We don't need - to close the descriptor but BFD lacks a way of closing the - BFD without closing the descriptor. */ -- obfd_filename = bfd_get_filename (objfile->obfd); -- if (!bfd_close (objfile->obfd)) -- error (_("Can't close BFD for %s: %s"), objfile->name, -- bfd_errmsg (bfd_get_error ())); -- objfile->obfd = bfd_open_maybe_remote (obfd_filename); -+ { -+ struct bfd *obfd = objfile->obfd; -+ -+ obfd_filename = bfd_get_filename (objfile->obfd); -+ /* Open the new BFD before freeing the old one, so that -+ the filename remains live. */ -+ objfile->obfd = gdb_bfd_open_maybe_remote (obfd_filename); -+ gdb_bfd_unref (obfd); -+ } -+ - if (objfile->obfd == NULL) - error (_("Can't open %s to read symbols."), objfile->name); -- else -- objfile->obfd = gdb_bfd_ref (objfile->obfd); - /* bfd_openr sets cacheable to true, which is what we want. */ - if (!bfd_check_format (objfile->obfd, bfd_object)) - error (_("Can't read symbols from %s: %s."), objfile->name, -diff --git a/gdb/symfile.h b/gdb/symfile.h -index aca7359..184a83e 100644 ---- a/gdb/symfile.h -+++ b/gdb/symfile.h -@@ -553,7 +553,7 @@ extern void find_lowest_section (bfd *, asection *, void *); - - extern bfd *symfile_bfd_open (char *); - --extern bfd *bfd_open_maybe_remote (const char *); -+extern bfd *gdb_bfd_open_maybe_remote (const char *); - - extern int get_section_index (struct objfile *, char *); - diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp -index 678639c..47a2202 100644 +index e22cb3a..5e16186 100644 --- a/gdb/testsuite/gdb.ada/packed_array.exp +++ b/gdb/testsuite/gdb.ada/packed_array.exp -@@ -60,5 +60,11 @@ gdb_test_multiple "$test" "$test" { +@@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" { # are. Observed with (FSF GNU Ada 4.5.3 20110124). xfail $test } @@ -10964,7 +6046,7 @@ index 0000000..b05411e + +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c -index a99137e..c3dc2d9 100644 +index 2cc935b..30c7f85 100644 --- a/gdb/testsuite/gdb.base/arrayidx.c +++ b/gdb/testsuite/gdb.base/arrayidx.c @@ -17,6 +17,13 @@ @@ -10982,7 +6064,7 @@ index a99137e..c3dc2d9 100644 main (void) { diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp -index cba0024..0dc0e46 100644 +index 387b34f..d5956ce 100644 --- a/gdb/testsuite/gdb.base/arrayidx.exp +++ b/gdb/testsuite/gdb.base/arrayidx.exp @@ -53,4 +53,12 @@ gdb_test "print array" \ @@ -12847,10 +7929,10 @@ index 0000000..4747ea9 + write (*,*) a ! break-static +end diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp -index 7645caf..f4f9c1f 100644 +index 351fa87..0b5db6e 100644 --- a/gdb/testsuite/gdb.gdb/selftest.exp +++ b/gdb/testsuite/gdb.gdb/selftest.exp -@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} { +@@ -91,6 +91,10 @@ proc do_steps_and_nexts {} { set description "step over cmdarg_vec initialization" set command "step" } @@ -13256,29 +8338,20 @@ index 0000000..295602d + writeln(s); { set breakpoint 2 here } +end. diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp -index 993e774..52dbd17 100644 +index aa4d937..60d2cc8 100644 --- a/gdb/testsuite/gdb.python/py-frame.exp +++ b/gdb/testsuite/gdb.python/py-frame.exp -@@ -74,8 +74,6 @@ gdb_test "python print bframe == gdb.newest_frame()" True \ +@@ -90,3 +90,5 @@ gdb_test "python print ('result = %s' % f0.read_var ('variable_which_surely_does + gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.read_var - success" - gdb_test "python print 'result =', f0 == f1" " = False" "test equality comparison (false)" - gdb_test "python print 'result =', f0 == f0" " = True" "test equality comparison (true)" --gdb_test "python print 'result =', f0 != f1" " = True" "test inequality comparison (true)" --gdb_test "python print 'result =', f0 != f0" " = False" "test inequality comparison (false)" - gdb_test "python print 'result =', f0.is_valid ()" " = True" "test Frame.is_valid" - gdb_test "python print 'result =', f0.name ()" " = f2" "test Frame.name" - gdb_test "python print 'result =', f0.type () == gdb.NORMAL_FRAME" " = True" "test Frame.type" -@@ -90,3 +88,5 @@ gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_ex - gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success" - - gdb_test "python print 'result =', gdb.selected_frame () == f1" " = True" "test gdb.selected_frame" + gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame" + -+gdb_test "python print 'result =', f0.block ()" "" "test Frame.block" ++gdb_test "python print ('result = %s' % (f0.block ()))" "" "test Frame.block" diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index acfd89b..c77d9c2 100644 +index 9142c72..2855220 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -358,6 +358,15 @@ proc test_value_after_death {} { +@@ -366,6 +366,15 @@ proc test_value_after_death {} { "print value's type" } @@ -13294,7 +8367,7 @@ index acfd89b..c77d9c2 100644 # Regression test for invalid subscript operations. The bug was that # the type of the value was not being checked before allowing a # subscript operation to proceed. -@@ -494,6 +503,7 @@ test_value_in_inferior +@@ -492,6 +501,7 @@ test_value_in_inferior test_inferior_function_call test_lazy_strings test_value_after_death @@ -13303,10 +8376,10 @@ index acfd89b..c77d9c2 100644 # Test either C or C++ values. test_subscript_regression "${binfile}" "c" diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 4f2b7c9..0daef25 100644 +index 8b16b38..f6e59b0 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -142,6 +142,11 @@ proc gdb_unload {} { +@@ -143,6 +143,11 @@ proc gdb_unload {} { send_gdb "y\n" exp_continue } @@ -13319,7 +8392,7 @@ index 4f2b7c9..0daef25 100644 send_gdb "y\n" exp_continue diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp -index dd18d37..f973485 100644 +index 569fb02..cacecf4 100644 --- a/gdb/testsuite/lib/pascal.exp +++ b/gdb/testsuite/lib/pascal.exp @@ -37,6 +37,9 @@ proc pascal_init {} { @@ -13354,10 +8427,10 @@ index dd18d37..f973485 100644 set pascal_init_done 1 } diff --git a/gdb/top.c b/gdb/top.c -index 061ad48..d615cfc 100644 +index e9d6c1c..7fe6ad1 100644 --- a/gdb/top.c +++ b/gdb/top.c -@@ -352,6 +352,9 @@ prepare_execute_command (void) +@@ -350,6 +350,9 @@ prepare_execute_command (void) mark = value_mark (); cleanup = make_cleanup_value_free_to_mark (mark); @@ -13368,45 +8441,36 @@ index 061ad48..d615cfc 100644 /* With multiple threads running while the one we're examining is stopped, the dcache can get stale without us being able to detect diff --git a/gdb/typeprint.c b/gdb/typeprint.c -index c25e705..498958a 100644 +index 2d5a6af..5251e3f 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c -@@ -35,6 +35,7 @@ +@@ -34,6 +34,7 @@ #include "gdb_string.h" #include "exceptions.h" #include "valprint.h" +#include "dwarf2loc.h" #include - - extern void _initialize_typeprint (void); -@@ -76,6 +77,9 @@ void + #include + #include "cli/cli-utils.h" +@@ -363,6 +364,9 @@ void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show) { + if (show >= 0 && current_language->la_language != language_ada) + type = check_typedef (type); + - LA_PRINT_TYPE (type, varstring, stream, show, 0); + LA_PRINT_TYPE (type, varstring, stream, show, 0, &default_ptype_flags); } -@@ -114,7 +118,8 @@ whatis_exp (char *exp, int show) - { - struct expression *expr; - struct value *val; -- struct cleanup *old_chain = NULL; +@@ -410,6 +414,7 @@ whatis_exp (char *exp, int show) + struct value_print_options opts; + struct type_print_options flags = default_ptype_flags; + + /* Required at least for the object_address_set call. */ -+ struct cleanup *old_chain = make_cleanup (null_cleanup, NULL); - struct type *real_type = NULL; - struct type *type; - int full = 0; -@@ -125,12 +130,13 @@ whatis_exp (char *exp, int show) + old_chain = make_cleanup (null_cleanup, NULL); + if (exp) - { - expr = parse_expression (exp); -- old_chain = make_cleanup (free_current_contents, &expr); -+ make_cleanup (free_current_contents, &expr); - val = evaluate_type (expr); - } +@@ -457,6 +462,7 @@ whatis_exp (char *exp, int show) else val = access_value_history (0); @@ -13414,43 +8478,11 @@ index c25e705..498958a 100644 type = value_type (val); get_user_print_options (&opts); -@@ -158,8 +164,7 @@ whatis_exp (char *exp, int show) - type_print (type, "", gdb_stdout, show); - printf_filtered ("\n"); - -- if (exp) -- do_cleanups (old_chain); -+ do_cleanups (old_chain); - } - - static void diff --git a/gdb/utils.c b/gdb/utils.c -index 5566149..6e1aa34 100644 +index 8bae4eb..6eb5877 100644 --- a/gdb/utils.c +++ b/gdb/utils.c -@@ -27,6 +27,7 @@ - #include "exceptions.h" - #include "gdbthread.h" - #include "fnmatch.h" -+#include "gdb_bfd.h" - #ifdef HAVE_SYS_RESOURCE_H - #include - #endif /* HAVE_SYS_RESOURCE_H */ -@@ -198,11 +199,11 @@ make_cleanup_dyn_string_delete (dyn_string_t arg) - static void - do_bfd_close_cleanup (void *arg) - { -- bfd_close (arg); -+ gdb_bfd_unref (arg); - } - - struct cleanup * --make_cleanup_bfd_close (bfd *abfd) -+make_cleanup_bfd_unref (bfd *abfd) - { - return make_cleanup (do_bfd_close_cleanup, abfd); - } -@@ -1738,6 +1739,36 @@ set_batch_flag_and_make_cleanup_restore_page_info (void) +@@ -1821,6 +1821,36 @@ set_batch_flag_and_make_cleanup_restore_page_info (void) return back_to; } @@ -13487,11 +8519,22 @@ index 5566149..6e1aa34 100644 /* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE. */ static void +diff --git a/gdb/utils.h b/gdb/utils.h +index 6983a53..0efa553 100644 +--- a/gdb/utils.h ++++ b/gdb/utils.h +@@ -380,4 +380,6 @@ extern int myread (int, char *, int); + extern ULONGEST align_up (ULONGEST v, int n); + extern ULONGEST align_down (ULONGEST v, int n); + ++extern struct cleanup *make_cleanup_restore_selected_frame (void); ++ + #endif /* UTILS_H */ diff --git a/gdb/valarith.c b/gdb/valarith.c -index 96d5411..37bd464 100644 +index 074cf36..5c44edc 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c -@@ -197,7 +197,10 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) +@@ -195,7 +195,10 @@ 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)); unsigned int elt_size = TYPE_LENGTH (elt_type); @@ -13503,7 +8546,7 @@ index 96d5411..37bd464 100644 struct value *v; if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) -@@ -297,6 +300,10 @@ int +@@ -255,6 +258,10 @@ int binop_user_defined_p (enum exp_opcode op, struct value *arg1, struct value *arg2) { @@ -13515,7 +8558,7 @@ index 96d5411..37bd464 100644 } diff --git a/gdb/valops.c b/gdb/valops.c -index 97d889b..6ae77b8 100644 +index e3d36a1..a6bda4d 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -45,6 +45,7 @@ @@ -13524,7 +8567,7 @@ index 97d889b..6ae77b8 100644 #include "exceptions.h" +#include "dwarf2loc.h" - extern int overload_debug; + extern unsigned int overload_debug; /* Local functions. */ @@ -919,6 +920,65 @@ value_one (struct type *type) return val; @@ -13602,17 +8645,18 @@ index 97d889b..6ae77b8 100644 if (value_bitsize (val)) { /* To read a lazy bitfield, read the entire enclosing value. This -@@ -1015,12 +1076,24 @@ value_fetch_lazy (struct value *val) +@@ -1014,13 +1075,24 @@ value_fetch_lazy (struct value *val) } else if (VALUE_LVAL (val) == lval_memory) { - CORE_ADDR addr = value_address (val); -- int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); +- struct type *type = check_typedef (value_enclosing_type (val)); + CORE_ADDR addr = value_raw_address (val); -- if (length) +- if (TYPE_LENGTH (type)) - read_value_memory (val, 0, value_stack (val), -- addr, value_contents_all_raw (val), length); +- addr, value_contents_all_raw (val), +- TYPE_LENGTH (type)); + if (object_address_get_data (value_type (val), &addr)) + { + struct type *type = value_enclosing_type (val); @@ -13632,7 +8676,7 @@ index 97d889b..6ae77b8 100644 } else if (VALUE_LVAL (val) == lval_register) { -@@ -1530,7 +1603,18 @@ address_of_variable (struct symbol *var, struct block *b) +@@ -1529,7 +1601,18 @@ address_of_variable (struct symbol *var, const struct block *b) if ((VALUE_LVAL (val) == lval_memory && value_lazy (val)) || TYPE_CODE (type) == TYPE_CODE_FUNC) { @@ -13652,7 +8696,7 @@ index 97d889b..6ae77b8 100644 return value_from_pointer (lookup_pointer_type (type), addr); } -@@ -1637,6 +1721,7 @@ struct value * +@@ -1636,6 +1719,7 @@ struct value * value_coerce_array (struct value *arg1) { struct type *type = check_typedef (value_type (arg1)); @@ -13660,7 +8704,7 @@ index 97d889b..6ae77b8 100644 /* If the user tries to do something requiring a pointer with an array that has not yet been pushed to the target, then this would -@@ -1646,8 +1731,12 @@ value_coerce_array (struct value *arg1) +@@ -1645,8 +1729,12 @@ value_coerce_array (struct value *arg1) if (VALUE_LVAL (arg1) != lval_memory) error (_("Attempt to take address of value not located in memory.")); @@ -13674,17 +8718,17 @@ index 97d889b..6ae77b8 100644 } /* Given a value which is a function, return a value which is a pointer -@@ -3769,6 +3858,8 @@ value_slice (struct value *array, int lowbound, int length) +@@ -3724,6 +3812,8 @@ value_slice (struct value *array, int lowbound, int length) TYPE_TARGET_TYPE (range_type), lowbound, lowbound + length - 1); + TYPE_BYTE_STRIDE (slice_range_type) = TYPE_BYTE_STRIDE (range_type); + - if (TYPE_CODE (array_type) == TYPE_CODE_BITSTRING) + { - int i; + struct type *element_type = TYPE_TARGET_TYPE (array_type); diff --git a/gdb/valprint.c b/gdb/valprint.c -index fc5942d..8333eb4 100644 +index 42dacc5..6977f62 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -37,6 +37,7 @@ @@ -13695,15 +8739,15 @@ index fc5942d..8333eb4 100644 #include -@@ -251,7 +252,6 @@ scalar_type_p (struct type *type) +@@ -287,7 +288,6 @@ scalar_type_p (struct type *type) case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: case TYPE_CODE_SET: - case TYPE_CODE_STRING: - case TYPE_CODE_BITSTRING: return 0; default: -@@ -1570,6 +1570,7 @@ val_print_array_elements (struct type *type, + return 1; +@@ -1605,6 +1605,7 @@ val_print_array_elements (struct type *type, { unsigned int things_printed = 0; unsigned len; @@ -13711,7 +8755,7 @@ index fc5942d..8333eb4 100644 struct type *elttype, *index_type; unsigned eltlen; /* Position of the array element we are examining to see -@@ -1578,9 +1579,33 @@ val_print_array_elements (struct type *type, +@@ -1613,9 +1614,33 @@ val_print_array_elements (struct type *type, /* Number of repetitions we have detected so far. */ unsigned int reps; LONGEST low_bound, high_bound; @@ -13747,7 +8791,7 @@ index fc5942d..8333eb4 100644 index_type = TYPE_INDEX_TYPE (type); if (get_array_bounds (type, &low_bound, &high_bound)) -@@ -1667,6 +1692,8 @@ val_print_array_elements (struct type *type, +@@ -1702,6 +1727,8 @@ val_print_array_elements (struct type *type, { fprintf_filtered (stream, "..."); } @@ -13757,7 +8801,7 @@ index fc5942d..8333eb4 100644 /* Read LEN bytes of target memory at address MEMADDR, placing the diff --git a/gdb/value.c b/gdb/value.c -index a6bb718..7b08d1f 100644 +index ec4b090..96a308f 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -42,6 +42,7 @@ @@ -13768,7 +8812,7 @@ index a6bb718..7b08d1f 100644 /* Prototypes for exported functions. */ -@@ -1437,12 +1438,15 @@ void +@@ -1440,12 +1441,15 @@ void set_value_component_location (struct value *component, const struct value *whole) { @@ -13784,7 +8828,7 @@ index a6bb718..7b08d1f 100644 if (whole->lval == lval_computed) { const struct lval_funcs *funcs = whole->location.computed.funcs; -@@ -1450,6 +1454,12 @@ set_value_component_location (struct value *component, +@@ -1453,6 +1457,12 @@ set_value_component_location (struct value *component, if (funcs->copy_closure) component->location.computed.closure = funcs->copy_closure (whole); } @@ -13797,7 +8841,7 @@ index a6bb718..7b08d1f 100644 } -@@ -1583,6 +1593,31 @@ show_values (char *num_exp, int from_tty) +@@ -1586,6 +1596,31 @@ show_values (char *num_exp, int from_tty) num_exp[1] = '\0'; } } @@ -13829,7 +8873,7 @@ index a6bb718..7b08d1f 100644 /* Internal variables. These are variables within the debugger that hold values assigned by debugger commands. -@@ -2118,6 +2153,38 @@ call_internal_function (struct gdbarch *gdbarch, +@@ -2121,6 +2156,38 @@ call_internal_function (struct gdbarch *gdbarch, return (*ifn->handler) (gdbarch, language, ifn->cookie, argc, argv); } @@ -13868,7 +8912,7 @@ index a6bb718..7b08d1f 100644 /* The 'function' command. This does nothing -- it is just a placeholder to let "help function NAME" work. This is also used as the implementation of the sub-command that is created when -@@ -2165,11 +2232,10 @@ preserve_one_value (struct value *value, struct objfile *objfile, +@@ -2168,11 +2235,10 @@ preserve_one_value (struct value *value, struct objfile *objfile, htab_t copied_types) { if (TYPE_OBJFILE (value->type) == objfile) @@ -13882,7 +8926,7 @@ index a6bb718..7b08d1f 100644 copied_types); } -@@ -2184,7 +2250,7 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, +@@ -2187,7 +2253,7 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, case INTERNALVAR_INTEGER: if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile) var->u.integer.type @@ -13891,7 +8935,7 @@ index a6bb718..7b08d1f 100644 break; case INTERNALVAR_VALUE: -@@ -3276,10 +3342,27 @@ readjust_indirect_value_type (struct value *value, struct type *enc_type, +@@ -3285,10 +3351,27 @@ readjust_indirect_value_type (struct value *value, struct type *enc_type, struct value * coerce_ref (struct value *arg) { @@ -13920,7 +8964,7 @@ index a6bb718..7b08d1f 100644 retval = coerce_ref_if_computed (arg); if (retval) return retval; -@@ -3386,4 +3469,10 @@ VARIABLE is already initialized.")); +@@ -3400,4 +3483,10 @@ VARIABLE is already initialized.")); add_prefix_cmd ("function", no_class, function_command, _("\ Placeholder command for showing help on convenience functions."), &functionlist, "function ", 0, &cmdlist); @@ -13932,7 +8976,7 @@ index a6bb718..7b08d1f 100644 +#endif } diff --git a/gdb/value.h b/gdb/value.h -index d8b157f..f49e827 100644 +index 67f1d04..2d2b830 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -533,6 +533,10 @@ extern struct value *value_from_decfloat (struct type *type, @@ -13946,34 +8990,3 @@ index d8b157f..f49e827 100644 extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); -diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c -index f16588a..afef615 100644 ---- a/gdb/windows-nat.c -+++ b/gdb/windows-nat.c -@@ -752,7 +752,7 @@ windows_make_so (const char *name, LPVOID load_addr) - asection *text = NULL; - CORE_ADDR text_vma; - -- abfd = bfd_openr (so->so_name, "pei-i386"); -+ abfd = gdb_bfd_openr (so->so_name, "pei-i386"); - - if (!abfd) - return so; -@@ -762,7 +762,7 @@ windows_make_so (const char *name, LPVOID load_addr) - - if (!text) - { -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - return so; - } - -@@ -773,7 +773,7 @@ windows_make_so (const char *name, LPVOID load_addr) - load_addr + 0x1000); - cygwin_load_end = cygwin_load_start + bfd_section_size (abfd, text); - -- bfd_close (abfd); -+ gdb_bfd_unref (abfd); - } - #endif - diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index 71711f0..773457e 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -37,13 +37,13 @@ gdb/gdbserver/ (linux_create_inferior, linux_tracefork_child): Call it instead of direct ptrace. -Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.c +Index: gdb-7.5.50.20130118/gdb/common/linux-ptrace.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/common/linux-ptrace.c 2012-09-17 20:28:14.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/common/linux-ptrace.c 2012-09-26 19:13:53.508780239 +0200 -@@ -28,6 +28,10 @@ - #include "buffer.h" +--- gdb-7.5.50.20130118.orig/gdb/common/linux-ptrace.c 2013-01-18 23:18:47.313360065 +0100 ++++ gdb-7.5.50.20130118/gdb/common/linux-ptrace.c 2013-01-18 23:19:27.269417051 +0100 +@@ -29,6 +29,10 @@ #include "gdb_assert.h" + #include "gdb_wait.h" +#ifdef HAVE_SELINUX_SELINUX_H +# include @@ -52,7 +52,7 @@ Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.c /* Find all possible reasons we could fail to attach PID and append these newline terminated reason strings to initialized BUFFER. '\0' termination of BUFFER must be done by the caller. */ -@@ -47,6 +51,8 @@ linux_ptrace_attach_warnings (pid_t pid, +@@ -48,6 +52,8 @@ linux_ptrace_attach_warnings (pid_t pid, buffer_xml_printf (buffer, _("warning: process %d is a zombie " "- the process has already terminated\n"), (int) pid); @@ -61,7 +61,7 @@ Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.c } #if defined __i386__ || defined __x86_64__ -@@ -242,3 +248,19 @@ linux_ptrace_init_warnings (void) +@@ -243,3 +249,19 @@ linux_ptrace_init_warnings (void) linux_ptrace_test_ret_to_nx (); } @@ -81,10 +81,10 @@ Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.c + "(gdb) shell sudo setsebool deny_ptrace=0")); +#endif /* HAVE_LIBSELINUX */ +} -Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.h +Index: gdb-7.5.50.20130118/gdb/common/linux-ptrace.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/common/linux-ptrace.h 2012-07-07 14:13:56.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/common/linux-ptrace.h 2012-09-26 19:13:28.358765406 +0200 +--- gdb-7.5.50.20130118.orig/gdb/common/linux-ptrace.h 2013-01-18 23:18:47.313360065 +0100 ++++ gdb-7.5.50.20130118/gdb/common/linux-ptrace.h 2013-01-18 23:19:04.990385360 +0100 @@ -69,5 +69,6 @@ struct buffer; extern void linux_ptrace_attach_warnings (pid_t pid, struct buffer *buffer); @@ -92,11 +92,11 @@ Index: gdb-7.5.0.20120926/gdb/common/linux-ptrace.h +extern void linux_ptrace_create_warnings (struct buffer *buffer); #endif /* COMMON_LINUX_PTRACE_H */ -Index: gdb-7.5.0.20120926/gdb/configure.ac +Index: gdb-7.5.50.20130118/gdb/configure.ac =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/configure.ac 2012-09-26 19:13:24.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/configure.ac 2012-09-26 19:13:28.410765451 +0200 -@@ -2008,6 +2008,10 @@ then +--- gdb-7.5.50.20130118.orig/gdb/configure.ac 2013-01-18 23:18:47.315360069 +0100 ++++ gdb-7.5.50.20130118/gdb/configure.ac 2013-01-18 23:19:04.991385362 +0100 +@@ -2068,6 +2068,10 @@ then [Define if you support the personality syscall.]) fi @@ -107,11 +107,11 @@ Index: gdb-7.5.0.20120926/gdb/configure.ac dnl Handle optional features that can be enabled. # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, -Index: gdb-7.5.0.20120926/gdb/gdbserver/configure.ac +Index: gdb-7.5.50.20130118/gdb/gdbserver/configure.ac =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbserver/configure.ac 2012-04-19 21:34:51.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/gdbserver/configure.ac 2012-09-26 19:13:28.446765428 +0200 -@@ -438,6 +438,10 @@ if $want_ipa ; then +--- gdb-7.5.50.20130118.orig/gdb/gdbserver/configure.ac 2013-01-18 23:18:47.315360069 +0100 ++++ gdb-7.5.50.20130118/gdb/gdbserver/configure.ac 2013-01-18 23:19:04.991385362 +0100 +@@ -451,6 +451,10 @@ if $want_ipa ; then fi fi @@ -122,10 +122,10 @@ Index: gdb-7.5.0.20120926/gdb/gdbserver/configure.ac AC_SUBST(GDBSERVER_DEPFILES) AC_SUBST(GDBSERVER_LIBS) AC_SUBST(USE_THREAD_DB) -Index: gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c +Index: gdb-7.5.50.20130118/gdb/gdbserver/linux-low.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbserver/linux-low.c 2012-07-07 14:13:57.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c 2012-09-26 19:13:28.453765471 +0200 +--- gdb-7.5.50.20130118.orig/gdb/gdbserver/linux-low.c 2013-01-18 23:18:47.317360073 +0100 ++++ gdb-7.5.50.20130118/gdb/gdbserver/linux-low.c 2013-01-18 23:19:04.993385366 +0100 @@ -601,6 +601,28 @@ add_lwp (ptid_t ptid) return lwp; } @@ -164,7 +164,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c #ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */ signal (__SIGRTMIN + 1, SIG_DFL); -@@ -4572,7 +4594,7 @@ linux_tracefork_grandchild (void *arg) +@@ -4574,7 +4596,7 @@ linux_tracefork_grandchild (void *arg) static int linux_tracefork_child (void *arg) { @@ -173,11 +173,11 @@ Index: gdb-7.5.0.20120926/gdb/gdbserver/linux-low.c kill (getpid (), SIGSTOP); #if !(defined(__UCLIBC__) && defined(HAS_NOMMU)) -Index: gdb-7.5.0.20120926/gdb/inf-ptrace.c +Index: gdb-7.5.50.20130118/gdb/inf-ptrace.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/inf-ptrace.c 2012-05-24 18:51:34.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/inf-ptrace.c 2012-09-26 19:13:28.458765461 +0200 -@@ -105,7 +105,15 @@ static void +--- gdb-7.5.50.20130118.orig/gdb/inf-ptrace.c 2013-01-18 23:18:47.318360076 +0100 ++++ gdb-7.5.50.20130118/gdb/inf-ptrace.c 2013-01-18 23:19:04.993385366 +0100 +@@ -104,7 +104,15 @@ static void inf_ptrace_me (void) { /* "Trace me, Dr. Memory!" */ @@ -193,11 +193,11 @@ Index: gdb-7.5.0.20120926/gdb/inf-ptrace.c } /* Start a new inferior Unix child process. EXEC_FILE is the file to -Index: gdb-7.5.0.20120926/gdb/linux-nat.c +Index: gdb-7.5.50.20130118/gdb/linux-nat.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/linux-nat.c 2012-09-26 19:13:22.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/linux-nat.c 2012-09-26 19:13:28.468765469 +0200 -@@ -1574,6 +1574,7 @@ linux_nat_create_inferior (struct target +--- gdb-7.5.50.20130118.orig/gdb/linux-nat.c 2013-01-18 23:18:47.320360083 +0100 ++++ gdb-7.5.50.20130118/gdb/linux-nat.c 2013-01-18 23:19:04.994385369 +0100 +@@ -1578,6 +1578,7 @@ linux_nat_create_inferior (struct target #ifdef HAVE_PERSONALITY int personality_orig = 0, personality_set = 0; #endif /* HAVE_PERSONALITY */ @@ -205,7 +205,7 @@ Index: gdb-7.5.0.20120926/gdb/linux-nat.c /* The fork_child mechanism is synchronous and calls target_wait, so we have to mask the async mode. */ -@@ -1598,7 +1599,10 @@ linux_nat_create_inferior (struct target +@@ -1602,7 +1603,10 @@ linux_nat_create_inferior (struct target /* Make sure we report all signals during startup. */ linux_nat_pass_signals (0, NULL); @@ -217,7 +217,7 @@ Index: gdb-7.5.0.20120926/gdb/linux-nat.c #ifdef HAVE_PERSONALITY if (personality_set) -@@ -1610,6 +1614,24 @@ linux_nat_create_inferior (struct target +@@ -1614,6 +1618,24 @@ linux_nat_create_inferior (struct target safe_strerror (errno)); } #endif /* HAVE_PERSONALITY */ diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index 2cddac3..0725ad2 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -21,24 +21,28 @@ debugging problem of GOMP outside of the scope of this Bug. -Index: gdb-7.2.50.20101231/gdb/infrun.c +Index: gdb-7.5.50.20130118/gdb/infrun.c =================================================================== ---- gdb-7.2.50.20101231.orig/gdb/infrun.c 2011-01-01 01:02:45.000000000 +0100 -+++ gdb-7.2.50.20101231/gdb/infrun.c 2011-01-01 01:10:22.000000000 +0100 -@@ -4585,6 +4585,12 @@ infrun: not switching back to stepped th +--- gdb-7.5.50.20130118.orig/gdb/infrun.c 2013-01-19 23:38:22.329371410 +0100 ++++ gdb-7.5.50.20130118/gdb/infrun.c 2013-01-19 23:39:03.322429041 +0100 +@@ -4918,6 +4918,16 @@ process_event_stop_test: if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL) { + struct symbol *stop_fn = find_pc_function (stop_pc); ++ struct minimal_symbol *stopf = lookup_minimal_symbol_by_pc (stop_pc); + -+ if (stop_fn == NULL -+ || strstr (SYMBOL_LINKAGE_NAME (stop_fn), ".omp_fn.") == NULL) ++ if ((stop_fn == NULL ++ || strstr (SYMBOL_LINKAGE_NAME (stop_fn), ".omp_fn.") == NULL) ++ /* gcc-4.7.2-9.fc19.x86_64 uses a new format. */ ++ && (stopf == NULL ++ || strstr (SYMBOL_LINKAGE_NAME (stopf), "._omp_fn.") == NULL)) +{ /* ".omp_fn." */ + /* We're doing a "next". Normal (forward) execution: set a breakpoint at the -@@ -4612,6 +4618,7 @@ infrun: not switching back to stepped th +@@ -4953,6 +4963,7 @@ process_event_stop_test: keep_going (ecs); return; @@ -46,10 +50,10 @@ Index: gdb-7.2.50.20101231/gdb/infrun.c } /* If we are in a function call trampoline (a stub between the -Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/omp-step.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp 2011-01-01 01:09:58.000000000 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/omp-step.exp 2013-01-19 23:38:23.213372622 +0100 @@ -0,0 +1,31 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -82,10 +86,10 @@ Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp + +gdb_breakpoint [gdb_get_line_number "success"] +gdb_continue_to_breakpoint "success" ".*success.*" -Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90 +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/omp-step.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90 2011-01-01 01:09:58.000000000 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/omp-step.f90 2013-01-19 23:38:23.213372622 +0100 @@ -0,0 +1,32 @@ +! Copyright 2009 Free Software Foundation, Inc. + diff --git a/gdb-bz623749-gcore-relro.patch b/gdb-bz623749-gcore-relro.patch deleted file mode 100644 index 4015a7a..0000000 --- a/gdb-bz623749-gcore-relro.patch +++ /dev/null @@ -1,169 +0,0 @@ -gdb: -https://bugzilla.redhat.com/show_bug.cgi?id=623749 -kernel: -https://bugzilla.redhat.com/show_bug.cgi?id=636937 - -http://sourceware.org/ml/gdb-patches/2010-09/msg00395.html -Subject: Re: [patch] Fix gcore writer for -Wl,-z,relro (PR corefiles/11804) - -gdb/testsuite/ -2010-09-22 Jan Kratochvil - - Fix gcore writer for -Wl,-z,relro. - * gdb.base/gcore-relro.exp: New file. - * gdb.base/gcore-relro-main.c: New file. - * gdb.base/gcore-relro-lib.c: New file. - ---- ./gdb/gcore.c 2010-09-23 20:14:56.000000000 +0200 -+++ ./gdb/gcore.c 2010-09-23 20:37:56.000000000 +0200 -@@ -401,6 +401,7 @@ gcore_create_callback (CORE_ADDR vaddr, - - if (write == 0 && !solib_keep_data_in_core (vaddr, size)) - { -+#if 0 /* https://bugzilla.redhat.com/show_bug.cgi?id=636937 */ - /* See if this region of memory lies inside a known file on disk. - If so, we can avoid copying its contents by clearing SEC_LOAD. */ - struct objfile *objfile; -@@ -433,6 +434,7 @@ gcore_create_callback (CORE_ADDR vaddr, - } - - keep: -+#endif - flags |= SEC_READONLY; - } - ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gcore-relro-lib.c -@@ -0,0 +1,21 @@ -+/* Copyright 2010 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+void -+lib (void) -+{ -+} ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gcore-relro-main.c -@@ -0,0 +1,25 @@ -+/* Copyright 2010 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+extern void lib (void); -+ -+int -+main (void) -+{ -+ lib (); -+ return 0; -+} ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gcore-relro.exp -@@ -0,0 +1,80 @@ -+# Copyright 2010 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+if {[skip_shlib_tests]} { -+ return 0 -+} -+ -+set testfile "gcore-relro" -+set srcmainfile ${testfile}-main.c -+set srclibfile ${testfile}-lib.c -+set libfile ${objdir}/${subdir}/${testfile}-lib.so -+set objfile ${objdir}/${subdir}/${testfile}-main.o -+set executable ${testfile}-main -+set binfile ${objdir}/${subdir}/${executable} -+set gcorefile ${objdir}/${subdir}/${executable}.gcore -+ -+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} {debug}] != "" -+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } { -+ untested ${testfile}.exp -+ return -1 -+} -+set opts [list debug shlib=${libfile} additional_flags=-Wl,-z,relro] -+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } { -+ unsupported "-Wl,-z,relro compilation failed" -+ return -1 -+} -+ -+clean_restart $executable -+gdb_load_shlibs $libfile -+ -+# Does this gdb support gcore? -+set test "help gcore" -+gdb_test_multiple $test $test { -+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" { -+ # gcore command not supported -- nothing to test here. -+ unsupported "gdb does not support gcore on this target" -+ return -1; -+ } -+ -re "Save a core file .*\r\n$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+if { ![runto lib] } then { -+ return -1 -+} -+ -+set escapedfilename [string_to_regexp ${gcorefile}] -+ -+set test "save a corefile" -+gdb_test_multiple "gcore ${gcorefile}" $test { -+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "Can't create a corefile\r\n$gdb_prompt $" { -+ unsupported $test -+ return -1 -+ } -+} -+ -+# Now restart gdb and load the corefile. -+ -+clean_restart $executable -+gdb_load_shlibs $libfile -+ -+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile" -+ -+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded" diff --git a/gdb-check-type.patch b/gdb-check-type.patch deleted file mode 100644 index fb44065..0000000 --- a/gdb-check-type.patch +++ /dev/null @@ -1,1002 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-08/msg00133.html - -### src/gdb/ChangeLog 2012/08/17 03:06:10 1.14599 -### src/gdb/ChangeLog 2012/08/17 17:36:56 1.14600 -## -1,3 +1,48 @@ -+2012-08-17 Keith Seitz -+ -+ PR c++/13356 -+ * gdbtypes.c (strict_type_checking): New variable. -+ (show_strict_type_checking): New function. -+ (rank_one_type): Return NS_POINTER_INTEGER_CONVERSION_BADNESS -+ if strict type checking is disabled. -+ (_initialize_gdbtypes): Add "check type" subcommand. -+ * gdbtypes.h (NS_INTEGER_POINTER_CONVERSION_BADNESS): New struct. -+ -+2012-08-17 Keith Seitz -+ -+ * language.h (type_mode): Remove. -+ (type_check): Remove. -+ (struct language_defn): Remove la_type_check. -+ (STRICT_TYPE): Remove unused macro. -+ (type_error): Remove. -+ * language.c (set_type_range_case): Renamed to ... -+ (set_range_case): ... this. Update all callers. -+ Remove type_mode/type_check. -+ (type_mode): Remove. -+ (type_check): Remove. -+ (show_type_command): Remove. -+ (set_type_command): Remove. -+ (language_info): Remove type checking output. -+ (type_error): Remove unused function. -+ (range_error): Update comment. -+ (unknown_language_defn): Remove la_type_check. -+ (auto_language_defn): Likewise. -+ (local_language_defn): Likewise. -+ (_initialize_language): Remove "check type" subcommand. -+ * ada-lang.c (ada_language_defn): Remove la_type_check. -+ * c-lang.c (c_language_defn): Likewise. -+ (cplus_language_defn): Likewise. -+ (asm_language_defn): Likewise. -+ (minimal_language_defn): Likewise. -+ * d-lang.c (d_language_defn): Likewise. -+ * f-lang.c (f_language_defn): Likewise. -+ * go-lang.c (go_language_defn): Likewise. -+ * jv-lang.c (java_language_defn): Likewise. -+ * m2-lang.c (m2_language_defn): Likewise. -+ * objc-lang.c (objc_language_defn): Likewise. -+ * opencl-lang.c (opencl_language_defn): Likewise. -+ * p-lang.c (pascal_language_defn): Likewise. -+ - 2012-08-16 Mike Frysinger - - * infcmd.c (_initialize_infcmd): Remove trailing ) in next help text. -Index: gdb-7.5.0.20120926/gdb/gdbtypes.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbtypes.c 2012-09-27 22:14:21.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/gdbtypes.c 2012-09-27 22:15:05.807706105 +0200 -@@ -62,6 +62,7 @@ const struct rank BASE_CONVERSION_BADNES - const struct rank REFERENCE_CONVERSION_BADNESS = {2,0}; - const struct rank NULL_POINTER_CONVERSION_BADNESS = {2,0}; - const struct rank NS_POINTER_CONVERSION_BADNESS = {10,0}; -+const struct rank NS_INTEGER_POINTER_CONVERSION_BADNESS = {3,0}; - - /* Floatformat pairs. */ - const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN] = { -@@ -134,6 +135,19 @@ show_overload_debug (struct ui_file *fil - value); - } - -+/* A flag to enable strict type checking. */ -+ -+static int strict_type_checking = 1; -+ -+/* A function to show the status of strict type checking. */ -+ -+static void -+show_strict_type_checking (struct ui_file *file, int from_tty, -+ struct cmd_list_element *c, const char *value) -+{ -+ fprintf_filtered (file, _("Strict type checking is %s.\n"), value); -+} -+ - struct extra - { - char str[128]; -@@ -2649,12 +2663,20 @@ rank_one_type (struct type *parm, struct - case TYPE_CODE_FUNC: - return rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL); - case TYPE_CODE_INT: -- if (value != NULL && TYPE_CODE (value_type (value)) == TYPE_CODE_INT -- && value_as_long (value) == 0) -+ if (value != NULL && TYPE_CODE (value_type (value)) == TYPE_CODE_INT) - { -- /* Null pointer conversion: allow it to be cast to a pointer. -- [4.10.1 of C++ standard draft n3290] */ -- return NULL_POINTER_CONVERSION_BADNESS; -+ if (value_as_long (value) == 0) -+ { -+ /* Null pointer conversion: allow it to be cast to a pointer. -+ [4.10.1 of C++ standard draft n3290] */ -+ return NULL_POINTER_CONVERSION_BADNESS; -+ } -+ else -+ { -+ /* If type checking is disabled, allow the conversion. */ -+ if (!strict_type_checking) -+ return NS_INTEGER_POINTER_CONVERSION_BADNESS; -+ } - } - /* fall through */ - case TYPE_CODE_ENUM: -@@ -4637,4 +4659,13 @@ _initialize_gdbtypes (void) - NULL, NULL, - show_opaque_type_resolution, - &setlist, &showlist); -+ -+ /* Add an option to permit non-strict type checking. */ -+ add_setshow_boolean_cmd ("type", class_support, -+ &strict_type_checking, -+ _("Set strict type checking."), -+ _("Show strict type checking."), -+ NULL, NULL, -+ show_strict_type_checking, -+ &setchecklist, &showchecklist); - } -Index: gdb-7.5.0.20120926/gdb/gdbtypes.h -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbtypes.h 2012-09-27 22:14:23.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/gdbtypes.h 2012-09-27 22:14:40.690695059 +0200 -@@ -1745,6 +1745,9 @@ extern const struct rank NULL_POINTER_CO - /* Converting a pointer to an int is usually OK. */ - extern const struct rank NS_POINTER_CONVERSION_BADNESS; - -+/* Badness of converting a (non-zero) integer constant -+ to a pointer. */ -+extern const struct rank NS_INTEGER_POINTER_CONVERSION_BADNESS; - - extern struct rank sum_ranks (struct rank a, struct rank b); - extern int compare_ranks (struct rank a, struct rank b); -Index: gdb-7.5.0.20120926/gdb/language.h -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/language.h 2012-06-13 17:47:14.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/language.h 2012-09-27 22:14:40.834695121 +0200 -@@ -55,27 +55,6 @@ extern enum range_check - } - range_check; - --/* type_mode == -- type_mode_auto: type_check set automatically to default of language. -- type_mode_manual: type_check set manually by user. */ -- --extern enum type_mode -- { -- type_mode_auto, type_mode_manual -- } --type_mode; -- --/* type_check == -- type_check_on: Types are checked in GDB expressions, producing errors. -- type_check_warn: Types are checked, producing warnings. -- type_check_off: Types are not checked in GDB expressions. */ -- --extern enum type_check -- { -- type_check_off, type_check_warn, type_check_on -- } --type_check; -- - /* case_mode == - case_mode_auto: case_sensitivity set upon selection of scope. - case_mode_manual: case_sensitivity set only by user. */ -@@ -162,10 +141,6 @@ struct language_defn - - enum range_check la_range_check; - -- /* Default type checking. */ -- -- enum type_check la_type_check; -- - /* Default case sensitivity. */ - enum case_sensitivity la_case_sensitivity; - -@@ -422,9 +397,6 @@ struct type *language_lookup_primitive_t - /* These macros define the behaviour of the expression - evaluator. */ - --/* Should we strictly type check expressions? */ --#define STRICT_TYPE (type_check != type_check_off) -- - /* Should we range check values against the domain of their type? */ - #define RANGE_CHECK (range_check != range_check_off) - -@@ -496,8 +468,6 @@ extern void binop_type_check (struct val - - /* Error messages */ - --extern void type_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2); -- - extern void range_error (const char *, ...) ATTRIBUTE_PRINTF (1, 2); - - /* Data: Does this value represent "truth" to the current language? */ -Index: gdb-7.5.0.20120926/gdb/language.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/language.c 2012-03-02 20:29:01.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/language.c 2012-09-27 22:14:40.922695162 +0200 -@@ -55,7 +55,7 @@ static void show_check (char *, int); - - static void set_check (char *, int); - --static void set_type_range_case (void); -+static void set_range_case (void); - - static void unk_lang_emit_char (int c, struct type *type, - struct ui_file *stream, int quoter); -@@ -81,8 +81,6 @@ extern const struct language_defn unknow - - enum range_mode range_mode = range_mode_auto; - enum range_check range_check = range_check_off; --enum type_mode type_mode = type_mode_auto; --enum type_check type_check = type_check_off; - enum case_mode case_mode = case_mode_auto; - enum case_sensitivity case_sensitivity = case_sensitive_on; - -@@ -174,7 +172,7 @@ set_language_command (char *ignore, int - /* Enter manual mode. Set the specified language. */ - language_mode = language_mode_manual; - current_language = languages[i]; -- set_type_range_case (); -+ set_range_case (); - expected_language = current_language; - return; - } -@@ -186,79 +184,6 @@ set_language_command (char *ignore, int - language); - } - --/* Show command. Display a warning if the type setting does -- not match the current language. */ --static void --show_type_command (struct ui_file *file, int from_tty, -- struct cmd_list_element *c, const char *value) --{ -- if (type_mode == type_mode_auto) -- { -- char *tmp = NULL; -- -- switch (type_check) -- { -- case type_check_on: -- tmp = "on"; -- break; -- case type_check_off: -- tmp = "off"; -- break; -- case type_check_warn: -- tmp = "warn"; -- break; -- default: -- internal_error (__FILE__, __LINE__, -- "Unrecognized type check setting."); -- } -- -- fprintf_filtered (gdb_stdout, -- _("Type checking is \"auto; currently %s\".\n"), -- tmp); -- } -- else -- fprintf_filtered (gdb_stdout, _("Type checking is \"%s\".\n"), -- value); -- -- if (type_check != current_language->la_type_check) -- warning (_("the current type check setting" -- " does not match the language.\n")); --} -- --/* Set command. Change the setting for type checking. */ --static void --set_type_command (char *ignore, int from_tty, struct cmd_list_element *c) --{ -- if (strcmp (type, "on") == 0) -- { -- type_check = type_check_on; -- type_mode = type_mode_manual; -- } -- else if (strcmp (type, "warn") == 0) -- { -- type_check = type_check_warn; -- type_mode = type_mode_manual; -- } -- else if (strcmp (type, "off") == 0) -- { -- type_check = type_check_off; -- type_mode = type_mode_manual; -- } -- else if (strcmp (type, "auto") == 0) -- { -- type_mode = type_mode_auto; -- set_type_range_case (); -- return; -- } -- else -- internal_error (__FILE__, __LINE__, -- _("Unrecognized type check setting: \"%s\""), type); -- -- if (type_check != current_language->la_type_check) -- warning (_("the current type check setting" -- " does not match the language.\n")); --} -- - /* Show command. Display a warning if the range setting does - not match the current language. */ - static void -@@ -320,7 +245,7 @@ set_range_command (char *ignore, int fro - else if (strcmp (range, "auto") == 0) - { - range_mode = range_mode_auto; -- set_type_range_case (); -+ set_range_case (); - return; - } - else -@@ -389,7 +314,7 @@ set_case_command (char *ignore, int from - else if (strcmp (case_sensitive, "auto") == 0) - { - case_mode = case_mode_auto; -- set_type_range_case (); -+ set_range_case (); - return; - } - else -@@ -409,14 +334,11 @@ set_case_command (char *ignore, int from - If SHOW is non-zero, then print out the current language, - type and range checking status. */ - static void --set_type_range_case (void) -+set_range_case (void) - { - if (range_mode == range_mode_auto) - range_check = current_language->la_range_check; - -- if (type_mode == type_mode_auto) -- type_check = current_language->la_type_check; -- - if (case_mode == case_mode_auto) - case_sensitivity = current_language->la_case_sensitivity; - } -@@ -437,7 +359,7 @@ set_language (enum language lang) - if (languages[i]->la_language == lang) - { - current_language = languages[i]; -- set_type_range_case (); -+ set_range_case (); - break; - } - } -@@ -461,8 +383,6 @@ language_info (int quietly) - - if (!quietly) - { -- printf_unfiltered (_("Type checking: %s\n"), type); -- show_type_command (NULL, 1, NULL, NULL); - printf_unfiltered (_("Range checking: %s\n"), range); - show_range_command (NULL, 1, NULL, NULL); - printf_unfiltered (_("Case sensitivity: %s\n"), case_sensitive); -@@ -500,38 +420,11 @@ value_true (struct value *val) - error messages that occur during type- and range- - checking. */ - --/* These are called when a language fails a type- or range-check. The -+/* This is called when a language fails a range-check. The - first argument should be a printf()-style format string, and the -- rest of the arguments should be its arguments. If -- [type|range]_check is [type|range]_check_on, an error is printed; -- if [type|range]_check_warn, a warning; otherwise just the -- message. */ -- --void --type_error (const char *string,...) --{ -- va_list args; -- -- va_start (args, string); -- switch (type_check) -- { -- case type_check_warn: -- vwarning (string, args); -- break; -- case type_check_on: -- verror (string, args); -- break; -- case type_check_off: -- /* FIXME: cagney/2002-01-30: Should this function print anything -- when type error is off? */ -- vfprintf_filtered (gdb_stderr, string, args); -- fprintf_filtered (gdb_stderr, "\n"); -- break; -- default: -- internal_error (__FILE__, __LINE__, _("bad switch")); -- } -- va_end (args); --} -+ rest of the arguments should be its arguments. If range_check is -+ range_check_on, an error is printed; if range_check_warn, a warning; -+ otherwise just the message. */ - - void - range_error (const char *string,...) -@@ -902,7 +795,6 @@ const struct language_defn unknown_langu - "unknown", - language_unknown, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_no, -@@ -946,7 +838,6 @@ const struct language_defn auto_language - "auto", - language_auto, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_no, -@@ -988,7 +879,6 @@ const struct language_defn local_languag - "local", - language_auto, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_no, -@@ -1135,13 +1025,6 @@ _initialize_language (void) - add_alias_cmd ("c", "check", no_class, 1, &showlist); - add_alias_cmd ("ch", "check", no_class, 1, &showlist); - -- add_setshow_enum_cmd ("type", class_support, type_or_range_names, &type, -- _("Set type checking. (on/warn/off/auto)"), -- _("Show type checking. (on/warn/off/auto)"), -- NULL, set_type_command, -- show_type_command, -- &setchecklist, &showchecklist); -- - add_setshow_enum_cmd ("range", class_support, type_or_range_names, - &range, - _("Set range checking. (on/warn/off/auto)"), -Index: gdb-7.5.0.20120926/gdb/ada-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ada-lang.c 2012-09-27 22:14:17.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ada-lang.c 2012-09-27 22:14:41.112695245 +0200 -@@ -12503,7 +12503,6 @@ const struct language_defn ada_language_ - "ada", /* Language name */ - language_ada, - range_check_off, -- type_check_off, - case_sensitive_on, /* Yes, Ada is case-insensitive, but - that's not quite what this means. */ - array_row_major, -Index: gdb-7.5.0.20120926/gdb/c-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/c-lang.c 2012-07-06 07:46:04.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/c-lang.c 2012-09-27 22:14:41.141695257 +0200 -@@ -831,7 +831,6 @@ const struct language_defn c_language_de - "c", /* Language name */ - language_c, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_c, -@@ -955,7 +954,6 @@ const struct language_defn cplus_languag - "c++", /* Language name */ - language_cplus, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_c, -@@ -997,7 +995,6 @@ const struct language_defn asm_language_ - "asm", /* Language name */ - language_asm, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_c, -@@ -1044,7 +1041,6 @@ const struct language_defn minimal_langu - "minimal", /* Language name */ - language_minimal, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_c, -Index: gdb-7.5.0.20120926/gdb/d-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/d-lang.c 2012-03-15 15:06:20.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/d-lang.c 2012-09-27 22:14:41.143695257 +0200 -@@ -240,7 +240,6 @@ static const struct language_defn d_lang - "d", - language_d, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_c, -Index: gdb-7.5.0.20120926/gdb/f-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/f-lang.c 2012-09-27 22:14:23.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/f-lang.c 2012-09-27 22:14:41.151695260 +0200 -@@ -260,7 +260,6 @@ const struct language_defn f_language_de - "fortran", - language_fortran, - range_check_on, -- type_check_on, - case_sensitive_off, - array_column_major, - macro_expansion_no, -Index: gdb-7.5.0.20120926/gdb/go-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/go-lang.c 2012-04-25 16:07:20.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/go-lang.c 2012-09-27 22:14:41.152695261 +0200 -@@ -562,7 +562,6 @@ static const struct language_defn go_lan - "go", - language_go, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_no, -Index: gdb-7.5.0.20120926/gdb/jv-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/jv-lang.c 2012-09-27 22:14:23.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/jv-lang.c 2012-09-27 22:14:41.154695263 +0200 -@@ -1169,7 +1169,6 @@ const struct language_defn java_language - "java", /* Language name */ - language_java, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_no, -Index: gdb-7.5.0.20120926/gdb/m2-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m2-lang.c 2012-03-02 20:29:01.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/m2-lang.c 2012-09-27 22:14:41.161695266 +0200 -@@ -370,7 +370,6 @@ const struct language_defn m2_language_d - "modula-2", - language_m2, - range_check_on, -- type_check_on, - case_sensitive_on, - array_row_major, - macro_expansion_no, -Index: gdb-7.5.0.20120926/gdb/objc-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/objc-lang.c 2012-03-02 20:29:01.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/objc-lang.c 2012-09-27 22:14:41.163695268 +0200 -@@ -509,7 +509,6 @@ const struct language_defn objc_language - "objective-c", /* Language name */ - language_objc, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_c, -Index: gdb-7.5.0.20120926/gdb/opencl-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/opencl-lang.c 2012-03-02 20:29:01.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/opencl-lang.c 2012-09-27 22:14:41.165695268 +0200 -@@ -993,7 +993,6 @@ const struct language_defn opencl_langua - "opencl", /* Language name */ - language_opencl, - range_check_off, -- type_check_off, - case_sensitive_on, - array_row_major, - macro_expansion_c, -Index: gdb-7.5.0.20120926/gdb/p-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/p-lang.c 2012-03-02 20:29:01.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/p-lang.c 2012-09-27 22:14:41.170695270 +0200 -@@ -429,7 +429,6 @@ const struct language_defn pascal_langua - "pascal", /* Language name */ - language_pascal, - range_check_on, -- type_check_on, - case_sensitive_on, - array_row_major, - macro_expansion_no, -Index: gdb-7.5.0.20120926/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/doc/gdb.texinfo 2012-09-27 22:14:23.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/doc/gdb.texinfo 2012-09-27 22:14:41.188695279 +0200 -@@ -12648,29 +12648,18 @@ List all the filename extensions and the - @node Checks - @section Type and Range Checking - --@quotation --@emph{Warning:} In this release, the @value{GDBN} commands for type and range --checking are included, but they do not yet have any effect. This --section documents the intended facilities. --@end quotation --@c FIXME remove warning when type/range code added -- - Some languages are designed to guard you against making seemingly common - errors through a series of compile- and run-time checks. These include --checking the type of arguments to functions and operators, and making -+checking the type of arguments to functions and operators and making - sure mathematical overflows are caught at run time. Checks such as - these help to ensure a program's correctness once it has been compiled --by eliminating type mismatches, and providing active checks for range -+by eliminating type mismatches and providing active checks for range - errors when your program is running. - --@value{GDBN} can check for conditions like the above if you wish. --Although @value{GDBN} does not check the statements in your program, --it can check expressions entered directly into @value{GDBN} for --evaluation via the @code{print} command, for example. As with the --working language, @value{GDBN} can also decide whether or not to check --automatically based on your program's source language. --@xref{Supported Languages, ,Supported Languages}, for the default --settings of supported languages. -+By default @value{GDBN} checks for these errors according to the -+rules of the current source language. Although @value{GDBN} does not check -+the statements in your program, it can check expressions entered directly -+into @value{GDBN} for evaluation via the @code{print} command, for example. - - @menu - * Type Checking:: An overview of type checking -@@ -12682,69 +12671,51 @@ settings of supported languages. - @node Type Checking - @subsection An Overview of Type Checking - --Some languages, such as Modula-2, are strongly typed, meaning that the -+Some languages, such as C and C@t{++}, are strongly typed, meaning that the - arguments to operators and functions have to be of the correct type, - otherwise an error occurs. These checks prevent type mismatch - errors from ever causing any run-time problems. For example, - - @smallexample --1 + 2 @result{} 3 -+int klass::my_method(char *b) @{ return b ? 1 : 2; @} -+ -+(@value{GDBP}) print obj.my_method (0) -+$1 = 2 - @exdent but --@error{} 1 + 2.3 -+(@value{GDBP}) print obj.my_method (0x1234) -+Cannot resolve method klass::my_method to any overloaded instance - @end smallexample - --The second example fails because the @code{CARDINAL} 1 is not --type-compatible with the @code{REAL} 2.3. -+The second example fails because in C@t{++} the integer constant -+@samp{0x1234} is not type-compatible with the pointer parameter type. - --For the expressions you use in @value{GDBN} commands, you can tell the --@value{GDBN} type checker to skip checking; -+For the expressions you use in @value{GDBN} commands, you can tell -+@value{GDBN} to not enforce strict type checking or - to treat any mismatches as errors and abandon the expression; --or to only issue warnings when type mismatches occur, --but evaluate the expression anyway. When you choose the last of --these, @value{GDBN} evaluates expressions like the second example above, but --also issues a warning. -+When type checking is disabled, @value{GDBN} successfully evaluates -+expressions like the second example above. - --Even if you turn type checking off, there may be other reasons -+Even if type checking is off, there may be other reasons - related to type that prevent @value{GDBN} from evaluating an expression. - For instance, @value{GDBN} does not know how to add an @code{int} and - a @code{struct foo}. These particular type errors have nothing to do --with the language in use, and usually arise from expressions, such as --the one described above, which make little sense to evaluate anyway. -- --Each language defines to what degree it is strict about type. For --instance, both Modula-2 and C require the arguments to arithmetical --operators to be numbers. In C, enumerated types and pointers can be --represented as numbers, so that they are valid arguments to mathematical --operators. @xref{Supported Languages, ,Supported Languages}, for further --details on specific languages. -+with the language in use and usually arise from expressions which make -+little sense to evaluate anyway. - --@value{GDBN} provides some additional commands for controlling the type checker: -+@value{GDBN} provides some additional commands for controlling type checking: - - @kindex set check type - @kindex show check type - @table @code --@item set check type auto --Set type checking on or off based on the current working language. --@xref{Supported Languages, ,Supported Languages}, for the default settings for --each language. -- - @item set check type on - @itemx set check type off --Set type checking on or off, overriding the default setting for the --current working language. Issue a warning if the setting does not --match the language default. If any type mismatches occur in -+Set strict type checking on or off. If any type mismatches occur in - evaluating an expression while type checking is on, @value{GDBN} prints a - message and aborts evaluation of the expression. - --@item set check type warn --Cause the type checker to issue warnings, but to always attempt to --evaluate the expression. Evaluating the expression may still --be impossible for other reasons. For example, @value{GDBN} cannot add --numbers and structures. -- --@item show type --Show the current setting of the type checker, and whether or not @value{GDBN} --is setting it automatically. -+@item show check type -+Show the current setting of type checking and whether @value{GDBN} -+is enforcing strict type checking rules. - @end table - - @cindex range checking -@@ -13195,8 +13166,8 @@ specification. - - @cindex C and C@t{++} defaults - --If you allow @value{GDBN} to set type and range checking automatically, they --both default to @code{off} whenever the working language changes to -+If you allow @value{GDBN} to set range checking automatically, it -+defaults to @code{off} whenever the working language changes to - C or C@t{++}. This happens regardless of whether you or @value{GDBN} - selects the working language. - -@@ -13207,37 +13178,15 @@ these files, it sets the working languag - @xref{Automatically, ,Having @value{GDBN} Infer the Source Language}, - for further details. - --@c Type checking is (a) primarily motivated by Modula-2, and (b) --@c unimplemented. If (b) changes, it might make sense to let this node --@c appear even if Mod-2 does not, but meanwhile ignore it. roland 16jul93. -- - @node C Checks - @subsubsection C and C@t{++} Type and Range Checks - - @cindex C and C@t{++} checks - --By default, when @value{GDBN} parses C or C@t{++} expressions, type checking --is not used. However, if you turn type checking on, @value{GDBN} --considers two variables type equivalent if: -- --@itemize @bullet --@item --The two variables are structured and have the same structure, union, or --enumerated tag. -- --@item --The two variables have the same type name, or types that have been --declared equivalent through @code{typedef}. -- --@ignore --@c leaving this out because neither J Gilmore nor R Pesch understand it. --@c FIXME--beers? --@item --The two @code{struct}, @code{union}, or @code{enum} variables are --declared in the same declaration. (Note: this may not be true for all C --compilers.) --@end ignore --@end itemize -+By default, when @value{GDBN} parses C or C@t{++} expressions, strict type -+checking is used. However, if you turn type checking off, @value{GDBN} -+will allow certain non-standard conversions, such as promoting integer -+constants to pointers. - - Range checking, if turned on, is done on mathematical operations. Array - indices are not checked, since they are often used to index a pointer -Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.base/default.exp -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.base/default.exp 2012-04-27 22:52:06.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.base/default.exp 2012-09-27 22:14:41.312695333 +0200 -@@ -495,12 +495,13 @@ gdb_test "section" "Must specify section - gdb_test "set annotate" "Argument required .integer to set it to.*" "set annotate" - #test set args - gdb_test_no_output "set args" "set args" --#test set check "c" abbreviation --gdb_test "set c" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"c\" abbreviation" --#test set check "ch" abbreviation --gdb_test "set ch" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check \"ch\" abbreviation" --#test set check --gdb_test "set check" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." "set check" -+ -+# Test set check abbreviations -+foreach x {"c" "ch" "check"} { -+ gdb_test "set $x" "\"set check\" must be followed by the name of a check subcommand.(\[^\r\n\]*\[\r\n\])+List of set check subcommands:(\[^\r\n\]*\[\r\n\])+set check range -- Set range checking(\[^\r\n\]*\[\r\n\])+set check type -- Set strict type checking(\[^\r\n\]*\[\r\n\])+Type \"help set check\" followed by set check subcommand name for full documentation.(\[^\r\n\]*\[\r\n\])+Command name abbreviations are allowed if unambiguous." \ -+ "set check \"$x\" abbreviation" -+} -+ - #test set check range - gdb_test "set check range" ".*" "set check range" - #test set check type -@@ -577,16 +578,17 @@ gdb_test "shell echo Hi dad!" "Hi dad!" - gdb_test "show annotate" "Annotation_level is 0." "show annotate" - #test show args - gdb_test "show args" "Argument list to give program being debugged when it is started is \"\"." "show args" --#test show check "c" abbreviation --gdb_test "show c" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\".*" "show check \"c\" abbreviation" --#test show check "ch" abbreviation --gdb_test "show ch" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check \"ch\" abbreviation" --#test show check --gdb_test "show check" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Type checking is \"auto; currently off\"." "show check" -+ -+# test show check abbreviations -+foreach x {"c" "ch" "check"} { -+ gdb_test "show $x" "range: *Range checking is \"auto; currently off\".(\[^\r\n\]*\[\r\n\])+type: *Strict type checking is on\..*" \ -+ "show check \"$x\" abbreviation" -+} -+ - #test show check range - gdb_test "show check range" "Range checking is \"auto; currently off\"." "show check range" - #test show check type --gdb_test "show check type" "Type checking is \"auto; currently off\"." "show check type" -+gdb_test "show check type" "Strict type checking is on\." "show check type" - #test show commands - gdb_test "show commands" ".*" "show commands" - #test show complaints -Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.base/help.exp -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.base/help.exp 2012-07-02 19:53:19.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.base/help.exp 2012-09-27 22:14:41.315695333 +0200 -@@ -376,22 +376,26 @@ gdb_test "help section" "Change the base - gdb_test "help set annotate" "Set annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help set annotate" - # test help set args - gdb_test "help set args" "Set argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\." --# test help set check "c" abbreviation --test_prefix_command_help {"set c" "set check"} { -- "Set the status of the type/range checker\.\[\r\n\]+" --} "help set check \"c\" abbreviation" --# test help set check "ch" abbreviation --test_prefix_command_help {"set ch" "set check"} { -- "Set the status of the type/range checker\.\[\r\n\]+" --} "help set check \"ch\" abbreviation" --# test help set check -+ -+# Test help set check abbreviations -+foreach x {"c" "ch"} { -+ test_prefix_command_help [list "set $x" "set check"] { -+ "Set the status of the type/range checker\.\[\r\n\]+" -+ } "help set check \"$x\" abbreviation" -+} -+ -+# Test help set check - test_prefix_command_help {"set check"} { - "Set the status of the type/range checker\.\[\r\n\]+" - } -+ - # test help set check range - gdb_test "help set check range" "Set range checking\. \\(on/warn/off/auto\\)" "help set check range" --# test help set check type --gdb_test "help set check type" "Set type checking\. \\(on/warn/off/auto\\)." "help set check type" -+ -+# Test help set check type -+gdb_test "help set check type" "Set strict type checking\." \ -+ "help set check type" -+ - # test help set complaints - gdb_test "help set complaints" "Set max number of complaints about incorrect symbols\." "help set complaints" - # test help set confirm -@@ -487,18 +491,25 @@ gdb_test "help shell" "Execute the rest - gdb_test "help show annotate" "Show annotation_level\.\[\r\n\]+0 == normal; 1 == fullname \\(for use when running under emacs\\)\[\r\n\]+2 == output annotated suitably for use by programs that control GDB\." "help show annotate" - # test help show args - gdb_test "help show args" "Show argument list to give program being debugged when it is started\.\[\r\n\]+Follow this command with any number of args, to be passed to the program\." --# test help show check "c" abbreviation --test_prefix_command_help {"show c" "show check"} { -- "Show the status of the type/range checker\.\[\r\n\]+" --} "help show check \"c\" abbreviation" -+ -+# Test help show check abbreviations -+foreach x {"c" "check"} { -+ test_prefix_command_help [list "show $x" "show check"] { -+ "Show the status of the type/range checker\.\[\r\n\]+" -+ } "help show check \"$x\" abbreviation" -+} -+ - # test help show check - test_prefix_command_help {"show check"} { - "Show the status of the type/range checker\.\[\r\n\]+" - } - # test help show check range - gdb_test "help show check range" "Show range checking\. \\(on/warn/off/auto\\)" "help show check range" -+ - # test help show check type --gdb_test "help show check type" "Show type checking\. \\(on/warn/off/auto\\)" "help show check type" -+gdb_test "help show check type" "Show strict type checking\." \ -+ "help show check type" -+ - # test help show commands - gdb_test "help show commands" "Show the history of commands you typed\.\[\r\n\]+You can supply a command number to start with, or a `\[+\]' to start after\[\r\n\]+the previous command number shown\." "help show commands" - # test help show complaints -Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.base/setshow.exp -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.base/setshow.exp 2012-03-13 22:02:40.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.base/setshow.exp 2012-09-27 22:14:41.320695336 +0200 -@@ -110,19 +110,22 @@ gdb_test "show check range" "Range check - #test set check range auto - gdb_test_no_output "set check range auto" "set check range auto" - #test show check range auto --gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)" --#test set check type on --gdb_test "set check type on" ".*" "set check type on" --#test show check type on --gdb_test "show check type" "Type checking is \"on\"..*" "show check type (on)" --#test set check type off with trailing space --gdb_test_no_output "set check type off " "set check type off" --#test show check type off --gdb_test "show check type" "Type checking is \"off\"..*" "show check type (off)" --#test set check type auto --gdb_test_no_output "set check type auto" "set check type auto" --#test show check type --gdb_test "show check type" "Type checking is \"auto; currently .*" "show check type (auto)" -+gdb_test "show check range" "Range checking is \"auto; currently .*" "show check range (auto)" -+ -+# Test set check type on -+gdb_test "set check type on" ".*" "set check type on" -+ -+# Test show check type on -+gdb_test "show check type" "Strict type checking is on\..*" \ -+ "show check type (on)" -+ -+# Test set check type off with trailing space -+gdb_test_no_output "set check type off " "set check type off" -+ -+# Test show check type off -+gdb_test "show check type" "Strict type checking is off\..*" \ -+ "show check type (off)" -+ - #test set complaints 100 - gdb_test_no_output "set complaints 100" "set complaints 100" - #test show complaints 100 -Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.exp -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.cp/converts.exp 2012-07-10 17:18:18.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.exp 2012-09-27 22:14:41.321695337 +0200 -@@ -70,9 +70,37 @@ gdb_test_multiple "p foo3_1 (0, 0)" $t { - pass $t - } - } -+ - gdb_test "p foo3_1 (0, 1)" \ - "Cannot resolve function foo3_1 to any overloaded instance" - gdb_test "p foo3_1 (0, (const char**) 1)" " = 31" - gdb_test "p foo3_2 (0, 0)" "= 32" - gdb_test "p foo3_2 (0, (char const**) 0)" " = 320" - -+# Test for strict type checking -+set error_str "Cannot resolve function %s to any overloaded instance" -+gdb_test "show check type" "Strict type checking is on\." -+gdb_test "p foo1_type_check (123)" [format $error_str "foo1_type_check"] -+gdb_test "p foo2_type_check (0, 1)" [format $error_str "foo2_type_check"] -+gdb_test "p foo2_type_check (1, 0)" [format $error_str "foo2_type_check"] -+gdb_test "p foo2_type_check (1, 1)" [format $error_str "foo2_type_check"] -+gdb_test "p foo3_type_check (0, 0, 1)" [format $error_str "foo3_type_check"] -+gdb_test "p foo3_type_check (0, 1, 0)" [format $error_str "foo3_type_check"] -+gdb_test "p foo3_type_check (1, 0, 0)" [format $error_str "foo3_type_check"] -+gdb_test "p foo3_type_check (0, 1, 1)" [format $error_str "foo3_type_check"] -+gdb_test "p foo3_type_check (1, 1, 0)" [format $error_str "foo3_type_check"] -+gdb_test "p foo3_type_check (1, 1, 1)" [format $error_str "foo3_type_check"] -+ -+gdb_test_no_output "set check type off" -+gdb_test "show check type" "Strict type checking is off\." -+gdb_test "p foo1_type_check (123)" " = 1000" -+gdb_test "p foo2_type_check (0, 1)" " = 1001" -+gdb_test "p foo2_type_check (1, 0)" " = 1001" -+gdb_test "p foo2_type_check (1, 1)" " = 1001" -+gdb_test "p foo3_type_check (0, 0, 1)" " = 1002" -+gdb_test "p foo3_type_check (0, 1, 0)" " = 1002" -+gdb_test "p foo3_type_check (1, 0, 0)" " = 1002" -+gdb_test "p foo3_type_check (0, 1, 1)" " = 1002" -+gdb_test "p foo3_type_check (1, 1, 0)" " = 1002" -+gdb_test "p foo3_type_check (1, 1, 1)" " = 1002" -+gdb_test "p foo3_2 (1,1)" " = 32" -Index: gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.cc -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/testsuite/gdb.cp/converts.cc 2011-10-14 22:22:50.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/testsuite/gdb.cp/converts.cc 2012-09-27 22:14:41.322695337 +0200 -@@ -27,6 +27,10 @@ int foo3_1 (int a, const char **b) { ret - int foo3_2 (int a, int b) { return 32; } - int foo3_2 (int a, const char **b) { return 320; } - -+int foo1_type_check (char *a) { return 1000; } -+int foo2_type_check (char *a, char *b) { return 1001; } -+int foo3_type_check (char *a, char *b, char *c) { return 1002; } -+ - int main() - { - -@@ -62,5 +66,9 @@ int main() - foo3_2 (0, static_cast (0)); - foo3_2 (0, 0); - -+ foo1_type_check (a); -+ foo2_type_check (a, a); -+ foo3_type_check (a, a, a); -+ - return 0; // end of main - } diff --git a/gdb-commonblock-pie.patch b/gdb-commonblock-pie.patch new file mode 100644 index 0000000..52e236e --- /dev/null +++ b/gdb-commonblock-pie.patch @@ -0,0 +1,60 @@ +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index 7a58c45..364e6af 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -16071,7 +16071,7 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, + list_to_add = &global_symbols; + break; + case DW_TAG_common_block: +- SYMBOL_CLASS (sym) = LOC_STATIC; ++ SYMBOL_CLASS (sym) = LOC_COMMON_BLOCK; + SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN; + add_symbol_to_list (sym, cu->list_in_scope); + break; +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index 22cca83..d01d6ec 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -427,7 +427,7 @@ info_common_command_for_block (struct block *block, const char *comname, + struct common_block *common = SYMBOL_VALUE_COMMON_BLOCK (sym); + size_t index; + +- gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC); ++ gdb_assert (SYMBOL_CLASS (sym) == LOC_COMMON_BLOCK); + + if (comname && (!SYMBOL_LINKAGE_NAME (sym) + || strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0)) +diff --git a/gdb/symtab.h b/gdb/symtab.h +index c334a3a..b992266 100644 +--- a/gdb/symtab.h ++++ b/gdb/symtab.h +@@ -120,7 +120,7 @@ struct general_symbol_info + + CORE_ADDR address; + +- /* A common block. Used with COMMON_BLOCK_DOMAIN. */ ++ /* A common block. Used with LOC_COMMON_BLOCK. */ + + struct common_block *common_block; + +@@ -414,7 +414,8 @@ typedef enum domain_enum_tag + + LABEL_DOMAIN, + +- /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. */ ++ /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. ++ They also always use LOC_COMMON_BLOCK. */ + COMMON_BLOCK_DOMAIN + } domain_enum; + +@@ -533,6 +534,10 @@ enum address_class + /* The variable's address is computed by a set of location + functions (see "struct symbol_computed_ops" below). */ + LOC_COMPUTED, ++ ++ /* The variable uses general_symbol_info->value->common_block field. ++ It also always uses COMMON_BLOCK_DOMAIN. */ ++ LOC_COMMON_BLOCK, + }; + + /* The methods needed to implement LOC_COMPUTED. These methods can diff --git a/gdb-core-open-vdso-warning.patch b/gdb-core-open-vdso-warning.patch index b835657..cafd844 100644 --- a/gdb-core-open-vdso-warning.patch +++ b/gdb-core-open-vdso-warning.patch @@ -3,10 +3,10 @@ Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Inp [ New patch variant. ] -Index: gdb-7.4.50.20120703/gdb/solib-svr4.c +Index: gdb-7.5.50.20130118/gdb/solib-svr4.c =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/solib-svr4.c 2012-07-06 15:39:57.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/solib-svr4.c 2012-07-06 15:40:01.124816148 +0200 +--- gdb-7.5.50.20130118.orig/gdb/solib-svr4.c 2013-01-18 23:05:19.414210015 +0100 ++++ gdb-7.5.50.20130118/gdb/solib-svr4.c 2013-01-18 23:05:34.813231664 +0100 @@ -1221,8 +1221,17 @@ svr4_read_so_list (CORE_ADDR lm, struct SO_NAME_MAX_PATH_SIZE - 1, &errcode); if (errcode != 0) @@ -27,20 +27,20 @@ Index: gdb-7.4.50.20120703/gdb/solib-svr4.c do_cleanups (old_chain); continue; } -Index: gdb-7.4.50.20120703/gdb/solib.c +Index: gdb-7.5.50.20130118/gdb/solib.c =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/solib.c 2012-07-06 15:38:39.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/solib.c 2012-07-06 15:40:01.125816147 +0200 -@@ -672,7 +672,7 @@ solib_used (const struct so_list *const +--- gdb-7.5.50.20130118.orig/gdb/solib.c 2013-01-18 23:05:19.415210017 +0100 ++++ gdb-7.5.50.20130118/gdb/solib.c 2013-01-18 23:05:57.421263173 +0100 +@@ -666,7 +666,7 @@ solib_used (const struct so_list *const processes we've just attached to, so that's okay. */ static void -update_solib_list (int from_tty, struct target_ops *target) +update_solib_list_1 (int from_tty, struct target_ops *target) { - struct target_so_ops *ops = solib_ops (target_gdbarch); + struct target_so_ops *ops = solib_ops (target_gdbarch ()); struct so_list *inferior = ops->current_sos(); -@@ -843,6 +843,21 @@ Do you need \"set solib-search-path\" or +@@ -837,6 +837,21 @@ Do you need \"set solib-search-path\" or } } @@ -62,10 +62,10 @@ Index: gdb-7.4.50.20120703/gdb/solib.c /* Return non-zero if NAME is the libpthread shared library. -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/corefile.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/corefile.exp 2012-07-06 15:39:41.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp 2012-07-06 15:40:10.322805539 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.base/corefile.exp 2013-01-18 23:05:19.416210020 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/corefile.exp 2013-01-18 23:05:34.814231667 +0100 @@ -286,3 +286,19 @@ if {$buildid == ""} { gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*" pass $wholetest @@ -86,10 +86,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp + pass $test + } +} -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/solib-symbol.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2012-07-06 15:38:39.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp 2012-07-06 15:40:01.127816145 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2013-01-18 23:05:19.416210020 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/solib-symbol.exp 2013-01-18 23:05:34.814231667 +0100 @@ -27,7 +27,8 @@ set lib_flags [list debug ldflags=-Wl,-B # Binary file. set testfile "solib-symbol-main" diff --git a/gdb-dlopen-stap-probe-1of7.patch b/gdb-dlopen-stap-probe-1of7.patch deleted file mode 100644 index 1891fb3..0000000 --- a/gdb-dlopen-stap-probe-1of7.patch +++ /dev/null @@ -1,795 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-07/msg00123.html - -### src/gdb/ChangeLog 2012/07/18 04:36:15 1.14473 -### src/gdb/ChangeLog 2012/07/18 16:12:15 1.14474 -## -1,3 +1,37 @@ -+2012-07-18 Sergio Durigan Junior -+ -+ * elfread.c (elf_get_probe_argument_count): Remove `objfile' argument. -+ (elf_compile_to_ax): Likewise. -+ * infrun.c (insert_exception_resume_from_probe): Likewise. -+ (check_exception_resume): Remove `objfile' variable. -+ * probe.c (find_probe_by_pc): Remove `objfile' argument. -+ (struct probe_and_objfile, probe_and_objfile_s): Delete. -+ (collect_probes): Adjust return value to `VEC (probe_p) *'. -+ (compare_entries): Rename to... -+ (compare_probes): ...this. Adjust function to work with -+ `struct probe *'. Rename variables `ea' and `eb' to `pa' and `pb' -+ respectively. -+ (gen_ui_out_table_header_info): Adjust `probes' argument to be -+ `VEC (probe_p) *'. -+ (print_ui_out_info): Adjust argument to be `struct probe *'. -+ (info_probes_for_ops): Adjust internal computations to use -+ `VEC (probe_p) *'. -+ (probe_safe_evaluate_at_pc): Refactor to not pass `objfile' anymore. -+ * probe.h (struct probe_ops) : Remove `objfile' argument. -+ (struct probe) : New field. -+ (find_probe_by_pc): Remove `objfile' argument. -+ * stap-probe.c (stap_parse_probe_arguments): Likewise. -+ (stap_get_probe_argument_count): Likewise. -+ (stap_get_arg): Likewise. -+ (stap_evaluate_probe_argument): Likewise. -+ (stap_compile_to_ax): Likewise. -+ (compile_probe_arg): Refactor not to pass `objfile' anymore. -+ (handle_stap_probe): Fill `objfile' field from `struct probe'. -+ (stap_gen_info_probes_table_header): Remove `objfile' argument. -+ * symfile.h (struct sym_probe_fns) : Likewise. -+ - 2012-07-18 Terry Guo - - PR 14329 ---- src/gdb/elfread.c 2012/06/26 20:14:01 1.133 -+++ src/gdb/elfread.c 2012/07/18 16:12:15 1.134 -@@ -1635,33 +1635,29 @@ - symfile.h. */ - - static unsigned --elf_get_probe_argument_count (struct objfile *objfile, -- struct probe *probe) -+elf_get_probe_argument_count (struct probe *probe) - { -- return probe->pops->get_probe_argument_count (probe, objfile); -+ return probe->pops->get_probe_argument_count (probe); - } - - /* Implementation of `sym_evaluate_probe_argument', as documented in - symfile.h. */ - - static struct value * --elf_evaluate_probe_argument (struct objfile *objfile, -- struct probe *probe, -- unsigned n) -+elf_evaluate_probe_argument (struct probe *probe, unsigned n) - { -- return probe->pops->evaluate_probe_argument (probe, objfile, n); -+ return probe->pops->evaluate_probe_argument (probe, n); - } - - /* Implementation of `sym_compile_to_ax', as documented in symfile.h. */ - - static void --elf_compile_to_ax (struct objfile *objfile, -- struct probe *probe, -+elf_compile_to_ax (struct probe *probe, - struct agent_expr *expr, - struct axs_value *value, - unsigned n) - { -- probe->pops->compile_to_ax (probe, objfile, expr, value, n); -+ probe->pops->compile_to_ax (probe, expr, value, n); - } - - /* Implementation of `sym_relocate_probe', as documented in symfile.h. */ ---- src/gdb/infrun.c 2012/07/01 10:37:04 1.549 -+++ src/gdb/infrun.c 2012/07/18 16:12:16 1.550 -@@ -5518,7 +5518,6 @@ - static void - insert_exception_resume_from_probe (struct thread_info *tp, - const struct probe *probe, -- struct objfile *objfile, - struct frame_info *frame) - { - struct value *arg_value; -@@ -5534,7 +5533,7 @@ - if (debug_infrun) - fprintf_unfiltered (gdb_stdlog, - "infrun: exception resume at %s\n", -- paddress (get_objfile_arch (objfile), -+ paddress (get_objfile_arch (probe->objfile), - handler)); - - bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame), -@@ -5552,7 +5551,6 @@ - struct frame_info *frame) - { - volatile struct gdb_exception e; -- struct objfile *objfile; - const struct probe *probe; - struct symbol *func; - -@@ -5560,11 +5558,10 @@ - SystemTap probe point. If so, the probe has two arguments: the - CFA and the HANDLER. We ignore the CFA, extract the handler, and - set a breakpoint there. */ -- probe = find_probe_by_pc (get_frame_pc (frame), &objfile); -+ probe = find_probe_by_pc (get_frame_pc (frame)); - if (probe) - { -- insert_exception_resume_from_probe (ecs->event_thread, probe, -- objfile, frame); -+ insert_exception_resume_from_probe (ecs->event_thread, probe, frame); - return; - } - ---- src/gdb/probe.c 2012/05/08 01:35:34 1.3 -+++ src/gdb/probe.c 2012/07/18 16:12:17 1.4 -@@ -204,7 +204,7 @@ - /* See definition in probe.h. */ - - struct probe * --find_probe_by_pc (CORE_ADDR pc, struct objfile **objfile_out) -+find_probe_by_pc (CORE_ADDR pc) - { - struct objfile *objfile; - -@@ -221,10 +221,7 @@ - probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile); - for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++) - if (probe->address == pc) -- { -- *objfile_out = objfile; -- return probe; -- } -+ return probe; - } - - return NULL; -@@ -232,21 +229,6 @@ - - - --/* A utility structure. A VEC of these is built when handling "info -- probes". */ -- --struct probe_and_objfile --{ -- /* The probe. */ -- struct probe *probe; -- -- /* The probe's objfile. */ -- struct objfile *objfile; --}; -- --typedef struct probe_and_objfile probe_and_objfile_s; --DEF_VEC_O (probe_and_objfile_s); -- - /* A helper function for collect_probes that compiles a regexp and - throws an exception on error. This installs a cleanup to free the - resulting pattern on success. If RX is NULL, this does nothing. */ -@@ -275,16 +257,16 @@ - If POPS is not NULL, only probes of this certain probe_ops will match. - Each argument is a regexp, or NULL, which matches anything. */ - --static VEC (probe_and_objfile_s) * -+static VEC (probe_p) * - collect_probes (char *objname, char *provider, char *probe_name, - const struct probe_ops *pops) - { - struct objfile *objfile; -- VEC (probe_and_objfile_s) *result = NULL; -+ VEC (probe_p) *result = NULL; - struct cleanup *cleanup, *cleanup_temps; - regex_t obj_pat, prov_pat, probe_pat; - -- cleanup = make_cleanup (VEC_cleanup (probe_and_objfile_s), &result); -+ cleanup = make_cleanup (VEC_cleanup (probe_p), &result); - - cleanup_temps = make_cleanup (null_cleanup, NULL); - compile_rx_or_error (&prov_pat, provider, _("Invalid provider regexp")); -@@ -310,8 +292,6 @@ - - for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++) - { -- probe_and_objfile_s entry; -- - if (pops != NULL && probe->pops != pops) - continue; - -@@ -323,9 +303,7 @@ - && regexec (&probe_pat, probe->name, 0, NULL, 0) != 0) - continue; - -- entry.probe = probe; -- entry.objfile = objfile; -- VEC_safe_push (probe_and_objfile_s, result, &entry); -+ VEC_safe_push (probe_p, result, probe); - } - } - -@@ -334,36 +312,36 @@ - return result; - } - --/* A qsort comparison function for probe_and_objfile_s objects. */ -+/* A qsort comparison function for probe_p objects. */ - - static int --compare_entries (const void *a, const void *b) -+compare_probes (const void *a, const void *b) - { -- const probe_and_objfile_s *ea = a; -- const probe_and_objfile_s *eb = b; -+ const struct probe *pa = *((const struct probe **) a); -+ const struct probe *pb = *((const struct probe **) b); - int v; - -- v = strcmp (ea->probe->provider, eb->probe->provider); -+ v = strcmp (pa->provider, pb->provider); - if (v) - return v; - -- v = strcmp (ea->probe->name, eb->probe->name); -+ v = strcmp (pa->name, pb->name); - if (v) - return v; - -- if (ea->probe->address < eb->probe->address) -+ if (pa->address < pb->address) - return -1; -- if (ea->probe->address > eb->probe->address) -+ if (pa->address > pb->address) - return 1; - -- return strcmp (ea->objfile->name, eb->objfile->name); -+ return strcmp (pa->objfile->name, pb->objfile->name); - } - - /* Helper function that generate entries in the ui_out table being - crafted by `info_probes_for_ops'. */ - - static void --gen_ui_out_table_header_info (VEC (probe_and_objfile_s) *probes, -+gen_ui_out_table_header_info (VEC (probe_p) *probes, - const struct probe_ops *p) - { - /* `headings' refers to the names of the columns when printing `info -@@ -392,11 +370,11 @@ - VEC_iterate (info_probe_column_s, headings, ix, column); - ++ix) - { -- probe_and_objfile_s *entry; -+ struct probe *probe; - int jx; - size_t size_max = strlen (column->print_name); - -- for (jx = 0; VEC_iterate (probe_and_objfile_s, probes, jx, entry); ++jx) -+ for (jx = 0; VEC_iterate (probe_p, probes, jx, probe); ++jx) - { - /* `probe_fields' refers to the values of each new field that this - probe will display. */ -@@ -405,12 +383,11 @@ - const char *val; - int kx; - -- if (entry->probe->pops != p) -+ if (probe->pops != p) - continue; - - c2 = make_cleanup (VEC_cleanup (const_char_ptr), &probe_fields); -- p->gen_info_probes_table_values (entry->probe, entry->objfile, -- &probe_fields); -+ p->gen_info_probes_table_values (probe, &probe_fields); - - gdb_assert (VEC_length (const_char_ptr, probe_fields) - == headings_size); -@@ -437,10 +414,10 @@ - } - - /* Helper function to print extra information about a probe and an objfile -- represented by ENTRY. */ -+ represented by PROBE. */ - - static void --print_ui_out_info (probe_and_objfile_s *entry) -+print_ui_out_info (struct probe *probe) - { - int ix; - int j = 0; -@@ -451,23 +428,21 @@ - info_probe_column_s *column; - struct cleanup *c; - -- gdb_assert (entry != NULL); -- gdb_assert (entry->probe != NULL); -- gdb_assert (entry->probe->pops != NULL); -+ gdb_assert (probe != NULL); -+ gdb_assert (probe->pops != NULL); - -- if (entry->probe->pops->gen_info_probes_table_header == NULL -- && entry->probe->pops->gen_info_probes_table_values == NULL) -+ if (probe->pops->gen_info_probes_table_header == NULL -+ && probe->pops->gen_info_probes_table_values == NULL) - return; - -- gdb_assert (entry->probe->pops->gen_info_probes_table_header != NULL -- && entry->probe->pops->gen_info_probes_table_values != NULL); -+ gdb_assert (probe->pops->gen_info_probes_table_header != NULL -+ && probe->pops->gen_info_probes_table_values != NULL); - - c = make_cleanup (VEC_cleanup (info_probe_column_s), &headings); - make_cleanup (VEC_cleanup (const_char_ptr), &values); - -- entry->probe->pops->gen_info_probes_table_header (&headings); -- entry->probe->pops->gen_info_probes_table_values (entry->probe, -- entry->objfile, &values); -+ probe->pops->gen_info_probes_table_header (&headings); -+ probe->pops->gen_info_probes_table_values (probe, &values); - - gdb_assert (VEC_length (info_probe_column_s, headings) - == VEC_length (const_char_ptr, values)); -@@ -515,16 +490,16 @@ - void - info_probes_for_ops (char *arg, int from_tty, const struct probe_ops *pops) - { -- char *provider, *probe = NULL, *objname = NULL; -+ char *provider, *probe_name = NULL, *objname = NULL; - struct cleanup *cleanup = make_cleanup (null_cleanup, NULL); -- VEC (probe_and_objfile_s) *items; -+ VEC (probe_p) *probes; - int i, any_found; - int ui_out_extra_fields = 0; - size_t size_addr; - size_t size_name = strlen ("Name"); - size_t size_objname = strlen ("Object"); - size_t size_provider = strlen ("Provider"); -- probe_and_objfile_s *entry; -+ struct probe *probe; - struct gdbarch *gdbarch = get_current_arch (); - - /* Do we have a `provider:probe:objfile' style of linespec? */ -@@ -533,10 +508,10 @@ - { - make_cleanup (xfree, provider); - -- probe = extract_arg (&arg); -- if (probe) -+ probe_name = extract_arg (&arg); -+ if (probe_name) - { -- make_cleanup (xfree, probe); -+ make_cleanup (xfree, probe_name); - - objname = extract_arg (&arg); - if (objname) -@@ -564,28 +539,27 @@ - else - ui_out_extra_fields = get_number_extra_fields (pops); - -- items = collect_probes (objname, provider, probe, pops); -- make_cleanup (VEC_cleanup (probe_and_objfile_s), &items); -+ probes = collect_probes (objname, provider, probe_name, pops); -+ make_cleanup (VEC_cleanup (probe_p), &probes); - make_cleanup_ui_out_table_begin_end (current_uiout, - 4 + ui_out_extra_fields, -- VEC_length (probe_and_objfile_s, items), -+ VEC_length (probe_p, probes), - "StaticProbes"); - -- if (!VEC_empty (probe_and_objfile_s, items)) -- qsort (VEC_address (probe_and_objfile_s, items), -- VEC_length (probe_and_objfile_s, items), -- sizeof (probe_and_objfile_s), compare_entries); -+ if (!VEC_empty (probe_p, probes)) -+ qsort (VEC_address (probe_p, probes), VEC_length (probe_p, probes), -+ sizeof (probe_p), compare_probes); - - /* What's the size of an address in our architecture? */ - size_addr = gdbarch_addr_bit (gdbarch) == 64 ? 18 : 10; - - /* Determining the maximum size of each field (`provider', `name' and - `objname'). */ -- for (i = 0; VEC_iterate (probe_and_objfile_s, items, i, entry); ++i) -+ for (i = 0; VEC_iterate (probe_p, probes, i, probe); ++i) - { -- size_name = max (strlen (entry->probe->name), size_name); -- size_provider = max (strlen (entry->probe->provider), size_provider); -- size_objname = max (strlen (entry->objfile->name), size_objname); -+ size_name = max (strlen (probe->name), size_name); -+ size_provider = max (strlen (probe->provider), size_provider); -+ size_objname = max (strlen (probe->objfile->name), size_objname); - } - - ui_out_table_header (current_uiout, size_provider, ui_left, "provider", -@@ -601,26 +575,26 @@ - /* We have to generate the table header for each new probe type that we - will print. */ - for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); ++ix) -- gen_ui_out_table_header_info (items, po); -+ gen_ui_out_table_header_info (probes, po); - } - else -- gen_ui_out_table_header_info (items, pops); -+ gen_ui_out_table_header_info (probes, pops); - - ui_out_table_header (current_uiout, size_objname, ui_left, "object", - _("Object")); - ui_out_table_body (current_uiout); - -- for (i = 0; VEC_iterate (probe_and_objfile_s, items, i, entry); ++i) -+ for (i = 0; VEC_iterate (probe_p, probes, i, probe); ++i) - { - struct cleanup *inner; - - inner = make_cleanup_ui_out_tuple_begin_end (current_uiout, "probe"); - -- ui_out_field_string (current_uiout, "provider", entry->probe->provider); -- ui_out_field_string (current_uiout, "name", entry->probe->name); -+ ui_out_field_string (current_uiout, "provider", probe->provider); -+ ui_out_field_string (current_uiout, "name", probe->name); - ui_out_field_core_addr (current_uiout, "addr", -- get_objfile_arch (entry->objfile), -- entry->probe->address); -+ get_objfile_arch (probe->objfile), -+ probe->address); - - if (pops == NULL) - { -@@ -629,19 +603,19 @@ - - for (ix = 0; VEC_iterate (probe_ops_cp, all_probe_ops, ix, po); - ++ix) -- if (entry->probe->pops == po) -- print_ui_out_info (entry); -+ if (probe->pops == po) -+ print_ui_out_info (probe); - } - else -- print_ui_out_info (entry); -+ print_ui_out_info (probe); - -- ui_out_field_string (current_uiout, "object", entry->objfile->name); -+ ui_out_field_string (current_uiout, "object", probe->objfile->name); - ui_out_text (current_uiout, "\n"); - - do_cleanups (inner); - } - -- any_found = !VEC_empty (probe_and_objfile_s, items); -+ any_found = !VEC_empty (probe_p, probes); - do_cleanups (cleanup); - - if (!any_found) -@@ -662,23 +636,24 @@ - probe_safe_evaluate_at_pc (struct frame_info *frame, unsigned n) - { - struct probe *probe; -- struct objfile *objfile; -+ const struct sym_probe_fns *probe_fns; - unsigned n_probes; - -- probe = find_probe_by_pc (get_frame_pc (frame), &objfile); -+ probe = find_probe_by_pc (get_frame_pc (frame)); - if (!probe) - return NULL; -- gdb_assert (objfile->sf && objfile->sf->sym_probe_fns); - -- n_probes -- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile, -- probe); -+ gdb_assert (probe->objfile != NULL); -+ gdb_assert (probe->objfile->sf != NULL); -+ gdb_assert (probe->objfile->sf->sym_probe_fns != NULL); -+ -+ probe_fns = probe->objfile->sf->sym_probe_fns; -+ n_probes = probe_fns->sym_get_probe_argument_count (probe); -+ - if (n >= n_probes) - return NULL; - -- return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile, -- probe, -- n); -+ return probe_fns->sym_evaluate_probe_argument (probe, n); - } - - /* See comment in probe.h. */ ---- src/gdb/probe.h 2012/04/27 20:47:55 1.1 -+++ src/gdb/probe.h 2012/07/18 16:12:17 1.2 -@@ -66,21 +66,18 @@ - - /* Return the number of arguments of PROBE. */ - -- unsigned (*get_probe_argument_count) (struct probe *probe, -- struct objfile *objfile); -+ unsigned (*get_probe_argument_count) (struct probe *probe); - - /* Evaluate the Nth argument from the PROBE, returning a value - corresponding to it. The argument number is represented N. */ - - struct value *(*evaluate_probe_argument) (struct probe *probe, -- struct objfile *objfile, - unsigned n); - - /* Compile the Nth argument of the PROBE to an agent expression. - The argument number is represented by N. */ - -- void (*compile_to_ax) (struct probe *probe, struct objfile *objfile, -- struct agent_expr *aexpr, -+ void (*compile_to_ax) (struct probe *probe, struct agent_expr *aexpr, - struct axs_value *axs_value, unsigned n); - - /* Set the semaphore associated with the PROBE. This function only makes -@@ -108,8 +105,8 @@ - void (*gen_info_probes_table_header) (VEC (info_probe_column_s) **heads); - - /* Function that will fill VALUES with the values of the extra fields -- to be printed for PROBE and OBJFILE. If the backend implements -- the `gen_ui_out_table_header' method, then it should implement -+ to be printed for PROBE. If the backend implements the -+ `gen_ui_out_table_header' method, then it should implement - this method as well. The backend should also guarantee that the - order and the number of values in the vector is exactly the same - as the order of the extra fields provided in the method -@@ -118,7 +115,6 @@ - position in the vector. */ - - void (*gen_info_probes_table_values) (struct probe *probe, -- struct objfile *objfile, - VEC (const_char_ptr) **values); - }; - -@@ -157,6 +153,11 @@ - /* The operations associated with this probe. */ - const struct probe_ops *pops; - -+ /* The objfile which contains this probe. Even if the probe is also -+ present in a separate debug objfile, this variable always points to -+ the non-separate debug objfile. */ -+ struct objfile *objfile; -+ - /* The name of the probe. */ - const char *name; - -@@ -181,11 +182,9 @@ - extern void register_probe_ops (struct probe *probe); - - /* Given a PC, find an associated probe with type PTYPE. If a probe is -- found, set *OBJFILE_OUT to the probe's objfile, and return the -- probe. If no probe is found, return NULL. */ -+ found, return it. If no probe is found, return NULL. */ - --extern struct probe *find_probe_by_pc (CORE_ADDR pc, -- struct objfile **objfile_out); -+extern struct probe *find_probe_by_pc (CORE_ADDR pc); - - /* Search OBJFILE for a probe with the given PROVIDER, NAME and PTYPE. - Return a VEC of all probes that were found. If no matching probe ---- src/gdb/stap-probe.c 2012/05/08 01:35:35 1.4 -+++ src/gdb/stap-probe.c 2012/07/18 16:12:17 1.5 -@@ -903,10 +903,10 @@ - this information. */ - - static void --stap_parse_probe_arguments (struct stap_probe *probe, struct objfile *objfile) -+stap_parse_probe_arguments (struct stap_probe *probe) - { - const char *cur; -- struct gdbarch *gdbarch = get_objfile_arch (objfile); -+ struct gdbarch *gdbarch = get_objfile_arch (probe->p.objfile); - - gdb_assert (!probe->args_parsed); - cur = probe->args_u.text; -@@ -991,15 +991,14 @@ - argument string. */ - - static unsigned --stap_get_probe_argument_count (struct probe *probe_generic, -- struct objfile *objfile) -+stap_get_probe_argument_count (struct probe *probe_generic) - { - struct stap_probe *probe = (struct stap_probe *) probe_generic; - - gdb_assert (probe_generic->pops == &stap_probe_ops); - - if (!probe->args_parsed) -- stap_parse_probe_arguments (probe, objfile); -+ stap_parse_probe_arguments (probe); - - gdb_assert (probe->args_parsed); - return VEC_length (stap_probe_arg_s, probe->args_u.vec); -@@ -1042,10 +1041,10 @@ - } - - static struct stap_probe_arg * --stap_get_arg (struct stap_probe *probe, struct objfile *objfile, unsigned n) -+stap_get_arg (struct stap_probe *probe, unsigned n) - { - if (!probe->args_parsed) -- stap_parse_probe_arguments (probe, objfile); -+ stap_parse_probe_arguments (probe); - - return VEC_index (stap_probe_arg_s, probe->args_u.vec, n); - } -@@ -1054,8 +1053,7 @@ - corresponding to it. Assertion is thrown if N does not exist. */ - - static struct value * --stap_evaluate_probe_argument (struct probe *probe_generic, -- struct objfile *objfile, unsigned n) -+stap_evaluate_probe_argument (struct probe *probe_generic, unsigned n) - { - struct stap_probe *stap_probe = (struct stap_probe *) probe_generic; - struct stap_probe_arg *arg; -@@ -1063,7 +1061,7 @@ - - gdb_assert (probe_generic->pops == &stap_probe_ops); - -- arg = stap_get_arg (stap_probe, objfile, n); -+ arg = stap_get_arg (stap_probe, n); - return evaluate_subexp_standard (arg->atype, arg->aexpr, &pos, EVAL_NORMAL); - } - -@@ -1071,9 +1069,8 @@ - Assertion is thrown if N does not exist. */ - - static void --stap_compile_to_ax (struct probe *probe_generic, struct objfile *objfile, -- struct agent_expr *expr, struct axs_value *value, -- unsigned n) -+stap_compile_to_ax (struct probe *probe_generic, struct agent_expr *expr, -+ struct axs_value *value, unsigned n) - { - struct stap_probe *stap_probe = (struct stap_probe *) probe_generic; - struct stap_probe_arg *arg; -@@ -1081,7 +1078,7 @@ - - gdb_assert (probe_generic->pops == &stap_probe_ops); - -- arg = stap_get_arg (stap_probe, objfile, n); -+ arg = stap_get_arg (stap_probe, n); - - pc = arg->aexpr->elts; - gen_expr (arg->aexpr, &pc, expr, value); -@@ -1124,20 +1121,24 @@ - struct frame_info *frame = get_selected_frame (_("No frame selected")); - CORE_ADDR pc = get_frame_pc (frame); - int sel = (int) (uintptr_t) data; -- struct objfile *objfile; - struct probe *pc_probe; -+ const struct sym_probe_fns *pc_probe_fns; - unsigned n_args; - - /* SEL == -1 means "_probe_argc". */ - gdb_assert (sel >= -1); - -- pc_probe = find_probe_by_pc (pc, &objfile); -+ pc_probe = find_probe_by_pc (pc); - if (pc_probe == NULL) - error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc)); - -- n_args -- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile, -- pc_probe); -+ gdb_assert (pc_probe->objfile != NULL); -+ gdb_assert (pc_probe->objfile->sf != NULL); -+ gdb_assert (pc_probe->objfile->sf->sym_probe_fns != NULL); -+ -+ pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns; -+ -+ n_args = pc_probe_fns->sym_get_probe_argument_count (pc_probe); - if (sel == -1) - return value_from_longest (builtin_type (arch)->builtin_int, n_args); - -@@ -1145,9 +1146,7 @@ - error (_("Invalid probe argument %d -- probe has %u arguments available"), - sel, n_args); - -- return objfile->sf->sym_probe_fns->sym_evaluate_probe_argument (objfile, -- pc_probe, -- sel); -+ return pc_probe_fns->sym_evaluate_probe_argument (pc_probe, sel); - } - - /* This is called to compile one of the $_probe_arg* convenience -@@ -1159,20 +1158,25 @@ - { - CORE_ADDR pc = expr->scope; - int sel = (int) (uintptr_t) data; -- struct objfile *objfile; - struct probe *pc_probe; -+ const struct sym_probe_fns *pc_probe_fns; - int n_probes; - - /* SEL == -1 means "_probe_argc". */ - gdb_assert (sel >= -1); - -- pc_probe = find_probe_by_pc (pc, &objfile); -+ pc_probe = find_probe_by_pc (pc); - if (pc_probe == NULL) - error (_("No SystemTap probe at PC %s"), core_addr_to_string (pc)); - -- n_probes -- = objfile->sf->sym_probe_fns->sym_get_probe_argument_count (objfile, -- pc_probe); -+ gdb_assert (pc_probe->objfile != NULL); -+ gdb_assert (pc_probe->objfile->sf != NULL); -+ gdb_assert (pc_probe->objfile->sf->sym_probe_fns != NULL); -+ -+ pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns; -+ -+ n_probes = pc_probe_fns->sym_get_probe_argument_count (pc_probe); -+ - if (sel == -1) - { - value->kind = axs_rvalue; -@@ -1186,8 +1190,7 @@ - error (_("Invalid probe argument %d -- probe has %d arguments available"), - sel, n_probes); - -- objfile->sf->sym_probe_fns->sym_compile_to_ax (objfile, pc_probe, -- expr, value, sel); -+ pc_probe_fns->sym_compile_to_ax (pc_probe, expr, value, sel); - } - - -@@ -1297,6 +1300,7 @@ - - ret = obstack_alloc (&objfile->objfile_obstack, sizeof (*ret)); - ret->p.pops = &stap_probe_ops; -+ ret->p.objfile = objfile; - - /* Provider and the name of the probe. */ - ret->p.provider = &el->data[3 * size]; -@@ -1481,15 +1485,16 @@ - - static void - stap_gen_info_probes_table_values (struct probe *probe_generic, -- struct objfile *objfile, - VEC (const_char_ptr) **ret) - { - struct stap_probe *probe = (struct stap_probe *) probe_generic; -- struct gdbarch *gdbarch = get_objfile_arch (objfile); -+ struct gdbarch *gdbarch; - const char *val = NULL; - - gdb_assert (probe_generic->pops == &stap_probe_ops); - -+ gdbarch = get_objfile_arch (probe->p.objfile); -+ - if (probe->sem_addr) - val = print_core_address (gdbarch, probe->sem_addr); - ---- src/gdb/symfile.h 2012/05/24 22:14:35 1.109 -+++ src/gdb/symfile.h 2012/07/18 16:12:17 1.110 -@@ -320,8 +320,7 @@ - have come from a call to this objfile's sym_get_probes method. - If you provide an implementation of sym_get_probes, you must - implement this method as well. */ -- unsigned (*sym_get_probe_argument_count) (struct objfile *objfile, -- struct probe *probe); -+ unsigned (*sym_get_probe_argument_count) (struct probe *probe); - - /* Evaluate the Nth argument available to PROBE. PROBE will have - come from a call to this objfile's sym_get_probes method. N will -@@ -330,8 +329,7 @@ - PC will match the address of the probe. If you provide an - implementation of sym_get_probes, you must implement this method - as well. */ -- struct value *(*sym_evaluate_probe_argument) (struct objfile *objfile, -- struct probe *probe, -+ struct value *(*sym_evaluate_probe_argument) (struct probe *probe, - unsigned n); - - /* Compile the Nth probe argument to an agent expression. PROBE -@@ -339,8 +337,7 @@ - method. N will be between 0 and the number of arguments - available to this probe. EXPR and VALUE are the agent expression - that is being updated. */ -- void (*sym_compile_to_ax) (struct objfile *objfile, -- struct probe *probe, -+ void (*sym_compile_to_ax) (struct probe *probe, - struct agent_expr *expr, - struct axs_value *value, - unsigned n); diff --git a/gdb-dlopen-stap-probe-2of7.patch b/gdb-dlopen-stap-probe-2of7.patch deleted file mode 100644 index 81b35e9..0000000 --- a/gdb-dlopen-stap-probe-2of7.patch +++ /dev/null @@ -1,74 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-07/msg00124.html - -### src/gdb/ChangeLog 2012/07/18 16:12:15 1.14474 -### src/gdb/ChangeLog 2012/07/18 16:20:36 1.14475 -## -1,5 +1,10 @@ - 2012-07-18 Sergio Durigan Junior - -+ * probe.c (probe_safe_evaluate_at_pc): Rename variable `n_probes'. -+ * stap-probe.c (compile_probe_arg): Likewise. -+ -+2012-07-18 Sergio Durigan Junior -+ - * elfread.c (elf_get_probe_argument_count): Remove `objfile' argument. - (elf_compile_to_ax): Likewise. - * infrun.c (insert_exception_resume_from_probe): Likewise. ---- src/gdb/probe.c 2012/07/18 16:12:17 1.4 -+++ src/gdb/probe.c 2012/07/18 16:20:43 1.5 -@@ -637,7 +637,7 @@ - { - struct probe *probe; - const struct sym_probe_fns *probe_fns; -- unsigned n_probes; -+ unsigned n_args; - - probe = find_probe_by_pc (get_frame_pc (frame)); - if (!probe) -@@ -648,9 +648,9 @@ - gdb_assert (probe->objfile->sf->sym_probe_fns != NULL); - - probe_fns = probe->objfile->sf->sym_probe_fns; -- n_probes = probe_fns->sym_get_probe_argument_count (probe); -+ n_args = probe_fns->sym_get_probe_argument_count (probe); - -- if (n >= n_probes) -+ if (n >= n_args) - return NULL; - - return probe_fns->sym_evaluate_probe_argument (probe, n); ---- src/gdb/stap-probe.c 2012/07/18 16:12:17 1.5 -+++ src/gdb/stap-probe.c 2012/07/18 16:20:43 1.6 -@@ -1160,7 +1160,7 @@ - int sel = (int) (uintptr_t) data; - struct probe *pc_probe; - const struct sym_probe_fns *pc_probe_fns; -- int n_probes; -+ int n_args; - - /* SEL == -1 means "_probe_argc". */ - gdb_assert (sel >= -1); -@@ -1175,20 +1175,20 @@ - - pc_probe_fns = pc_probe->objfile->sf->sym_probe_fns; - -- n_probes = pc_probe_fns->sym_get_probe_argument_count (pc_probe); -+ n_args = pc_probe_fns->sym_get_probe_argument_count (pc_probe); - - if (sel == -1) - { - value->kind = axs_rvalue; - value->type = builtin_type (expr->gdbarch)->builtin_int; -- ax_const_l (expr, n_probes); -+ ax_const_l (expr, n_args); - return; - } - - gdb_assert (sel >= 0); -- if (sel >= n_probes) -+ if (sel >= n_args) - error (_("Invalid probe argument %d -- probe has %d arguments available"), -- sel, n_probes); -+ sel, n_args); - - pc_probe_fns->sym_compile_to_ax (pc_probe, expr, value, sel); - } diff --git a/gdb-dlopen-stap-probe-6of7.patch b/gdb-dlopen-stap-probe-6of7.patch index 574150e..af44305 100644 --- a/gdb-dlopen-stap-probe-6of7.patch +++ b/gdb-dlopen-stap-probe-6of7.patch @@ -81,11 +81,11 @@ gdb/testsuite * gdb.base/break-dlmopen.c: Likewise. * gdb.base/break-dlmopen-solib.c: Likewise. -Index: gdb-7.4.91.20120814/gdb/breakpoint.h +Index: gdb-7.5.50.20130118/gdb/breakpoint.h =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/breakpoint.h 2012-08-14 17:31:37.050984427 +0200 -+++ gdb-7.4.91.20120814/gdb/breakpoint.h 2012-08-14 17:34:44.203746601 +0200 -@@ -1515,8 +1515,6 @@ extern int user_breakpoint_p (struct bre +--- gdb-7.5.50.20130118.orig/gdb/breakpoint.h 2013-01-18 23:57:14.782978485 +0100 ++++ gdb-7.5.50.20130118/gdb/breakpoint.h 2013-01-18 23:57:50.511792890 +0100 +@@ -1548,8 +1548,6 @@ extern int user_breakpoint_p (struct bre /* Attempt to determine architecture of location identified by SAL. */ extern struct gdbarch *get_sal_arch (struct symtab_and_line sal); @@ -94,11 +94,11 @@ Index: gdb-7.4.91.20120814/gdb/breakpoint.h extern void breakpoints_relocate (struct objfile *objfile, struct section_offsets *delta); -Index: gdb-7.4.91.20120814/gdb/breakpoint.c +Index: gdb-7.5.50.20130118/gdb/breakpoint.c =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/breakpoint.c 2012-08-14 17:31:37.128984404 +0200 -+++ gdb-7.4.91.20120814/gdb/breakpoint.c 2012-08-14 17:34:44.211746597 +0200 -@@ -5205,7 +5205,7 @@ bpstat_stop_status (struct address_space +--- gdb-7.5.50.20130118.orig/gdb/breakpoint.c 2013-01-18 23:57:14.782978485 +0100 ++++ gdb-7.5.50.20130118/gdb/breakpoint.c 2013-01-18 23:57:50.514792879 +0100 +@@ -5254,7 +5254,7 @@ bpstat_stop_status (struct address_space { if (bs->breakpoint_at && bs->breakpoint_at->type == bp_shlib_event) { @@ -107,7 +107,7 @@ Index: gdb-7.4.91.20120814/gdb/breakpoint.c break; } } -@@ -5301,25 +5301,6 @@ handle_jit_event (void) +@@ -5350,25 +5350,6 @@ handle_jit_event (void) target_terminal_inferior (); } @@ -133,11 +133,11 @@ Index: gdb-7.4.91.20120814/gdb/breakpoint.c /* Prepare WHAT final decision for infrun. */ /* Decide what infrun needs to do with this bpstat. */ -Index: gdb-7.4.91.20120814/gdb/solib.h +Index: gdb-7.5.50.20130118/gdb/solib.h =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/solib.h 2012-02-03 16:19:37.000000000 +0100 -+++ gdb-7.4.91.20120814/gdb/solib.h 2012-08-14 17:34:44.257746587 +0200 -@@ -21,6 +21,9 @@ +--- gdb-7.5.50.20130118.orig/gdb/solib.h 2013-01-18 23:57:14.782978485 +0100 ++++ gdb-7.5.50.20130118/gdb/solib.h 2013-01-18 23:57:50.515792875 +0100 +@@ -20,6 +20,9 @@ #ifndef SOLIB_H #define SOLIB_H @@ -147,7 +147,7 @@ Index: gdb-7.4.91.20120814/gdb/solib.h /* Forward decl's for prototypes */ struct so_list; struct target_ops; -@@ -91,4 +94,15 @@ extern CORE_ADDR gdb_bfd_lookup_symbol_f +@@ -90,4 +93,15 @@ extern CORE_ADDR gdb_bfd_lookup_symbol_f void *), void *data); @@ -163,11 +163,11 @@ Index: gdb-7.4.91.20120814/gdb/solib.h +extern void update_solib_breakpoints (void); + #endif /* SOLIB_H */ -Index: gdb-7.4.91.20120814/gdb/solib.c +Index: gdb-7.5.50.20130118/gdb/solib.c =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/solib.c 2012-08-14 17:31:36.832984492 +0200 -+++ gdb-7.4.91.20120814/gdb/solib.c 2012-08-14 17:34:44.272746583 +0200 -@@ -1226,6 +1226,42 @@ no_shared_libraries (char *ignored, int +--- gdb-7.5.50.20130118.orig/gdb/solib.c 2013-01-18 23:57:14.782978485 +0100 ++++ gdb-7.5.50.20130118/gdb/solib.c 2013-01-18 23:58:09.144716601 +0100 +@@ -1221,6 +1221,42 @@ no_shared_libraries (char *ignored, int objfile_purge_solibs (); } @@ -176,7 +176,7 @@ Index: gdb-7.4.91.20120814/gdb/solib.c +void +handle_solib_event (bpstat bs) +{ -+ struct target_so_ops *ops = solib_ops (target_gdbarch); ++ struct target_so_ops *ops = solib_ops (target_gdbarch ()); + + if (ops->handle_solib_event != NULL) + ops->handle_solib_event (bs); @@ -200,7 +200,7 @@ Index: gdb-7.4.91.20120814/gdb/solib.c +void +update_solib_breakpoints (void) +{ -+ struct target_so_ops *ops = solib_ops (target_gdbarch); ++ struct target_so_ops *ops = solib_ops (target_gdbarch ()); + + if (ops->update_breakpoints != NULL) + ops->update_breakpoints (); @@ -210,11 +210,11 @@ Index: gdb-7.4.91.20120814/gdb/solib.c /* Reload shared libraries, but avoid reloading the same symbol file we already have loaded. */ -Index: gdb-7.4.91.20120814/gdb/solist.h +Index: gdb-7.5.50.20130118/gdb/solist.h =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/solist.h 2012-01-04 09:17:11.000000000 +0100 -+++ gdb-7.4.91.20120814/gdb/solist.h 2012-08-14 17:34:44.273746584 +0200 -@@ -23,6 +23,8 @@ +--- gdb-7.5.50.20130118.orig/gdb/solist.h 2013-01-18 23:57:14.782978485 +0100 ++++ gdb-7.5.50.20130118/gdb/solist.h 2013-01-18 23:57:50.515792875 +0100 +@@ -22,6 +22,8 @@ #define SO_NAME_MAX_PATH_SIZE 512 /* FIXME: Should be dynamic */ /* For domain_enum domain. */ #include "symtab.h" @@ -223,7 +223,7 @@ Index: gdb-7.4.91.20120814/gdb/solist.h /* Forward declaration for target specific link map information. This struct is opaque to all but the target specific file. */ -@@ -149,6 +151,20 @@ struct target_so_ops +@@ -148,6 +150,20 @@ struct target_so_ops core file (in particular, for readonly sections). */ int (*keep_data_in_core) (CORE_ADDR vaddr, unsigned long size); @@ -244,11 +244,11 @@ Index: gdb-7.4.91.20120814/gdb/solist.h }; /* Free the memory associated with a (so_list *). */ -Index: gdb-7.4.91.20120814/gdb/infrun.c +Index: gdb-7.5.50.20130118/gdb/infrun.c =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/infrun.c 2012-08-14 17:33:16.249955007 +0200 -+++ gdb-7.4.91.20120814/gdb/infrun.c 2012-08-14 17:34:44.276746583 +0200 -@@ -361,6 +361,16 @@ static struct symbol *step_start_functio +--- gdb-7.5.50.20130118.orig/gdb/infrun.c 2013-01-18 23:57:14.782978485 +0100 ++++ gdb-7.5.50.20130118/gdb/infrun.c 2013-01-18 23:57:50.517792865 +0100 +@@ -369,6 +369,16 @@ static struct symbol *step_start_functio /* Nonzero if we want to give control to the user when we're notified of shared library events by the dynamic linker. */ int stop_on_solib_events; @@ -265,7 +265,7 @@ Index: gdb-7.4.91.20120814/gdb/infrun.c static void show_stop_on_solib_events (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) -@@ -3321,7 +3331,7 @@ handle_inferior_event (struct execution_ +@@ -3347,7 +3357,7 @@ handle_inferior_event (struct execution_ context_switch (ecs->ptid); regcache = get_thread_regcache (ecs->ptid); @@ -274,7 +274,7 @@ Index: gdb-7.4.91.20120814/gdb/infrun.c ecs->event_thread->control.stop_bpstat = bpstat_stop_status (get_regcache_aspace (regcache), -@@ -7226,7 +7236,7 @@ Show stopping for shared library events. +@@ -7327,7 +7337,7 @@ Show stopping for shared library events. If nonzero, gdb will give control to the user when the dynamic linker\n\ notifies gdb of shared library events. The most common event of interest\n\ to the user would be loading/unloading of a new library."), @@ -283,11 +283,11 @@ Index: gdb-7.4.91.20120814/gdb/infrun.c show_stop_on_solib_events, &setlist, &showlist); -Index: gdb-7.4.91.20120814/gdb/solib-svr4.c +Index: gdb-7.5.50.20130118/gdb/solib-svr4.c =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/solib-svr4.c 2012-08-14 17:34:39.346752840 +0200 -+++ gdb-7.4.91.20120814/gdb/solib-svr4.c 2012-08-14 17:35:42.635732596 +0200 -@@ -47,10 +47,12 @@ +--- gdb-7.5.50.20130118.orig/gdb/solib-svr4.c 2013-01-18 23:57:45.430815943 +0100 ++++ gdb-7.5.50.20130118/gdb/solib-svr4.c 2013-01-18 23:57:50.519792858 +0100 +@@ -46,10 +46,12 @@ #include "auxv.h" #include "exceptions.h" #include "gdb_bfd.h" @@ -300,7 +300,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* Link map info to include in an allocated so_list entry. */ -@@ -71,6 +73,16 @@ struct lm_info +@@ -70,6 +72,16 @@ struct lm_info /* Values read in from inferior's fields of the same name. */ CORE_ADDR l_ld, l_next, l_prev, l_name; @@ -317,7 +317,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c }; /* On SVR4 systems, a list of symbols in the dynamic linker where -@@ -107,6 +119,53 @@ static const char * const main_name_lis +@@ -106,6 +118,53 @@ static const char * const main_name_lis NULL }; @@ -371,7 +371,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* Per pspace SVR4 specific data. */ struct svr4_info -@@ -129,17 +188,58 @@ struct svr4_info +@@ -128,17 +187,58 @@ struct svr4_info CORE_ADDR interp_text_sect_high; CORE_ADDR interp_plt_sect_low; CORE_ADDR interp_plt_sect_high; @@ -430,7 +430,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c xfree (info); } -@@ -188,10 +288,21 @@ svr4_same_1 (const char *gdb_so_name, co +@@ -187,10 +287,21 @@ svr4_same_1 (const char *gdb_so_name, co return 0; } @@ -453,7 +453,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c } static struct lm_info * -@@ -322,18 +433,26 @@ lm_addr_check (struct so_list *so, bfd * +@@ -321,18 +432,26 @@ lm_addr_check (struct so_list *so, bfd * } else { @@ -492,7 +492,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c } } -@@ -775,16 +894,10 @@ locate_base (struct svr4_info *info) +@@ -774,16 +893,10 @@ locate_base (struct svr4_info *info) return info->debug_base; } @@ -510,8 +510,8 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c +r_map_from_debug_base (CORE_ADDR debug_base) { struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); - struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; -@@ -793,13 +906,27 @@ solib_svr4_r_map (struct svr4_info *info + struct type *ptr_type = builtin_type (target_gdbarch ())->builtin_data_ptr; +@@ -792,13 +905,27 @@ solib_svr4_r_map (struct svr4_info *info TRY_CATCH (ex, RETURN_MASK_ERROR) { @@ -540,7 +540,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* Find r_brk from the inferior's debug base. */ static CORE_ADDR -@@ -1164,15 +1291,17 @@ svr4_default_sos (void) +@@ -1163,15 +1290,17 @@ svr4_default_sos (void) return new; } @@ -565,7 +565,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c for (; lm != 0; prev_lm = lm, lm = next_lm) { -@@ -1189,7 +1318,7 @@ svr4_read_so_list (CORE_ADDR lm, struct +@@ -1188,7 +1317,7 @@ svr4_read_so_list (CORE_ADDR lm, struct if (new->lm_info == NULL) { do_cleanups (old_chain); @@ -574,16 +574,16 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c } next_lm = new->lm_info->l_next; -@@ -1200,7 +1329,7 @@ svr4_read_so_list (CORE_ADDR lm, struct - paddress (target_gdbarch, prev_lm), - paddress (target_gdbarch, new->lm_info->l_prev)); +@@ -1199,7 +1328,7 @@ svr4_read_so_list (CORE_ADDR lm, struct + paddress (target_gdbarch (), prev_lm), + paddress (target_gdbarch (), new->lm_info->l_prev)); do_cleanups (old_chain); - break; + return 0; } /* For SVR4 versions, the first entry in the link map is for the -@@ -1295,20 +1424,61 @@ svr4_read_so_list (CORE_ADDR lm, struct +@@ -1294,20 +1423,61 @@ svr4_read_so_list (CORE_ADDR lm, struct **link_ptr_ptr = new; *link_ptr_ptr = &new->next; } @@ -648,7 +648,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* Fall back to manual examination of the target if the packet is not supported or gdbserver failed to find DT_DEBUG. gdb.server/solib-list.exp -@@ -1331,6 +1501,10 @@ svr4_current_sos (void) +@@ -1330,6 +1500,10 @@ svr4_current_sos (void) info = get_svr4_info (); @@ -659,7 +659,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* Always locate the debug struct, in case it has moved. */ info->debug_base = 0; locate_base (info); -@@ -1340,35 +1514,12 @@ svr4_current_sos (void) +@@ -1339,35 +1513,12 @@ svr4_current_sos (void) if (! info->debug_base) return svr4_default_sos (); @@ -698,8 +698,8 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c } /* Get the address of the link_map for a given OBJFILE. */ -@@ -1450,6 +1601,498 @@ exec_entry_point (struct bfd *abfd, stru - targ); +@@ -1452,6 +1603,498 @@ exec_entry_point (struct bfd *abfd, stru + return gdbarch_addr_bits_remove (target_gdbarch (), addr); } +/* A probe and its associated information structure. */ @@ -1197,7 +1197,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* Helper function for gdb_bfd_lookup_symbol. */ static int -@@ -1502,6 +2145,9 @@ enable_break (struct svr4_info *info, in +@@ -1504,6 +2147,9 @@ enable_break (struct svr4_info *info, in info->interp_text_sect_low = info->interp_text_sect_high = 0; info->interp_plt_sect_low = info->interp_plt_sect_high = 0; @@ -1207,7 +1207,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* If we already have a shared library list in the target, and r_debug contains r_brk, set the breakpoint there - this should mean r_brk has already been relocated. Assume the dynamic linker -@@ -1533,7 +2179,7 @@ enable_break (struct svr4_info *info, in +@@ -1535,7 +2181,7 @@ enable_break (struct svr4_info *info, in That knowledge is encoded in the address, if it's Thumb the low bit is 1. However, we've stripped that info above and it's not clear what all the consequences are of passing a non-addr_bits_remove'd @@ -1216,44 +1216,44 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c find_pc_section verifies we know about the address and have some hope of computing the right kind of breakpoint to use (via symbol info). It does mean that GDB needs to be pointed at a -@@ -1571,7 +2217,7 @@ enable_break (struct svr4_info *info, in +@@ -1573,7 +2219,7 @@ enable_break (struct svr4_info *info, in + bfd_section_size (tmp_bfd, interp_sect); } -- create_solib_event_breakpoint (target_gdbarch, sym_addr); -+ svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr); +- create_solib_event_breakpoint (target_gdbarch (), sym_addr); ++ svr4_create_solib_event_breakpoints (target_gdbarch (), sym_addr); return 1; } } -@@ -1729,7 +2375,8 @@ enable_break (struct svr4_info *info, in +@@ -1731,7 +2377,8 @@ enable_break (struct svr4_info *info, in if (sym_addr != 0) { -- create_solib_event_breakpoint (target_gdbarch, load_addr + sym_addr); -+ svr4_create_solib_event_breakpoints (target_gdbarch, +- create_solib_event_breakpoint (target_gdbarch (), load_addr + sym_addr); ++ svr4_create_solib_event_breakpoints (target_gdbarch (), + load_addr + sym_addr); xfree (interp_name); return 1; } -@@ -1755,7 +2402,7 @@ enable_break (struct svr4_info *info, in - sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, +@@ -1757,7 +2404,7 @@ enable_break (struct svr4_info *info, in + sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), sym_addr, ¤t_target); -- create_solib_event_breakpoint (target_gdbarch, sym_addr); -+ svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr); +- create_solib_event_breakpoint (target_gdbarch (), sym_addr); ++ svr4_create_solib_event_breakpoints (target_gdbarch (), sym_addr); return 1; } } -@@ -1771,7 +2418,7 @@ enable_break (struct svr4_info *info, in - sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch, +@@ -1773,7 +2420,7 @@ enable_break (struct svr4_info *info, in + sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch (), sym_addr, ¤t_target); -- create_solib_event_breakpoint (target_gdbarch, sym_addr); -+ svr4_create_solib_event_breakpoints (target_gdbarch, sym_addr); +- create_solib_event_breakpoint (target_gdbarch (), sym_addr); ++ svr4_create_solib_event_breakpoints (target_gdbarch (), sym_addr); return 1; } } -@@ -2281,6 +2928,9 @@ svr4_solib_create_inferior_hook (int fro +@@ -2269,6 +2916,9 @@ svr4_solib_create_inferior_hook (int fro info = get_svr4_info (); @@ -1263,17 +1263,17 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c /* Relocate the main executable if necessary. */ svr4_relocate_main_executable (); -@@ -2547,4 +3197,6 @@ _initialize_svr4_solib (void) +@@ -2510,4 +3160,6 @@ _initialize_svr4_solib (void) svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol; svr4_so_ops.same = svr4_same; svr4_so_ops.keep_data_in_core = svr4_keep_data_in_core; + svr4_so_ops.handle_solib_event = svr4_handle_solib_event; + svr4_so_ops.update_breakpoints = svr4_update_solib_event_breakpoints; } -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen-solib.c +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-dlmopen-solib.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen-solib.c 2012-08-14 17:34:44.330746591 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-dlmopen-solib.c 2013-01-18 23:57:50.519792858 +0100 @@ -0,0 +1,24 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -1299,10 +1299,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen-solib.c + + return 0; +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen.c +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-dlmopen.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen.c 2012-08-14 17:34:44.339746576 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-dlmopen.c 2013-01-18 23:57:50.519792858 +0100 @@ -0,0 +1,58 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -1362,10 +1362,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen.c + + return 0; +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-dlmopen.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen.exp 2012-08-14 17:34:44.343746563 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-dlmopen.exp 2013-01-18 23:57:50.519792858 +0100 @@ -0,0 +1,125 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -1492,10 +1492,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-dlmopen.exp + gdb_test "c" {Breakpoint [0-9]+, .* in stop \(\)} + check_info_shared "info sharedlibrary #7" 0 +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-interp.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-interp.exp =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/testsuite/gdb.base/break-interp.exp 2012-06-21 22:46:21.000000000 +0200 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-interp.exp 2012-08-14 17:34:44.344746565 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.base/break-interp.exp 2013-01-18 23:57:14.782978485 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-interp.exp 2013-01-18 23:57:50.520792854 +0100 @@ -109,12 +109,19 @@ proc strip_debug {dest} { } } @@ -1591,10 +1591,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-interp.exp # Use two separate gdb_test_multiple statements to avoid timeouts due # to slow processing of wildcard capturing long output -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes-solib.c +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-probes-solib.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes-solib.c 2012-08-14 17:34:44.355746561 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-probes-solib.c 2013-01-18 23:57:50.520792854 +0100 @@ -0,0 +1,24 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -1620,10 +1620,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes-solib.c + + return 0; +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes.c +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-probes.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes.c 2012-08-14 17:34:44.362746561 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-probes.c 2013-01-18 23:57:50.520792854 +0100 @@ -0,0 +1,26 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -1651,10 +1651,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes.c + + return 0; +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-probes.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes.exp 2012-08-14 17:34:44.363746561 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-probes.exp 2013-01-18 23:57:50.520792854 +0100 @@ -0,0 +1,76 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -1732,10 +1732,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/break-probes.exp + # Call something to ensure that relocation occurred + gdb_test "call foo(23)" "foo 23.*\\\$.* = .*" +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared-solib1.c +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared-solib1.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared-solib1.c 2012-08-14 17:34:44.365746561 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared-solib1.c 2013-01-18 23:57:50.520792854 +0100 @@ -0,0 +1,24 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -1761,10 +1761,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared-solib1.c + + return 0; +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared-solib2.c +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared-solib2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared-solib2.c 2012-08-14 17:34:44.365746561 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared-solib2.c 2013-01-18 23:57:50.520792854 +0100 @@ -0,0 +1,24 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -1790,10 +1790,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared-solib2.c + + return 0; +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared.c +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared.c 2012-08-14 17:34:44.366746561 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared.c 2013-01-18 23:57:50.520792854 +0100 @@ -0,0 +1,48 @@ +/* Copyright 2012 Free Software Foundation, Inc. + @@ -1843,10 +1843,10 @@ Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared.c + + return 0; +} -Index: gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120814/gdb/testsuite/gdb.base/info-shared.exp 2012-08-14 17:34:44.367746561 +0200 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/info-shared.exp 2013-01-18 23:57:50.521792850 +0100 @@ -0,0 +1,139 @@ +# Copyright 2012 Free Software Foundation, Inc. + diff --git a/gdb-dlopen-stap-probe-7of7.patch b/gdb-dlopen-stap-probe-7of7.patch index 074db24..8f2b419 100644 --- a/gdb-dlopen-stap-probe-7of7.patch +++ b/gdb-dlopen-stap-probe-7of7.patch @@ -13,13 +13,13 @@ * solib-svr4.c (svr4_handle_solib_event): Inhibit section map updates for calls to evaluate_probe_argument. -Index: gdb-7.4.91.20120814/gdb/objfiles.h +Index: gdb-7.5.50.20130118/gdb/objfiles.h =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/objfiles.h 2012-08-14 17:16:54.000000000 +0200 -+++ gdb-7.4.91.20120814/gdb/objfiles.h 2012-08-14 17:20:55.913174609 +0200 -@@ -526,6 +526,22 @@ extern void set_objfile_data (struct obj - extern void *objfile_data (struct objfile *objfile, - const struct objfile_data *data); +--- gdb-7.5.50.20130118.orig/gdb/objfiles.h 2013-01-18 23:18:16.862315673 +0100 ++++ gdb-7.5.50.20130118/gdb/objfiles.h 2013-01-18 23:18:36.702343482 +0100 +@@ -508,6 +508,22 @@ extern int in_plt_section (CORE_ADDR, ch + modules. */ + DECLARE_REGISTRY(objfile); +/* In normal use, the section map will be rebuilt by FIND_PC_SECTION + if objfiles have been added, removed or relocated since it was last @@ -40,11 +40,11 @@ Index: gdb-7.4.91.20120814/gdb/objfiles.h extern void default_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, -Index: gdb-7.4.91.20120814/gdb/objfiles.c +Index: gdb-7.5.50.20130118/gdb/objfiles.c =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/objfiles.c 2012-08-14 17:16:55.000000000 +0200 -+++ gdb-7.4.91.20120814/gdb/objfiles.c 2012-08-14 17:20:55.915174609 +0200 -@@ -70,6 +70,9 @@ struct objfile_pspace_info +--- gdb-7.5.50.20130118.orig/gdb/objfiles.c 2013-01-18 23:18:13.647311006 +0100 ++++ gdb-7.5.50.20130118/gdb/objfiles.c 2013-01-18 23:18:16.862315673 +0100 +@@ -69,6 +69,9 @@ struct objfile_pspace_info int objfiles_changed_p; struct obj_section **sections; int num_sections; @@ -54,7 +54,7 @@ Index: gdb-7.4.91.20120814/gdb/objfiles.c }; /* Per-program-space data key. */ -@@ -1295,7 +1298,7 @@ find_pc_section (CORE_ADDR pc) +@@ -1356,7 +1359,7 @@ find_pc_section (CORE_ADDR pc) return s; pspace_info = get_objfile_pspace_data (current_program_space); @@ -63,7 +63,7 @@ Index: gdb-7.4.91.20120814/gdb/objfiles.c { update_section_map (current_program_space, &pspace_info->sections, -@@ -1463,6 +1466,30 @@ objfiles_changed (void) +@@ -1415,6 +1418,30 @@ objfiles_changed (void) get_objfile_pspace_data (current_program_space)->objfiles_changed_p = 1; } @@ -94,11 +94,11 @@ Index: gdb-7.4.91.20120814/gdb/objfiles.c /* The default implementation for the "iterate_over_objfiles_in_search_order" gdbarch method. It is equivalent to use the ALL_OBJFILES macro, searching the objfiles in the order they are stored internally, -Index: gdb-7.4.91.20120814/gdb/solib-svr4.c +Index: gdb-7.5.50.20130118/gdb/solib-svr4.c =================================================================== ---- gdb-7.4.91.20120814.orig/gdb/solib-svr4.c 2012-08-14 17:20:42.000000000 +0200 -+++ gdb-7.4.91.20120814/gdb/solib-svr4.c 2012-08-14 17:21:14.090169216 +0200 -@@ -1847,6 +1847,7 @@ svr4_handle_solib_event (bpstat bs) +--- gdb-7.5.50.20130118.orig/gdb/solib-svr4.c 2013-01-18 23:18:13.649311010 +0100 ++++ gdb-7.5.50.20130118/gdb/solib-svr4.c 2013-01-18 23:18:16.863315675 +0100 +@@ -1849,6 +1849,7 @@ svr4_handle_solib_event (bpstat bs) struct svr4_info *info = get_svr4_info (); struct probe_and_info buf, *pi = &buf; enum probe_action action; @@ -106,7 +106,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c struct value *val; LONGEST lmid; CORE_ADDR debug_base, lm = 0; -@@ -1870,6 +1871,19 @@ svr4_handle_solib_event (bpstat bs) +@@ -1872,6 +1873,19 @@ svr4_handle_solib_event (bpstat bs) if (action == NAMESPACE_NO_ACTION) return; @@ -126,7 +126,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c val = evaluate_probe_argument (pi->probe, 0); if (val == NULL) goto error; -@@ -1901,6 +1915,9 @@ svr4_handle_solib_event (bpstat bs) +@@ -1903,6 +1917,9 @@ svr4_handle_solib_event (bpstat bs) action = NAMESPACE_RELOAD; } @@ -136,7 +136,7 @@ Index: gdb-7.4.91.20120814/gdb/solib-svr4.c if (action == NAMESPACE_UPDATE_OR_RELOAD) { if (namespace_update_incremental (info, lmid, lm, is_initial_ns)) -@@ -1923,6 +1940,8 @@ svr4_handle_solib_event (bpstat bs) +@@ -1925,6 +1942,8 @@ svr4_handle_solib_event (bpstat bs) warning (_("Probes-based dynamic linker interface failed.\n" "Reverting to original interface.\n")); diff --git a/gdb-entryval-inlined.patch b/gdb-entryval-inlined.patch deleted file mode 100644 index 3cbe84b..0000000 --- a/gdb-entryval-inlined.patch +++ /dev/null @@ -1,888 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2012-10/msg00095.html -Subject: [patch] entry values: Fix resolving in inlined frames - -Hi, - -Breakpoint 1, fn2 (y=, x=6) at gdb.arch/amd64-entry-value-inline.c:32 -32 y = -2 + x; /* break-here */ -(gdb) info addr y -(gdb) bt -#0 fn2 (y=, x=6) at gdb.arch/amd64-entry-value-inline.c:32 -#1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42 -#2 0x00000000004004af in main () at gdb.arch/amd64-entry-value-inline.c:48 -(gdb) info frame -Stack level 0, frame at 0x7fffffffdb68: - rip = 0x4005bc in fn2 (gdb.arch/amd64-entry-value-inline.c:32); saved rip 0x4004af - inlined into frame 1 -[...] -(gdb) set debug entry-values 1 -(gdb) p y -DW_OP_GNU_entry_value resolving expects callee fn1 at 0x4005a0 but the called frame is for fn3 at 0x4005b0 - -FAIL: ------ -$1 = -PASS: ------ -$1 = 25 - -(gdb) p/x $pc -$2 = 0x4005bc -(gdb) up -#1 fn3 (x=x@entry=6, y=y@entry=25) at gdb.arch/amd64-entry-value-inline.c:42 -(gdb) p/x $pc -$3 = 0x4005bc - -The problem is that DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value binding -exists between DW_TAG_subprogram, nor DW_TAG_inlined_subroutine as described -by Jakub Jelinek. This makes sense, when we look at DW_TAG_GNU_call_site and -we just unwind the current inlined frame we get the same PC - this is no new -information. - -TAILCALL_FRAME is a different case, while also an artificial frame the -sequence cannot be determined at compile time and the binding -DW_TAG_GNU_call_site <-> DW_OP_GNU_entry_value exists also for -TAILCALL_FRAMEs. - -I will check it in. - -No regressions on {x86_64,x86_64-m32,i686}-fedora18-linux-gnu. - - -Thanks, -Jan - - -gdb/ -2012-10-05 Jan Kratochvil - - Fix entry values resolving in inlined frames. - * dwarf2loc.c (dwarf_expr_reg_to_entry_parameter): Move func_addr, - gdbarch and caller_frame initialization later. Skip INLINE_FRAME - entries of FRAME. - -gdb/testsuite/ -2012-10-05 Jan Kratochvil - - Fix entry values resolving in inlined frames. - * gdb.arch/amd64-entry-value-inline.S: New file. - * gdb.arch/amd64-entry-value-inline.c: New file. - * gdb.arch/amd64-entry-value-inline.exp: New file. - -diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index e8d39fe..0bdc042 100644 ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -980,16 +980,27 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame, - union call_site_parameter_u kind_u, - struct dwarf2_per_cu_data **per_cu_return) - { -- CORE_ADDR func_addr = get_frame_func (frame); -- CORE_ADDR caller_pc; -- struct gdbarch *gdbarch = get_frame_arch (frame); -- struct frame_info *caller_frame = get_prev_frame (frame); -+ CORE_ADDR func_addr, caller_pc; -+ struct gdbarch *gdbarch; -+ struct frame_info *caller_frame; - struct call_site *call_site; - int iparams; - /* Initialize it just to avoid a GCC false warning. */ - struct call_site_parameter *parameter = NULL; - CORE_ADDR target_addr; - -+ /* Skip any inlined frames, entry value call sites work between real -+ functions. They do not make sense between inline functions as even PC -+ does not change there. */ -+ while (get_frame_type (frame) == INLINE_FRAME) -+ { -+ frame = get_prev_frame (frame); -+ gdb_assert (frame != NULL); -+ } -+ -+ func_addr = get_frame_func (frame); -+ gdbarch = get_frame_arch (frame); -+ caller_frame = get_prev_frame (frame); - if (gdbarch != frame_unwind_arch (frame)) - { - struct minimal_symbol *msym = lookup_minimal_symbol_by_pc (func_addr); -diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S -new file mode 100644 -index 0000000..5f353f5 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S -@@ -0,0 +1,672 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* This file is compiled from gdb.arch/amd64-entry-value-inline.c -+ using -g -dA -S -O2. */ -+ -+ .file "amd64-entry-value-inline.c" -+ .text -+.Ltext0: -+ .p2align 4,,15 -+ .type fn1, @function -+fn1: -+.LFB0: -+ .file 1 "gdb.arch/amd64-entry-value-inline.c" -+ # gdb.arch/amd64-entry-value-inline.c:22 -+ .loc 1 22 0 -+ .cfi_startproc -+.LVL0: -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (FALLTHRU) -+ # gdb.arch/amd64-entry-value-inline.c:23 -+ .loc 1 23 0 -+ movl v(%rip), %eax -+ addl $1, %eax -+ movl %eax, v(%rip) -+# SUCC: EXIT [100.0%] -+ ret -+ .cfi_endproc -+.LFE0: -+ .size fn1, .-fn1 -+ .p2align 4,,15 -+ .globl fn3 -+ .type fn3, @function -+fn3: -+.LFB2: -+ # gdb.arch/amd64-entry-value-inline.c:41 -+ .loc 1 41 0 -+ .cfi_startproc -+.LVL1: -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (FALLTHRU) -+.LBB4: -+.LBB5: -+ # gdb.arch/amd64-entry-value-inline.c:29 -+ .loc 1 29 0 -+ testl %esi, %esi -+.LBE5: -+.LBE4: -+ # gdb.arch/amd64-entry-value-inline.c:41 -+ .loc 1 41 0 -+ pushq %rbx -+ .cfi_def_cfa_offset 16 -+ .cfi_offset 3, -16 -+ # gdb.arch/amd64-entry-value-inline.c:41 -+ .loc 1 41 0 -+ movl %edi, %ebx -+.LBB7: -+.LBB6: -+# SUCC: 3 [39.0%] (FALLTHRU,CAN_FALLTHRU) 4 [61.0%] (CAN_FALLTHRU) -+ # gdb.arch/amd64-entry-value-inline.c:29 -+ .loc 1 29 0 -+ je .L3 -+# BLOCK 3 freq:3898 seq:1 -+# PRED: 2 [39.0%] (FALLTHRU,CAN_FALLTHRU) -+ # gdb.arch/amd64-entry-value-inline.c:31 -+ .loc 1 31 0 -+ call fn1 -+.LVL2: -+ # gdb.arch/amd64-entry-value-inline.c:32 -+ .loc 1 32 0 -+ leal -2(%rbx), %eax -+.LVL3: -+ # gdb.arch/amd64-entry-value-inline.c:33 -+ .loc 1 33 0 -+ movl %eax, %edi -+ imull %eax, %edi -+ addl $1, %edi -+.LVL4: -+ imull %edi, %eax -+.LVL5: -+ # gdb.arch/amd64-entry-value-inline.c:34 -+ .loc 1 34 0 -+ leal (%rbx,%rax), %edi -+ call fn1 -+.LVL6: -+# SUCC: 4 [100.0%] (FALLTHRU,CAN_FALLTHRU) -+# BLOCK 4 freq:10000 seq:2 -+# PRED: 2 [61.0%] (CAN_FALLTHRU) 3 [100.0%] (FALLTHRU,CAN_FALLTHRU) -+.L3: -+.LBE6: -+.LBE7: -+ # gdb.arch/amd64-entry-value-inline.c:43 -+ .loc 1 43 0 -+ movl %ebx, %eax -+ popq %rbx -+ .cfi_def_cfa_offset 8 -+.LVL7: -+# SUCC: EXIT [100.0%] -+ ret -+ .cfi_endproc -+.LFE2: -+ .size fn3, .-fn3 -+ .section .text.startup,"ax",@progbits -+ .p2align 4,,15 -+ .globl main -+ .type main, @function -+main: -+.LFB3: -+ # gdb.arch/amd64-entry-value-inline.c:47 -+ .loc 1 47 0 -+ .cfi_startproc -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (FALLTHRU) -+ # gdb.arch/amd64-entry-value-inline.c:48 -+ .loc 1 48 0 -+ movl $25, %esi -+ movl $6, %edi -+ call fn3 -+.LVL8: -+ # gdb.arch/amd64-entry-value-inline.c:50 -+ .loc 1 50 0 -+ xorl %eax, %eax -+# SUCC: EXIT [100.0%] -+ ret -+ .cfi_endproc -+.LFE3: -+ .size main, .-main -+ .local v -+ .comm v,4,4 -+ .text -+.Letext0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .long 0x164 # Length of Compilation Unit Info -+ .value 0x4 # DWARF version number -+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section -+ .byte 0x8 # Pointer Size (in bytes) -+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) -+ .long .LASF0 # DW_AT_producer: "GNU C 4.8.0 20121005 (experimental) -mtune=generic -march=x86-64 -g -O2" -+ .byte 0x1 # DW_AT_language -+ .long .LASF1 # DW_AT_name: "gdb.arch/amd64-entry-value-inline.c" -+ .long .LASF2 # DW_AT_comp_dir: "" -+ .long .Ldebug_ranges0+0x30 # DW_AT_ranges -+ .quad 0 # DW_AT_low_pc -+ .long .Ldebug_line0 # DW_AT_stmt_list -+ .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram) -+ .ascii "fn1\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x15 # DW_AT_decl_line -+ # DW_AT_prototyped -+ .quad .LFB0 # DW_AT_low_pc -+ .quad .LFE0-.LFB0 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ # DW_AT_GNU_all_call_sites -+ .long 0x52 # DW_AT_sibling -+ .uleb128 0x3 # (DIE (0x46) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x15 # DW_AT_decl_line -+ .long 0x52 # DW_AT_type -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0 # end of children of DIE 0x29 -+ .uleb128 0x4 # (DIE (0x52) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .ascii "int\0" # DW_AT_name -+ .uleb128 0x5 # (DIE (0x59) DW_TAG_subprogram) -+ .ascii "fn2\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x1b # DW_AT_decl_line -+ # DW_AT_prototyped -+ .long 0x52 # DW_AT_type -+ .byte 0x1 # DW_AT_inline -+ .long 0x7c # DW_AT_sibling -+ .uleb128 0x6 # (DIE (0x69) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x1b # DW_AT_decl_line -+ .long 0x52 # DW_AT_type -+ .uleb128 0x6 # (DIE (0x72) DW_TAG_formal_parameter) -+ .ascii "y\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x1b # DW_AT_decl_line -+ .long 0x52 # DW_AT_type -+ .byte 0 # end of children of DIE 0x59 -+ .uleb128 0x7 # (DIE (0x7c) DW_TAG_subprogram) -+ # DW_AT_external -+ .ascii "fn3\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x28 # DW_AT_decl_line -+ # DW_AT_prototyped -+ .long 0x52 # DW_AT_type -+ .quad .LFB2 # DW_AT_low_pc -+ .quad .LFE2-.LFB2 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ # DW_AT_GNU_all_call_sites -+ .long 0x115 # DW_AT_sibling -+ .uleb128 0x8 # (DIE (0x9d) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x28 # DW_AT_decl_line -+ .long 0x52 # DW_AT_type -+ .long .LLST0 # DW_AT_location -+ .uleb128 0x8 # (DIE (0xaa) DW_TAG_formal_parameter) -+ .ascii "y\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x28 # DW_AT_decl_line -+ .long 0x52 # DW_AT_type -+ .long .LLST1 # DW_AT_location -+ .uleb128 0x9 # (DIE (0xb7) DW_TAG_inlined_subroutine) -+ .long 0x59 # DW_AT_abstract_origin -+ .quad .LBB4 # DW_AT_entry_pc -+ .long .Ldebug_ranges0+0 # DW_AT_ranges -+ .byte 0x1 # DW_AT_call_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x2a # DW_AT_call_line -+ .uleb128 0xa # (DIE (0xca) DW_TAG_formal_parameter) -+ .long 0x72 # DW_AT_abstract_origin -+ .long .LLST2 # DW_AT_location -+ .uleb128 0xa # (DIE (0xd3) DW_TAG_formal_parameter) -+ .long 0x69 # DW_AT_abstract_origin -+ .long .LLST0 # DW_AT_location -+ .uleb128 0xb # (DIE (0xdc) DW_TAG_GNU_call_site) -+ .quad .LVL2 # DW_AT_low_pc -+ .long 0x29 # DW_AT_abstract_origin -+ .long 0xf4 # DW_AT_sibling -+ .uleb128 0xc # (DIE (0xed) DW_TAG_GNU_call_site_parameter) -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .uleb128 0x2 # DW_AT_GNU_call_site_value -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 0 -+ .byte 0 # end of children of DIE 0xdc -+ .uleb128 0xd # (DIE (0xf4) DW_TAG_GNU_call_site) -+ .quad .LVL6 # DW_AT_low_pc -+ .long 0x29 # DW_AT_abstract_origin -+ .uleb128 0xc # (DIE (0x101) DW_TAG_GNU_call_site_parameter) -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .uleb128 0xd # DW_AT_GNU_call_site_value -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 -2 -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 -2 -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 -2 -+ .byte 0x1e # DW_OP_mul -+ .byte 0x23 # DW_OP_plus_uconst -+ .uleb128 0x1 -+ .byte 0x1e # DW_OP_mul -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 0 -+ .byte 0x22 # DW_OP_plus -+ .byte 0 # end of children of DIE 0xf4 -+ .byte 0 # end of children of DIE 0xb7 -+ .byte 0 # end of children of DIE 0x7c -+ .uleb128 0xe # (DIE (0x115) DW_TAG_subprogram) -+ # DW_AT_external -+ .long .LASF3 # DW_AT_name: "main" -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x2e # DW_AT_decl_line -+ .long 0x52 # DW_AT_type -+ .quad .LFB3 # DW_AT_low_pc -+ .quad .LFE3-.LFB3 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ # DW_AT_GNU_all_call_sites -+ .long 0x14f # DW_AT_sibling -+ .uleb128 0xd # (DIE (0x136) DW_TAG_GNU_call_site) -+ .quad .LVL8 # DW_AT_low_pc -+ .long 0x7c # DW_AT_abstract_origin -+ .uleb128 0xc # (DIE (0x143) DW_TAG_GNU_call_site_parameter) -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .uleb128 0x1 # DW_AT_GNU_call_site_value -+ .byte 0x36 # DW_OP_lit6 -+ .uleb128 0xc # (DIE (0x148) DW_TAG_GNU_call_site_parameter) -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x54 # DW_OP_reg4 -+ .uleb128 0x1 # DW_AT_GNU_call_site_value -+ .byte 0x49 # DW_OP_lit25 -+ .byte 0 # end of children of DIE 0x136 -+ .byte 0 # end of children of DIE 0x115 -+ .uleb128 0xf # (DIE (0x14f) DW_TAG_variable) -+ .ascii "v\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-entry-value-inline.c) -+ .byte 0x12 # DW_AT_decl_line -+ .long 0x162 # DW_AT_type -+ .uleb128 0x9 # DW_AT_location -+ .byte 0x3 # DW_OP_addr -+ .quad v -+ .uleb128 0x10 # (DIE (0x162) DW_TAG_volatile_type) -+ .long 0x52 # DW_AT_type -+ .byte 0 # end of children of DIE 0xb -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .uleb128 0x1 # (abbrev code) -+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x25 # (DW_AT_producer) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x13 # (DW_AT_language) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x1b # (DW_AT_comp_dir) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x55 # (DW_AT_ranges) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x10 # (DW_AT_stmt_list) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x2 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x3 # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x4 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x5 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x20 # (DW_AT_inline) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x6 # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x7 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x8 # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x9 # (abbrev code) -+ .uleb128 0x1d # (TAG: DW_TAG_inlined_subroutine) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x52 # (DW_AT_entry_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x55 # (DW_AT_ranges) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .uleb128 0x58 # (DW_AT_call_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x59 # (DW_AT_call_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xa # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xb # (abbrev code) -+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xc # (abbrev code) -+ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2111 # (DW_AT_GNU_call_site_value) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xd # (abbrev code) -+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xe # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xf # (abbrev code) -+ .uleb128 0x34 # (TAG: DW_TAG_variable) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x10 # (abbrev code) -+ .uleb128 0x35 # (TAG: DW_TAG_volatile_type) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .byte 0 -+ .section .debug_loc,"",@progbits -+.Ldebug_loc0: -+.LLST0: -+ .quad .LVL1 # Location list begin address (*.LLST0) -+ .quad .LVL2-1 # Location list end address (*.LLST0) -+ .value 0x1 # Location expression size -+ .byte 0x55 # DW_OP_reg5 -+ .quad .LVL2-1 # Location list begin address (*.LLST0) -+ .quad .LVL7 # Location list end address (*.LLST0) -+ .value 0x1 # Location expression size -+ .byte 0x53 # DW_OP_reg3 -+ .quad .LVL7 # Location list begin address (*.LLST0) -+ .quad .LFE2 # Location list end address (*.LLST0) -+ .value 0x1 # Location expression size -+ .byte 0x50 # DW_OP_reg0 -+ .quad 0 # Location list terminator begin (*.LLST0) -+ .quad 0 # Location list terminator end (*.LLST0) -+.LLST1: -+ .quad .LVL1 # Location list begin address (*.LLST1) -+ .quad .LVL2-1 # Location list end address (*.LLST1) -+ .value 0x1 # Location expression size -+ .byte 0x54 # DW_OP_reg4 -+ .quad .LVL2-1 # Location list begin address (*.LLST1) -+ .quad .LFE2 # Location list end address (*.LLST1) -+ .value 0x4 # Location expression size -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x54 # DW_OP_reg4 -+ .byte 0x9f # DW_OP_stack_value -+ .quad 0 # Location list terminator begin (*.LLST1) -+ .quad 0 # Location list terminator end (*.LLST1) -+.LLST2: -+ .quad .LVL1 # Location list begin address (*.LLST2) -+ .quad .LVL2-1 # Location list end address (*.LLST2) -+ .value 0x1 # Location expression size -+ .byte 0x54 # DW_OP_reg4 -+ .quad .LVL2-1 # Location list begin address (*.LLST2) -+ .quad .LVL3 # Location list end address (*.LLST2) -+ .value 0x4 # Location expression size -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x54 # DW_OP_reg4 -+ .byte 0x9f # DW_OP_stack_value -+ .quad .LVL3 # Location list begin address (*.LLST2) -+ .quad .LVL4 # Location list end address (*.LLST2) -+ .value 0x1 # Location expression size -+ .byte 0x50 # DW_OP_reg0 -+ .quad .LVL4 # Location list begin address (*.LLST2) -+ .quad .LVL5 # Location list end address (*.LLST2) -+ .value 0x6 # Location expression size -+ .byte 0x70 # DW_OP_breg0 -+ .sleb128 0 -+ .byte 0x75 # DW_OP_breg5 -+ .sleb128 0 -+ .byte 0x1e # DW_OP_mul -+ .byte 0x9f # DW_OP_stack_value -+ .quad .LVL5 # Location list begin address (*.LLST2) -+ .quad .LVL6-1 # Location list end address (*.LLST2) -+ .value 0x1 # Location expression size -+ .byte 0x50 # DW_OP_reg0 -+ .quad .LVL6-1 # Location list begin address (*.LLST2) -+ .quad .LVL6 # Location list end address (*.LLST2) -+ .value 0xb # Location expression size -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 -2 -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 -2 -+ .byte 0x73 # DW_OP_breg3 -+ .sleb128 -2 -+ .byte 0x1e # DW_OP_mul -+ .byte 0x23 # DW_OP_plus_uconst -+ .uleb128 0x1 -+ .byte 0x1e # DW_OP_mul -+ .byte 0x9f # DW_OP_stack_value -+ .quad 0 # Location list terminator begin (*.LLST2) -+ .quad 0 # Location list terminator end (*.LLST2) -+ .section .debug_aranges,"",@progbits -+ .long 0x3c # Length of Address Ranges Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .byte 0x8 # Size of Address -+ .byte 0 # Size of Segment Descriptor -+ .value 0 # Pad to 16 byte boundary -+ .value 0 -+ .quad .Ltext0 # Address -+ .quad .Letext0-.Ltext0 # Length -+ .quad .LFB3 # Address -+ .quad .LFE3-.LFB3 # Length -+ .quad 0 -+ .quad 0 -+ .section .debug_ranges,"",@progbits -+.Ldebug_ranges0: -+ .quad .LBB4 # Offset 0 -+ .quad .LBE4 -+ .quad .LBB7 -+ .quad .LBE7 -+ .quad 0 -+ .quad 0 -+ .quad .Ltext0 # Offset 0x30 -+ .quad .Letext0 -+ .quad .LFB3 # Offset 0x40 -+ .quad .LFE3 -+ .quad 0 -+ .quad 0 -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .section .debug_str,"MS",@progbits,1 -+.LASF0: -+ .string "GNU C 4.8.0 20121005+patches (experimental) -mtune=generic -march=x86-64 -g -O2" -+.LASF1: -+ .string "gdb.arch/amd64-entry-value-inline.c" -+.LASF2: -+ .string "" -+.LASF3: -+ .string "main" -+ .ident "GCC: (GNU) 4.8.0 20121005 (experimental)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c -new file mode 100644 -index 0000000..f7fefb8 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.c -@@ -0,0 +1,50 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+static volatile int v; -+ -+static __attribute__((noinline, noclone)) void -+fn1 (int x) -+{ -+ v++; -+} -+ -+static int -+fn2 (int x, int y) -+{ -+ if (y) -+ { -+ fn1 (x); -+ y = -2 + x; /* break-here */ -+ y = y * y * y + y; -+ fn1 (x + y); -+ } -+ return x; -+} -+ -+__attribute__((noinline, noclone)) int -+fn3 (int x, int y) -+{ -+ return fn2 (x, y); -+} -+ -+int -+main () -+{ -+ fn3 (6, 25); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp -new file mode 100644 -index 0000000..6aa92c1 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.exp -@@ -0,0 +1,40 @@ -+# Copyright (C) 2012 Free Software Foundation, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set opts {} -+standard_testfile .S -+ -+if [info exists COMPILE] { -+ # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-inline.exp COMPILE=1" -+ standard_testfile -+ lappend opts debug optimize=-O2 -+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } { -+ verbose "Skipping ${testfile}." -+ return -+} -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } { -+ return -1 -+} -+ -+if ![runto_main] { -+ return -1 -+} -+ -+set srcfile $testfile.c -+gdb_breakpoint [gdb_get_line_number "break-here"] -+ -+gdb_continue_to_breakpoint "break-here" ".* break-here .*" -+gdb_test "p y" " = 25" - diff --git a/gdb-fortran-common-reduce.patch b/gdb-fortran-common-reduce.patch deleted file mode 100644 index 238b355..0000000 --- a/gdb-fortran-common-reduce.patch +++ /dev/null @@ -1,508 +0,0 @@ -Index: gdb-7.4.50.20120602/gdb/f-lang.c -=================================================================== ---- gdb-7.4.50.20120602.orig/gdb/f-lang.c 2012-03-02 20:29:00.000000000 +0100 -+++ gdb-7.4.50.20120602/gdb/f-lang.c 2012-06-02 19:13:31.520050654 +0200 -@@ -59,20 +59,6 @@ typedef struct saved_bf_symnum SAVED_BF, - /* Local functions */ - - extern void _initialize_f_language (void); --#if 0 --static void clear_function_list (void); --static long get_bf_for_fcn (long); --static void clear_bf_list (void); --static void patch_all_commons_by_name (char *, CORE_ADDR, int); --static SAVED_F77_COMMON_PTR find_first_common_named (char *); --static void add_common_entry (struct symbol *); --static void add_common_block (char *, CORE_ADDR, int, char *); --static SAVED_FUNCTION *allocate_saved_function_node (void); --static SAVED_BF_PTR allocate_saved_bf_node (void); --static COMMON_ENTRY_PTR allocate_common_entry_node (void); --static SAVED_F77_COMMON_PTR allocate_saved_f77_common_node (void); --static void patch_common_entries (SAVED_F77_COMMON_PTR, CORE_ADDR, int); --#endif - - static void f_printchar (int c, struct type *type, struct ui_file * stream); - static void f_emit_char (int c, struct type *type, -@@ -385,185 +371,7 @@ _initialize_f_language (void) - add_language (&f_language_defn); - } - --#if 0 --static SAVED_BF_PTR --allocate_saved_bf_node (void) --{ -- SAVED_BF_PTR new; -- -- new = (SAVED_BF_PTR) xmalloc (sizeof (SAVED_BF)); -- return (new); --} -- --static SAVED_FUNCTION * --allocate_saved_function_node (void) --{ -- SAVED_FUNCTION *new; -- -- new = (SAVED_FUNCTION *) xmalloc (sizeof (SAVED_FUNCTION)); -- return (new); --} -- --static SAVED_F77_COMMON_PTR --allocate_saved_f77_common_node (void) --{ -- SAVED_F77_COMMON_PTR new; -- -- new = (SAVED_F77_COMMON_PTR) xmalloc (sizeof (SAVED_F77_COMMON)); -- return (new); --} -- --static COMMON_ENTRY_PTR --allocate_common_entry_node (void) --{ -- COMMON_ENTRY_PTR new; -- -- new = (COMMON_ENTRY_PTR) xmalloc (sizeof (COMMON_ENTRY)); -- return (new); --} --#endif -- - SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON */ --SAVED_F77_COMMON_PTR tail_common_list = NULL; /* Ptr to last saved COMMON */ --SAVED_F77_COMMON_PTR current_common = NULL; /* Ptr to current COMMON */ -- --#if 0 --static SAVED_BF_PTR saved_bf_list = NULL; /* Ptr to (.bf,function) -- list */ --static SAVED_BF_PTR saved_bf_list_end = NULL; /* Ptr to above list's end */ --static SAVED_BF_PTR current_head_bf_list = NULL; /* Current head of -- above list. */ -- --static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use -- in macros. */ -- --/* The following function simply enters a given common block onto -- the global common block chain. */ -- --static void --add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab) --{ -- SAVED_F77_COMMON_PTR tmp; -- char *c, *local_copy_func_stab; -- -- /* If the COMMON block we are trying to add has a blank -- name (i.e. "#BLNK_COM") then we set it to __BLANK -- because the darn "#" character makes GDB's input -- parser have fits. */ -- -- -- if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0 -- || strcmp (name, BLANK_COMMON_NAME_MF77) == 0) -- { -- -- xfree (name); -- name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1); -- strcpy (name, BLANK_COMMON_NAME_LOCAL); -- } -- -- tmp = allocate_saved_f77_common_node (); -- -- local_copy_func_stab = xmalloc (strlen (func_stab) + 1); -- strcpy (local_copy_func_stab, func_stab); -- -- tmp->name = xmalloc (strlen (name) + 1); -- -- /* local_copy_func_stab is a stabstring, let us first extract the -- function name from the stab by NULLing out the ':' character. */ -- -- -- c = NULL; -- c = strchr (local_copy_func_stab, ':'); -- -- if (c) -- *c = '\0'; -- else -- error (_("Malformed function STAB found in add_common_block()")); -- -- -- tmp->owning_function = xmalloc (strlen (local_copy_func_stab) + 1); -- -- strcpy (tmp->owning_function, local_copy_func_stab); -- -- strcpy (tmp->name, name); -- tmp->offset = offset; -- tmp->next = NULL; -- tmp->entries = NULL; -- tmp->secnum = secnum; -- -- current_common = tmp; -- -- if (head_common_list == NULL) -- { -- head_common_list = tail_common_list = tmp; -- } -- else -- { -- tail_common_list->next = tmp; -- tail_common_list = tmp; -- } --} --#endif -- --/* The following function simply enters a given common entry onto -- the "current_common" block that has been saved away. */ -- --#if 0 --static void --add_common_entry (struct symbol *entry_sym_ptr) --{ -- COMMON_ENTRY_PTR tmp; -- -- -- -- /* The order of this list is important, since -- we expect the entries to appear in decl. -- order when we later issue "info common" calls. */ -- -- tmp = allocate_common_entry_node (); -- -- tmp->next = NULL; -- tmp->symbol = entry_sym_ptr; -- -- if (current_common == NULL) -- error (_("Attempt to add COMMON entry with no block open!")); -- else -- { -- if (current_common->entries == NULL) -- { -- current_common->entries = tmp; -- current_common->end_of_entries = tmp; -- } -- else -- { -- current_common->end_of_entries->next = tmp; -- current_common->end_of_entries = tmp; -- } -- } --} --#endif -- --/* This routine finds the first encountred COMMON block named "name". */ -- --#if 0 --static SAVED_F77_COMMON_PTR --find_first_common_named (char *name) --{ -- -- SAVED_F77_COMMON_PTR tmp; -- -- tmp = head_common_list; -- -- while (tmp != NULL) -- { -- if (strcmp (tmp->name, name) == 0) -- return (tmp); -- else -- tmp = tmp->next; -- } -- return (NULL); --} --#endif - - /* This routine finds the first encountred COMMON block named "name" - that belongs to function funcname. */ -@@ -586,193 +394,3 @@ find_common_for_function (const char *na - } - return (NULL); - } -- -- --#if 0 -- --/* The following function is called to patch up the offsets -- for the statics contained in the COMMON block named -- "name." */ -- --static void --patch_common_entries (SAVED_F77_COMMON_PTR blk, CORE_ADDR offset, int secnum) --{ -- COMMON_ENTRY_PTR entry; -- -- blk->offset = offset; /* Keep this around for future use. */ -- -- entry = blk->entries; -- -- while (entry != NULL) -- { -- SYMBOL_VALUE (entry->symbol) += offset; -- SYMBOL_SECTION (entry->symbol) = secnum; -- -- entry = entry->next; -- } -- blk->secnum = secnum; --} -- --/* Patch all commons named "name" that need patching.Since COMMON -- blocks occur with relative infrequency, we simply do a linear scan on -- the name. Eventually, the best way to do this will be a -- hashed-lookup. Secnum is the section number for the .bss section -- (which is where common data lives). */ -- --static void --patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum) --{ -- -- SAVED_F77_COMMON_PTR tmp; -- -- /* For blank common blocks, change the canonical reprsentation -- of a blank name */ -- -- if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0 -- || strcmp (name, BLANK_COMMON_NAME_MF77) == 0) -- { -- xfree (name); -- name = alloca (strlen (BLANK_COMMON_NAME_LOCAL) + 1); -- strcpy (name, BLANK_COMMON_NAME_LOCAL); -- } -- -- tmp = head_common_list; -- -- while (tmp != NULL) -- { -- if (COMMON_NEEDS_PATCHING (tmp)) -- if (strcmp (tmp->name, name) == 0) -- patch_common_entries (tmp, offset, secnum); -- -- tmp = tmp->next; -- } --} --#endif -- --/* This macro adds the symbol-number for the start of the function -- (the symbol number of the .bf) referenced by symnum_fcn to a -- list. This list, in reality should be a FIFO queue but since -- #line pragmas sometimes cause line ranges to get messed up -- we simply create a linear list. This list can then be searched -- first by a queueing algorithm and upon failure fall back to -- a linear scan. */ -- --#if 0 --#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \ -- \ -- if (saved_bf_list == NULL) \ --{ \ -- tmp_bf_ptr = allocate_saved_bf_node(); \ -- \ -- tmp_bf_ptr->symnum_bf = (bf_sym); \ -- tmp_bf_ptr->symnum_fcn = (fcn_sym); \ -- tmp_bf_ptr->next = NULL; \ -- \ -- current_head_bf_list = saved_bf_list = tmp_bf_ptr; \ -- saved_bf_list_end = tmp_bf_ptr; \ -- } \ --else \ --{ \ -- tmp_bf_ptr = allocate_saved_bf_node(); \ -- \ -- tmp_bf_ptr->symnum_bf = (bf_sym); \ -- tmp_bf_ptr->symnum_fcn = (fcn_sym); \ -- tmp_bf_ptr->next = NULL; \ -- \ -- saved_bf_list_end->next = tmp_bf_ptr; \ -- saved_bf_list_end = tmp_bf_ptr; \ -- } --#endif -- --/* This function frees the entire (.bf,function) list. */ -- --#if 0 --static void --clear_bf_list (void) --{ -- -- SAVED_BF_PTR tmp = saved_bf_list; -- SAVED_BF_PTR next = NULL; -- -- while (tmp != NULL) -- { -- next = tmp->next; -- xfree (tmp); -- tmp = next; -- } -- saved_bf_list = NULL; --} --#endif -- --int global_remote_debug; -- --#if 0 -- --static long --get_bf_for_fcn (long the_function) --{ -- SAVED_BF_PTR tmp; -- int nprobes = 0; -- -- /* First use a simple queuing algorithm (i.e. look and see if the -- item at the head of the queue is the one you want). */ -- -- if (saved_bf_list == NULL) -- internal_error (__FILE__, __LINE__, -- _("cannot get .bf node off empty list")); -- -- if (current_head_bf_list != NULL) -- if (current_head_bf_list->symnum_fcn == the_function) -- { -- if (global_remote_debug) -- fprintf_unfiltered (gdb_stderr, "*"); -- -- tmp = current_head_bf_list; -- current_head_bf_list = current_head_bf_list->next; -- return (tmp->symnum_bf); -- } -- -- /* If the above did not work (probably because #line directives were -- used in the sourcefile and they messed up our internal tables) we now do -- the ugly linear scan. */ -- -- if (global_remote_debug) -- fprintf_unfiltered (gdb_stderr, "\ndefaulting to linear scan\n"); -- -- nprobes = 0; -- tmp = saved_bf_list; -- while (tmp != NULL) -- { -- nprobes++; -- if (tmp->symnum_fcn == the_function) -- { -- if (global_remote_debug) -- fprintf_unfiltered (gdb_stderr, "Found in %d probes\n", nprobes); -- current_head_bf_list = tmp->next; -- return (tmp->symnum_bf); -- } -- tmp = tmp->next; -- } -- -- return (-1); --} -- --static SAVED_FUNCTION_PTR saved_function_list = NULL; --static SAVED_FUNCTION_PTR saved_function_list_end = NULL; -- --static void --clear_function_list (void) --{ -- SAVED_FUNCTION_PTR tmp = saved_function_list; -- SAVED_FUNCTION_PTR next = NULL; -- -- while (tmp != NULL) -- { -- next = tmp->next; -- xfree (tmp); -- tmp = next; -- } -- -- saved_function_list = NULL; --} --#endif -Index: gdb-7.4.50.20120602/gdb/f-lang.h -=================================================================== ---- gdb-7.4.50.20120602.orig/gdb/f-lang.h 2012-06-02 19:11:54.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/f-lang.h 2012-06-02 19:13:55.345317970 +0200 -@@ -76,15 +76,10 @@ typedef struct saved_f77_common SAVED_F7 - typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR; - - extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */ --extern SAVED_F77_COMMON_PTR tail_common_list; /* Ptr to last saved COMMON */ --extern SAVED_F77_COMMON_PTR current_common; /* Ptr to current COMMON */ - - extern SAVED_F77_COMMON_PTR find_common_for_function (const char *, - const char *); - --#define UNINITIALIZED_SECNUM -1 --#define COMMON_NEEDS_PATCHING(blk) ((blk)->secnum == UNINITIALIZED_SECNUM) -- - #define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */ - #define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */ - #define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */ -Index: gdb-7.4.50.20120602/gdb/f-valprint.c -=================================================================== ---- gdb-7.4.50.20120602.orig/gdb/f-valprint.c 2012-06-02 19:11:54.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/f-valprint.c 2012-06-02 19:14:11.625313432 +0200 -@@ -35,10 +35,6 @@ - #include "command.h" - #include "block.h" - --#if 0 --static int there_is_a_visible_common_named (char *); --#endif -- - extern void _initialize_f_valprint (void); - static void info_common_command (char *, int); - static void list_all_visible_commons (const char *); -@@ -535,67 +531,6 @@ info_common_command (char *comname, int - comname, funname); - } - --/* This function is used to determine whether there is a -- F77 common block visible at the current scope called 'comname'. */ -- --#if 0 --static int --there_is_a_visible_common_named (char *comname) --{ -- SAVED_F77_COMMON_PTR the_common; -- struct frame_info *fi; -- char *funname = 0; -- struct symbol *func; -- -- if (comname == NULL) -- error (_("Cannot deal with NULL common name!")); -- -- fi = get_selected_frame (_("No frame selected")); -- -- /* The following is generally ripped off from stack.c's routine -- print_frame_info(). */ -- -- func = find_pc_function (fi->pc); -- if (func) -- { -- /* In certain pathological cases, the symtabs give the wrong -- function (when we are in the first function in a file which -- is compiled without debugging symbols, the previous function -- is compiled with debugging symbols, and the "foo.o" symbol -- that is supposed to tell us where the file with debugging symbols -- ends has been truncated by ar because it is longer than 15 -- characters). -- -- So look in the minimal symbol tables as well, and if it comes -- up with a larger address for the function use that instead. -- I don't think this can ever cause any problems; there shouldn't -- be any minimal symbols in the middle of a function. -- FIXME: (Not necessarily true. What about text labels?) */ -- -- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc); -- -- if (msymbol != NULL -- && (SYMBOL_VALUE_ADDRESS (msymbol) -- > BLOCK_START (SYMBOL_BLOCK_VALUE (func)))) -- funname = SYMBOL_LINKAGE_NAME (msymbol); -- else -- funname = SYMBOL_LINKAGE_NAME (func); -- } -- else -- { -- struct minimal_symbol *msymbol = -- lookup_minimal_symbol_by_pc (fi->pc); -- -- if (msymbol != NULL) -- funname = SYMBOL_LINKAGE_NAME (msymbol); -- } -- -- the_common = find_common_for_function (comname, funname); -- -- return (the_common ? 1 : 0); --} --#endif -- - void - _initialize_f_valprint (void) - { diff --git a/gdb-fortran-common.patch b/gdb-fortran-common.patch deleted file mode 100644 index e072133..0000000 --- a/gdb-fortran-common.patch +++ /dev/null @@ -1,598 +0,0 @@ -Index: gdb-7.4.91.20120801/gdb/dwarf2read.c -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/dwarf2read.c 2012-08-01 18:36:51.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/dwarf2read.c 2012-08-01 18:38:54.201540500 +0200 -@@ -11073,12 +11073,14 @@ read_set_type (struct die_info *die, str - return set_die_type (die, set_type, cu); - } - --/* First cut: install each common block member as a global variable. */ -+/* Create appropriate locally-scoped variables for all the DW_TAG_common_block -+ entries. Create also TYPE_CODE_STRUCT listing all such variables to be -+ available for `info common'. COMMON_BLOCK_DOMAIN is used to sepate the -+ common blocks name namespace from regular variable names. */ - - static void - read_common_block (struct die_info *die, struct dwarf2_cu *cu) - { -- struct die_info *child_die; - struct attribute *attr; - struct symbol *sym; - CORE_ADDR base = (CORE_ADDR) 0; -@@ -11103,20 +11105,67 @@ read_common_block (struct die_info *die, - } - if (die->child != NULL) - { -+ struct objfile *objfile = cu->objfile; -+ struct die_info *child_die; -+ struct type *type; -+ struct field *field; -+ char *name; -+ struct symbol *sym; -+ -+ type = alloc_type (objfile); -+ TYPE_CODE (type) = TYPE_CODE_STRUCT; -+ /* Artificial type to be used only by `info common'. */ -+ TYPE_NAME (type) = ""; -+ -+ child_die = die->child; -+ while (child_die && child_die->tag) -+ { -+ TYPE_NFIELDS (type)++; -+ child_die = sibling_die (child_die); -+ } -+ -+ TYPE_FIELDS (type) = obstack_alloc (&objfile->objfile_obstack, -+ sizeof (*TYPE_FIELDS (type)) -+ * TYPE_NFIELDS (type)); -+ memset (TYPE_FIELDS (type), 0, sizeof (*TYPE_FIELDS (type)) -+ * TYPE_NFIELDS (type)); -+ -+ field = TYPE_FIELDS (type); - child_die = die->child; - while (child_die && child_die->tag) - { - LONGEST offset; - -+ /* Create the symbol in the DW_TAG_common_block block in the current -+ symbol scope. */ - sym = new_symbol (child_die, NULL, cu); -+ -+ /* Undocumented in DWARF3, when it can be present? */ - if (sym != NULL - && handle_data_member_location (child_die, cu, &offset)) - { - SYMBOL_VALUE_ADDRESS (sym) = base + offset; - add_symbol_to_list (sym, &global_symbols); - } -+ -+ if (SYMBOL_CLASS (sym) == LOC_STATIC) -+ SET_FIELD_PHYSADDR (*field, SYMBOL_VALUE_ADDRESS (sym)); -+ else -+ SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym)); -+ FIELD_TYPE (*field) = SYMBOL_TYPE (sym); -+ FIELD_NAME (*field) = SYMBOL_NATURAL_NAME (sym); -+ field++; - child_die = sibling_die (child_die); - } -+ -+ /* TYPE_LENGTH (type) is left 0 - it is only a virtual structure even -+ with no consecutive address space. */ -+ -+ sym = new_symbol (die, type, cu); -+ /* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */ -+ SYMBOL_VALUE_ADDRESS (sym) = base; -+ -+ set_die_type (die, type, cu); - } - } - -@@ -15155,6 +15204,13 @@ new_symbol_full (struct die_info *die, s - { - var_decode_location (attr, sym, cu); - attr2 = dwarf2_attr (die, DW_AT_external, cu); -+ -+ /* Fortran explicitly imports any global symbols to the local -+ scope by DW_TAG_common_block. */ -+ if (cu->language == language_fortran && die->parent -+ && die->parent->tag == DW_TAG_common_block) -+ attr2 = NULL; -+ - if (SYMBOL_CLASS (sym) == LOC_STATIC - && SYMBOL_VALUE_ADDRESS (sym) == 0 - && !dwarf2_per_objfile->has_section_at_zero) -@@ -15319,6 +15375,11 @@ new_symbol_full (struct die_info *die, s - SYMBOL_CLASS (sym) = LOC_TYPEDEF; - list_to_add = &global_symbols; - break; -+ case DW_TAG_common_block: -+ SYMBOL_CLASS (sym) = LOC_STATIC; -+ SYMBOL_DOMAIN (sym) = COMMON_BLOCK_DOMAIN; -+ add_symbol_to_list (sym, cu->list_in_scope); -+ break; - default: - /* Not a tag we recognize. Hopefully we aren't processing - trash data, but since we must specifically ignore things -Index: gdb-7.4.91.20120801/gdb/f-lang.c -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/f-lang.c 2012-08-01 18:38:24.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/f-lang.c 2012-08-01 18:38:54.202540495 +0200 -@@ -370,27 +370,3 @@ _initialize_f_language (void) - - add_language (&f_language_defn); - } -- --SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON */ -- --/* This routine finds the first encountred COMMON block named "name" -- that belongs to function funcname. */ -- --SAVED_F77_COMMON_PTR --find_common_for_function (const char *name, const char *funcname) --{ -- -- SAVED_F77_COMMON_PTR tmp; -- -- tmp = head_common_list; -- -- while (tmp != NULL) -- { -- if (strcmp (tmp->name, name) == 0 -- && strcmp (tmp->owning_function, funcname) == 0) -- return (tmp); -- else -- tmp = tmp->next; -- } -- return (NULL); --} -Index: gdb-7.4.91.20120801/gdb/f-lang.h -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/f-lang.h 2012-08-01 18:38:24.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/f-lang.h 2012-08-01 18:38:54.203540489 +0200 -@@ -52,37 +52,8 @@ enum f90_range_type - NONE_BOUND_DEFAULT /* "(low:high)" */ - }; - --struct common_entry -- { -- struct symbol *symbol; /* The symbol node corresponding -- to this component */ -- struct common_entry *next; /* The next component */ -- }; -- --struct saved_f77_common -- { -- char *name; /* Name of COMMON */ -- char *owning_function; /* Name of parent function */ -- int secnum; /* Section # of .bss */ -- CORE_ADDR offset; /* Offset from .bss for -- this block */ -- struct common_entry *entries; /* List of block's components */ -- struct common_entry *end_of_entries; /* ptr. to end of components */ -- struct saved_f77_common *next; /* Next saved COMMON block */ -- }; -- --typedef struct saved_f77_common SAVED_F77_COMMON, *SAVED_F77_COMMON_PTR; -- --typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR; -- --extern SAVED_F77_COMMON_PTR head_common_list; /* Ptr to 1st saved COMMON */ -- --extern SAVED_F77_COMMON_PTR find_common_for_function (const char *, -- const char *); -- - #define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */ - #define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */ --#define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */ - - /* When reasonable array bounds cannot be fetched, such as when - you ask to 'mt print symbols' and there is no stack frame and -Index: gdb-7.4.91.20120801/gdb/f-valprint.c -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/f-valprint.c 2012-08-01 18:38:24.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/f-valprint.c 2012-08-01 18:41:26.411698186 +0200 -@@ -34,10 +34,11 @@ - #include "gdbcore.h" - #include "command.h" - #include "block.h" -+#include "dictionary.h" -+#include "gdb_assert.h" - - extern void _initialize_f_valprint (void); - static void info_common_command (char *, int); --static void list_all_visible_commons (const char *); - static void f77_create_arrayprint_offset_tbl (struct type *, - struct ui_file *); - static void f77_get_dynamic_length_of_aggregate (struct type *); -@@ -420,22 +421,53 @@ f_val_print (struct type *type, const gd - gdb_flush (stream); - } - --static void --list_all_visible_commons (const char *funname) -+static int -+info_common_command_for_block (struct block *block, const char *comname) - { -- SAVED_F77_COMMON_PTR tmp; -- -- tmp = head_common_list; -+ struct block_iterator iter; -+ struct symbol *sym; -+ int values_printed = 0; -+ const char *name; -+ struct value_print_options opts; -+ -+ get_user_print_options (&opts); -+ -+ ALL_BLOCK_SYMBOLS (block, iter, sym) -+ if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN) -+ { -+ struct type *type = SYMBOL_TYPE (sym); -+ int index; -+ -+ gdb_assert (SYMBOL_CLASS (sym) == LOC_STATIC); -+ gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT); -+ -+ if (comname && (!SYMBOL_LINKAGE_NAME (sym) -+ || strcmp (comname, SYMBOL_LINKAGE_NAME (sym)) != 0)) -+ continue; -+ -+ values_printed = 1; -+ if (SYMBOL_PRINT_NAME (sym)) -+ printf_filtered (_("Contents of F77 COMMON block '%s':\n"), -+ SYMBOL_PRINT_NAME (sym)); -+ else -+ printf_filtered (_("Contents of blank COMMON block:\n")); -+ -+ for (index = 0; index < TYPE_NFIELDS (type); index++) -+ { -+ struct value *val; -+ -+ gdb_assert (field_is_static (&TYPE_FIELD (type, index))); -+ val = value_static_field (type, index); -+ -+ printf_filtered ("%s = ", TYPE_FIELD_NAME (type, index)); -+ value_print (val, gdb_stdout, &opts); -+ putchar_filtered ('\n'); -+ } - -- printf_filtered (_("All COMMON blocks visible at this level:\n\n")); -- -- while (tmp != NULL) -- { -- if (strcmp (tmp->owning_function, funname) == 0) -- printf_filtered ("%s\n", tmp->name); -+ putchar_filtered ('\n'); -+ } - -- tmp = tmp->next; -- } -+ return values_printed; - } - - /* This function is used to print out the values in a given COMMON -@@ -445,11 +477,9 @@ list_all_visible_commons (const char *fu - static void - info_common_command (char *comname, int from_tty) - { -- SAVED_F77_COMMON_PTR the_common; -- COMMON_ENTRY_PTR entry; - struct frame_info *fi; -- const char *funname = 0; -- struct symbol *func; -+ struct block *block; -+ int values_printed = 0; - - /* We have been told to display the contents of F77 COMMON - block supposedly visible in this function. Let us -@@ -461,87 +491,31 @@ info_common_command (char *comname, int - /* The following is generally ripped off from stack.c's routine - print_frame_info(). */ - -- func = find_pc_function (get_frame_pc (fi)); -- if (func) -+ block = get_frame_block (fi, 0); -+ if (block == NULL) - { -- /* In certain pathological cases, the symtabs give the wrong -- function (when we are in the first function in a file which -- is compiled without debugging symbols, the previous function -- is compiled with debugging symbols, and the "foo.o" symbol -- that is supposed to tell us where the file with debugging symbols -- ends has been truncated by ar because it is longer than 15 -- characters). -- -- So look in the minimal symbol tables as well, and if it comes -- up with a larger address for the function use that instead. -- I don't think this can ever cause any problems; there shouldn't -- be any minimal symbols in the middle of a function. -- FIXME: (Not necessarily true. What about text labels?) */ -- -- struct minimal_symbol *msymbol = -- lookup_minimal_symbol_by_pc (get_frame_pc (fi)); -- -- if (msymbol != NULL -- && (SYMBOL_VALUE_ADDRESS (msymbol) -- > BLOCK_START (SYMBOL_BLOCK_VALUE (func)))) -- funname = SYMBOL_LINKAGE_NAME (msymbol); -- else -- funname = SYMBOL_LINKAGE_NAME (func); -- } -- else -- { -- struct minimal_symbol *msymbol = -- lookup_minimal_symbol_by_pc (get_frame_pc (fi)); -- -- if (msymbol != NULL) -- funname = SYMBOL_LINKAGE_NAME (msymbol); -- else /* Got no 'funname', code below will fail. */ -- error (_("No function found for frame.")); -+ printf_filtered (_("No symbol table info available.\n")); -+ return; - } - -- /* If comname is NULL, we assume the user wishes to see the -- which COMMON blocks are visible here and then return. */ -- -- if (comname == 0) -+ while (block) - { -- list_all_visible_commons (funname); -- return; -+ if (info_common_command_for_block (block, comname)) -+ values_printed = 1; -+ /* After handling the function's top-level block, stop. Don't -+ continue to its superblock, the block of per-file symbols. */ -+ if (BLOCK_FUNCTION (block)) -+ break; -+ block = BLOCK_SUPERBLOCK (block); - } - -- the_common = find_common_for_function (comname, funname); -- -- if (the_common) -+ if (!values_printed) - { -- struct frame_id frame_id = get_frame_id (fi); -- -- if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0) -- printf_filtered (_("Contents of blank COMMON block:\n")); -+ if (comname) -+ printf_filtered (_("No common block '%s'.\n"), comname); - else -- printf_filtered (_("Contents of F77 COMMON block '%s':\n"), comname); -- -- printf_filtered ("\n"); -- entry = the_common->entries; -- -- while (entry != NULL) -- { -- fi = frame_find_by_id (frame_id); -- if (fi == NULL) -- { -- warning (_("Unable to restore previously selected frame.")); -- break; -- } -- -- print_variable_and_value (NULL, entry->symbol, fi, gdb_stdout, 0); -- -- /* print_variable_and_value invalidates FI. */ -- fi = NULL; -- -- entry = entry->next; -- } -+ printf_filtered (_("No common blocks.\n")); - } -- else -- printf_filtered (_("Cannot locate the common block %s in function '%s'\n"), -- comname, funname); - } - - void -Index: gdb-7.4.91.20120801/gdb/stack.c -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/stack.c 2012-08-01 18:36:51.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/stack.c 2012-08-01 18:38:54.206540471 +0200 -@@ -1851,6 +1851,8 @@ iterate_over_block_locals (struct block - case LOC_COMPUTED: - if (SYMBOL_IS_ARGUMENT (sym)) - break; -+ if (SYMBOL_DOMAIN (sym) == COMMON_BLOCK_DOMAIN) -+ break; - (*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data); - break; - -Index: gdb-7.4.91.20120801/gdb/symtab.h -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/symtab.h 2012-06-30 00:46:46.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/symtab.h 2012-08-01 18:38:54.206540471 +0200 -@@ -394,7 +394,10 @@ typedef enum domain_enum_tag - - /* LABEL_DOMAIN may be used for names of labels (for gotos). */ - -- LABEL_DOMAIN -+ LABEL_DOMAIN, -+ -+ /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN. */ -+ COMMON_BLOCK_DOMAIN - } domain_enum; - - /* Searching domains, used for `search_symbols'. Element numbers are -Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.exp 2012-08-01 18:38:54.207540465 +0200 -@@ -0,0 +1,101 @@ -+# 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 . -+ -+set testfile "common-block" -+set srcfile ${testfile}.f90 -+set binfile ${objdir}/${subdir}/${testfile} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 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 "stop-here-out"] -+gdb_continue_to_breakpoint "stop-here-out" -+ -+# Common block naming with source name /foo/: -+# .symtab DW_TAG_common_block's DW_AT_name -+# Intel Fortran foo_ foo_ -+# GNU Fortran foo_ foo -+#set suffix "_" -+set suffix "" -+ -+set int4 {(integer\(kind=4\)|INTEGER\(4\))} -+set real4 {(real\(kind=4\)|REAL\(4\))} -+set real8 {(real\(kind=8\)|REAL\(8\))} -+ -+gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context." -+gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context." -+gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context." -+gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." -+gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." -+gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." -+ -+gdb_test "info locals" "ix_x = 11\r\niy_y = 22\r\niz_z = 33\r\nix = 1\r\niy = 2\r\niz = 3" "info locals out" -+gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix_x = 11\r\niy_y = 22\r\niz_z = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix = 1\r\niy = 2\r\niz = 3" "info common out" -+ -+gdb_test "ptype ix" "type = $int4" "ptype ix out" -+gdb_test "ptype iy" "type = $real4" "ptype iy out" -+gdb_test "ptype iz" "type = $real8" "ptype iz out" -+gdb_test "ptype ix_x" "type = $int4" "ptype ix_x out" -+gdb_test "ptype iy_y" "type = $real4" "ptype iy_y out" -+gdb_test "ptype iz_z" "type = $real8" "ptype iz_z out" -+ -+gdb_test "p ix" " = 1 *" "p ix out" -+gdb_test "p iy" " = 2 *" "p iy out" -+gdb_test "p iz" " = 3 *" "p iz out" -+gdb_test "p ix_x" " = 11 *" "p ix_x out" -+gdb_test "p iy_y" " = 22 *" "p iy_y out" -+gdb_test "p iz_z" " = 33 *" "p iz_z out" -+ -+gdb_breakpoint [gdb_get_line_number "stop-here-in"] -+gdb_continue_to_breakpoint "stop-here-in" -+ -+gdb_test "whatis foo$suffix" "No symbol \"foo$suffix\" in current context." "whatis foo$suffix in" -+gdb_test "ptype foo$suffix" "No symbol \"foo$suffix\" in current context." "ptype foo$suffix in" -+gdb_test "p foo$suffix" "No symbol \"foo$suffix\" in current context." "p foo$suffix in" -+gdb_test "whatis fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "whatis fo_o$suffix in" -+gdb_test "ptype fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "ptype fo_o$suffix in" -+gdb_test "p fo_o$suffix" "No symbol \"fo_o$suffix\" in current context." "p fo_o$suffix in" -+ -+gdb_test "info locals" "ix = 11\r\niy2 = 22\r\niz = 33\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3\r\niy = 5\r\niz_z = 55" "info locals in" -+gdb_test "info common" "Contents of F77 COMMON block 'fo_o':\r\nix = 11\r\niy2 = 22\r\niz = 33\r\n\r\nContents of F77 COMMON block 'foo':\r\nix_x = 1\r\niy_y = 2\r\niz_z2 = 3" "info common in" -+ -+gdb_test "ptype ix" "type = $int4" "ptype ix in" -+gdb_test "ptype iy2" "type = $real4" "ptype iy2 in" -+gdb_test "ptype iz" "type = $real8" "ptype iz in" -+gdb_test "ptype ix_x" "type = $int4" "ptype ix_x in" -+gdb_test "ptype iy_y" "type = $real4" "ptype iy_y in" -+gdb_test "ptype iz_z2" "type = $real8" "ptype iz_z2 in" -+ -+gdb_test "p ix" " = 11 *" "p ix in" -+gdb_test "p iy2" " = 22 *" "p iy2 in" -+gdb_test "p iz" " = 33 *" "p iz in" -+gdb_test "p ix_x" " = 1 *" "p ix_x in" -+gdb_test "p iy_y" " = 2 *" "p iy_y in" -+gdb_test "p iz_z2" " = 3 *" "p iz_z2 in" -Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.f90 2012-08-01 18:38:54.207540465 +0200 -@@ -0,0 +1,67 @@ -+! 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 in -+ -+ INTEGER*4 ix -+ REAL*4 iy2 -+ REAL*8 iz -+ -+ INTEGER*4 ix_x -+ REAL*4 iy_y -+ REAL*8 iz_z2 -+ -+ common /fo_o/ix,iy2,iz -+ common /foo/ix_x,iy_y,iz_z2 -+ -+ iy = 5 -+ iz_z = 55 -+ -+ if (ix .ne. 11 .or. iy2 .ne. 22.0 .or. iz .ne. 33.0) call abort -+ if (ix_x .ne. 1 .or. iy_y .ne. 2.0 .or. iz_z2 .ne. 3.0) call abort -+ -+ ix = 0 ! stop-here-in -+ -+end subroutine in -+ -+program common_test -+ -+ INTEGER*4 ix -+ REAL*4 iy -+ REAL*8 iz -+ -+ INTEGER*4 ix_x -+ REAL*4 iy_y -+ REAL*8 iz_z -+ -+ common /foo/ix,iy,iz -+ common /fo_o/ix_x,iy_y,iz_z -+ -+ ix = 1 -+ iy = 2.0 -+ iz = 3.0 -+ -+ ix_x = 11 -+ iy_y = 22.0 -+ iz_z = 33.0 -+ -+ call in ! stop-here-out -+ -+end program common_test diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 308b359..83f6b09 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -1,8 +1,8 @@ -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 53100c5..e7586ac 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -13306,6 +13306,25 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, +Index: gdb-7.5.50.20130118/gdb/dwarf2read.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/dwarf2read.c 2013-01-19 21:16:22.437961789 +0100 ++++ gdb-7.5.50.20130118/gdb/dwarf2read.c 2013-01-19 21:24:22.242969266 +0100 +@@ -15987,6 +15987,25 @@ new_symbol_full (struct die_info *die, s /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language); linkagename = dwarf2_physname (name, die, cu); @@ -28,12 +28,11 @@ index 53100c5..e7586ac 100644 SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), 0, objfile); /* Fortran does not have mangling standard and the mangling does differ -diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -new file mode 100644 -index 0000000..575071f ---- /dev/null -+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp -@@ -0,0 +1,101 @@ +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp 2013-01-19 21:23:09.119827963 +0100 +@@ -0,0 +1,108 @@ +# Copyright (C) 2012 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -90,7 +89,11 @@ index 0000000..575071f + } + -re " = {} (0x\[0-9a-f\]+) <__strstr>\r\n$gdb_prompt $" { + set addr $expect_out(1,string) -+ pass "$test (GDB workaround or future fixed glibc)" ++ pass "$test (GDB workaround)" ++ } ++ -re " = {} (0x\[0-9a-f\]+) <__libc_strstr>\r\n$gdb_prompt $" { ++ set addr $expect_out(1,string) ++ pass "$test (fixed glibc)" + } + -re " = {char \\*\\(const char \\*, const char \\*\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { + untested "$test (gnu-ifunc not in use by glibc)" @@ -126,7 +129,10 @@ index 0000000..575071f + pass $test + } + -re " = {} $addr <__strstr>\r\n$gdb_prompt $" { -+ pass "$test (GDB workaround or future fixed glibc)" ++ pass "$test (GDB workaround)" ++ } ++ -re " = {} $addr <__libc_strstr>\r\n$gdb_prompt $" { ++ pass "$test (fixed glibc)" + } + -re " = {void \\*\\(void\\)} 0x\[0-9a-f\]+ \r\n$gdb_prompt $" { + fail $test diff --git a/gdb-implicitpointer-offset.patch b/gdb-implicitpointer-offset.patch deleted file mode 100644 index 067df12..0000000 --- a/gdb-implicitpointer-offset.patch +++ /dev/null @@ -1,350 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2012-12/msg00030.html -Subject: Re: RFC: fix bug in DW_OP_GNU_implicit_pointer - ->>>>> "Jan" == Jan Kratochvil writes: - -Jan> And how it is implemented in GCC? - -Correctly. - ->> I updated the implptr-64bit test case to test the new code as well. - -Jan> This is .S test so GCC is not tested there. - -Yeah, I considered this, but I did not want to add a new test that would -be exposed to gcc version differences -- and testing gcc's output is -more properly done in the gcc test suite anyway. - -Jan> Maybe to call them now for example: -Jan> dwarf2_fetch_die_loc_cu_off -Jan> dwarf2_fetch_die_loc_sect_off - -Ok. - -Jan> Missing added TWO_CU here. - -Added. - -Tom - -2012-11-30 Tom Tromey - - * dwarf2read.c (dwarf2_fetch_die_loc_sect_off): New function. - (dwarf2_fetch_die_loc_cu_off): Rename from - dwarf2_fetch_die_location_block. Rewrite to use - dwarf2_fetch_die_loc_sect_off. - * dwarf2loc.h (dwarf2_fetch_die_loc_sect_off): Declare. - (dwarf2_fetch_die_loc_cu_off): Rename. - * dwarf2loc.c (indirect_pieced_value): Use - dwarf2_fetch_die_loc_sect_off. - * dwarf2expr.h (struct dwarf_expr_context) : Update - comment. - (struct dwarf_expr_piece) : Now a sect_offset. - * dwarf2expr.c (add_piece): Update. - (execute_stack_op) : Update comment. - -2012-11-30 Tom Tromey - - * gdb.dwarf2/implptr-64bit.exp: Run tests with two CUs as well. - (test): Add "two_cu" argument. - * gdb.dwarf2/implptr-64bit.S: Move subprogram later; use ref_addr - for types; allow two CUs. - -diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c -index 214b371..877add4 100644 ---- a/gdb/dwarf2expr.c -+++ b/gdb/dwarf2expr.c -@@ -342,7 +342,7 @@ add_piece (struct dwarf_expr_context *ctx, ULONGEST size, ULONGEST offset) - } - else if (p->location == DWARF_VALUE_IMPLICIT_POINTER) - { -- p->v.ptr.die.cu_off = ctx->len; -+ p->v.ptr.die.sect_off = ctx->len; - p->v.ptr.offset = value_as_long (dwarf_expr_fetch (ctx, 0)); - } - else if (p->location == DWARF_VALUE_REGISTER) -@@ -872,7 +872,7 @@ execute_stack_op (struct dwarf_expr_context *ctx, - error (_("DWARF-2 expression error: DW_OP_GNU_implicit_pointer " - "is not allowed in frame context")); - -- /* The referred-to DIE of cu_offset kind. */ -+ /* The referred-to DIE of sect_offset kind. */ - ctx->len = extract_unsigned_integer (op_ptr, ctx->ref_addr_size, - byte_order); - op_ptr += ctx->ref_addr_size; -diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h -index 19efbfd..1b890dc 100644 ---- a/gdb/dwarf2expr.h -+++ b/gdb/dwarf2expr.h -@@ -165,7 +165,7 @@ struct dwarf_expr_context - - /* For DWARF_VALUE_LITERAL, the current literal value's length and - data. For DWARF_VALUE_IMPLICIT_POINTER, LEN is the offset of the -- target DIE of cu_offset kind. */ -+ target DIE of sect_offset kind. */ - ULONGEST len; - const gdb_byte *data; - -@@ -236,7 +236,7 @@ struct dwarf_expr_piece - struct - { - /* The referent DIE from DW_OP_GNU_implicit_pointer. */ -- cu_offset die; -+ sect_offset die; - /* The byte offset into the resulting data. */ - LONGEST offset; - } ptr; -diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index cadcc17..94a03ca 100644 ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -425,8 +425,7 @@ per_cu_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset, - { - struct dwarf2_locexpr_baton block; - -- block = dwarf2_fetch_die_location_block (die_offset, per_cu, -- get_frame_pc, baton); -+ block = dwarf2_fetch_die_loc_cu_off (die_offset, per_cu, get_frame_pc, baton); - - /* DW_OP_call_ref is currently not supported. */ - gdb_assert (block.per_cu == per_cu); -@@ -2034,9 +2033,10 @@ indirect_pieced_value (struct value *value) - byte_offset = value_as_address (value); - - gdb_assert (piece); -- baton = dwarf2_fetch_die_location_block (piece->v.ptr.die, c->per_cu, -- get_frame_address_in_block_wrapper, -- frame); -+ baton -+ = dwarf2_fetch_die_loc_sect_off (piece->v.ptr.die, c->per_cu, -+ get_frame_address_in_block_wrapper, -+ frame); - - return dwarf2_evaluate_loc_desc_full (TYPE_TARGET_TYPE (type), frame, - baton.data, baton.size, baton.per_cu, -@@ -3201,8 +3201,8 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, - op_ptr += size; - - offset.cu_off = uoffset; -- block = dwarf2_fetch_die_location_block (offset, per_cu, -- get_ax_pc, expr); -+ block = dwarf2_fetch_die_loc_cu_off (offset, per_cu, -+ get_ax_pc, expr); - - /* DW_OP_call_ref is currently not supported. */ - gdb_assert (block.per_cu == per_cu); -diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h -index 0f10767..6a8b3c8 100644 ---- a/gdb/dwarf2loc.h -+++ b/gdb/dwarf2loc.h -@@ -62,7 +62,12 @@ const gdb_byte *dwarf2_find_location_expression - size_t *locexpr_length, - CORE_ADDR pc); - --struct dwarf2_locexpr_baton dwarf2_fetch_die_location_block -+struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off -+ (sect_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu, -+ CORE_ADDR (*get_frame_pc) (void *baton), -+ void *baton); -+ -+struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off - (cu_offset offset_in_cu, struct dwarf2_per_cu_data *per_cu, - CORE_ADDR (*get_frame_pc) (void *baton), - void *baton); -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index f4bd7a9..59dea05 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -17343,12 +17343,11 @@ follow_die_ref (struct die_info *src_die, struct attribute *attr, - dwarf2_locexpr_baton->data has lifetime of PER_CU->OBJFILE. */ - - struct dwarf2_locexpr_baton --dwarf2_fetch_die_location_block (cu_offset offset_in_cu, -- struct dwarf2_per_cu_data *per_cu, -- CORE_ADDR (*get_frame_pc) (void *baton), -- void *baton) -+dwarf2_fetch_die_loc_sect_off (sect_offset offset, -+ struct dwarf2_per_cu_data *per_cu, -+ CORE_ADDR (*get_frame_pc) (void *baton), -+ void *baton) - { -- sect_offset offset = { per_cu->offset.sect_off + offset_in_cu.cu_off }; - struct dwarf2_cu *cu; - struct die_info *die; - struct attribute *attr; -@@ -17403,6 +17402,20 @@ dwarf2_fetch_die_location_block (cu_offset offset_in_cu, - return retval; - } - -+/* Like dwarf2_fetch_die_loc_sect_off, but take a CU -+ offset. */ -+ -+struct dwarf2_locexpr_baton -+dwarf2_fetch_die_loc_cu_off (cu_offset offset_in_cu, -+ struct dwarf2_per_cu_data *per_cu, -+ CORE_ADDR (*get_frame_pc) (void *baton), -+ void *baton) -+{ -+ sect_offset offset = { per_cu->offset.sect_off + offset_in_cu.cu_off }; -+ -+ return dwarf2_fetch_die_loc_sect_off (offset, per_cu, get_frame_pc, baton); -+} -+ - /* Return the type of the DIE at DIE_OFFSET in the CU named by - PER_CU. */ - -diff --git a/gdb/testsuite/gdb.dwarf2/implptr-64bit.S b/gdb/testsuite/gdb.dwarf2/implptr-64bit.S -index be8db5c..d0d870a 100644 ---- a/gdb/testsuite/gdb.dwarf2/implptr-64bit.S -+++ b/gdb/testsuite/gdb.dwarf2/implptr-64bit.S -@@ -18,11 +18,12 @@ d: - /* Length of Compilation Unit Info */ - #if OFFSET_SIZE == 4 - # define OFFSET .4byte -- .4byte debug_end - 1f -+# define HEADER_LINE1 -+# define HEADER_LINE2(END) .4byte END - 1f - #elif OFFSET_SIZE == 8 - # define OFFSET .8byte -- .4byte 0xffffffff -- .8byte debug_end - 1f -+# define HEADER_LINE1 .4byte 0xffffffff -+# define HEADER_LINE2(END) .8byte END - 1f - #else - # error - #endif -@@ -40,6 +41,16 @@ d: - #else - # error - #endif -+ -+#if TWO_CU -+# define END1 .Lcu_end_1 -+#else -+# define END1 debug_end -+#endif -+ -+ HEADER_LINE1 -+ HEADER_LINE2(END1) -+ - 1: - .2byte DWARF_VERSION /* DWARF version number */ - OFFSET .Ldebug_abbrev0 /* Offset Into Abbrev. Section */ -@@ -68,13 +79,6 @@ d: - - .byte 0x0 /* end of children of DW_TAG_structure_type */ - -- .uleb128 6 /* Abbrev: DW_TAG_subprogram */ -- .ascii "main\0" /* DW_AT_name */ -- ADDR main /* DW_AT_low_pc */ -- ADDR main + 0x100 /* DW_AT_high_pc */ -- .4byte .Ltype_int - d /* DW_AT_type */ -- .byte 1 /* DW_AT_external */ -- - .Ltype_structptr: - .uleb128 0x5 /* DW_TAG_pointer_type */ - .byte ADDR_SIZE /* DW_AT_byte_size */ -@@ -90,7 +94,32 @@ d: - 3: - .byte 1, 1, 1, 1 - 2: -- .4byte .Ltype_struct - d /* DW_AT_type */ -+ REF_ADDR .Ltype_struct - d /* DW_AT_type */ -+ -+#if TWO_CU -+ .byte 0x0 /* end of children of CU */ -+.Lcu_end_1: -+ -+ HEADER_LINE1 -+ HEADER_LINE2 (debug_end) -+ -+1: -+ .2byte DWARF_VERSION /* DWARF version number */ -+ OFFSET .Ldebug_abbrev0 /* Offset Into Abbrev. Section */ -+ .byte ADDR_SIZE /* Pointer Size (in bytes) */ -+ -+ .uleb128 0x1 /* (DIE (0xb) DW_TAG_compile_unit) */ -+ .ascii "GNU C 4.4.3\0" /* DW_AT_producer */ -+ .byte 0x1 /* DW_AT_language */ -+ .ascii "1.c\0" /* DW_AT_name */ -+#endif -+ -+ .uleb128 6 /* Abbrev: DW_TAG_subprogram */ -+ .ascii "main\0" /* DW_AT_name */ -+ ADDR main /* DW_AT_low_pc */ -+ ADDR main + 0x100 /* DW_AT_high_pc */ -+ REF_ADDR .Ltype_int - d /* DW_AT_type */ -+ .byte 1 /* DW_AT_external */ - - .uleb128 0x4 /* (DW_TAG_variable) */ - .ascii "p\0" /* DW_AT_name */ -@@ -100,7 +129,7 @@ d: - REF_ADDR .Lvar_out - d /* referenced DIE */ - .sleb128 0 /* offset */ - 2: -- .4byte .Ltype_structptr - d /* DW_AT_type */ -+ REF_ADDR .Ltype_structptr - d /* DW_AT_type */ - - .byte 0x0 /* end of children of main */ - -@@ -152,7 +181,7 @@ debug_end: - .uleb128 0x02 /* (DW_AT_location) */ - .uleb128 0xa /* (DW_FORM_block1) */ - .uleb128 0x49 /* (DW_AT_type) */ -- .uleb128 0x13 /* (DW_FORM_ref4) */ -+ .uleb128 0x10 /* (DW_FORM_ref_addr) */ - .byte 0x0 - .byte 0x0 - -@@ -176,7 +205,7 @@ debug_end: - .uleb128 0x12 /* DW_AT_high_pc */ - .uleb128 0x1 /* DW_FORM_addr */ - .uleb128 0x49 /* DW_AT_type */ -- .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x10 /* DW_FORM_ref_addr */ - .uleb128 0x3f /* DW_AT_external */ - .uleb128 0xc /* DW_FORM_flag */ - .byte 0x0 /* Terminator */ -diff --git a/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp -index 78f1594..066cf78 100644 ---- a/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp -+++ b/gdb/testsuite/gdb.dwarf2/implptr-64bit.exp -@@ -22,16 +22,16 @@ if {![dwarf2_support]} { - standard_testfile .S - set mainfile main.c - --proc test { dwarf_version offset_size addr_size ref_addr_size } { -+proc test { dwarf_version offset_size addr_size ref_addr_size two_cu } { - global testfile srcfile mainfile - - # 32-bit targets do not support any of the testcases; keep quiet there. - set opts {quiet} -- foreach n { dwarf_version offset_size addr_size ref_addr_size } { -+ foreach n { dwarf_version offset_size addr_size ref_addr_size two_cu } { - lappend opts "additional_flags=-D[string toupper $n]=[expr "\$$n"]" - } - -- set name "d${dwarf_version}o${offset_size}a${addr_size}r${ref_addr_size}" -+ set name "d${dwarf_version}o${offset_size}a${addr_size}r${ref_addr_size}t${two_cu}" - set executable ${testfile}-${name} - if [prepare_for_testing ${testfile}.exp $executable "${srcfile} ${mainfile}" $opts] { - return -1 -@@ -44,8 +44,12 @@ proc test { dwarf_version offset_size addr_size ref_addr_size } { - gdb_test "p/x p->f" " = 0x1010101" $name - } - --# DWARF_VERSION OFFSET_SIZE ADDR_SIZE REF_ADDR_SIZE --test 2 8 4 4 --test 2 4 8 8 --test 3 8 4 8 --test 3 4 8 4 -+# DWARF_VERSION OFFSET_SIZE ADDR_SIZE REF_ADDR_SIZE TWO_CU -+test 2 8 4 4 0 -+test 2 4 8 8 0 -+test 3 8 4 8 0 -+test 3 4 8 4 0 -+test 2 8 4 4 1 -+test 2 4 8 8 1 -+test 3 8 4 8 1 -+test 3 4 8 4 1 - diff --git a/gdb-minidebuginfo.patch b/gdb-minidebuginfo.patch deleted file mode 100644 index d6e6f7e..0000000 --- a/gdb-minidebuginfo.patch +++ /dev/null @@ -1,1056 +0,0 @@ -http://fedoraproject.org/wiki/Features/MiniDebugInfo -https://bugzilla.redhat.com/show_bug.cgi?id=834068 - -Patch by Alexander Larsson. -Review/modifications and testfile by Jan Kratochvil. - -Index: gdb-7.4.91.20120801/gdb/Makefile.in -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/Makefile.in 2012-08-01 18:44:51.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/Makefile.in 2012-08-01 18:47:05.701820594 +0200 -@@ -151,6 +151,9 @@ READLINE_CFLAGS = @READLINE_CFLAGS@ - # Where is expat? This will be empty if expat was not available. - LIBEXPAT = @LIBEXPAT@ - -+# Where is lzma? This will be empty if lzma was not available. -+LIBLZMA = @LIBLZMA@ -+ - WARN_CFLAGS = @WARN_CFLAGS@ - WERROR_CFLAGS = @WERROR_CFLAGS@ - GDB_WARN_CFLAGS = $(WARN_CFLAGS) -@@ -467,7 +470,7 @@ INTERNAL_LDFLAGS = $(CFLAGS) $(GLOBAL_CF - # LIBIBERTY appears twice on purpose. - CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \ - $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ @PYTHON_LIBS@ \ -- $(LIBEXPAT) \ -+ $(LIBEXPAT) $(LIBLZMA) \ - $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) - CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \ - $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) -Index: gdb-7.4.91.20120801/gdb/config.in -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/config.in 2012-08-01 18:45:21.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/config.in 2012-08-01 18:47:05.701820594 +0200 -@@ -198,6 +198,9 @@ - /* Define to 1 if you have the `libiconvlist' function. */ - #undef HAVE_LIBICONVLIST - -+/* Define if you have the lzma library. */ -+#undef HAVE_LIBLZMA -+ - /* Define to 1 if you have the `m' library (-lm). */ - #undef HAVE_LIBM - -Index: gdb-7.4.91.20120801/gdb/configure -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/configure 2012-08-01 18:45:21.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/configure 2012-08-01 18:47:05.703820583 +0200 -@@ -641,6 +641,9 @@ TCL_VERSION - WIN32LDAPP - GUI_CFLAGS_X - LIBGUI -+LTLIBLZMA -+LIBLZMA -+HAVE_LIBLZMA - WIN32LIBS - SER_HARDWIRE - WERROR_CFLAGS -@@ -813,6 +816,8 @@ with_system_gdbinit - enable_werror - enable_build_warnings - enable_gdb_build_warnings -+with_lzma -+with_liblzma_prefix - with_tcl - with_tk - with_x -@@ -1532,6 +1537,9 @@ Optional Packages: - --with-sysroot[=DIR] search for usr/lib et al within DIR - --with-system-gdbinit=PATH - automatically load a system-wide gdbinit file -+ --with-lzma support lzma compression (auto/yes/no) -+ --with-liblzma-prefix[=DIR] search for liblzma in DIR/include and DIR/lib -+ --without-liblzma-prefix don't search for liblzma in includedir and libdir - --with-tcl directory containing tcl configuration (tclConfig.sh) - --with-tk directory containing tk configuration (tkConfig.sh) - --with-x use the X Window System -@@ -13151,6 +13159,494 @@ LIBS=$OLD_LIBS - # Add any host-specific objects to GDB. - CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}" - -+# If building on ELF, look for lzma support for embedded compressed debug info. -+if test $gdb_cv_var_elf = yes; then -+ -+# Check whether --with-lzma was given. -+if test "${with_lzma+set}" = set; then : -+ withval=$with_lzma; -+else -+ with_lzma=auto -+fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to use lzma" >&5 -+$as_echo_n "checking whether to use lzma... " >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lzma" >&5 -+$as_echo "$with_lzma" >&6; } -+ -+ if test "${with_lzma}" != no; then -+ -+ -+ -+ -+ -+ -+ -+ -+ use_additional=yes -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ -+# Check whether --with-liblzma-prefix was given. -+if test "${with_liblzma_prefix+set}" = set; then : -+ withval=$with_liblzma_prefix; -+ if test "X$withval" = "Xno"; then -+ use_additional=no -+ else -+ if test "X$withval" = "X"; then -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ -+ eval additional_includedir=\"$includedir\" -+ eval additional_libdir=\"$libdir\" -+ -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ else -+ additional_includedir="$withval/include" -+ additional_libdir="$withval/lib" -+ fi -+ fi -+ -+fi -+ -+ LIBLZMA= -+ LTLIBLZMA= -+ INCLZMA= -+ rpathdirs= -+ ltrpathdirs= -+ names_already_handled= -+ names_next_round='lzma ' -+ while test -n "$names_next_round"; do -+ names_this_round="$names_next_round" -+ names_next_round= -+ for name in $names_this_round; do -+ already_handled= -+ for n in $names_already_handled; do -+ if test "$n" = "$name"; then -+ already_handled=yes -+ break -+ fi -+ done -+ if test -z "$already_handled"; then -+ names_already_handled="$names_already_handled $name" -+ uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` -+ eval value=\"\$HAVE_LIB$uppername\" -+ if test -n "$value"; then -+ if test "$value" = yes; then -+ eval value=\"\$LIB$uppername\" -+ test -z "$value" || LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$value" -+ eval value=\"\$LTLIB$uppername\" -+ test -z "$value" || LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }$value" -+ else -+ : -+ fi -+ else -+ found_dir= -+ found_la= -+ found_so= -+ found_a= -+ if test $use_additional = yes; then -+ if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then -+ found_dir="$additional_libdir" -+ found_so="$additional_libdir/lib$name.$shlibext" -+ if test -f "$additional_libdir/lib$name.la"; then -+ found_la="$additional_libdir/lib$name.la" -+ fi -+ else -+ if test -f "$additional_libdir/lib$name.$libext"; then -+ found_dir="$additional_libdir" -+ found_a="$additional_libdir/lib$name.$libext" -+ if test -f "$additional_libdir/lib$name.la"; then -+ found_la="$additional_libdir/lib$name.la" -+ fi -+ fi -+ fi -+ fi -+ if test "X$found_dir" = "X"; then -+ for x in $LDFLAGS $LTLIBLZMA; do -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ eval x=\"$x\" -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ case "$x" in -+ -L*) -+ dir=`echo "X$x" | sed -e 's/^X-L//'` -+ if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then -+ found_dir="$dir" -+ found_so="$dir/lib$name.$shlibext" -+ if test -f "$dir/lib$name.la"; then -+ found_la="$dir/lib$name.la" -+ fi -+ else -+ if test -f "$dir/lib$name.$libext"; then -+ found_dir="$dir" -+ found_a="$dir/lib$name.$libext" -+ if test -f "$dir/lib$name.la"; then -+ found_la="$dir/lib$name.la" -+ fi -+ fi -+ fi -+ ;; -+ esac -+ if test "X$found_dir" != "X"; then -+ break -+ fi -+ done -+ fi -+ if test "X$found_dir" != "X"; then -+ LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }-L$found_dir -l$name" -+ if test "X$found_so" != "X"; then -+ if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_so" -+ else -+ haveit= -+ for x in $ltrpathdirs; do -+ if test "X$x" = "X$found_dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ ltrpathdirs="$ltrpathdirs $found_dir" -+ fi -+ if test "$hardcode_direct" = yes; then -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_so" -+ else -+ if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_so" -+ haveit= -+ for x in $rpathdirs; do -+ if test "X$x" = "X$found_dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ rpathdirs="$rpathdirs $found_dir" -+ fi -+ else -+ haveit= -+ for x in $LDFLAGS $LIBLZMA; do -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ eval x=\"$x\" -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ if test "X$x" = "X-L$found_dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-L$found_dir" -+ fi -+ if test "$hardcode_minus_L" != no; then -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_so" -+ else -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-l$name" -+ fi -+ fi -+ fi -+ fi -+ else -+ if test "X$found_a" != "X"; then -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$found_a" -+ else -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-L$found_dir -l$name" -+ fi -+ fi -+ additional_includedir= -+ case "$found_dir" in -+ */lib | */lib/) -+ basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` -+ additional_includedir="$basedir/include" -+ ;; -+ esac -+ if test "X$additional_includedir" != "X"; then -+ if test "X$additional_includedir" != "X/usr/include"; then -+ haveit= -+ if test "X$additional_includedir" = "X/usr/local/include"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux*) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ for x in $CPPFLAGS $INCLZMA; do -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ eval x=\"$x\" -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ if test "X$x" = "X-I$additional_includedir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test -d "$additional_includedir"; then -+ INCLZMA="${INCLZMA}${INCLZMA:+ }-I$additional_includedir" -+ fi -+ fi -+ fi -+ fi -+ fi -+ if test -n "$found_la"; then -+ save_libdir="$libdir" -+ case "$found_la" in -+ */* | *\\*) . "$found_la" ;; -+ *) . "./$found_la" ;; -+ esac -+ libdir="$save_libdir" -+ for dep in $dependency_libs; do -+ case "$dep" in -+ -L*) -+ additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` -+ if test "X$additional_libdir" != "X/usr/lib"; then -+ haveit= -+ if test "X$additional_libdir" = "X/usr/local/lib"; then -+ if test -n "$GCC"; then -+ case $host_os in -+ linux*) haveit=yes;; -+ esac -+ fi -+ fi -+ if test -z "$haveit"; then -+ haveit= -+ for x in $LDFLAGS $LIBLZMA; do -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ eval x=\"$x\" -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ if test "X$x" = "X-L$additional_libdir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test -d "$additional_libdir"; then -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-L$additional_libdir" -+ fi -+ fi -+ haveit= -+ for x in $LDFLAGS $LTLIBLZMA; do -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ eval x=\"$x\" -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ if test "X$x" = "X-L$additional_libdir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ if test -d "$additional_libdir"; then -+ LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }-L$additional_libdir" -+ fi -+ fi -+ fi -+ fi -+ ;; -+ -R*) -+ dir=`echo "X$dep" | sed -e 's/^X-R//'` -+ if test "$enable_rpath" != no; then -+ haveit= -+ for x in $rpathdirs; do -+ if test "X$x" = "X$dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ rpathdirs="$rpathdirs $dir" -+ fi -+ haveit= -+ for x in $ltrpathdirs; do -+ if test "X$x" = "X$dir"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ ltrpathdirs="$ltrpathdirs $dir" -+ fi -+ fi -+ ;; -+ -l*) -+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` -+ ;; -+ *.la) -+ names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` -+ ;; -+ *) -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$dep" -+ LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }$dep" -+ ;; -+ esac -+ done -+ fi -+ else -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }-l$name" -+ LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }-l$name" -+ fi -+ fi -+ fi -+ done -+ done -+ if test "X$rpathdirs" != "X"; then -+ if test -n "$hardcode_libdir_separator"; then -+ alldirs= -+ for found_dir in $rpathdirs; do -+ alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" -+ done -+ acl_save_libdir="$libdir" -+ libdir="$alldirs" -+ eval flag=\"$hardcode_libdir_flag_spec\" -+ libdir="$acl_save_libdir" -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$flag" -+ else -+ for found_dir in $rpathdirs; do -+ acl_save_libdir="$libdir" -+ libdir="$found_dir" -+ eval flag=\"$hardcode_libdir_flag_spec\" -+ libdir="$acl_save_libdir" -+ LIBLZMA="${LIBLZMA}${LIBLZMA:+ }$flag" -+ done -+ fi -+ fi -+ if test "X$ltrpathdirs" != "X"; then -+ for found_dir in $ltrpathdirs; do -+ LTLIBLZMA="${LTLIBLZMA}${LTLIBLZMA:+ }-R$found_dir" -+ done -+ fi -+ -+ -+ ac_save_CPPFLAGS="$CPPFLAGS" -+ -+ for element in $INCLZMA; do -+ haveit= -+ for x in $CPPFLAGS; do -+ -+ acl_save_prefix="$prefix" -+ prefix="$acl_final_prefix" -+ acl_save_exec_prefix="$exec_prefix" -+ exec_prefix="$acl_final_exec_prefix" -+ eval x=\"$x\" -+ exec_prefix="$acl_save_exec_prefix" -+ prefix="$acl_save_prefix" -+ -+ if test "X$x" = "X$element"; then -+ haveit=yes -+ break -+ fi -+ done -+ if test -z "$haveit"; then -+ CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" -+ fi -+ done -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for liblzma" >&5 -+$as_echo_n "checking for liblzma... " >&6; } -+if test "${ac_cv_liblzma+set}" = set; then : -+ $as_echo_n "(cached) " >&6 -+else -+ -+ ac_save_LIBS="$LIBS" -+ LIBS="$LIBS $LIBLZMA" -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+#include "lzma.h" -+int -+main () -+{ -+lzma_index_iter iter; -+ lzma_index_iter_init (&iter, 0); -+ lzma_mf_is_supported (LZMA_MF_HC3); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_liblzma=yes -+else -+ ac_cv_liblzma=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ LIBS="$ac_save_LIBS" -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_liblzma" >&5 -+$as_echo "$ac_cv_liblzma" >&6; } -+ if test "$ac_cv_liblzma" = yes; then -+ HAVE_LIBLZMA=yes -+ -+$as_echo "#define HAVE_LIBLZMA 1" >>confdefs.h -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to link with liblzma" >&5 -+$as_echo_n "checking how to link with liblzma... " >&6; } -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIBLZMA" >&5 -+$as_echo "$LIBLZMA" >&6; } -+ else -+ HAVE_LIBLZMA=no -+ CPPFLAGS="$ac_save_CPPFLAGS" -+ LIBLZMA= -+ LTLIBLZMA= -+ fi -+ -+ -+ -+ -+ -+ -+ if test "$HAVE_LIBLZMA" != yes; then -+ if test "$with_lzma" = yes; then -+ as_fn_error "missing liblzma for --with-lzma" "$LINENO" 5 -+ fi -+ fi -+ fi -+fi -+ - LIBGUI="../libgui/src/libgui.a" - GUI_CFLAGS_X="-I${srcdir}/../libgui/src" - -Index: gdb-7.4.91.20120801/gdb/configure.ac -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/configure.ac 2012-08-01 18:45:21.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/configure.ac 2012-08-01 18:47:05.704820577 +0200 -@@ -2196,6 +2196,27 @@ LIBS=$OLD_LIBS - # Add any host-specific objects to GDB. - CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}" - -+# If building on ELF, look for lzma support for embedded compressed debug info. -+if test $gdb_cv_var_elf = yes; then -+ AC_ARG_WITH(lzma, -+ AS_HELP_STRING([--with-lzma], [support lzma compression (auto/yes/no)]), -+ [], [with_lzma=auto]) -+ AC_MSG_CHECKING([whether to use lzma]) -+ AC_MSG_RESULT([$with_lzma]) -+ -+ if test "${with_lzma}" != no; then -+ AC_LIB_HAVE_LINKFLAGS([lzma], [], [#include "lzma.h"], -+ [lzma_index_iter iter; -+ lzma_index_iter_init (&iter, 0); -+ lzma_mf_is_supported (LZMA_MF_HC3);]) -+ if test "$HAVE_LIBLZMA" != yes; then -+ if test "$with_lzma" = yes; then -+ AC_MSG_ERROR([missing liblzma for --with-lzma]) -+ fi -+ fi -+ fi -+fi -+ - LIBGUI="../libgui/src/libgui.a" - GUI_CFLAGS_X="-I${srcdir}/../libgui/src" - AC_SUBST(LIBGUI) -Index: gdb-7.4.91.20120801/gdb/elfread.c -=================================================================== ---- gdb-7.4.91.20120801.orig/gdb/elfread.c 2012-08-01 18:44:51.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/elfread.c 2012-08-01 18:57:59.528202398 +0200 -@@ -51,6 +51,10 @@ - #include "observer.h" - #include "elf/external.h" - #include -+#include "gdbcore.h" -+#ifdef HAVE_LIBLZMA -+# include -+#endif - - extern void _initialize_elfread (void); - -@@ -2210,6 +2214,262 @@ find_separate_debug_file_by_buildid (str - return NULL; - } - -+#ifdef HAVE_LIBLZMA -+ -+/* Custom lzma_allocator.alloc so they use the gdb ones. */ -+ -+static void * -+alloc_lzma (void *opaque, size_t nmemb, size_t size) -+{ -+ return xmalloc (nmemb * size); -+} -+ -+/* Custom lzma_allocator.free so they use the gdb ones. */ -+ -+static void -+free_lzma (void *opaque, void *ptr) -+{ -+ xfree (ptr); -+} -+ -+/* It cannot be const due to the lzma library function prototypes. */ -+ -+static lzma_allocator gdb_lzma_allocator = { alloc_lzma, free_lzma, NULL}; -+ -+/* Custom bfd_openr_iovec implementation to read compressed data from a -+ section. This keeps only the last decompressed block in memory to -+ allow larger data without using to much memory. */ -+ -+struct lzma_stream -+{ -+ /* Section of input BFD we are decoding data from. */ -+ asection *section; -+ -+ /* lzma library decompression state. */ -+ lzma_index *index; -+ -+ /* Currently decoded block. */ -+ bfd_size_type data_start; -+ bfd_size_type data_end; -+ gdb_byte *data; -+}; -+ -+/* bfd_openr_iovec OPEN_P implementation for -+ find_separate_debug_file_in_section. OPEN_CLOSURE is 'asection *' of the -+ section to decompress. -+ -+ Return 'struct lzma_stream *' must be freed by caller by xfree, together -+ with its INDEX lzma data. */ -+ -+static void * -+lzma_open (struct bfd *nbfd, void *open_closure) -+{ -+ asection *section = open_closure; -+ bfd_size_type size, offset; -+ lzma_stream_flags options; -+ gdb_byte footer[LZMA_STREAM_HEADER_SIZE]; -+ gdb_byte *indexdata; -+ lzma_index *index; -+ int ret; -+ uint64_t memlimit = UINT64_MAX; -+ struct lzma_stream *lstream; -+ size_t pos; -+ -+ size = bfd_get_section_size (section); -+ offset = section->filepos + size - LZMA_STREAM_HEADER_SIZE; -+ if (size < LZMA_STREAM_HEADER_SIZE -+ || bfd_seek (section->owner, offset, SEEK_SET) != 0 -+ || bfd_bread (footer, LZMA_STREAM_HEADER_SIZE, section->owner) -+ != LZMA_STREAM_HEADER_SIZE -+ || lzma_stream_footer_decode (&options, footer) != LZMA_OK -+ || offset < options.backward_size) -+ { -+ bfd_set_error (bfd_error_wrong_format); -+ return NULL; -+ } -+ -+ offset -= options.backward_size; -+ indexdata = xmalloc (options.backward_size); -+ index = NULL; -+ pos = 0; -+ if (bfd_seek (section->owner, offset, SEEK_SET) != 0 -+ || bfd_bread (indexdata, options.backward_size, section->owner) -+ != options.backward_size -+ || lzma_index_buffer_decode (&index, &memlimit, &gdb_lzma_allocator, -+ indexdata, &pos, options.backward_size) -+ != LZMA_OK -+ || lzma_index_size (index) != options.backward_size) -+ { -+ xfree (indexdata); -+ bfd_set_error (bfd_error_wrong_format); -+ return NULL; -+ } -+ xfree (indexdata); -+ -+ lstream = xzalloc (sizeof (struct lzma_stream)); -+ lstream->section = section; -+ lstream->index = index; -+ -+ return lstream; -+} -+ -+/* bfd_openr_iovec PREAD_P implementation for -+ find_separate_debug_file_in_section. Passed STREAM -+ is 'struct lzma_stream *'. */ -+ -+static file_ptr -+lzma_pread (struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, -+ file_ptr offset) -+{ -+ struct lzma_stream *lstream = stream; -+ bfd_size_type chunk_size; -+ lzma_index_iter iter; -+ gdb_byte *compressed, *uncompressed; -+ file_ptr block_offset; -+ lzma_filter filters[LZMA_FILTERS_MAX + 1]; -+ lzma_block block; -+ size_t compressed_pos, uncompressed_pos; -+ file_ptr res; -+ -+ res = 0; -+ while (nbytes > 0) -+ { -+ if (lstream->data == NULL -+ || lstream->data_start > offset || offset >= lstream->data_end) -+ { -+ asection *section = lstream->section; -+ -+ lzma_index_iter_init (&iter, lstream->index); -+ if (lzma_index_iter_locate (&iter, offset)) -+ break; -+ -+ compressed = xmalloc (iter.block.total_size); -+ block_offset = section->filepos + iter.block.compressed_file_offset; -+ if (bfd_seek (section->owner, block_offset, SEEK_SET) != 0 -+ || bfd_bread (compressed, iter.block.total_size, section->owner) -+ != iter.block.total_size) -+ { -+ xfree (compressed); -+ break; -+ } -+ -+ uncompressed = xmalloc (iter.block.uncompressed_size); -+ -+ memset (&block, 0, sizeof (block)); -+ block.filters = filters; -+ block.header_size = lzma_block_header_size_decode (compressed[0]); -+ if (lzma_block_header_decode (&block, &gdb_lzma_allocator, compressed) -+ != LZMA_OK) -+ { -+ xfree (compressed); -+ xfree (uncompressed); -+ break; -+ } -+ -+ compressed_pos = block.header_size; -+ uncompressed_pos = 0; -+ if (lzma_block_buffer_decode (&block, &gdb_lzma_allocator, -+ compressed, &compressed_pos, -+ iter.block.total_size, -+ uncompressed, &uncompressed_pos, -+ iter.block.uncompressed_size) -+ != LZMA_OK) -+ { -+ xfree (compressed); -+ xfree (uncompressed); -+ break; -+ } -+ -+ xfree (compressed); -+ -+ xfree (lstream->data); -+ lstream->data = uncompressed; -+ lstream->data_start = iter.block.uncompressed_file_offset; -+ lstream->data_end = (iter.block.uncompressed_file_offset -+ + iter.block.uncompressed_size); -+ } -+ -+ chunk_size = min (nbytes, lstream->data_end - offset); -+ memcpy (buf, lstream->data + offset - lstream->data_start, chunk_size); -+ buf = (gdb_byte *) buf + chunk_size; -+ offset += chunk_size; -+ nbytes -= chunk_size; -+ res += chunk_size; -+ } -+ -+ return res; -+} -+ -+/* bfd_openr_iovec CLOSE_P implementation for -+ find_separate_debug_file_in_section. Passed STREAM -+ is 'struct lzma_stream *'. */ -+ -+static int -+lzma_close (struct bfd *nbfd, -+ void *stream) -+{ -+ struct lzma_stream *lstream = stream; -+ -+ lzma_index_end (lstream->index, &gdb_lzma_allocator); -+ xfree (lstream->data); -+ xfree (lstream); -+ return 0; -+} -+ -+/* bfd_openr_iovec STAT_P implementation for -+ find_separate_debug_file_in_section. Passed STREAM -+ is 'struct lzma_stream *'. */ -+ -+static int -+lzma_stat (struct bfd *abfd, -+ void *stream, -+ struct stat *sb) -+{ -+ struct lzma_stream *lstream = stream; -+ -+ sb->st_size = lzma_index_uncompressed_size (lstream->index); -+ return 0; -+} -+ -+/* This looks for a xz compressed separate debug info object file embedded -+ in a section called .gnu_debugdata. If we find one we create a iovec -+ based bfd that decompresses the object data on demand. */ -+ -+static bfd * -+find_separate_debug_file_in_section (struct objfile *objfile) -+{ -+ asection *section; -+ bfd *abfd; -+ -+ section = bfd_get_section_by_name (objfile->obfd, ".gnu_debugdata"); -+ if (section == NULL) -+ return NULL; -+ -+ /* objfile->NAME lifetime is longer than the ABFD's lifetime. */ -+ abfd = gdb_bfd_openr_iovec (objfile->name, gnutarget, lzma_open, section, -+ lzma_pread, lzma_close, lzma_stat); -+ if (abfd == NULL) -+ return NULL; -+ -+ if (!bfd_check_format (abfd, bfd_object)) -+ { -+ gdb_bfd_unref (abfd); -+ return NULL; -+ } -+ -+ return abfd; -+} -+ -+#else /* !HAVE_LIBLZMA */ -+ -+static bfd * -+find_separate_debug_file_in_section (struct objfile *objfile) -+{ -+ return NULL; -+} -+ -+#endif /* !HAVE_LIBLZMA */ -+ - /* Scan and build partial symbols for a symbol file. - We have been initialized by a call to elf_symfile_init, which - currently does nothing. -@@ -2433,6 +2693,8 @@ elf_symfile_read (struct objfile *objfil - else if (!objfile_has_partial_symbols (objfile)) - { - char *debugfile, *build_id_filename; -+ bfd *abfd = NULL; -+ struct cleanup *cleanup; - - debugfile = find_separate_debug_file_by_buildid (objfile, - &build_id_filename); -@@ -2440,14 +2702,11 @@ elf_symfile_read (struct objfile *objfil - if (debugfile == NULL) - debugfile = find_separate_debug_file_by_debuglink (objfile); - -+ cleanup = make_cleanup (xfree, debugfile); - if (debugfile) - { -- struct cleanup *cleanup = make_cleanup (xfree, debugfile); -- bfd *abfd = symfile_bfd_open (debugfile); -- -+ abfd = symfile_bfd_open (debugfile); - make_cleanup_bfd_unref (abfd); -- symbol_file_add_separate (abfd, symfile_flags, objfile); -- do_cleanups (cleanup); - } - /* Check if any separate debug info has been extracted out. */ - else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink") -@@ -2455,6 +2714,17 @@ elf_symfile_read (struct objfile *objfil - debug_print_missing (objfile->name, build_id_filename); - - xfree (build_id_filename); -+ -+ if (abfd == NULL) -+ { -+ abfd = find_separate_debug_file_in_section (objfile); -+ make_cleanup_bfd_unref (abfd); -+ } -+ -+ if (abfd != NULL) -+ symbol_file_add_separate (abfd, symfile_flags, objfile); -+ -+ do_cleanups (cleanup); - } - - if (symtab_create_debug) -Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.c 2012-08-01 18:47:05.705820572 +0200 -@@ -0,0 +1,30 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include -+ -+static int -+debugdata_function (void) -+{ -+ return raise (SIGSEGV) + 1; -+} -+ -+int -+main (void) -+{ -+ return debugdata_function () + 1; -+} -Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp 2012-08-01 18:47:05.705820572 +0200 -@@ -0,0 +1,91 @@ -+# Copyright 2012 Free Software Foundation, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile -+ -+load_lib dwarf.exp -+if ![dwarf2_support] { -+ return 0 -+} -+ -+if [build_executable ${testfile}.exp $testfile] { -+ return -1 -+} -+ -+proc run { test cmdline } { -+ verbose "cmdline is $cmdline" -+ set result [catch "exec $cmdline" output] -+ verbose "result is $result" -+ verbose "output is $output" -+ if {$result == 0} { -+ pass $test -+ return 0 -+ } else { -+ fail $test -+ return -1 -+ } -+} -+ -+set strip_program [transform strip] -+set nm_program [transform nm] -+ -+# Extract the dynamic symbols from the main binary, there is no need to also have these -+# in the normal symbol table -+file delete -- ${binfile}.dynsyms -+if [run "nm -D" "[transform nm] -D ${binfile} --format=posix --defined-only | awk \\{print\\ \\\$1\\} | sort > ${binfile}.dynsyms"] { -+ return -1 -+} -+ -+# Extract all the text (i.e. function) symbols from the debuginfo -+file delete -- ${binfile}.funcsyms -+if [run "nm" "[transform nm] ${binfile} --format=posix --defined-only | awk \\{if(\\\$2==\"T\"||\\\$2==\"t\")print\\ \\\$1\\} | sort > ${binfile}.funcsyms"] { -+ return -1 -+} -+ -+# Keep all the function symbols not already in the dynamic symbol table -+file delete -- ${binfile}.keep_symbols -+if [run "comm" "comm -13 ${binfile}.dynsyms ${binfile}.funcsyms > ${binfile}.keep_symbols"] { -+ return -1 -+} -+ -+# Copy the full debuginfo, keeping only a minumal set of symbols and removing some unnecessary sections -+file delete -- ${binfile}.mini_debuginfo -+if [run "objcopy 1" "[transform objcopy] -S --remove-section .gdb_index --remove-section .comment --keep-symbols=${binfile}.keep_symbols ${binfile} ${binfile}.mini_debuginfo"] { -+ return -1 -+} -+ -+# GDB specific - we do not have split executable in advance. -+file delete -- ${binfile}.strip -+if [run "strip" "[transform strip] --strip-all -o ${binfile}.strip ${binfile}"] { -+ return -1 -+} -+ -+# Inject the compressed data into the .gnu_debugdata section of the original binary -+file delete -- ${binfile}.mini_debuginfo.xz -+if [run "xz" "xz ${binfile}.mini_debuginfo"] { -+ return -1 -+} -+file delete -- ${binfile}.test -+if [run "objcopy 2" "[transform objcopy] --add-section .gnu_debugdata=${binfile}.mini_debuginfo.xz ${binfile}.strip ${binfile}.test"] { -+ return -1 -+} -+ -+clean_restart "$testfile.strip" -+ -+gdb_test "p debugdata_function" {No symbol table is loaded\. Use the "file" command\.} "no symtab" -+ -+clean_restart "$testfile.test" -+ -+gdb_test "p debugdata_function" { = {} 0x[0-9a-f]+ } "have symtab" diff --git a/gdb-print-class.patch b/gdb-print-class.patch deleted file mode 100644 index 4f18381..0000000 --- a/gdb-print-class.patch +++ /dev/null @@ -1,110 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00169.html - -### src/gdb/ChangeLog 2012/09/27 12:53:57 1.14718 -### src/gdb/ChangeLog 2012/09/27 16:04:18 1.14719 -## -1,3 +1,8 @@ -+2012-09-27 Tom Tromey -+ -+ Fix https://bugzilla.redhat.com/show_bug.cgi?id=849357 -+ * cp-valprint.c (cp_print_value_fields): Use get_vptr_fieldno. -+ - 2012-09-27 Joel Brobecker - - * sol-thread.c (sol_thread_fetch_registers) ---- src/gdb/cp-valprint.c 2012/07/06 05:36:07 1.85 -+++ src/gdb/cp-valprint.c 2012/09/27 16:04:22 1.86 -@@ -210,7 +210,9 @@ - { - int statmem_obstack_initial_size = 0; - int stat_array_obstack_initial_size = 0; -- -+ struct type *vptr_basetype = NULL; -+ int vptr_fieldno; -+ - if (dont_print_statmem == 0) - { - statmem_obstack_initial_size = -@@ -225,6 +227,7 @@ - } - } - -+ vptr_fieldno = get_vptr_fieldno (type, &vptr_basetype); - for (i = n_baseclasses; i < len; i++) - { - /* If requested, skip printing of static fields. */ -@@ -358,7 +361,7 @@ - v, stream, recurse + 1, - options); - } -- else if (i == TYPE_VPTR_FIELDNO (type)) -+ else if (i == vptr_fieldno && type == vptr_basetype) - { - int i_offset = offset + TYPE_FIELD_BITPOS (type, i) / 8; - struct type *i_type = TYPE_FIELD_TYPE (type, i); -### src/gdb/testsuite/ChangeLog 2012/09/26 19:50:12 1.3396 -### src/gdb/testsuite/ChangeLog 2012/09/27 16:04:22 1.3397 -## -1,3 +1,10 @@ -+2012-09-27 Tom Tromey -+ -+ * gdb.cp/derivation.exp: Add regression test. -+ * gdb.cp/derivation.cc (class V_base, class V_inter, class -+ V_derived): New. -+ (vderived): New global. -+ - 2012-09-26 Tom Tromey - - * gdb.dwarf2/dw2-common-block.S: New file. ---- src/gdb/testsuite/gdb.cp/derivation.cc 2011/12/13 17:22:08 1.2 -+++ src/gdb/testsuite/gdb.cp/derivation.cc 2012/09/27 16:04:23 1.3 -@@ -118,8 +118,37 @@ - - }; - -+class V_base -+{ -+public: -+ virtual void m(); -+ int base; -+}; - -+void -+V_base::m() -+{ -+} -+ -+class V_inter : public virtual V_base -+{ -+public: -+ virtual void f(); -+ int inter; -+}; -+ -+void -+V_inter::f() -+{ -+} -+ -+class V_derived : public V_inter -+{ -+public: -+ double x; -+}; - -+V_derived vderived; - - int A::afoo() { - return 1; ---- src/gdb/testsuite/gdb.cp/derivation.exp 2012/07/10 15:18:18 1.19 -+++ src/gdb/testsuite/gdb.cp/derivation.exp 2012/09/27 16:04:23 1.20 -@@ -176,3 +176,11 @@ - - gdb_test "print g_instance.bfoo()" "\\$\[0-9\]+ = 2" "print value of g_instance.bfoo()" - gdb_test "print g_instance.cfoo()" "\\$\[0-9\]+ = 3" "print value of g_instance.cfoo()" -+ -+# This is a regression test for a bug that caused a crash when trying -+# to print the vtbl pointer. We don't care about the output so much -+# here (it is tested elsewhere), just that gdb doesn't crash. We test -+# "ptype" first because, before the gdb fix, that was the only code -+# path calling get_vptr_fieldno. -+gdb_test "ptype vderived" "type = .*" -+gdb_test "print vderived" " = {.* inter = 0.*x = 0}" diff --git a/gdb-rhbz795424-bitpos-06of25.patch b/gdb-rhbz795424-bitpos-06of25.patch deleted file mode 100644 index f75ba9d..0000000 --- a/gdb-rhbz795424-bitpos-06of25.patch +++ /dev/null @@ -1,23 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-07/msg00173.html - -### src/gdb/ChangeLog 2012/07/20 17:54:05 1.14507 -### src/gdb/ChangeLog 2012/07/22 16:52:39 1.14508 -## -1,3 +1,7 @@ -+2012-07-22 Siddhesh Poyarekar -+ -+ * sh-tdep.c (sh_treat_as_flt_p): Remove unused variable LEN. -+ - 2012-07-20 Jeff Kenton - - * tilegx-linux-tdep.c (tilegx_linux_sigframe_init): Fix ---- src/gdb/sh-tdep.c 2012/06/08 14:24:57 1.245 -+++ src/gdb/sh-tdep.c 2012/07/22 16:52:41 1.246 -@@ -1032,8 +1032,6 @@ - static int - sh_treat_as_flt_p (struct type *type) - { -- int len = TYPE_LENGTH (type); -- - /* Ordinary float types are obviously treated as float. */ - if (TYPE_CODE (type) == TYPE_CODE_FLT) - return 1; diff --git a/gdb-rhbz795424-bitpos-07of25.patch b/gdb-rhbz795424-bitpos-07of25.patch deleted file mode 100644 index dd9b6fd..0000000 --- a/gdb-rhbz795424-bitpos-07of25.patch +++ /dev/null @@ -1,64 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-07/msg00182.html - -### src/gdb/ChangeLog 2012/07/23 15:25:11 1.14514 -### src/gdb/ChangeLog 2012/07/23 18:08:27 1.14515 -## -1,3 +1,9 @@ -+2012-07-23 Siddhesh Poyarekar -+ -+ * p-valprint.c (pascal_object_print_value): Replace potentially -+ unsafe alloca with xmalloc/xfree. -+ * valops.c (search_struct_method): Likewise. -+ - 2012-07-23 Tom Tromey - - * solib-svr4.c (enable_break): Update. ---- src/gdb/p-valprint.c 2012/05/18 21:02:49 1.100 -+++ src/gdb/p-valprint.c 2012/07/23 18:08:29 1.101 -@@ -797,8 +797,11 @@ - - if (boffset < 0 || boffset >= TYPE_LENGTH (type)) - { -- /* FIXME (alloc): not safe is baseclass is really really big. */ -- gdb_byte *buf = alloca (TYPE_LENGTH (baseclass)); -+ gdb_byte *buf; -+ struct cleanup *back_to; -+ -+ buf = xmalloc (TYPE_LENGTH (baseclass)); -+ back_to = make_cleanup (xfree, buf); - - base_valaddr = buf; - if (target_read_memory (address + boffset, buf, -@@ -807,6 +810,7 @@ - address = address + boffset; - thisoffset = 0; - boffset = 0; -+ do_cleanups (back_to); - } - else - base_valaddr = valaddr; ---- src/gdb/valops.c 2012/06/24 07:28:10 1.297 -+++ src/gdb/valops.c 2012/07/23 18:08:29 1.298 -@@ -2281,8 +2281,13 @@ - - if (offset < 0 || offset >= TYPE_LENGTH (type)) - { -- gdb_byte *tmp = alloca (TYPE_LENGTH (baseclass)); -- CORE_ADDR address = value_address (*arg1p); -+ gdb_byte *tmp; -+ struct cleanup *back_to; -+ CORE_ADDR address; -+ -+ tmp = xmalloc (TYPE_LENGTH (baseclass)); -+ back_to = make_cleanup (xfree, tmp); -+ address = value_address (*arg1p); - - if (target_read_memory (address + offset, - tmp, TYPE_LENGTH (baseclass)) != 0) -@@ -2293,6 +2298,7 @@ - address + offset); - base_valaddr = value_contents_for_printing (base_val); - this_offset = 0; -+ do_cleanups (back_to); - } - else - { diff --git a/gdb-rhbz795424-bitpos-08of25.patch b/gdb-rhbz795424-bitpos-08of25.patch deleted file mode 100644 index 6f2f691..0000000 --- a/gdb-rhbz795424-bitpos-08of25.patch +++ /dev/null @@ -1,139 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-07/msg00213.html - -### src/gdb/ChangeLog 2012/07/25 20:14:17 1.14531 -### src/gdb/ChangeLog 2012/07/26 02:03:14 1.14532 -## -1,3 +1,17 @@ -+2012-07-26 Siddhesh Poyarekar -+ -+ * dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Expand parameter -+ SIZE to size_t. -+ (dwarf2_evaluate_loc_desc): Likewise. -+ (dwarf2_loc_desc_needs_frame): Likewise. -+ (locexpr_describe_location_1): Likewise. -+ * dwarf2loc.h (struct dwarf2_locexpr_baton): Make SIZE as -+ size_t. -+ (struct dwarf2_loclist_baton): Likewise. -+ * dwarf2read.c (struct dwarf_block): Likewise. -+ (dump_die_shallow): Use pulongest to print dwarf_block.size. -+ (decode_locdesc): Expand SIZE and I to size_t. -+ - 2012-07-25 Jan Kratochvil - - * contrib/cc-with-tweaks.sh: Put into comment path gdb/contrib/. ---- src/gdb/dwarf2loc.c 2012/07/13 20:15:50 1.152 -+++ src/gdb/dwarf2loc.c 2012/07/26 02:03:16 1.153 -@@ -54,8 +54,8 @@ - static struct value *dwarf2_evaluate_loc_desc_full (struct type *type, - struct frame_info *frame, - const gdb_byte *data, -- unsigned short size, -- struct dwarf2_per_cu_data *per_cu, -+ size_t size, -+ struct dwarf2_per_cu_data *per_cu, - LONGEST byte_offset); - - /* Until these have formal names, we define these here. -@@ -2111,7 +2111,7 @@ - - static struct value * - dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, -- const gdb_byte *data, unsigned short size, -+ const gdb_byte *data, size_t size, - struct dwarf2_per_cu_data *per_cu, - LONGEST byte_offset) - { -@@ -2312,7 +2312,7 @@ - - struct value * - dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, -- const gdb_byte *data, unsigned short size, -+ const gdb_byte *data, size_t size, - struct dwarf2_per_cu_data *per_cu) - { - return dwarf2_evaluate_loc_desc_full (type, frame, data, size, per_cu, 0); -@@ -2433,7 +2433,7 @@ - requires a frame to evaluate. */ - - static int --dwarf2_loc_desc_needs_frame (const gdb_byte *data, unsigned short size, -+dwarf2_loc_desc_needs_frame (const gdb_byte *data, size_t size, - struct dwarf2_per_cu_data *per_cu) - { - struct needs_frame_baton baton; -@@ -3827,7 +3827,7 @@ - static void - locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr, - struct ui_file *stream, -- const gdb_byte *data, int size, -+ const gdb_byte *data, size_t size, - struct objfile *objfile, unsigned int addr_size, - int offset_size, struct dwarf2_per_cu_data *per_cu) - { ---- src/gdb/dwarf2loc.h 2012/05/22 18:45:22 1.33 -+++ src/gdb/dwarf2loc.h 2012/07/26 02:03:16 1.34 -@@ -77,7 +77,7 @@ - struct value *dwarf2_evaluate_loc_desc (struct type *type, - struct frame_info *frame, - const gdb_byte *data, -- unsigned short size, -+ size_t size, - struct dwarf2_per_cu_data *per_cu); - - CORE_ADDR dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu, -@@ -97,7 +97,7 @@ - - /* Length of the location expression. For optimized out expressions it is - zero. */ -- unsigned long size; -+ size_t size; - - /* The compilation unit containing the symbol whose location - we're computing. */ -@@ -114,7 +114,7 @@ - const gdb_byte *data; - - /* Length of the location list. */ -- unsigned long size; -+ size_t size; - - /* The compilation unit containing the symbol whose location - we're computing. */ ---- src/gdb/dwarf2read.c 2012/07/20 17:38:04 1.697 -+++ src/gdb/dwarf2read.c 2012/07/26 02:03:16 1.698 -@@ -990,7 +990,7 @@ - /* Blocks are a bunch of untyped bytes. */ - struct dwarf_block - { -- unsigned int size; -+ size_t size; - - /* Valid only if SIZE is not zero. */ - gdb_byte *data; -@@ -16197,12 +16197,12 @@ - case DW_FORM_block4: - case DW_FORM_block: - case DW_FORM_block1: -- fprintf_unfiltered (f, "block: size %d", -- DW_BLOCK (&die->attrs[i])->size); -+ fprintf_unfiltered (f, "block: size %s", -+ pulongest (DW_BLOCK (&die->attrs[i])->size)); - break; - case DW_FORM_exprloc: -- fprintf_unfiltered (f, "expression: size %u", -- DW_BLOCK (&die->attrs[i])->size); -+ fprintf_unfiltered (f, "expression: size %s", -+ pulongest (DW_BLOCK (&die->attrs[i])->size)); - break; - case DW_FORM_ref_addr: - fprintf_unfiltered (f, "ref address: "); -@@ -16746,8 +16746,8 @@ - decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu) - { - struct objfile *objfile = cu->objfile; -- int i; -- int size = blk->size; -+ size_t i; -+ size_t size = blk->size; - gdb_byte *data = blk->data; - CORE_ADDR stack[64]; - int stacki; diff --git a/gdb-rhbz795424-bitpos-09of25.patch b/gdb-rhbz795424-bitpos-09of25.patch deleted file mode 100644 index 4b1866d..0000000 --- a/gdb-rhbz795424-bitpos-09of25.patch +++ /dev/null @@ -1,34 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-08/msg00085.html - -### src/gdb/ChangeLog 2012/08/10 05:03:07 1.14574 -### src/gdb/ChangeLog 2012/08/10 18:55:16 1.14575 -## -1,3 +1,9 @@ -+2012-08-10 Siddhesh Poyarekar -+ -+ * python/py-type.c (convert_field): Use gdb_py_long_from_longest -+ for TYPE_FIELD_BITPOS. -+ (typy_get_sizeof): Likewise for TYPE_LENGTH. -+ - 2012-08-10 Mike Frysinger - - PR cli/10436: ---- src/gdb/python/py-type.c 2012/05/18 21:02:52 1.39 -+++ src/gdb/python/py-type.c 2012/08/10 18:55:18 1.40 -@@ -176,7 +176,7 @@ - } - else - { -- arg = PyLong_FromLong (TYPE_FIELD_BITPOS (type, field)); -+ arg = gdb_py_long_from_longest (TYPE_FIELD_BITPOS (type, field)); - attrstring = "bitpos"; - } - -@@ -683,7 +683,7 @@ - } - /* Ignore exceptions. */ - -- return PyLong_FromLong (TYPE_LENGTH (type)); -+ return gdb_py_long_from_longest (TYPE_LENGTH (type)); - } - - static struct type * diff --git a/gdb-rhbz795424-bitpos-10of25.patch b/gdb-rhbz795424-bitpos-10of25.patch deleted file mode 100644 index f70145a..0000000 --- a/gdb-rhbz795424-bitpos-10of25.patch +++ /dev/null @@ -1,119 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-08/msg00187.html - -### src/gdb/ChangeLog 2012/08/24 03:17:12 1.14628 -### src/gdb/ChangeLog 2012/08/24 03:57:22 1.14629 -## -1,3 +1,11 @@ -+2012-08-24 Siddhesh Poyarekar -+ -+ * h8300-tdep.c (h8300_push_dummy_call): Replace unsafe alloca -+ with xmalloc/cleanup. -+ * mt-tdep.c (mt_push_dummy_call): Likewise. -+ * tilegx-tdep.c (tilegx_push_dummy_call): Likewise. -+ * xstormy16-tdep.c (xstormy16_push_dummy_call): Likewise. -+ - 2012-08-24 Yao Qi - - * jv-exp.y (push_expression_name): Add "." at the end of error ---- src/gdb/h8300-tdep.c 2012/05/18 21:02:47 1.133 -+++ src/gdb/h8300-tdep.c 2012/08/24 03:57:22 1.134 -@@ -666,13 +666,15 @@ - - for (argument = 0; argument < nargs; argument++) - { -+ struct cleanup *back_to; - struct type *type = value_type (args[argument]); - int len = TYPE_LENGTH (type); - char *contents = (char *) value_contents (args[argument]); - - /* Pad the argument appropriately. */ - int padded_len = align_up (len, wordsize); -- gdb_byte *padded = alloca (padded_len); -+ gdb_byte *padded = xmalloc (padded_len); -+ back_to = make_cleanup (xfree, padded); - - memset (padded, 0, padded_len); - memcpy (len < wordsize ? padded + padded_len - len : padded, -@@ -720,6 +722,8 @@ - subsequent arguments go on the stack. */ - reg = E_ARGLAST_REGNUM + 1; - } -+ -+ do_cleanups (back_to); - } - - /* Store return address. */ ---- src/gdb/mt-tdep.c 2012/05/16 14:35:06 1.40 -+++ src/gdb/mt-tdep.c 2012/08/24 03:57:22 1.41 -@@ -845,16 +845,20 @@ - for (j = nargs - 1; j >= i; j--) - { - gdb_byte *val; -+ struct cleanup *back_to; -+ const gdb_byte *contents = value_contents (args[j]); - - /* Right-justify the value in an aligned-length buffer. */ - typelen = TYPE_LENGTH (value_type (args[j])); - slacklen = (wordsize - (typelen % wordsize)) % wordsize; -- val = alloca (typelen + slacklen); -- memcpy (val, value_contents (args[j]), typelen); -+ val = xmalloc (typelen + slacklen); -+ back_to = make_cleanup (xfree, val); -+ memcpy (val, contents, typelen); - memset (val + typelen, 0, slacklen); - /* Now write this data to the stack. */ - stack_dest -= typelen + slacklen; - write_memory (stack_dest, val, typelen + slacklen); -+ do_cleanups (back_to); - } - - /* Finally, if a param needs to be split between registers and stack, ---- src/gdb/tilegx-tdep.c 2012/05/30 19:31:44 1.1 -+++ src/gdb/tilegx-tdep.c 2012/08/24 03:57:22 1.2 -@@ -343,16 +343,20 @@ - for (j = nargs - 1; j >= i; j--) - { - gdb_byte *val; -+ struct cleanup *back_to; -+ const gdb_byte *contents = value_contents (args[j]); - - typelen = TYPE_LENGTH (value_enclosing_type (args[j])); - slacklen = ((typelen + 3) & (~3)) - typelen; -- val = alloca (typelen + slacklen); -- memcpy (val, value_contents (args[j]), typelen); -+ val = xmalloc (typelen + slacklen); -+ back_to = make_cleanup (xfree, val); -+ memcpy (val, contents, typelen); - memset (val + typelen, 0, slacklen); - - /* Now write data to the stack. The stack grows downwards. */ - stack_dest -= typelen + slacklen; - write_memory (stack_dest, val, typelen + slacklen); -+ do_cleanups (back_to); - } - - /* Add 2 words for linkage space to the stack. */ ---- src/gdb/xstormy16-tdep.c 2012/05/16 14:35:08 1.118 -+++ src/gdb/xstormy16-tdep.c 2012/08/24 03:57:22 1.119 -@@ -279,16 +279,20 @@ - for (j = nargs - 1; j >= i; j--) - { - char *val; -+ struct cleanup *back_to; -+ const gdb_byte *bytes = value_contents (args[j]); - - typelen = TYPE_LENGTH (value_enclosing_type (args[j])); - slacklen = typelen & 1; -- val = alloca (typelen + slacklen); -- memcpy (val, value_contents (args[j]), typelen); -+ val = xmalloc (typelen + slacklen); -+ back_to = make_cleanup (xfree, val); -+ memcpy (val, bytes, typelen); - memset (val + typelen, 0, slacklen); - - /* Now write this data to the stack. The stack grows upwards. */ - write_memory (stack_dest, val, typelen + slacklen); - stack_dest += typelen + slacklen; -+ do_cleanups (back_to); - } - - store_unsigned_integer (buf, xstormy16_pc_size, byte_order, bp_addr); diff --git a/gdb-rhbz795424-bitpos-11of25.patch b/gdb-rhbz795424-bitpos-11of25.patch deleted file mode 100644 index e58a5a8..0000000 --- a/gdb-rhbz795424-bitpos-11of25.patch +++ /dev/null @@ -1,34 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00065.html - -### src/gdb/ChangeLog 2012/09/14 00:54:57 1.14656 -### src/gdb/ChangeLog 2012/09/14 07:00:37 1.14657 -## -1,3 +1,8 @@ -+2012-09-14 Siddhesh Poyarekar -+ -+ * printcmd.c (ui_printf): Eliminate single-use variable -+ PARAM_LEN. -+ - 2012-09-14 Yao Qi - Pedro Alves - ---- src/gdb/printcmd.c 2012/09/11 21:26:16 1.211 -+++ src/gdb/printcmd.c 2012/09/14 07:00:42 1.212 -@@ -2267,7 +2267,6 @@ - - /* Parameter data. */ - struct type *param_type = value_type (val_args[i]); -- unsigned int param_len = TYPE_LENGTH (param_type); - struct gdbarch *gdbarch = get_type_arch (param_type); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - -@@ -2329,8 +2328,8 @@ - - /* Conversion between different DFP types. */ - if (TYPE_CODE (param_type) == TYPE_CODE_DECFLOAT) -- decimal_convert (param_ptr, param_len, byte_order, -- dec, dfp_len, byte_order); -+ decimal_convert (param_ptr, TYPE_LENGTH (param_type), -+ byte_order, dec, dfp_len, byte_order); - else - /* If this is a non-trivial conversion, just output 0. - A correct converted value can be displayed by explicitly diff --git a/gdb-rhbz795424-bitpos-12of25.patch b/gdb-rhbz795424-bitpos-12of25.patch deleted file mode 100644 index 50b19a1..0000000 --- a/gdb-rhbz795424-bitpos-12of25.patch +++ /dev/null @@ -1,66 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00068.html - -### src/gdb/ChangeLog 2012/09/14 12:10:21 1.14659 -### src/gdb/ChangeLog 2012/09/14 12:46:55 1.14660 -## -1,3 +1,8 @@ -+2012-09-14 Siddhesh Poyarekar -+ -+ * valarith.c (value_concat): Replace unsafe ALLOCA with -+ XMALLOC/XFREE. -+ - 2012-09-14 Pedro Alves - - * gdb.1 (SEE ALSO): Expand pointer to GDB's Texinfo manual. -Index: gdb-7.5.0.20120926/gdb/valarith.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valarith.c 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/valarith.c 2012-11-07 22:02:18.661767281 +0100 -@@ -716,9 +716,12 @@ value_concat (struct value *arg1, struct - if (TYPE_CODE (type2) == TYPE_CODE_STRING - || TYPE_CODE (type2) == TYPE_CODE_CHAR) - { -+ struct cleanup *back_to; -+ - count = longest_to_int (value_as_long (inval1)); - inval2len = TYPE_LENGTH (type2); -- ptr = (char *) alloca (count * inval2len); -+ ptr = (char *) xmalloc (count * inval2len); -+ back_to = make_cleanup (xfree, ptr); - if (TYPE_CODE (type2) == TYPE_CODE_CHAR) - { - char_type = type2; -@@ -741,6 +744,7 @@ value_concat (struct value *arg1, struct - } - } - outval = value_string (ptr, count * inval2len, char_type); -+ do_cleanups (back_to); - } - else if (TYPE_CODE (type2) == TYPE_CODE_BITSTRING - || TYPE_CODE (type2) == TYPE_CODE_BOOL) -@@ -755,6 +759,8 @@ value_concat (struct value *arg1, struct - else if (TYPE_CODE (type1) == TYPE_CODE_STRING - || TYPE_CODE (type1) == TYPE_CODE_CHAR) - { -+ struct cleanup *back_to; -+ - /* We have two character strings to concatenate. */ - if (TYPE_CODE (type2) != TYPE_CODE_STRING - && TYPE_CODE (type2) != TYPE_CODE_CHAR) -@@ -763,7 +769,8 @@ value_concat (struct value *arg1, struct - } - inval1len = TYPE_LENGTH (type1); - inval2len = TYPE_LENGTH (type2); -- ptr = (char *) alloca (inval1len + inval2len); -+ ptr = (char *) xmalloc (inval1len + inval2len); -+ back_to = make_cleanup (xfree, ptr); - if (TYPE_CODE (type1) == TYPE_CODE_CHAR) - { - char_type = type1; -@@ -786,6 +793,7 @@ value_concat (struct value *arg1, struct - memcpy (ptr + inval1len, value_contents (inval2), inval2len); - } - outval = value_string (ptr, inval1len + inval2len, char_type); -+ do_cleanups (back_to); - } - else if (TYPE_CODE (type1) == TYPE_CODE_BITSTRING - || TYPE_CODE (type1) == TYPE_CODE_BOOL) diff --git a/gdb-rhbz795424-bitpos-13of25.patch b/gdb-rhbz795424-bitpos-13of25.patch deleted file mode 100644 index 4ae2098..0000000 --- a/gdb-rhbz795424-bitpos-13of25.patch +++ /dev/null @@ -1,28 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00082.html - -### src/gdb/ChangeLog 2012/09/17 07:15:47 1.14664 -### src/gdb/ChangeLog 2012/09/17 07:26:54 1.14665 -## -1,3 +1,8 @@ -+2012-09-17 Siddhesh Poyarekar -+ -+ * infrun.c (restore_infcall_suspend_state): Eliminate single-use -+ variable LEN. -+ - 2012-09-17 Jan Kratochvil - - PR 14119 ---- src/gdb/infrun.c 2012/09/17 07:09:34 1.558 -+++ src/gdb/infrun.c 2012/09/17 07:26:55 1.559 -@@ -6777,11 +6777,10 @@ - if (inf_state->siginfo_gdbarch == gdbarch) - { - struct type *type = gdbarch_get_siginfo_type (gdbarch); -- size_t len = TYPE_LENGTH (type); - - /* Errors ignored. */ - target_write (¤t_target, TARGET_OBJECT_SIGNAL_INFO, NULL, -- inf_state->siginfo_data, 0, len); -+ inf_state->siginfo_data, 0, TYPE_LENGTH (type)); - } - - /* The inferior can be gone if the user types "print exit(0)" diff --git a/gdb-rhbz795424-bitpos-14of25.patch b/gdb-rhbz795424-bitpos-14of25.patch deleted file mode 100644 index a09ad5e..0000000 --- a/gdb-rhbz795424-bitpos-14of25.patch +++ /dev/null @@ -1,209 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00084.html - -### src/gdb/ChangeLog 2012/09/17 08:42:07 1.14666 -### src/gdb/ChangeLog 2012/09/17 08:52:17 1.14667 -## -1,3 +1,23 @@ -+2012-09-17 Siddhesh Poyarekar -+ -+ * m2-valprint.c (m2_print_array_contents): Eliminate variable -+ ELTLEN and use TYPE_LENGTH directly. -+ (m2_val_print): Likewise. -+ * m68k-tdep.c (m68k_svr4_extract_return_value): Eliminate -+ variable LEN and use TYPE_LENGTH directly. -+ (m68k_svr4_store_return_value): Likewise. -+ * mips-tdep.c (mips_o32_push_dummy_call): Eliminate variable -+ ARGLEN and use TYPE_LENGTH directly. -+ (mips_o64_push_dummy_call): Likewise. -+ * s390-tdep (s390_function_arg_pass_by_reference): Eliminate -+ variable LENGTH and use TYPE_LENGTH directly. -+ (s390_function_arg_float): Likewise. -+ (s390_function_arg_integer): Likewise. -+ (s390_push_dummy_call): Likewise. -+ (s390_return_value_convention): Likewise. -+ * spu-tdep.c (spu_push_dummy_call): Eliminate LEN and use -+ TYPE_LENGTH directly. -+ - 2012-09-17 Yao Qi - - * cli/cli-decode.c (add_setshow_zuinteger_unlimited_cmd): New. ---- src/gdb/m2-valprint.c 2012/08/16 07:36:20 1.45 -+++ src/gdb/m2-valprint.c 2012/09/17 08:52:18 1.46 -@@ -269,16 +269,14 @@ - const struct value_print_options *options, - int len) - { -- int eltlen; - CHECK_TYPEDEF (type); - - if (TYPE_LENGTH (type) > 0) - { -- eltlen = TYPE_LENGTH (type); - if (options->prettyprint_arrays) - print_spaces_filtered (2 + 2 * recurse, stream); - /* For an array of chars, print with string syntax. */ -- if (eltlen == 1 && -+ if (TYPE_LENGTH (type) == 1 && - ((TYPE_CODE (type) == TYPE_CODE_INT) - || ((current_language->la_language == language_m2) - && (TYPE_CODE (type) == TYPE_CODE_CHAR))) -@@ -320,7 +318,6 @@ - unsigned int i = 0; /* Number of characters printed. */ - unsigned len; - struct type *elttype; -- unsigned eltlen; - CORE_ADDR addr; - - CHECK_TYPEDEF (type); -@@ -330,12 +327,11 @@ - if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0) - { - elttype = check_typedef (TYPE_TARGET_TYPE (type)); -- eltlen = TYPE_LENGTH (elttype); -- len = TYPE_LENGTH (type) / eltlen; -+ len = TYPE_LENGTH (type) / TYPE_LENGTH (elttype); - if (options->prettyprint_arrays) - print_spaces_filtered (2 + 2 * recurse, stream); - /* For an array of chars, print with string syntax. */ -- if (eltlen == 1 && -+ if (TYPE_LENGTH (elttype) == 1 && - ((TYPE_CODE (elttype) == TYPE_CODE_INT) - || ((current_language->la_language == language_m2) - && (TYPE_CODE (elttype) == TYPE_CODE_CHAR))) ---- src/gdb/m68k-tdep.c 2012/07/24 16:37:24 1.159 -+++ src/gdb/m68k-tdep.c 2012/09/17 08:52:18 1.160 -@@ -315,7 +315,6 @@ - m68k_svr4_extract_return_value (struct type *type, struct regcache *regcache, - gdb_byte *valbuf) - { -- int len = TYPE_LENGTH (type); - gdb_byte buf[M68K_MAX_REGISTER_SIZE]; - struct gdbarch *gdbarch = get_regcache_arch (regcache); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -@@ -326,7 +325,7 @@ - regcache_raw_read (regcache, M68K_FP0_REGNUM, buf); - convert_typed_floating (buf, fpreg_type, valbuf, type); - } -- else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) -+ else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) - regcache_raw_read (regcache, M68K_A0_REGNUM, valbuf); - else - m68k_extract_return_value (type, regcache, valbuf); -@@ -357,7 +356,6 @@ - m68k_svr4_store_return_value (struct type *type, struct regcache *regcache, - const gdb_byte *valbuf) - { -- int len = TYPE_LENGTH (type); - struct gdbarch *gdbarch = get_regcache_arch (regcache); - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - -@@ -368,7 +366,7 @@ - convert_typed_floating (valbuf, type, buf, fpreg_type); - regcache_raw_write (regcache, M68K_FP0_REGNUM, buf); - } -- else if (TYPE_CODE (type) == TYPE_CODE_PTR && len == 4) -+ else if (TYPE_CODE (type) == TYPE_CODE_PTR && TYPE_LENGTH (type) == 4) - { - regcache_raw_write (regcache, M68K_A0_REGNUM, valbuf); - regcache_raw_write (regcache, M68K_D0_REGNUM, valbuf); ---- src/gdb/mips-tdep.c 2012/08/19 22:22:49 1.561 -+++ src/gdb/mips-tdep.c 2012/09/17 08:52:18 1.562 -@@ -5174,13 +5174,12 @@ - for (argnum = 0; argnum < nargs; argnum++) - { - struct type *arg_type = check_typedef (value_type (args[argnum])); -- int arglen = TYPE_LENGTH (arg_type); - - /* Align to double-word if necessary. */ - if (mips_type_needs_double_align (arg_type)) - len = align_up (len, MIPS32_REGSIZE * 2); - /* Allocate space on the stack. */ -- len += align_up (arglen, MIPS32_REGSIZE); -+ len += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE); - } - sp -= align_up (len, 16); - -@@ -5703,10 +5702,9 @@ - for (argnum = 0; argnum < nargs; argnum++) - { - struct type *arg_type = check_typedef (value_type (args[argnum])); -- int arglen = TYPE_LENGTH (arg_type); - - /* Allocate space on the stack. */ -- len += align_up (arglen, MIPS64_REGSIZE); -+ len += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE); - } - sp -= align_up (len, 16); - ---- src/gdb/s390-tdep.c 2012/05/18 21:02:50 1.206 -+++ src/gdb/s390-tdep.c 2012/09/17 08:52:18 1.207 -@@ -2489,8 +2489,7 @@ - static int - s390_function_arg_pass_by_reference (struct type *type) - { -- unsigned length = TYPE_LENGTH (type); -- if (length > 8) -+ if (TYPE_LENGTH (type) > 8) - return 1; - - return (is_struct_like (type) && !is_power_of_two (TYPE_LENGTH (type))) -@@ -2503,8 +2502,7 @@ - static int - s390_function_arg_float (struct type *type) - { -- unsigned length = TYPE_LENGTH (type); -- if (length > 8) -+ if (TYPE_LENGTH (type) > 8) - return 0; - - return is_float_like (type); -@@ -2515,13 +2513,12 @@ - static int - s390_function_arg_integer (struct type *type) - { -- unsigned length = TYPE_LENGTH (type); -- if (length > 8) -+ if (TYPE_LENGTH (type) > 8) - return 0; - - return is_integer_like (type) - || is_pointer_like (type) -- || (is_struct_like (type) && is_power_of_two (length)); -+ || (is_struct_like (type) && is_power_of_two (TYPE_LENGTH (type))); - } - - /* Return ARG, a `SIMPLE_ARG', sign-extended or zero-extended to a full -@@ -2616,11 +2613,10 @@ - { - struct value *arg = args[i]; - struct type *type = check_typedef (value_type (arg)); -- unsigned length = TYPE_LENGTH (type); - - if (s390_function_arg_pass_by_reference (type)) - { -- sp -= length; -+ sp -= TYPE_LENGTH (type); - sp = align_down (sp, alignment_of (type)); - copy_addr[i] = sp; - } -@@ -2799,8 +2795,7 @@ - static enum return_value_convention - s390_return_value_convention (struct gdbarch *gdbarch, struct type *type) - { -- int length = TYPE_LENGTH (type); -- if (length > 8) -+ if (TYPE_LENGTH (type) > 8) - return RETURN_VALUE_STRUCT_CONVENTION; - - switch (TYPE_CODE (type)) ---- src/gdb/spu-tdep.c 2012/05/18 21:02:50 1.81 -+++ src/gdb/spu-tdep.c 2012/09/17 08:52:18 1.82 -@@ -1373,8 +1373,7 @@ - struct value *arg = args[i]; - struct type *type = check_typedef (value_type (arg)); - const gdb_byte *contents = value_contents (arg); -- int len = TYPE_LENGTH (type); -- int n_regs = align_up (len, 16) / 16; -+ int n_regs = align_up (TYPE_LENGTH (type), 16) / 16; - - /* If the argument doesn't wholly fit into registers, it and - all subsequent arguments go to the stack. */ diff --git a/gdb-rhbz795424-bitpos-15of25.patch b/gdb-rhbz795424-bitpos-15of25.patch deleted file mode 100644 index bfcba69..0000000 --- a/gdb-rhbz795424-bitpos-15of25.patch +++ /dev/null @@ -1,36 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00132.html - -### src/gdb/ChangeLog 2012/09/22 13:04:54 1.14691 -### src/gdb/ChangeLog 2012/09/24 10:25:07 1.14692 -## -1,3 +1,8 @@ -+2012-09-24 Siddhesh Poyarekar -+ -+ * m2-typeprint.c (m2_enum): Expand LASTVAL to LONGEST. -+ * p-valprint.c (pascal_type_print_base): Likewise. -+ - 2012-09-22 Yao Qi - - * remote.c (remote_get_trace_status): Remove setting default ---- src/gdb/m2-typeprint.c 2012/04/18 06:46:46 1.30 -+++ src/gdb/m2-typeprint.c 2012/09/24 10:25:09 1.31 -@@ -587,7 +587,8 @@ - void - m2_enum (struct type *type, struct ui_file *stream, int show, int level) - { -- int lastval, i, len; -+ LONGEST lastval; -+ int i, len; - - if (show < 0) - { ---- src/gdb/p-typeprint.c 2012/08/16 07:36:20 1.47 -+++ src/gdb/p-typeprint.c 2012/09/24 10:25:09 1.48 -@@ -440,7 +440,7 @@ - { - int i; - int len; -- int lastval; -+ LONGEST lastval; - enum - { - s_none, s_public, s_private, s_protected diff --git a/gdb-rhbz795424-bitpos-16of25.patch b/gdb-rhbz795424-bitpos-16of25.patch deleted file mode 100644 index a91d815..0000000 --- a/gdb-rhbz795424-bitpos-16of25.patch +++ /dev/null @@ -1,27 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00138.html - -### src/gdb/ChangeLog 2012/09/24 10:25:07 1.14692 -### src/gdb/ChangeLog 2012/09/25 12:20:35 1.14693 -## -1,3 +1,8 @@ -+2012-09-25 Siddhesh Poyarekar -+ -+ * c-typeprint.c (c_type_print_varspec_suffix): Remove cast and -+ use plongest to print the array size. -+ - 2012-09-24 Siddhesh Poyarekar - - * m2-typeprint.c (m2_enum): Expand LASTVAL to LONGEST. -Index: gdb-7.5.0.20120926/gdb/c-typeprint.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/c-typeprint.c 2012-11-07 22:00:40.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/c-typeprint.c 2012-11-07 22:03:39.269650157 +0100 -@@ -631,7 +631,8 @@ c_type_print_varspec_suffix (struct type - fprintf_filtered (stream, "variable"); - } - else if (get_array_bounds (type, &low_bound, &high_bound)) -- fprintf_filtered (stream, "%d", (int) (high_bound - low_bound + 1)); -+ fprintf_filtered (stream, "%s", -+ plongest (high_bound - low_bound + 1)); - fprintf_filtered (stream, "]"); - - c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, diff --git a/gdb-rhbz795424-bitpos-17of25.patch b/gdb-rhbz795424-bitpos-17of25.patch deleted file mode 100644 index 9fada4e..0000000 --- a/gdb-rhbz795424-bitpos-17of25.patch +++ /dev/null @@ -1,729 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00142.html - -### src/gdb/ChangeLog 2012/09/25 12:38:55 1.14696 -### src/gdb/ChangeLog 2012/09/25 12:48:52 1.14697 -## -1,3 +1,36 @@ -+2012-09-25 Siddhesh Poyarekar -+ -+ * ada-valprint.c (ada_val_print_1): Eliminate single-use -+ variable LEN. -+ * alpha-tdep.c (alpha_extract_return_value): Use TYPE_LENGTH -+ directly. -+ (alpha_store_return_value): Likewise. -+ * amd64-tdep.c (amd64_classify_aggregate): Likewise. -+ (amd64_push_arguments): Likewise. -+ * ax-gdb.c (gen_trace_static_fields): Likewise. -+ (gen_traced_pop): Likewise. -+ * bfin-tdep.c (bfin_push_dummy_call): Likewise. -+ * breakpoint.c (update_watchpoint): Likewise. -+ * findcmd.c (parse_find_args): Use local variable for type -+ instead of length. -+ * findvar.c (default_read_var_value): Use TYPE_LENGTH directly. -+ * h8300-tdep.c (h8300h_extract_return_value): Likewise. -+ (h8300_store_return_value): Likewise. -+ * i386-darwin-tdep.c (i386_darwin_push_dummy_call): Likewise. -+ Use i386_darwin_arg_type_alignment directly. -+ * infcall.c (call_function_by_hand): Use TYPE_LENGTH directly. -+ * lm32-tdep.c (lm32_push_dummy_call): Likewise. -+ * m68hc11-tdep.c (m68hc11_push_dummy_call): Likewise. -+ (m68hc11_extract_return_value): Likewise. -+ * mep-tdep.c (mep_push_dummy_call): Likewise. -+ * printcmd.c (float_type_from_length): Likewise. -+ * s390-tdep.c (s390_value_from_register): Likewise. -+ * stack.c (read_frame_arg): Likewise. -+ * tracepoint.c (encode_actions_1): Likewise. -+ * valops.c (value_fetch_lazy): Use local variable for type -+ instead of length. Use TYPE_LENGTH directly. -+ * value.c (value_contents_equal): Use TYPE_LENGTH directly. -+ - 2012-09-25 Joel Brobecker - - * symtab.c (skip_prologue_sal): Fix typo in comment. -Index: gdb-7.5.0.20120926/gdb/ada-valprint.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ada-valprint.c 2012-04-18 08:46:46.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ada-valprint.c 2012-11-07 22:03:57.600623522 +0100 -@@ -730,9 +730,8 @@ ada_val_print_1 (struct type *type, cons - if (ada_is_fixed_point_type (type)) - { - LONGEST v = unpack_long (type, valaddr + offset_aligned); -- int len = TYPE_LENGTH (type); - -- fprintf_filtered (stream, len < 4 ? "%.11g" : "%.17g", -+ fprintf_filtered (stream, TYPE_LENGTH (type) < 4 ? "%.11g" : "%.17g", - (double) ada_fixed_to_float (type, v)); - return; - } -Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/alpha-tdep.c 2012-05-16 16:35:02.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/alpha-tdep.c 2012-11-07 22:03:57.602623520 +0100 -@@ -475,14 +475,13 @@ alpha_extract_return_value (struct type - { - struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); -- int length = TYPE_LENGTH (valtype); - gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; - ULONGEST l; - - switch (TYPE_CODE (valtype)) - { - case TYPE_CODE_FLT: -- switch (length) -+ switch (TYPE_LENGTH (valtype)) - { - case 4: - regcache_cooked_read (regcache, ALPHA_FP0_REGNUM, raw_buffer); -@@ -505,7 +504,7 @@ alpha_extract_return_value (struct type - break; - - case TYPE_CODE_COMPLEX: -- switch (length) -+ switch (TYPE_LENGTH (valtype)) - { - case 8: - /* ??? This isn't correct wrt the ABI, but it's what GCC does. */ -@@ -531,7 +530,7 @@ alpha_extract_return_value (struct type - default: - /* Assume everything else degenerates to an integer. */ - regcache_cooked_read_unsigned (regcache, ALPHA_V0_REGNUM, &l); -- store_unsigned_integer (valbuf, length, byte_order, l); -+ store_unsigned_integer (valbuf, TYPE_LENGTH (valtype), byte_order, l); - break; - } - } -@@ -544,14 +543,13 @@ alpha_store_return_value (struct type *v - const gdb_byte *valbuf) - { - struct gdbarch *gdbarch = get_regcache_arch (regcache); -- int length = TYPE_LENGTH (valtype); - gdb_byte raw_buffer[ALPHA_REGISTER_SIZE]; - ULONGEST l; - - switch (TYPE_CODE (valtype)) - { - case TYPE_CODE_FLT: -- switch (length) -+ switch (TYPE_LENGTH (valtype)) - { - case 4: - alpha_lds (gdbarch, raw_buffer, valbuf); -@@ -575,7 +573,7 @@ alpha_store_return_value (struct type *v - break; - - case TYPE_CODE_COMPLEX: -- switch (length) -+ switch (TYPE_LENGTH (valtype)) - { - case 8: - /* ??? This isn't correct wrt the ABI, but it's what GCC does. */ -@@ -603,7 +601,7 @@ alpha_store_return_value (struct type *v - /* Assume everything else degenerates to an integer. */ - /* 32-bit values must be sign-extended to 64 bits - even if the base data type is unsigned. */ -- if (length == 4) -+ if (TYPE_LENGTH (valtype) == 4) - valtype = builtin_type (gdbarch)->builtin_int32; - l = unpack_long (valtype, valbuf); - regcache_cooked_write_unsigned (regcache, ALPHA_V0_REGNUM, l); -Index: gdb-7.5.0.20120926/gdb/amd64-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/amd64-tdep.c 2012-11-07 22:00:42.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/amd64-tdep.c 2012-11-07 22:03:57.623623489 +0100 -@@ -446,12 +446,10 @@ amd64_non_pod_p (struct type *type) - static void - amd64_classify_aggregate (struct type *type, enum amd64_reg_class class[2]) - { -- int len = TYPE_LENGTH (type); -- - /* 1. If the size of an object is larger than two eightbytes, or in - C++, is a non-POD structure or union type, or contains - unaligned fields, it has class memory. */ -- if (len > 16 || amd64_non_pod_p (type)) -+ if (TYPE_LENGTH (type) > 16 || amd64_non_pod_p (type)) - { - class[0] = class[1] = AMD64_MEMORY; - return; -@@ -471,7 +469,7 @@ amd64_classify_aggregate (struct type *t - - /* All fields in an array have the same type. */ - amd64_classify (subtype, class); -- if (len > 8 && class[1] == AMD64_NO_CLASS) -+ if (TYPE_LENGTH (type) > 8 && class[1] == AMD64_NO_CLASS) - class[1] = class[0]; - } - else -@@ -839,10 +837,9 @@ amd64_push_arguments (struct regcache *r - { - struct type *type = value_type (stack_args[i]); - const gdb_byte *valbuf = value_contents (stack_args[i]); -- int len = TYPE_LENGTH (type); - CORE_ADDR arg_addr = sp + element * 8; - -- write_memory (arg_addr, valbuf, len); -+ write_memory (arg_addr, valbuf, TYPE_LENGTH (type)); - if (arg_addr_regno[i] >= 0) - { - /* We also need to store the address of that argument in -@@ -853,7 +850,7 @@ amd64_push_arguments (struct regcache *r - store_unsigned_integer (buf, 8, byte_order, arg_addr); - regcache_cooked_write (regcache, arg_addr_regno[i], buf); - } -- element += ((len + 7) / 8); -+ element += ((TYPE_LENGTH (type) + 7) / 8); - } - - /* The psABI says that "For calls that may call functions that use -Index: gdb-7.5.0.20120926/gdb/ax-gdb.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ax-gdb.c 2012-07-05 03:03:01.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ax-gdb.c 2012-11-07 22:03:57.626623484 +0100 -@@ -367,9 +367,9 @@ gen_trace_static_fields (struct gdbarch - { - case axs_lvalue_memory: - { -- int length = TYPE_LENGTH (check_typedef (value.type)); -- -- ax_const_l (ax, length); -+ /* Initialize the TYPE_LENGTH if it is a typedef. */ -+ check_typedef (value.type); -+ ax_const_l (ax, TYPE_LENGTH (value.type)); - ax_simple (ax, aop_trace); - } - break; -@@ -425,17 +425,18 @@ gen_traced_pop (struct gdbarch *gdbarch, - - case axs_lvalue_memory: - { -- int length = TYPE_LENGTH (check_typedef (value->type)); -- - if (string_trace) - ax_simple (ax, aop_dup); - -+ /* Initialize the TYPE_LENGTH if it is a typedef. */ -+ check_typedef (value->type); -+ - /* There's no point in trying to use a trace_quick bytecode - here, since "trace_quick SIZE pop" is three bytes, whereas - "const8 SIZE trace" is also three bytes, does the same - thing, and the simplest code which generates that will also - work correctly for objects with large sizes. */ -- ax_const_l (ax, length); -+ ax_const_l (ax, TYPE_LENGTH (value->type)); - ax_simple (ax, aop_trace); - - if (string_trace) -Index: gdb-7.5.0.20120926/gdb/bfin-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/bfin-tdep.c 2012-05-16 16:35:03.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/bfin-tdep.c 2012-11-07 22:03:57.643623460 +0100 -@@ -513,9 +513,8 @@ bfin_push_dummy_call (struct gdbarch *gd - for (i = nargs - 1; i >= 0; i--) - { - struct type *value_type = value_enclosing_type (args[i]); -- int len = TYPE_LENGTH (value_type); - -- total_len += (len + 3) & ~3; -+ total_len += (TYPE_LENGTH (value_type) + 3) & ~3; - } - - /* At least twelve bytes of stack space must be allocated for the function's -@@ -531,8 +530,7 @@ bfin_push_dummy_call (struct gdbarch *gd - { - struct type *value_type = value_enclosing_type (args[i]); - struct type *arg_type = check_typedef (value_type); -- int len = TYPE_LENGTH (value_type); -- int container_len = (len + 3) & ~3; -+ int container_len = (TYPE_LENGTH (value_type) + 3) & ~3; - - sp -= container_len; - write_memory (sp, value_contents_writeable (args[i]), container_len); -Index: gdb-7.5.0.20120926/gdb/breakpoint.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/breakpoint.c 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/breakpoint.c 2012-11-07 22:03:57.660623434 +0100 -@@ -1844,11 +1844,10 @@ update_watchpoint (struct watchpoint *b, - && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) - { - CORE_ADDR addr; -- int len, type; -+ int type; - struct bp_location *loc, **tmp; - - addr = value_address (v); -- len = TYPE_LENGTH (value_type (v)); - type = hw_write; - if (b->base.type == bp_read_watchpoint) - type = hw_read; -@@ -1863,7 +1862,7 @@ update_watchpoint (struct watchpoint *b, - - loc->pspace = frame_pspace; - loc->address = addr; -- loc->length = len; -+ loc->length = TYPE_LENGTH (value_type (v)); - loc->watchpoint_type = type; - } - } -Index: gdb-7.5.0.20120926/gdb/findcmd.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/findcmd.c 2012-07-06 17:51:39.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/findcmd.c 2012-11-07 22:03:57.676623411 +0100 -@@ -169,19 +169,19 @@ parse_find_args (char *args, ULONGEST *m - while (*s != '\0') - { - LONGEST x; -- int val_bytes; -+ struct type *t; - ULONGEST pattern_buf_size_need; - - while (isspace (*s)) - ++s; - - v = parse_to_comma_and_eval (&s); -- val_bytes = TYPE_LENGTH (value_type (v)); -+ t = value_type (v); - - /* Keep it simple and assume size == 'g' when watching for when we - need to grow the pattern buf. */ - pattern_buf_size_need = (pattern_buf_end - pattern_buf -- + max (val_bytes, sizeof (int64_t))); -+ + max (TYPE_LENGTH (t), sizeof (int64_t))); - if (pattern_buf_size_need > pattern_buf_size) - { - size_t current_offset = pattern_buf_end - pattern_buf; -@@ -215,8 +215,8 @@ parse_find_args (char *args, ULONGEST *m - } - else - { -- memcpy (pattern_buf_end, value_contents (v), val_bytes); -- pattern_buf_end += val_bytes; -+ memcpy (pattern_buf_end, value_contents (v), TYPE_LENGTH (t)); -+ pattern_buf_end += TYPE_LENGTH (t); - } - - if (*s == ',') -Index: gdb-7.5.0.20120926/gdb/h8300-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/h8300-tdep.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/h8300-tdep.c 2012-11-07 22:03:57.679623409 +0100 -@@ -785,16 +785,15 @@ h8300h_extract_return_value (struct type - { - struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); -- int len = TYPE_LENGTH (type); - ULONGEST c; - -- switch (len) -+ switch (TYPE_LENGTH (type)) - { - case 1: - case 2: - case 4: - regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c); -- store_unsigned_integer (valbuf, len, byte_order, c); -+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c); - break; - case 8: /* long long is now 8 bytes. */ - if (TYPE_CODE (type) == TYPE_CODE_INT) -@@ -852,18 +851,17 @@ h8300_store_return_value (struct type *t - { - struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); -- int len = TYPE_LENGTH (type); - ULONGEST val; - -- switch (len) -+ switch (TYPE_LENGTH (type)) - { - case 1: - case 2: /* short... */ -- val = extract_unsigned_integer (valbuf, len, byte_order); -+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order); - regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val); - break; - case 4: /* long, float */ -- val = extract_unsigned_integer (valbuf, len, byte_order); -+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order); - regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, - (val >> 16) & 0xffff); - regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, val & 0xffff); -@@ -882,19 +880,18 @@ h8300h_store_return_value (struct type * - { - struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); -- int len = TYPE_LENGTH (type); - ULONGEST val; - -- switch (len) -+ switch (TYPE_LENGTH (type)) - { - case 1: - case 2: - case 4: /* long, float */ -- val = extract_unsigned_integer (valbuf, len, byte_order); -+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order); - regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, val); - break; - case 8: -- val = extract_unsigned_integer (valbuf, len, byte_order); -+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order); - regcache_cooked_write_unsigned (regcache, E_RET0_REGNUM, - (val >> 32) & 0xffffffff); - regcache_cooked_write_unsigned (regcache, E_RET1_REGNUM, -Index: gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/i386-darwin-tdep.c 2012-04-02 15:15:48.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c 2012-11-07 22:03:57.680623407 +0100 -@@ -196,13 +196,12 @@ i386_darwin_push_dummy_call (struct gdba - } - else - { -- int len = TYPE_LENGTH (arg_type); -- int align = i386_darwin_arg_type_alignment (arg_type); -- -- args_space = align_up (args_space, align); -+ args_space = align_up (args_space, -+ i386_darwin_arg_type_alignment (arg_type)); - if (write_pass) - write_memory (sp + args_space, -- value_contents_all (args[i]), len); -+ value_contents_all (args[i]), -+ TYPE_LENGTH (arg_type)); - - /* The System V ABI says that: - -@@ -211,7 +210,7 @@ i386_darwin_push_dummy_call (struct gdba - depending on the size of the argument." - - This makes sure the stack stays word-aligned. */ -- args_space += align_up (len, 4); -+ args_space += align_up (TYPE_LENGTH (arg_type), 4); - } - } - -Index: gdb-7.5.0.20120926/gdb/infcall.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/infcall.c 2012-07-31 09:34:39.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/infcall.c 2012-11-07 22:03:57.694623385 +0100 -@@ -709,13 +709,11 @@ call_function_by_hand (struct value *fun - - if (struct_return || hidden_first_param_p) - { -- int len = TYPE_LENGTH (values_type); -- - if (gdbarch_inner_than (gdbarch, 1, 2)) - { - /* Stack grows downward. Align STRUCT_ADDR and SP after - making space for the return value. */ -- sp -= len; -+ sp -= TYPE_LENGTH (values_type); - if (gdbarch_frame_align_p (gdbarch)) - sp = gdbarch_frame_align (gdbarch, sp); - struct_addr = sp; -@@ -727,7 +725,7 @@ call_function_by_hand (struct value *fun - if (gdbarch_frame_align_p (gdbarch)) - sp = gdbarch_frame_align (gdbarch, sp); - struct_addr = sp; -- sp += len; -+ sp += TYPE_LENGTH (values_type); - if (gdbarch_frame_align_p (gdbarch)) - sp = gdbarch_frame_align (gdbarch, sp); - } -Index: gdb-7.5.0.20120926/gdb/lm32-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/lm32-tdep.c 2012-05-18 23:02:48.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/lm32-tdep.c 2012-11-07 22:03:57.695623384 +0100 -@@ -261,7 +261,6 @@ lm32_push_dummy_call (struct gdbarch *gd - struct value *arg = args[i]; - struct type *arg_type = check_typedef (value_type (arg)); - gdb_byte *contents; -- int len; - ULONGEST val; - - /* Promote small integer types to int. */ -@@ -283,8 +282,8 @@ lm32_push_dummy_call (struct gdbarch *gd - /* FIXME: Handle structures. */ - - contents = (gdb_byte *) value_contents (arg); -- len = TYPE_LENGTH (arg_type); -- val = extract_unsigned_integer (contents, len, byte_order); -+ val = extract_unsigned_integer (contents, TYPE_LENGTH (arg_type), -+ byte_order); - - /* First num_arg_regs parameters are passed by registers, - and the rest are passed on the stack. */ -@@ -292,7 +291,7 @@ lm32_push_dummy_call (struct gdbarch *gd - regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val); - else - { -- write_memory (sp, (void *) &val, len); -+ write_memory (sp, (void *) &val, TYPE_LENGTH (arg_type)); - sp -= 4; - } - } -Index: gdb-7.5.0.20120926/gdb/m68hc11-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m68hc11-tdep.c 2012-05-16 16:35:06.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/m68hc11-tdep.c 2012-11-07 22:03:57.724623347 +0100 -@@ -1174,7 +1174,6 @@ m68hc11_push_dummy_call (struct gdbarch - int first_stack_argnum; - struct type *type; - char *val; -- int len; - char buf[2]; - - first_stack_argnum = 0; -@@ -1185,19 +1184,18 @@ m68hc11_push_dummy_call (struct gdbarch - else if (nargs > 0) - { - type = value_type (args[0]); -- len = TYPE_LENGTH (type); - - /* First argument is passed in D and X registers. */ -- if (len <= 4) -+ if (TYPE_LENGTH (type) <= 4) - { - ULONGEST v; - - v = extract_unsigned_integer (value_contents (args[0]), -- len, byte_order); -+ TYPE_LENGTH (type), byte_order); - first_stack_argnum = 1; - - regcache_cooked_write_unsigned (regcache, HARD_D_REGNUM, v); -- if (len > 2) -+ if (TYPE_LENGTH (type) > 2) - { - v >>= 16; - regcache_cooked_write_unsigned (regcache, HARD_X_REGNUM, v); -@@ -1208,9 +1206,8 @@ m68hc11_push_dummy_call (struct gdbarch - for (argnum = nargs - 1; argnum >= first_stack_argnum; argnum--) - { - type = value_type (args[argnum]); -- len = TYPE_LENGTH (type); - -- if (len & 1) -+ if (TYPE_LENGTH (type) & 1) - { - static char zero = 0; - -@@ -1218,8 +1215,8 @@ m68hc11_push_dummy_call (struct gdbarch - write_memory (sp, &zero, 1); - } - val = (char*) value_contents (args[argnum]); -- sp -= len; -- write_memory (sp, val, len); -+ sp -= TYPE_LENGTH (type); -+ write_memory (sp, val, TYPE_LENGTH (type)); - } - - /* Store return address. */ -@@ -1291,11 +1288,10 @@ static void - m68hc11_extract_return_value (struct type *type, struct regcache *regcache, - void *valbuf) - { -- int len = TYPE_LENGTH (type); - char buf[M68HC11_REG_SIZE]; - - regcache_raw_read (regcache, HARD_D_REGNUM, buf); -- switch (len) -+ switch (TYPE_LENGTH (type)) - { - case 1: - memcpy (valbuf, buf + 1, 1); -Index: gdb-7.5.0.20120926/gdb/mep-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/mep-tdep.c 2012-05-16 16:35:06.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/mep-tdep.c 2012-11-07 22:03:57.727623334 +0100 -@@ -2337,11 +2337,10 @@ mep_push_dummy_call (struct gdbarch *gdb - - for (i = 0; i < argc; i++) - { -- unsigned arg_size = TYPE_LENGTH (value_type (argv[i])); - ULONGEST value; - - /* Arguments that fit in a GPR get expanded to fill the GPR. */ -- if (arg_size <= MEP_GPR_SIZE) -+ if (TYPE_LENGTH (value_type (argv[i])) <= MEP_GPR_SIZE) - value = extract_unsigned_integer (value_contents (argv[i]), - TYPE_LENGTH (value_type (argv[i])), - byte_order); -Index: gdb-7.5.0.20120926/gdb/printcmd.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/printcmd.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/printcmd.c 2012-11-07 22:03:57.730623334 +0100 -@@ -347,13 +347,12 @@ float_type_from_length (struct type *typ - { - struct gdbarch *gdbarch = get_type_arch (type); - const struct builtin_type *builtin = builtin_type (gdbarch); -- unsigned int len = TYPE_LENGTH (type); - -- if (len == TYPE_LENGTH (builtin->builtin_float)) -+ if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_float)) - type = builtin->builtin_float; -- else if (len == TYPE_LENGTH (builtin->builtin_double)) -+ else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_double)) - type = builtin->builtin_double; -- else if (len == TYPE_LENGTH (builtin->builtin_long_double)) -+ else if (TYPE_LENGTH (type) == TYPE_LENGTH (builtin->builtin_long_double)) - type = builtin->builtin_long_double; - - return type; -Index: gdb-7.5.0.20120926/gdb/s390-tdep.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/s390-tdep.c 2012-11-07 22:02:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/s390-tdep.c 2012-11-07 22:03:57.733623329 +0100 -@@ -376,9 +376,11 @@ s390_value_from_register (struct type *t - struct frame_info *frame) - { - struct value *value = default_value_from_register (type, regnum, frame); -- int len = TYPE_LENGTH (check_typedef (type)); - -- if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM && len < 8) -+ check_typedef (type); -+ -+ if (regnum >= S390_F0_REGNUM && regnum <= S390_F15_REGNUM -+ && TYPE_LENGTH (type) < 8) - set_value_offset (value, 0); - - return value; -Index: gdb-7.5.0.20120926/gdb/stack.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/stack.c 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/stack.c 2012-11-07 22:03:57.737623322 +0100 -@@ -354,14 +354,15 @@ read_frame_arg (struct symbol *sym, stru - - if (val && entryval && !ui_out_is_mi_like_p (current_uiout)) - { -- unsigned len = TYPE_LENGTH (value_type (val)); -+ struct type *type = value_type (val); - - if (!value_optimized_out (val) && value_lazy (val)) - value_fetch_lazy (val); - if (!value_optimized_out (val) && value_lazy (entryval)) - value_fetch_lazy (entryval); - if (!value_optimized_out (val) -- && value_available_contents_eq (val, 0, entryval, 0, len)) -+ && value_available_contents_eq (val, 0, entryval, 0, -+ TYPE_LENGTH (type))) - { - /* Initialize it just to avoid a GCC false warning. */ - struct value *val_deref = NULL, *entryval_deref; -@@ -373,12 +374,12 @@ read_frame_arg (struct symbol *sym, stru - - TRY_CATCH (except, RETURN_MASK_ERROR) - { -- unsigned len_deref; -+ struct type *type_deref; - - val_deref = coerce_ref (val); - if (value_lazy (val_deref)) - value_fetch_lazy (val_deref); -- len_deref = TYPE_LENGTH (value_type (val_deref)); -+ type_deref = value_type (val_deref); - - entryval_deref = coerce_ref (entryval); - if (value_lazy (entryval_deref)) -@@ -389,7 +390,7 @@ read_frame_arg (struct symbol *sym, stru - if (val != val_deref - && value_available_contents_eq (val_deref, 0, - entryval_deref, 0, -- len_deref)) -+ TYPE_LENGTH (type_deref))) - val_equal = 1; - } - -Index: gdb-7.5.0.20120926/gdb/tracepoint.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/tracepoint.c 2012-06-30 00:46:46.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/tracepoint.c 2012-11-07 22:03:57.741623318 +0100 -@@ -1450,7 +1450,7 @@ encode_actions_1 (struct command_line *a - } - else - { -- unsigned long addr, len; -+ unsigned long addr; - struct cleanup *old_chain = NULL; - struct cleanup *old_chain1 = NULL; - -@@ -1480,8 +1480,10 @@ encode_actions_1 (struct command_line *a - /* Safe because we know it's a simple expression. */ - tempval = evaluate_expression (exp); - addr = value_address (tempval); -- len = TYPE_LENGTH (check_typedef (exp->elts[1].type)); -- add_memrange (collect, memrange_absolute, addr, len); -+ /* Initialize the TYPE_LENGTH if it is a typedef. */ -+ check_typedef (exp->elts[1].type); -+ add_memrange (collect, memrange_absolute, addr, -+ TYPE_LENGTH (exp->elts[1].type)); - break; - - case OP_VAR_VALUE: -Index: gdb-7.5.0.20120926/gdb/valops.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valops.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/valops.c 2012-11-07 22:06:35.899393539 +0100 -@@ -1055,7 +1055,6 @@ value_fetch_lazy (struct value *val) - struct value *parent = value_parent (val); - LONGEST offset = value_offset (val); - LONGEST num; -- int length = TYPE_LENGTH (type); - - if (!value_bits_valid (val, - TARGET_CHAR_BIT * offset + value_bitpos (val), -@@ -1069,9 +1068,9 @@ value_fetch_lazy (struct value *val) - value_bitsize (val), parent, &num)) - mark_value_bytes_unavailable (val, - value_embedded_offset (val), -- length); -+ TYPE_LENGTH (type)); - else -- store_signed_integer (value_contents_raw (val), length, -+ store_signed_integer (value_contents_raw (val), TYPE_LENGTH (type), - byte_order, num); - } - else if (VALUE_LVAL (val) == lval_memory) -@@ -1080,16 +1079,16 @@ value_fetch_lazy (struct value *val) - - if (object_address_get_data (value_type (val), &addr)) - { -- struct type *type = value_enclosing_type (val); -- int length = TYPE_LENGTH (check_typedef (type)); -+ struct type *type = check_typedef (value_enclosing_type (val)); - -- if (length) -+ if (TYPE_LENGTH (type)) - { - /* Delay it after object_address_get_data above. */ - allocate_value_contents (val); - addr += value_offset (val); - read_value_memory (val, 0, value_stack (val), -- addr, value_contents_all_raw (val), length); -+ addr, value_contents_all_raw (val), -+ TYPE_LENGTH (type)); - } - } - /* Just to be sure it has been called. */ -Index: gdb-7.5.0.20120926/gdb/value.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/value.c 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/value.c 2012-11-07 22:03:57.751623303 +0100 -@@ -1034,15 +1034,14 @@ value_contents_equal (struct value *val1 - { - struct type *type1; - struct type *type2; -- int len; - - type1 = check_typedef (value_type (val1)); - type2 = check_typedef (value_type (val2)); -- len = TYPE_LENGTH (type1); -- if (len != TYPE_LENGTH (type2)) -+ if (TYPE_LENGTH (type1) != TYPE_LENGTH (type2)) - return 0; - -- return (memcmp (value_contents (val1), value_contents (val2), len) == 0); -+ return (memcmp (value_contents (val1), value_contents (val2), -+ TYPE_LENGTH (type1)) == 0); - } - - int diff --git a/gdb-rhbz795424-bitpos-18of25.patch b/gdb-rhbz795424-bitpos-18of25.patch deleted file mode 100644 index 162b556..0000000 --- a/gdb-rhbz795424-bitpos-18of25.patch +++ /dev/null @@ -1,45 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00145.html - -### src/gdb/ChangeLog 2012/09/25 12:48:52 1.14697 -### src/gdb/ChangeLog 2012/09/26 02:06:51 1.14698 -## -1,3 +1,8 @@ -+2012-09-26 Siddhesh Poyarekar -+ -+ * breakpoint.c (invalidate_bp_value_on_memory_change): Expand -+ parameter LEN to ssize_t. -+ - 2012-09-25 Siddhesh Poyarekar - - * ada-valprint.c (ada_val_print_1): Eliminate single-use ---- src/gdb/breakpoint.c 2012/09/25 12:48:52 1.705 -+++ src/gdb/breakpoint.c 2012/09/26 02:06:54 1.706 -@@ -14718,7 +14718,7 @@ - GDB itself. */ - - static void --invalidate_bp_value_on_memory_change (CORE_ADDR addr, int len, -+invalidate_bp_value_on_memory_change (CORE_ADDR addr, ssize_t len, - const bfd_byte *data) - { - struct breakpoint *bp; -### src/gdb/doc/ChangeLog 2012/09/21 01:46:42 1.1370 -### src/gdb/doc/ChangeLog 2012/09/26 02:06:55 1.1371 -## -1,3 +1,7 @@ -+2012-09-26 Siddhesh Poyarekar -+ -+ * observer.texi (memory_changed): Expand parameter LEN to ssize_t. -+ - 2012-09-21 Yao Qi - Pedro Alves - ---- src/gdb/doc/observer.texi 2012/09/21 01:46:43 1.40 -+++ src/gdb/doc/observer.texi 2012/09/26 02:06:55 1.41 -@@ -230,7 +230,7 @@ - This method is called immediately before freeing @var{inf}. - @end deftypefun - --@deftypefun void memory_changed (CORE_ADDR @var{addr}, int @var{len}, const bfd_byte *@var{data}) -+@deftypefun void memory_changed (CORE_ADDR @var{addr}, ssize_t @var{len}, const bfd_byte *@var{data}) - Bytes from @var{data} to @var{data} + @var{len} have been written - to the current inferior at @var{addr}. - @end deftypefun diff --git a/gdb-rhbz795424-bitpos-19of25.patch b/gdb-rhbz795424-bitpos-19of25.patch deleted file mode 100644 index ea50ec7..0000000 --- a/gdb-rhbz795424-bitpos-19of25.patch +++ /dev/null @@ -1,260 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00147.html - -### src/gdb/ChangeLog 2012/09/26 02:06:51 1.14698 -### src/gdb/ChangeLog 2012/09/26 07:52:44 1.14699 -## -1,5 +1,19 @@ - 2012-09-26 Siddhesh Poyarekar - -+ * amd64-tdep.c (amd64_return_value): Use TYPE_LENGTH directly. -+ * bfin-tdep.c (bfin_extract_return_value): Likewise. -+ (bfin_store_return_value): Likewise. -+ * cris-tdep.c (cris_store_return_value): Likewise. -+ (cris_extract_return_value): Likewise. -+ * h8300-tdep.c (h8300_extract_return_value): Likewise. -+ * hppa-tdep.c (hppa64_return_value): Likewise. -+ * lm32-tdep.c (lm32_store_return_value): Likewise. -+ * microblaze-tdep.c (microblaze_store_return_value): Likewise. -+ * spu-tdep.c (spu_value_from_register): Likewise. -+ * vax-tdep.c (vax_return_value): Likewise. -+ -+2012-09-26 Siddhesh Poyarekar -+ - * breakpoint.c (invalidate_bp_value_on_memory_change): Expand - parameter LEN to ssize_t. - ---- src/gdb/amd64-tdep.c 2012/09/25 12:48:52 1.110 -+++ src/gdb/amd64-tdep.c 2012/09/26 07:52:47 1.111 -@@ -637,7 +637,7 @@ - } - - gdb_assert (class[1] != AMD64_MEMORY); -- gdb_assert (len <= 16); -+ gdb_assert (TYPE_LENGTH (type) <= 16); - - for (i = 0; len > 0; i++, len -= 8) - { ---- src/gdb/bfin-tdep.c 2012/09/25 12:48:52 1.11 -+++ src/gdb/bfin-tdep.c 2012/09/26 07:52:47 1.12 -@@ -615,7 +615,7 @@ - ULONGEST tmp; - int regno = BFIN_R0_REGNUM; - -- gdb_assert (len <= 8); -+ gdb_assert (TYPE_LENGTH (type) <= 8); - - while (len > 0) - { -@@ -643,7 +643,7 @@ - int len = TYPE_LENGTH (type); - int regno = BFIN_R0_REGNUM; - -- gdb_assert (len <= 8); -+ gdb_assert (TYPE_LENGTH (type) <= 8); - - while (len > 0) - { ---- src/gdb/cris-tdep.c 2012/05/18 21:02:47 1.185 -+++ src/gdb/cris-tdep.c 2012/09/26 07:52:47 1.186 -@@ -1662,20 +1662,20 @@ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - ULONGEST val; -- int len = TYPE_LENGTH (type); - -- if (len <= 4) -+ if (TYPE_LENGTH (type) <= 4) - { - /* Put the return value in R10. */ -- val = extract_unsigned_integer (valbuf, len, byte_order); -+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order); - regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val); - } -- else if (len <= 8) -+ else if (TYPE_LENGTH (type) <= 8) - { - /* Put the return value in R10 and R11. */ - val = extract_unsigned_integer (valbuf, 4, byte_order); - regcache_cooked_write_unsigned (regcache, ARG1_REGNUM, val); -- val = extract_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order); -+ val = extract_unsigned_integer ((char *)valbuf + 4, -+ TYPE_LENGTH (type) - 4, byte_order); - regcache_cooked_write_unsigned (regcache, ARG2_REGNUM, val); - } - else -@@ -1833,21 +1833,21 @@ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - ULONGEST val; -- int len = TYPE_LENGTH (type); - -- if (len <= 4) -+ if (TYPE_LENGTH (type) <= 4) - { - /* Get the return value from R10. */ - regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val); -- store_unsigned_integer (valbuf, len, byte_order, val); -+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, val); - } -- else if (len <= 8) -+ else if (TYPE_LENGTH (type) <= 8) - { - /* Get the return value from R10 and R11. */ - regcache_cooked_read_unsigned (regcache, ARG1_REGNUM, &val); - store_unsigned_integer (valbuf, 4, byte_order, val); - regcache_cooked_read_unsigned (regcache, ARG2_REGNUM, &val); -- store_unsigned_integer ((char *)valbuf + 4, len - 4, byte_order, val); -+ store_unsigned_integer ((char *)valbuf + 4, TYPE_LENGTH (type) - 4, -+ byte_order, val); - } - else - error (_("cris_extract_return_value: type length too large")); ---- src/gdb/h8300-tdep.c 2012/09/25 12:48:53 1.136 -+++ src/gdb/h8300-tdep.c 2012/09/26 07:52:48 1.137 -@@ -751,12 +751,12 @@ - int len = TYPE_LENGTH (type); - ULONGEST c, addr; - -- switch (len) -+ switch (TYPE_LENGTH (type)) - { - case 1: - case 2: - regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c); -- store_unsigned_integer (valbuf, len, byte_order, c); -+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c); - break; - case 4: /* Needs two registers on plain H8/300 */ - regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &c); -@@ -768,8 +768,9 @@ - if (TYPE_CODE (type) == TYPE_CODE_INT) - { - regcache_cooked_read_unsigned (regcache, E_RET0_REGNUM, &addr); -- c = read_memory_unsigned_integer ((CORE_ADDR) addr, len, byte_order); -- store_unsigned_integer (valbuf, len, byte_order, c); -+ c = read_memory_unsigned_integer ((CORE_ADDR) addr, -+ TYPE_LENGTH (type), byte_order); -+ store_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order, c); - } - else - { ---- src/gdb/hppa-tdep.c 2012/05/18 21:02:48 1.281 -+++ src/gdb/hppa-tdep.c 2012/09/26 07:52:48 1.282 -@@ -1160,7 +1160,7 @@ - int len = TYPE_LENGTH (type); - int regnum, offset; - -- if (len > 16) -+ if (TYPE_LENGTH (type) > 16) - { - /* All return values larget than 128 bits must be aggregate - return values. */ ---- src/gdb/lm32-tdep.c 2012/09/25 12:48:53 1.13 -+++ src/gdb/lm32-tdep.c 2012/09/26 07:52:48 1.14 -@@ -349,18 +349,18 @@ - struct gdbarch *gdbarch = get_regcache_arch (regcache); - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - ULONGEST val; -- int len = TYPE_LENGTH (type); - -- if (len <= 4) -+ if (TYPE_LENGTH (type) <= 4) - { -- val = extract_unsigned_integer (valbuf, len, byte_order); -+ val = extract_unsigned_integer (valbuf, TYPE_LENGTH (type), byte_order); - regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val); - } -- else if (len <= 8) -+ else if (TYPE_LENGTH (type) <= 8) - { - val = extract_unsigned_integer (valbuf, 4, byte_order); - regcache_cooked_write_unsigned (regcache, SIM_LM32_R1_REGNUM, val); -- val = extract_unsigned_integer (valbuf + 4, len - 4, byte_order); -+ val = extract_unsigned_integer (valbuf + 4, TYPE_LENGTH (type) - 4, -+ byte_order); - regcache_cooked_write_unsigned (regcache, SIM_LM32_R2_REGNUM, val); - } - else ---- src/gdb/microblaze-tdep.c 2012/08/02 09:36:39 1.13 -+++ src/gdb/microblaze-tdep.c 2012/09/26 07:52:48 1.14 -@@ -590,22 +590,21 @@ - microblaze_store_return_value (struct type *type, struct regcache *regcache, - const gdb_byte *valbuf) - { -- int len = TYPE_LENGTH (type); - gdb_byte buf[8]; - - memset (buf, 0, sizeof(buf)); - - /* Integral and pointer return values. */ - -- if (len > 4) -+ if (TYPE_LENGTH (type) > 4) - { -- gdb_assert (len == 8); -+ gdb_assert (TYPE_LENGTH (type) == 8); - memcpy (buf, valbuf, 8); - regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM+1, buf + 4); - } - else - /* ??? Do we need to do any sign-extension here? */ -- memcpy (buf + 4 - len, valbuf, len); -+ memcpy (buf + 4 - TYPE_LENGTH (type), valbuf, TYPE_LENGTH (type)); - - regcache_cooked_write (regcache, MICROBLAZE_RETVAL_REGNUM, buf); - } ---- src/gdb/spu-tdep.c 2012/09/17 08:52:18 1.82 -+++ src/gdb/spu-tdep.c 2012/09/26 07:52:48 1.83 -@@ -316,11 +316,10 @@ - struct frame_info *frame) - { - struct value *value = default_value_from_register (type, regnum, frame); -- int len = TYPE_LENGTH (type); - -- if (regnum < SPU_NUM_GPRS && len < 16) -+ if (regnum < SPU_NUM_GPRS && TYPE_LENGTH (type) < 16) - { -- int preferred_slot = len < 4 ? 4 - len : 0; -+ int preferred_slot = TYPE_LENGTH (type) < 4 ? 4 - TYPE_LENGTH (type) : 0; - set_value_offset (value, preferred_slot); - } - ---- src/gdb/vax-tdep.c 2012/05/16 14:35:08 1.112 -+++ src/gdb/vax-tdep.c 2012/09/26 07:52:48 1.113 -@@ -208,7 +208,6 @@ - struct type *type, struct regcache *regcache, - gdb_byte *readbuf, const gdb_byte *writebuf) - { -- int len = TYPE_LENGTH (type); - gdb_byte buf[8]; - - if (TYPE_CODE (type) == TYPE_CODE_STRUCT -@@ -224,7 +223,7 @@ - ULONGEST addr; - - regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr); -- read_memory (addr, readbuf, len); -+ read_memory (addr, readbuf, TYPE_LENGTH (type)); - } - - return RETURN_VALUE_ABI_RETURNS_ADDRESS; -@@ -234,16 +233,16 @@ - { - /* Read the contents of R0 and (if necessary) R1. */ - regcache_cooked_read (regcache, VAX_R0_REGNUM, buf); -- if (len > 4) -+ if (TYPE_LENGTH (type) > 4) - regcache_cooked_read (regcache, VAX_R1_REGNUM, buf + 4); -- memcpy (readbuf, buf, len); -+ memcpy (readbuf, buf, TYPE_LENGTH (type)); - } - if (writebuf) - { - /* Read the contents to R0 and (if necessary) R1. */ -- memcpy (buf, writebuf, len); -+ memcpy (buf, writebuf, TYPE_LENGTH (type)); - regcache_cooked_write (regcache, VAX_R0_REGNUM, buf); -- if (len > 4) -+ if (TYPE_LENGTH (type) > 4) - regcache_cooked_write (regcache, VAX_R1_REGNUM, buf + 4); - } - diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index 1210127..b3204e1 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -463,10 +463,10 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-main.patch -Index: gdb-7.5.0.20120926/gdb/ada-lang.c +Index: gdb-7.5.50.20130118/gdb/ada-lang.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ada-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/ada-lang.c 2012-11-07 22:09:29.668141036 +0100 +--- gdb-7.5.50.20130118.orig/gdb/ada-lang.c 2013-01-18 23:27:22.060601299 +0100 ++++ gdb-7.5.50.20130118/gdb/ada-lang.c 2013-01-18 23:27:28.845607295 +0100 @@ -80,7 +80,7 @@ static struct type *desc_bounds_type (st static struct value *desc_bounds (struct value *); @@ -539,7 +539,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c struct type *); static struct value *assign_aggregate (struct value *, struct value *, -@@ -586,7 +587,7 @@ coerce_unspec_val_to_type (struct value +@@ -587,7 +588,7 @@ coerce_unspec_val_to_type (struct value } static const gdb_byte * @@ -548,7 +548,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c { if (valaddr == NULL) return NULL; -@@ -595,7 +596,7 @@ cond_offset_host (const gdb_byte *valadd +@@ -596,7 +597,7 @@ cond_offset_host (const gdb_byte *valadd } static CORE_ADDR @@ -557,7 +557,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c { if (address == 0) return 0; -@@ -1601,7 +1602,7 @@ desc_bounds (struct value *arr) +@@ -1602,7 +1603,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ @@ -566,7 +566,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); -@@ -1667,7 +1668,7 @@ desc_data (struct value *arr) +@@ -1668,7 +1669,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ @@ -575,7 +575,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); -@@ -1702,7 +1703,7 @@ desc_one_bound (struct value *bounds, in +@@ -1703,7 +1704,7 @@ desc_one_bound (struct value *bounds, in of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ @@ -584,7 +584,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); -@@ -1892,7 +1893,7 @@ ada_type_of_array (struct value *arr, in +@@ -1893,7 +1894,7 @@ ada_type_of_array (struct value *arr, in zero, and does not need to be recomputed. */ if (lo < hi) { @@ -593,7 +593,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; -@@ -2044,7 +2045,7 @@ decode_packed_array_bitsize (struct type +@@ -2045,7 +2046,7 @@ decode_packed_array_bitsize (struct type in bits. */ static struct type * @@ -602,7 +602,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c { struct type *new_elt_type; struct type *new_type; -@@ -2096,7 +2097,7 @@ decode_constrained_packed_array_type (st +@@ -2097,7 +2098,7 @@ decode_constrained_packed_array_type (st char *name; const char *tail; struct type *shadow_type; @@ -611,7 +611,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); -@@ -2167,7 +2168,8 @@ decode_constrained_packed_array (struct +@@ -2168,7 +2169,8 @@ decode_constrained_packed_array (struct array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ @@ -621,7 +621,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; -@@ -2268,15 +2270,16 @@ has_negatives (struct type *type) +@@ -2269,15 +2271,16 @@ has_negatives (struct type *type) struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, @@ -644,7 +644,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c byte of source that are unused */ accumSize; /* Number of meaningful bits in accum */ unsigned char *bytes; /* First byte containing data to unpack */ -@@ -2309,7 +2312,7 @@ ada_value_primitive_packed_val (struct v +@@ -2310,7 +2313,7 @@ ada_value_primitive_packed_val (struct v if (obj != NULL) { @@ -653,7 +653,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c set_value_component_location (v, obj); set_value_bitpos (v, bit_offset + value_bitpos (obj)); -@@ -2426,7 +2429,7 @@ ada_value_primitive_packed_val (struct v +@@ -2427,7 +2430,7 @@ ada_value_primitive_packed_val (struct v not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, @@ -662,7 +662,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c { unsigned int accum, mask; int accum_bits, chunk_size; -@@ -2516,7 +2519,7 @@ ada_value_assign (struct value *toval, s +@@ -2517,7 +2520,7 @@ ada_value_assign (struct value *toval, s { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; @@ -671,7 +671,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c char *buffer = (char *) alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); -@@ -2561,7 +2564,7 @@ value_assign_to_component (struct value +@@ -2562,7 +2565,7 @@ value_assign_to_component (struct value (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); @@ -680,7 +680,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c val = value_cast (value_type (component), val); -@@ -4081,7 +4084,7 @@ ensure_lval (struct value *val) +@@ -4082,7 +4085,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { @@ -689,7 +689,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); -@@ -4155,7 +4158,7 @@ static CORE_ADDR +@@ -4156,7 +4159,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); @@ -698,7 +698,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c gdb_byte *buf = alloca (len); CORE_ADDR addr; -@@ -6024,7 +6027,7 @@ value_tag_from_contents_and_address (str +@@ -6051,7 +6054,7 @@ value_tag_from_contents_and_address (str const gdb_byte *valaddr, CORE_ADDR address) { @@ -707,7 +707,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -6407,7 +6410,7 @@ ada_in_variant (LONGEST val, struct type +@@ -6516,7 +6519,7 @@ ada_in_variant (LONGEST val, struct type only in that it can handle packed values of arbitrary type. */ static struct value * @@ -716,7 +716,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c struct type *arg_type) { struct type *type; -@@ -6419,7 +6422,7 @@ ada_value_primitive_field (struct value +@@ -6528,7 +6531,7 @@ ada_value_primitive_field (struct value if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { @@ -725,7 +725,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -6446,9 +6449,9 @@ ada_value_primitive_field (struct value +@@ -6555,9 +6558,9 @@ ada_value_primitive_field (struct value Returns 1 if found, 0 otherwise. */ static int @@ -737,7 +737,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c int *index_p) { int i; -@@ -6466,8 +6469,8 @@ find_struct_field (const char *name, str +@@ -6575,8 +6578,8 @@ find_struct_field (const char *name, str for (i = 0; i < TYPE_NFIELDS (type); i += 1) { @@ -748,7 +748,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) -@@ -6537,7 +6540,7 @@ num_visible_fields (struct type *type) +@@ -6646,7 +6649,7 @@ num_visible_fields (struct type *type) Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * @@ -757,7 +757,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c struct type *type) { int i; -@@ -6570,7 +6573,7 @@ ada_search_struct_field (char *name, str +@@ -6679,7 +6682,7 @@ ada_search_struct_field (char *name, str int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -766,7 +766,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { -@@ -6588,8 +6591,8 @@ ada_search_struct_field (char *name, str +@@ -6697,8 +6700,8 @@ ada_search_struct_field (char *name, str return NULL; } @@ -777,7 +777,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c /* Return field #INDEX in ARG, where the index is that returned by -@@ -6598,7 +6601,7 @@ static struct value *ada_index_struct_fi +@@ -6707,7 +6710,7 @@ static struct value *ada_index_struct_fi * If found, return value, else return NULL. */ static struct value * @@ -786,7 +786,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -6610,7 +6613,7 @@ ada_index_struct_field (int index, struc +@@ -6719,7 +6722,7 @@ ada_index_struct_field (int index, struc * *INDEX_P. */ static struct value * @@ -795,7 +795,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c struct type *type) { int i; -@@ -6700,7 +6703,8 @@ ada_value_struct_elt (struct value *arg, +@@ -6809,7 +6812,8 @@ ada_value_struct_elt (struct value *arg, v = ada_search_struct_field (name, arg, 0, t); else { @@ -805,7 +805,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c struct type *field_type; CORE_ADDR address; -@@ -7006,8 +7010,8 @@ ada_coerce_ref (struct value *val0) +@@ -7122,8 +7126,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ @@ -816,7 +816,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c { return (off + alignment - 1) & ~(alignment - 1); } -@@ -7386,10 +7390,9 @@ ada_template_to_fixed_record_type_1 (str +@@ -7502,10 +7506,9 @@ ada_template_to_fixed_record_type_1 (str struct value *mark = value_mark (); struct value *dval; struct type *rtype; @@ -829,7 +829,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c int f; /* Compute the number of fields in this record type that are going -@@ -7460,7 +7463,7 @@ ada_template_to_fixed_record_type_1 (str +@@ -7576,7 +7579,7 @@ ada_template_to_fixed_record_type_1 (str that follow this one. */ if (ada_is_aligner_type (field_type)) { @@ -838,7 +838,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); -@@ -7579,11 +7582,11 @@ ada_template_to_fixed_record_type_1 (str +@@ -7705,11 +7708,11 @@ ada_template_to_fixed_record_type_1 (str if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) @@ -854,7 +854,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c } else { -@@ -7920,7 +7923,8 @@ to_fixed_array_type (struct type *type0, +@@ -8046,7 +8049,8 @@ to_fixed_array_type (struct type *type0, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ @@ -864,11 +864,11 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.c int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); -Index: gdb-7.5.0.20120926/gdb/ada-lang.h +Index: gdb-7.5.50.20130118/gdb/ada-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ada-lang.h 2012-03-29 20:23:00.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ada-lang.h 2012-11-07 22:09:29.669141035 +0100 -@@ -168,7 +168,7 @@ extern void ada_print_type (struct type +--- gdb-7.5.50.20130118.orig/gdb/ada-lang.h 2013-01-18 23:27:22.061601301 +0100 ++++ gdb-7.5.50.20130118/gdb/ada-lang.h 2013-01-18 23:27:28.845607295 +0100 +@@ -169,7 +169,7 @@ extern void ada_print_type (struct type extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); @@ -877,7 +877,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -183,7 +183,7 @@ extern void ada_emit_char (int, struct t +@@ -184,7 +184,7 @@ extern void ada_emit_char (int, struct t extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, @@ -886,7 +886,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.h const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, -@@ -257,7 +257,7 @@ extern int ada_is_constrained_packed_arr +@@ -258,7 +258,7 @@ extern int ada_is_constrained_packed_arr extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, @@ -895,11 +895,11 @@ Index: gdb-7.5.0.20120926/gdb/ada-lang.h struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); -Index: gdb-7.5.0.20120926/gdb/ada-typeprint.c +Index: gdb-7.5.50.20130118/gdb/ada-typeprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ada-typeprint.c 2012-04-18 08:46:46.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ada-typeprint.c 2012-11-07 22:09:29.705140982 +0100 -@@ -815,8 +815,8 @@ ada_print_type (struct type *type0, cons +--- gdb-7.5.50.20130118.orig/gdb/ada-typeprint.c 2013-01-18 23:27:22.061601301 +0100 ++++ gdb-7.5.50.20130118/gdb/ada-typeprint.c 2013-01-18 23:27:28.845607295 +0100 +@@ -829,8 +829,8 @@ ada_print_type (struct type *type0, cons const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) @@ -910,7 +910,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-typeprint.c else { fprintf_filtered (stream, "range "); -@@ -837,7 +837,8 @@ ada_print_type (struct type *type0, cons +@@ -851,7 +851,8 @@ ada_print_type (struct type *type0, cons } break; case TYPE_CODE_FLT: @@ -920,11 +920,11 @@ Index: gdb-7.5.0.20120926/gdb/ada-typeprint.c break; case TYPE_CODE_ENUM: if (show < 0) -Index: gdb-7.5.0.20120926/gdb/ada-valprint.c +Index: gdb-7.5.50.20130118/gdb/ada-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ada-valprint.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/ada-valprint.c 2012-11-07 22:09:29.731140943 +0100 -@@ -42,16 +42,16 @@ static void print_record (struct type *, +--- gdb-7.5.50.20130118.orig/gdb/ada-valprint.c 2013-01-18 23:27:22.062601303 +0100 ++++ gdb-7.5.50.20130118/gdb/ada-valprint.c 2013-01-18 23:27:28.846607297 +0100 +@@ -41,16 +41,16 @@ static void print_record (struct type *, const struct value_print_options *); static int print_field_values (struct type *, const gdb_byte *, @@ -945,7 +945,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c const struct value *, const struct value_print_options *); -@@ -144,7 +144,7 @@ val_print_packed_array_elements (struct +@@ -143,7 +143,7 @@ val_print_packed_array_elements (struct unsigned int things_printed = 0; unsigned len; struct type *elttype, *index_type; @@ -954,7 +954,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c unsigned long bitsize = TYPE_FIELD_BITSIZE (type, 0); struct value *mark = value_mark (); LONGEST low = 0; -@@ -293,7 +293,7 @@ ada_emit_char (int c, struct type *type, +@@ -292,7 +292,7 @@ ada_emit_char (int c, struct type *type, of a character. */ static int @@ -963,7 +963,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c enum bfd_endian byte_order) { if (type_len == 1) -@@ -465,11 +465,11 @@ ada_print_scalar (struct type *type, LON +@@ -464,11 +464,11 @@ ada_print_scalar (struct type *type, LON static void printstr (struct ui_file *stream, struct type *elttype, const gdb_byte *string, @@ -977,7 +977,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -484,9 +484,9 @@ printstr (struct ui_file *stream, struct +@@ -483,9 +483,9 @@ printstr (struct ui_file *stream, struct { /* Position of the character we are examining to see whether it is repeated. */ @@ -989,7 +989,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c QUIT; -@@ -520,7 +520,8 @@ printstr (struct ui_file *stream, struct +@@ -516,7 +516,8 @@ printstr (struct ui_file *stream, struct ada_emit_char (char_at (string, i, type_len, byte_order), elttype, stream, '\'', type_len); fputs_filtered ("'", stream); @@ -999,7 +999,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -@@ -556,7 +557,7 @@ printstr (struct ui_file *stream, struct +@@ -544,7 +545,7 @@ printstr (struct ui_file *stream, struct void ada_printstr (struct ui_file *stream, struct type *type, @@ -1008,7 +1008,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -570,7 +571,7 @@ ada_printstr (struct ui_file *stream, st +@@ -558,7 +559,7 @@ ada_printstr (struct ui_file *stream, st void ada_val_print (struct type *type, const gdb_byte *valaddr, @@ -1017,7 +1017,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -@@ -602,8 +603,8 @@ ada_val_print_array (struct type *type, +@@ -590,8 +591,8 @@ ada_val_print_array (struct type *type, { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (type)); struct type *elttype = TYPE_TARGET_TYPE (type); @@ -1028,7 +1028,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c /* We know that ELTTYPE cannot possibly be null, because we found that TYPE is a string-like type. Similarly, the size of ELTTYPE -@@ -621,7 +622,7 @@ ada_val_print_array (struct type *type, +@@ -609,7 +610,7 @@ ada_val_print_array (struct type *type, elements up to it. */ if (options->stop_print_at_null) { @@ -1037,7 +1037,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c /* Look for a NULL char. */ for (temp_len = 0; -@@ -654,7 +655,7 @@ ada_val_print_array (struct type *type, +@@ -642,7 +643,7 @@ ada_val_print_array (struct type *type, static void ada_val_print_1 (struct type *type, const gdb_byte *valaddr, @@ -1046,7 +1046,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) -@@ -923,12 +924,12 @@ ada_val_print_1 (struct type *type, cons +@@ -917,12 +918,12 @@ ada_val_print_1 (struct type *type, cons static int print_variant_part (struct type *type, int field_num, @@ -1061,7 +1061,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c { struct type *var_type = TYPE_FIELD_TYPE (type, field_num); int which = ada_which_variant_applies (var_type, outer_type, -@@ -1035,11 +1036,11 @@ print_record (struct type *type, const g +@@ -1029,11 +1030,11 @@ print_record (struct type *type, const g static int print_field_values (struct type *type, const gdb_byte *valaddr, @@ -1075,7 +1075,7 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c { int i, len; -@@ -1120,7 +1121,7 @@ print_field_values (struct type *type, c +@@ -1099,7 +1100,7 @@ print_field_values (struct type *type, c } else { @@ -1084,11 +1084,11 @@ Index: gdb-7.5.0.20120926/gdb/ada-valprint.c int bit_size = TYPE_FIELD_BITSIZE (type, i); struct value_print_options opts; -Index: gdb-7.5.0.20120926/gdb/annotate.c +Index: gdb-7.5.50.20130118/gdb/annotate.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/annotate.c 2012-01-04 09:16:56.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/annotate.c 2012-11-07 22:09:29.732140942 +0100 -@@ -522,21 +522,21 @@ annotate_frame_end (void) +--- gdb-7.5.50.20130118.orig/gdb/annotate.c 2013-01-18 23:27:22.062601303 +0100 ++++ gdb-7.5.50.20130118/gdb/annotate.c 2013-01-18 23:27:28.846607297 +0100 +@@ -521,21 +521,21 @@ annotate_frame_end (void) } void @@ -1114,11 +1114,11 @@ Index: gdb-7.5.0.20120926/gdb/annotate.c } void -Index: gdb-7.5.0.20120926/gdb/annotate.h +Index: gdb-7.5.50.20130118/gdb/annotate.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/annotate.h 2012-01-04 09:16:56.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/annotate.h 2012-11-07 22:09:29.733140941 +0100 -@@ -94,8 +94,8 @@ extern void annotate_frame_source_end (v +--- gdb-7.5.50.20130118.orig/gdb/annotate.h 2013-01-18 23:27:22.062601303 +0100 ++++ gdb-7.5.50.20130118/gdb/annotate.h 2013-01-18 23:27:28.846607297 +0100 +@@ -93,8 +93,8 @@ extern void annotate_frame_source_end (v extern void annotate_frame_where (void); extern void annotate_frame_end (void); @@ -1129,10 +1129,10 @@ Index: gdb-7.5.0.20120926/gdb/annotate.h extern void annotate_elt_rep_end (void); extern void annotate_elt (void); extern void annotate_array_section_end (void); -Index: gdb-7.5.0.20120926/gdb/arm-linux-nat.c +Index: gdb-7.5.50.20130118/gdb/arm-linux-nat.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/arm-linux-nat.c 2012-08-01 14:57:06.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/arm-linux-nat.c 2012-11-07 22:09:29.734140940 +0100 +--- gdb-7.5.50.20130118.orig/gdb/arm-linux-nat.c 2013-01-18 23:27:22.063601305 +0100 ++++ gdb-7.5.50.20130118/gdb/arm-linux-nat.c 2013-01-18 23:27:28.847607298 +0100 @@ -1073,7 +1073,7 @@ arm_linux_remove_hw_breakpoint (struct g /* Are we able to use a hardware watchpoint for the LEN bytes starting at ADDR? */ @@ -1142,11 +1142,11 @@ Index: gdb-7.5.0.20120926/gdb/arm-linux-nat.c { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); CORE_ADDR max_wp_length, aligned_addr; -Index: gdb-7.5.0.20120926/gdb/ax-gdb.c +Index: gdb-7.5.50.20130118/gdb/ax-gdb.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ax-gdb.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/ax-gdb.c 2012-11-07 22:09:29.736140938 +0100 -@@ -84,12 +84,12 @@ static void gen_traced_pop (struct gdbar +--- gdb-7.5.50.20130118.orig/gdb/ax-gdb.c 2013-01-18 23:27:22.064601307 +0100 ++++ gdb-7.5.50.20130118/gdb/ax-gdb.c 2013-01-18 23:27:28.848607299 +0100 +@@ -83,12 +83,12 @@ static void gen_traced_pop (struct gdbar static void gen_sign_extend (struct agent_expr *, struct type *); static void gen_extend (struct agent_expr *, struct type *); static void gen_fetch (struct agent_expr *, struct type *); @@ -1161,7 +1161,7 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c static void gen_sym_offset (struct agent_expr *, struct symbol *); static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, struct axs_value *value, struct symbol *var); -@@ -137,15 +137,16 @@ static void gen_deref (struct agent_expr +@@ -136,15 +136,16 @@ static void gen_deref (struct agent_expr static void gen_address_of (struct agent_expr *, struct axs_value *); static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1181,7 +1181,7 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c struct type *type); static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, -@@ -570,7 +571,7 @@ gen_fetch (struct agent_expr *ax, struct +@@ -569,7 +570,7 @@ gen_fetch (struct agent_expr *ax, struct right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void @@ -1190,7 +1190,7 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c { if (distance > 0) { -@@ -624,7 +625,7 @@ gen_frame_locals_address (struct gdbarch +@@ -623,7 +624,7 @@ gen_frame_locals_address (struct gdbarch programming in ML, it would be clearer why these are the same thing. */ static void @@ -1199,7 +1199,7 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the -@@ -1280,7 +1281,7 @@ gen_address_of (struct agent_expr *ax, s +@@ -1279,7 +1280,7 @@ gen_address_of (struct agent_expr *ax, s static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *type, @@ -1208,7 +1208,7 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] -@@ -1315,13 +1316,13 @@ gen_bitfield_ref (struct expression *exp +@@ -1314,13 +1315,13 @@ gen_bitfield_ref (struct expression *exp /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ @@ -1227,7 +1227,7 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c /* The index in ops of the opcode we're considering. */ int op; -@@ -1440,7 +1441,7 @@ gen_bitfield_ref (struct expression *exp +@@ -1439,7 +1440,7 @@ gen_bitfield_ref (struct expression *exp static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1236,7 +1236,7 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) -@@ -1465,7 +1466,7 @@ gen_primitive_field (struct expression * +@@ -1464,7 +1465,7 @@ gen_primitive_field (struct expression * static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1245,10 +1245,10 @@ Index: gdb-7.5.0.20120926/gdb/ax-gdb.c { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); -Index: gdb-7.5.0.20120926/gdb/ax-general.c +Index: gdb-7.5.50.20130118/gdb/ax-general.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ax-general.c 2012-07-02 17:29:33.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ax-general.c 2012-11-07 22:09:29.743140927 +0100 +--- gdb-7.5.50.20130118.orig/gdb/ax-general.c 2013-01-18 23:27:22.064601307 +0100 ++++ gdb-7.5.50.20130118/gdb/ax-general.c 2013-01-18 23:27:28.848607299 +0100 @@ -192,7 +192,7 @@ ax_zero_ext (struct agent_expr *x, int n /* Append a trace_quick instruction to EXPR, to record N bytes. */ @@ -1258,10 +1258,10 @@ Index: gdb-7.5.0.20120926/gdb/ax-general.c { /* N must fit in a byte. */ if (n < 0 || n > 255) -Index: gdb-7.5.0.20120926/gdb/ax.h +Index: gdb-7.5.50.20130118/gdb/ax.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ax.h 2012-07-02 17:29:33.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ax.h 2012-11-07 22:09:29.744140925 +0100 +--- gdb-7.5.50.20130118.orig/gdb/ax.h 2013-01-18 23:27:22.064601307 +0100 ++++ gdb-7.5.50.20130118/gdb/ax.h 2013-01-18 23:27:28.848607299 +0100 @@ -190,7 +190,7 @@ extern void ax_ext (struct agent_expr *E extern void ax_zero_ext (struct agent_expr *EXPR, int N); @@ -1271,11 +1271,11 @@ Index: gdb-7.5.0.20120926/gdb/ax.h /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or aop_if_goto). We assume we don't know the target offset yet, -Index: gdb-7.5.0.20120926/gdb/breakpoint.c +Index: gdb-7.5.50.20130118/gdb/breakpoint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/breakpoint.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/breakpoint.c 2012-11-07 22:09:29.748140920 +0100 -@@ -6565,7 +6565,7 @@ breakpoint_address_match (struct address +--- gdb-7.5.50.20130118.orig/gdb/breakpoint.c 2013-01-18 23:27:22.067601312 +0100 ++++ gdb-7.5.50.20130118/gdb/breakpoint.c 2013-01-18 23:29:33.652726603 +0100 +@@ -6627,7 +6627,7 @@ breakpoint_address_match (struct address static int breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1, @@ -1283,8 +1283,8 @@ Index: gdb-7.5.0.20120926/gdb/breakpoint.c + LONGEST len1, struct address_space *aspace2, CORE_ADDR addr2) { - return ((gdbarch_has_global_breakpoints (target_gdbarch) -@@ -11043,7 +11043,7 @@ can_use_hardware_watchpoint (struct valu + return ((gdbarch_has_global_breakpoints (target_gdbarch ()) +@@ -11155,7 +11155,7 @@ can_use_hardware_watchpoint (struct valu && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1293,10 +1293,10 @@ Index: gdb-7.5.0.20120926/gdb/breakpoint.c int num_regs; len = (target_exact_watchpoints -Index: gdb-7.5.0.20120926/gdb/breakpoint.h +Index: gdb-7.5.50.20130118/gdb/breakpoint.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/breakpoint.h 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/breakpoint.h 2012-11-07 22:09:29.778140875 +0100 +--- gdb-7.5.50.20130118.orig/gdb/breakpoint.h 2013-01-18 23:27:22.068601313 +0100 ++++ gdb-7.5.50.20130118/gdb/breakpoint.h 2013-01-18 23:27:28.854607311 +0100 @@ -250,7 +250,7 @@ struct bp_target_info /* If this is a ranged breakpoint, then this field contains the @@ -1315,11 +1315,11 @@ Index: gdb-7.5.0.20120926/gdb/breakpoint.h /* Type of hardware watchpoint. */ enum target_hw_bp_type watchpoint_type; -Index: gdb-7.5.0.20120926/gdb/c-lang.c +Index: gdb-7.5.50.20130118/gdb/c-lang.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/c-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/c-lang.c 2012-11-07 22:09:29.786140864 +0100 -@@ -189,7 +189,7 @@ c_printchar (int c, struct type *type, s +--- gdb-7.5.50.20130118.orig/gdb/c-lang.c 2013-01-18 23:27:22.069601315 +0100 ++++ gdb-7.5.50.20130118/gdb/c-lang.c 2013-01-18 23:27:28.854607311 +0100 +@@ -188,7 +188,7 @@ c_printchar (int c, struct type *type, s void c_printstr (struct ui_file *stream, struct type *type, @@ -1328,7 +1328,7 @@ Index: gdb-7.5.0.20120926/gdb/c-lang.c const char *user_encoding, int force_ellipses, const struct value_print_options *options) { -@@ -678,7 +678,7 @@ evaluate_subexp_c (struct type *expect_t +@@ -677,7 +677,7 @@ evaluate_subexp_c (struct type *expect_t } else { @@ -1337,7 +1337,7 @@ Index: gdb-7.5.0.20120926/gdb/c-lang.c /* Write the terminating character. */ for (i = 0; i < TYPE_LENGTH (type); ++i) -@@ -687,7 +687,7 @@ evaluate_subexp_c (struct type *expect_t +@@ -686,7 +686,7 @@ evaluate_subexp_c (struct type *expect_t if (satisfy_expected) { LONGEST low_bound, high_bound; @@ -1346,11 +1346,11 @@ Index: gdb-7.5.0.20120926/gdb/c-lang.c if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) -Index: gdb-7.5.0.20120926/gdb/c-lang.h +Index: gdb-7.5.50.20130118/gdb/c-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/c-lang.h 2012-03-01 20:26:12.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/c-lang.h 2012-11-07 22:09:29.787140863 +0100 -@@ -72,7 +72,7 @@ extern void c_print_typedef (struct type +--- gdb-7.5.50.20130118.orig/gdb/c-lang.h 2013-01-18 23:27:22.069601315 +0100 ++++ gdb-7.5.50.20130118/gdb/c-lang.h 2013-01-18 23:27:28.854607311 +0100 +@@ -73,7 +73,7 @@ extern void c_print_typedef (struct type struct ui_file *); extern void c_val_print (struct type *, const gdb_byte *, @@ -1359,7 +1359,7 @@ Index: gdb-7.5.0.20120926/gdb/c-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -92,7 +92,7 @@ extern void c_printchar (int, struct typ +@@ -93,7 +93,7 @@ extern void c_printchar (int, struct typ extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, @@ -1368,7 +1368,7 @@ Index: gdb-7.5.0.20120926/gdb/c-lang.h const char *user_encoding, int force_ellipses, const struct value_print_options *options); -@@ -118,14 +118,14 @@ extern void cp_print_class_member (const +@@ -119,14 +119,14 @@ extern void cp_print_class_member (const struct ui_file *, char *); extern void cp_print_value_fields (struct type *, struct type *, @@ -1385,11 +1385,11 @@ Index: gdb-7.5.0.20120926/gdb/c-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *, -Index: gdb-7.5.0.20120926/gdb/c-valprint.c +Index: gdb-7.5.50.20130118/gdb/c-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/c-valprint.c 2012-05-18 23:02:47.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/c-valprint.c 2012-11-07 22:09:29.789140861 +0100 -@@ -133,7 +133,7 @@ static const struct generic_val_print_de +--- gdb-7.5.50.20130118.orig/gdb/c-valprint.c 2013-01-18 23:27:22.069601315 +0100 ++++ gdb-7.5.50.20130118/gdb/c-valprint.c 2013-01-18 23:27:28.855607313 +0100 +@@ -132,7 +132,7 @@ static const struct generic_val_print_de void c_val_print (struct type *type, const gdb_byte *valaddr, @@ -1398,7 +1398,7 @@ Index: gdb-7.5.0.20120926/gdb/c-valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) -@@ -144,7 +144,7 @@ c_val_print (struct type *type, const gd +@@ -143,7 +143,7 @@ c_val_print (struct type *type, const gd unsigned len; struct type *elttype, *unresolved_elttype; struct type *unresolved_type = type; @@ -1407,7 +1407,7 @@ Index: gdb-7.5.0.20120926/gdb/c-valprint.c CORE_ADDR addr; CHECK_TYPEDEF (type); -@@ -364,9 +364,9 @@ c_val_print (struct type *type, const gd +@@ -379,9 +379,9 @@ c_val_print (struct type *type, const gd /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ @@ -1420,7 +1420,7 @@ Index: gdb-7.5.0.20120926/gdb/c-valprint.c struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); CORE_ADDR addr -@@ -445,7 +445,8 @@ c_value_print (struct value *val, struct +@@ -460,7 +460,8 @@ c_value_print (struct value *val, struct const struct value_print_options *options) { struct type *type, *real_type, *val_type; @@ -1430,10 +1430,10 @@ Index: gdb-7.5.0.20120926/gdb/c-valprint.c struct value_print_options opts = *options; opts.deref_ref = 1; -Index: gdb-7.5.0.20120926/gdb/cp-abi.c +Index: gdb-7.5.50.20130118/gdb/cp-abi.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/cp-abi.c 2012-03-15 16:43:11.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/cp-abi.c 2012-11-07 22:09:29.790140859 +0100 +--- gdb-7.5.50.20130118.orig/gdb/cp-abi.c 2013-01-18 23:27:22.070601317 +0100 ++++ gdb-7.5.50.20130118/gdb/cp-abi.c 2013-01-18 23:27:28.855607313 +0100 @@ -68,13 +68,13 @@ is_operator_name (const char *name) return (*current_cp_abi.is_operator_name) (name); } @@ -1469,10 +1469,10 @@ Index: gdb-7.5.0.20120926/gdb/cp-abi.c { struct type *ret = NULL; volatile struct gdb_exception e; -Index: gdb-7.5.0.20120926/gdb/cp-abi.h +Index: gdb-7.5.50.20130118/gdb/cp-abi.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/cp-abi.h 2012-03-15 16:43:11.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/cp-abi.h 2012-11-07 22:09:29.792140855 +0100 +--- gdb-7.5.50.20130118.orig/gdb/cp-abi.h 2013-01-18 23:27:22.070601317 +0100 ++++ gdb-7.5.50.20130118/gdb/cp-abi.h 2013-01-18 23:27:28.855607313 +0100 @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_fi struct fn_field *f, int j, @@ -1527,10 +1527,10 @@ Index: gdb-7.5.0.20120926/gdb/cp-abi.h void (*print_method_ptr) (const gdb_byte *contents, struct type *type, struct ui_file *stream); -Index: gdb-7.5.0.20120926/gdb/cp-valprint.c +Index: gdb-7.5.50.20130118/gdb/cp-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/cp-valprint.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/cp-valprint.c 2012-11-07 22:12:14.392901699 +0100 +--- gdb-7.5.50.20130118.orig/gdb/cp-valprint.c 2013-01-18 23:27:22.070601317 +0100 ++++ gdb-7.5.50.20130118/gdb/cp-valprint.c 2013-01-18 23:27:28.856607315 +0100 @@ -82,7 +82,7 @@ static void cp_print_static_field (struc const struct value_print_options *); @@ -1549,7 +1549,7 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -363,7 +363,7 @@ cp_print_value_fields (struct type *type +@@ -342,7 +342,7 @@ cp_print_value_fields (struct type *type } else if (i == vptr_fieldno && type == vptr_basetype) { @@ -1558,7 +1558,7 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c struct type *i_type = TYPE_FIELD_TYPE (type, i); if (valprint_check_validity (stream, i_type, i_offset, val)) -@@ -446,7 +446,7 @@ cp_print_value_fields (struct type *type +@@ -425,7 +425,7 @@ cp_print_value_fields (struct type *type void cp_print_value_fields_rtti (struct type *type, @@ -1567,7 +1567,7 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -462,7 +462,8 @@ cp_print_value_fields_rtti (struct type +@@ -441,7 +441,8 @@ cp_print_value_fields_rtti (struct type TARGET_CHAR_BIT * TYPE_LENGTH (type))) { struct value *value; @@ -1577,7 +1577,7 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c /* Ugh, we have to convert back to a value here. */ value = value_from_contents_and_address (type, valaddr + offset, -@@ -486,7 +487,7 @@ cp_print_value_fields_rtti (struct type +@@ -465,7 +466,7 @@ cp_print_value_fields_rtti (struct type static void cp_print_value (struct type *type, struct type *real_type, @@ -1586,7 +1586,7 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -496,7 +497,7 @@ cp_print_value (struct type *type, struc +@@ -475,7 +476,7 @@ cp_print_value (struct type *type, struc = (struct type **) obstack_next_free (&dont_print_vb_obstack); struct obstack tmp_obstack = dont_print_vb_obstack; int i, n_baseclasses = TYPE_N_BASECLASSES (type); @@ -1595,7 +1595,7 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c struct type *thistype; if (dont_print_vb == 0) -@@ -510,7 +511,7 @@ cp_print_value (struct type *type, struc +@@ -489,7 +490,7 @@ cp_print_value (struct type *type, struc for (i = 0; i < n_baseclasses; i++) { @@ -1604,10 +1604,10 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c int skip; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = TYPE_NAME (baseclass); -Index: gdb-7.5.0.20120926/gdb/d-lang.h +Index: gdb-7.5.50.20130118/gdb/d-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/d-lang.h 2012-03-01 20:26:12.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/d-lang.h 2012-11-07 22:09:29.795140852 +0100 +--- gdb-7.5.50.20130118.orig/gdb/d-lang.h 2013-01-18 23:27:22.070601317 +0100 ++++ gdb-7.5.50.20130118/gdb/d-lang.h 2013-01-18 23:27:28.856607315 +0100 @@ -25,7 +25,7 @@ extern char *d_demangle (const char *mangled, int options); @@ -1617,10 +1617,10 @@ Index: gdb-7.5.0.20120926/gdb/d-lang.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.5.0.20120926/gdb/d-valprint.c +Index: gdb-7.5.50.20130118/gdb/d-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/d-valprint.c 2012-03-01 20:26:12.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/d-valprint.c 2012-11-07 22:09:29.795140852 +0100 +--- gdb-7.5.50.20130118.orig/gdb/d-valprint.c 2013-01-18 23:27:22.071601319 +0100 ++++ gdb-7.5.50.20130118/gdb/d-valprint.c 2013-01-18 23:27:28.856607315 +0100 @@ -29,7 +29,7 @@ static int @@ -1643,11 +1643,11 @@ Index: gdb-7.5.0.20120926/gdb/d-valprint.c const struct value_print_options *options) { int ret; -Index: gdb-7.5.0.20120926/gdb/doublest.c +Index: gdb-7.5.50.20130118/gdb/doublest.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/doublest.c 2012-01-04 09:17:00.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/doublest.c 2012-11-07 22:09:29.797140848 +0100 -@@ -770,7 +770,7 @@ floatformat_from_doublest (const struct +--- gdb-7.5.50.20130118.orig/gdb/doublest.c 2013-01-18 23:27:22.071601319 +0100 ++++ gdb-7.5.50.20130118/gdb/doublest.c 2013-01-18 23:27:28.856607315 +0100 +@@ -791,7 +791,7 @@ floatformat_from_doublest (const struct but not passed on by GDB. This should be fixed. */ static const struct floatformat * @@ -1656,7 +1656,7 @@ Index: gdb-7.5.0.20120926/gdb/doublest.c { const struct floatformat *format; -@@ -798,8 +798,8 @@ floatformat_from_length (struct gdbarch +@@ -819,8 +819,8 @@ floatformat_from_length (struct gdbarch else format = NULL; if (format == NULL) @@ -1667,10 +1667,10 @@ Index: gdb-7.5.0.20120926/gdb/doublest.c return format; } -Index: gdb-7.5.0.20120926/gdb/dwarf2loc.c +Index: gdb-7.5.50.20130118/gdb/dwarf2loc.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/dwarf2loc.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/dwarf2loc.c 2012-11-07 22:09:29.800140844 +0100 +--- gdb-7.5.50.20130118.orig/gdb/dwarf2loc.c 2013-01-18 23:27:22.073601323 +0100 ++++ gdb-7.5.50.20130118/gdb/dwarf2loc.c 2013-01-18 23:27:28.857607316 +0100 @@ -1672,19 +1672,19 @@ insert_bits (unsigned int datum, BITS_BIG_ENDIAN is taken directly from gdbarch. */ @@ -1815,7 +1815,7 @@ Index: gdb-7.5.0.20120926/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2400,7 +2401,7 @@ dwarf2_evaluate_loc_desc_full (struct ty +@@ -2401,7 +2402,7 @@ dwarf2_evaluate_loc_desc_full (struct ty struct value *value = dwarf_expr_fetch (ctx, 0); gdb_byte *contents; const gdb_byte *val_bytes; @@ -1824,11 +1824,11 @@ Index: gdb-7.5.0.20120926/gdb/dwarf2loc.c if (byte_offset + TYPE_LENGTH (type) > n) invalid_synthetic_pointer (); -Index: gdb-7.5.0.20120926/gdb/dwarf2read.c +Index: gdb-7.5.50.20130118/gdb/dwarf2read.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/dwarf2read.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/dwarf2read.c 2012-11-07 22:09:29.809140832 +0100 -@@ -1128,12 +1128,12 @@ dwarf2_complex_location_expr_complaint ( +--- gdb-7.5.50.20130118.orig/gdb/dwarf2read.c 2013-01-18 23:27:22.076601328 +0100 ++++ gdb-7.5.50.20130118/gdb/dwarf2read.c 2013-01-18 23:27:28.860607321 +0100 +@@ -1216,12 +1216,12 @@ dwarf2_complex_location_expr_complaint ( } static void @@ -1845,7 +1845,7 @@ Index: gdb-7.5.0.20120926/gdb/dwarf2read.c } static void -@@ -9831,8 +9831,8 @@ dwarf2_add_field (struct field_info *fip +@@ -10615,8 +10615,8 @@ dwarf2_add_field (struct field_info *fip object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -1856,21 +1856,21 @@ Index: gdb-7.5.0.20120926/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) -Index: gdb-7.5.0.20120926/gdb/eval.c +Index: gdb-7.5.50.20130118/gdb/eval.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/eval.c 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/eval.c 2012-11-07 22:13:52.096837314 +0100 -@@ -320,7 +320,8 @@ evaluate_struct_tuple (struct value *str - int pc = *pos; +--- gdb-7.5.50.20130118.orig/gdb/eval.c 2013-01-18 23:27:22.078601331 +0100 ++++ gdb-7.5.50.20130118/gdb/eval.c 2013-01-18 23:30:27.432785712 +0100 +@@ -294,7 +294,8 @@ evaluate_struct_tuple (struct value *str + while (--nargs >= 0) + { struct value *val = NULL; - int nlabels = 0; - int bitpos, bitsize; -+ int bitsize; + LONGEST bitpos; ++ int bitsize; bfd_byte *addr; - /* Skip past the labels, and count them. */ -@@ -463,7 +464,7 @@ init_array_element (struct value *array, + fieldno++; +@@ -356,7 +357,7 @@ init_array_element (struct value *array, enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; @@ -1879,7 +1879,7 @@ Index: gdb-7.5.0.20120926/gdb/eval.c if (exp->elts[*pos].opcode == BINOP_COMMA) { -@@ -816,11 +817,11 @@ binop_promote (const struct language_def +@@ -709,11 +710,11 @@ binop_promote (const struct language_def /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); @@ -1894,8 +1894,8 @@ Index: gdb-7.5.0.20120926/gdb/eval.c int unsigned_operation; /* Determine type length and signedness after promotion for -@@ -1004,7 +1005,7 @@ evaluate_subexp_standard (struct type *e - int lower; +@@ -896,7 +897,7 @@ evaluate_subexp_standard (struct type *e + struct value **argvec; int code; int ix; - long mem_offset; @@ -1903,7 +1903,7 @@ Index: gdb-7.5.0.20120926/gdb/eval.c struct type **arg_types; int save_pos1; struct symbol *function = NULL; -@@ -1194,7 +1195,7 @@ evaluate_subexp_standard (struct type *e +@@ -1076,7 +1077,7 @@ evaluate_subexp_standard (struct type *e struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); @@ -1912,7 +1912,7 @@ Index: gdb-7.5.0.20120926/gdb/eval.c LONGEST low_bound, high_bound, index; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -2194,7 +2195,8 @@ evaluate_subexp_standard (struct type *e +@@ -2081,7 +2082,8 @@ evaluate_subexp_standard (struct type *e { struct type *type = value_type (arg1); struct type *real_type; @@ -1922,11 +1922,11 @@ Index: gdb-7.5.0.20120926/gdb/eval.c struct value_print_options opts; get_user_print_options (&opts); -Index: gdb-7.5.0.20120926/gdb/f-lang.c +Index: gdb-7.5.50.20130118/gdb/f-lang.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/f-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/f-lang.c 2012-11-07 22:09:29.847140776 +0100 -@@ -124,7 +124,7 @@ f_printchar (int c, struct type *type, s +--- gdb-7.5.50.20130118.orig/gdb/f-lang.c 2013-01-18 23:27:22.078601331 +0100 ++++ gdb-7.5.50.20130118/gdb/f-lang.c 2013-01-18 23:27:28.861607323 +0100 +@@ -103,7 +103,7 @@ f_printchar (int c, struct type *type, s static void f_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -1935,11 +1935,11 @@ Index: gdb-7.5.0.20120926/gdb/f-lang.c const struct value_print_options *options) { const char *type_encoding = f_get_encoding (type); -Index: gdb-7.5.0.20120926/gdb/f-lang.h +Index: gdb-7.5.50.20130118/gdb/f-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/f-lang.h 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/f-lang.h 2012-11-07 22:12:39.504865208 +0100 -@@ -32,7 +32,7 @@ extern const char *f_object_address_data +--- gdb-7.5.50.20130118.orig/gdb/f-lang.h 2013-01-18 23:27:22.078601331 +0100 ++++ gdb-7.5.50.20130118/gdb/f-lang.h 2013-01-18 23:27:28.861607323 +0100 +@@ -33,7 +33,7 @@ extern const char *f_object_address_data (struct type *type, struct ui_file *stream); extern void f_object_address_data_valid_or_error (struct type *type); @@ -1948,10 +1948,10 @@ Index: gdb-7.5.0.20120926/gdb/f-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -Index: gdb-7.5.0.20120926/gdb/f-valprint.c +Index: gdb-7.5.50.20130118/gdb/f-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/f-valprint.c 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/f-valprint.c 2012-11-07 22:09:29.849140772 +0100 +--- gdb-7.5.50.20130118.orig/gdb/f-valprint.c 2013-01-18 23:27:22.079601333 +0100 ++++ gdb-7.5.50.20130118/gdb/f-valprint.c 2013-01-18 23:27:28.861607323 +0100 @@ -43,7 +43,7 @@ static void f77_create_arrayprint_offset struct ui_file *); static void f77_get_dynamic_length_of_aggregate (struct type *); @@ -2016,11 +2016,11 @@ Index: gdb-7.5.0.20120926/gdb/f-valprint.c val_print (TYPE_FIELD_TYPE (type, index), valaddr, embedded_offset + offset, -Index: gdb-7.5.0.20120926/gdb/findvar.c +Index: gdb-7.5.50.20130118/gdb/findvar.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/findvar.c 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/findvar.c 2012-11-07 22:10:21.855065210 +0100 -@@ -645,7 +645,7 @@ default_value_from_register (struct type +--- gdb-7.5.50.20130118.orig/gdb/findvar.c 2013-01-18 23:27:22.079601333 +0100 ++++ gdb-7.5.50.20130118/gdb/findvar.c 2013-01-18 23:30:53.511815716 +0100 +@@ -644,7 +644,7 @@ default_value_from_register (struct type struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -2029,7 +2029,7 @@ Index: gdb-7.5.0.20120926/gdb/findvar.c struct value *value = allocate_value (type); VALUE_LVAL (value) = lval_register; -@@ -675,10 +675,10 @@ void +@@ -677,10 +677,10 @@ void read_frame_register_value (struct value *value, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -2043,20 +2043,20 @@ Index: gdb-7.5.0.20120926/gdb/findvar.c gdb_assert (VALUE_LVAL (value) == lval_register); -@@ -693,7 +693,7 @@ read_frame_register_value (struct value +@@ -695,7 +695,7 @@ read_frame_register_value (struct value while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); - int reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; + LONGEST reg_len = TYPE_LENGTH (value_type (regval)) - reg_offset; - /* If the register length is larger than the number of bytes - remaining to copy, then only copy the appropriate bytes. */ -Index: gdb-7.5.0.20120926/gdb/frame.c + if (value_optimized_out (regval)) + { +Index: gdb-7.5.50.20130118/gdb/frame.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/frame.c 2012-09-17 09:17:27.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/frame.c 2012-11-07 22:09:29.853140768 +0100 -@@ -1117,7 +1117,7 @@ frame_register_read (struct frame_info * +--- gdb-7.5.50.20130118.orig/gdb/frame.c 2013-01-18 23:27:22.080601335 +0100 ++++ gdb-7.5.50.20130118/gdb/frame.c 2013-01-18 23:27:28.862607325 +0100 +@@ -1113,7 +1113,7 @@ deprecated_frame_register_read (struct f int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -2065,7 +2065,7 @@ Index: gdb-7.5.0.20120926/gdb/frame.c int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -1146,7 +1146,7 @@ get_frame_register_bytes (struct frame_i +@@ -1142,7 +1142,7 @@ get_frame_register_bytes (struct frame_i } if (len > maxsize) error (_("Bad debug information detected: " @@ -2074,11 +2074,11 @@ Index: gdb-7.5.0.20120926/gdb/frame.c /* Copy the data. */ while (len > 0) -Index: gdb-7.5.0.20120926/gdb/frame.h +Index: gdb-7.5.50.20130118/gdb/frame.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/frame.h 2012-03-01 23:47:46.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/frame.h 2012-11-07 22:09:29.854140766 +0100 -@@ -530,7 +530,7 @@ extern void put_frame_register (struct f +--- gdb-7.5.50.20130118.orig/gdb/frame.h 2013-01-18 23:27:22.080601335 +0100 ++++ gdb-7.5.50.20130118/gdb/frame.h 2013-01-18 23:27:28.862607325 +0100 +@@ -532,7 +532,7 @@ extern void put_frame_register (struct f contents are optimized out or unavailable, set *OPTIMIZEDP, *UNAVAILABLEP accordingly. */ extern int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -2087,11 +2087,11 @@ Index: gdb-7.5.0.20120926/gdb/frame.h gdb_byte *myaddr, int *optimizedp, int *unavailablep); -Index: gdb-7.5.0.20120926/gdb/gdbtypes.c +Index: gdb-7.5.50.20130118/gdb/gdbtypes.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbtypes.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/gdbtypes.c 2012-11-07 22:09:57.924099982 +0100 -@@ -2089,7 +2089,7 @@ allocate_gnat_aux_type (struct type *typ +--- gdb-7.5.50.20130118.orig/gdb/gdbtypes.c 2013-01-18 23:27:22.081601337 +0100 ++++ gdb-7.5.50.20130118/gdb/gdbtypes.c 2013-01-18 23:28:53.769685242 +0100 +@@ -2091,7 +2091,7 @@ allocate_gnat_aux_type (struct type *typ where init_type is called with a NULL value for NAME). */ struct type * @@ -2100,7 +2100,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.c char *name, struct objfile *objfile) { struct type *type; -@@ -2321,8 +2321,8 @@ is_public_ancestor (struct type *base, s +@@ -2324,8 +2324,8 @@ is_public_ancestor (struct type *base, s static int is_unique_ancestor_worker (struct type *base, struct type *dclass, @@ -2111,7 +2111,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.c CORE_ADDR address, struct value *val) { int i, count = 0; -@@ -2333,7 +2333,7 @@ is_unique_ancestor_worker (struct type * +@@ -2336,7 +2336,7 @@ is_unique_ancestor_worker (struct type * for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; @@ -2120,7 +2120,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.c iter = check_typedef (TYPE_BASECLASS (dclass, i)); -@@ -2374,7 +2374,7 @@ is_unique_ancestor_worker (struct type * +@@ -2377,7 +2377,7 @@ is_unique_ancestor_worker (struct type * int is_unique_ancestor (struct type *base, struct value *val) { @@ -2129,7 +2129,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.c return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), -@@ -3275,7 +3275,7 @@ recursive_dump_type (struct type *type, +@@ -3286,7 +3286,7 @@ recursive_dump_type (struct type *type, break; } puts_filtered ("\n"); @@ -2138,7 +2138,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.c if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); -@@ -3395,8 +3395,8 @@ recursive_dump_type (struct type *type, +@@ -3410,8 +3410,8 @@ recursive_dump_type (struct type *type, idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); else printfi_filtered (spaces + 2, @@ -2149,8 +2149,8 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.c TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", -@@ -4105,7 +4105,7 @@ free_all_types (void) - CODE, LENGTH, and NAME fields. */ +@@ -3925,7 +3925,7 @@ copy_type (const struct type *type) + struct type * arch_type (struct gdbarch *gdbarch, - enum type_code code, int length, char *name) @@ -2158,11 +2158,11 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.c { struct type *type; -Index: gdb-7.5.0.20120926/gdb/gdbtypes.h +Index: gdb-7.5.50.20130118/gdb/gdbtypes.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbtypes.h 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/gdbtypes.h 2012-11-07 22:09:29.861140755 +0100 -@@ -602,7 +602,7 @@ struct main_type +--- gdb-7.5.50.20130118.orig/gdb/gdbtypes.h 2013-01-18 23:27:22.082601339 +0100 ++++ gdb-7.5.50.20130118/gdb/gdbtypes.h 2013-01-18 23:27:28.863607327 +0100 +@@ -606,7 +606,7 @@ struct main_type gdbarch_bits_big_endian=0 targets, it is the bit offset to the LSB. */ @@ -2171,7 +2171,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.h /* Enum value. */ LONGEST enumval; -@@ -794,7 +794,7 @@ struct type +@@ -798,7 +798,7 @@ struct type HOST_CHAR_BIT. However, this would still fail to address machines based on a ternary or decimal representation. */ @@ -2180,7 +2180,7 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.h /* Core type, shared by a group of qualified types. */ struct main_type *main_type; -@@ -1546,11 +1546,12 @@ extern struct type *alloc_type_copy (con +@@ -1542,11 +1542,12 @@ extern struct type *alloc_type_copy (con extern struct gdbarch *get_type_arch (const struct type *); /* Helper function to construct objfile-owned types. */ @@ -2195,11 +2195,11 @@ Index: gdb-7.5.0.20120926/gdb/gdbtypes.h extern struct type *arch_integer_type (struct gdbarch *, int, int, char *); extern struct type *arch_character_type (struct gdbarch *, int, int, char *); extern struct type *arch_boolean_type (struct gdbarch *, int, int, char *); -Index: gdb-7.5.0.20120926/gdb/gnu-v2-abi.c +Index: gdb-7.5.50.20130118/gdb/gnu-v2-abi.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gnu-v2-abi.c 2012-02-07 05:48:21.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/gnu-v2-abi.c 2012-11-07 22:09:29.870140742 +0100 -@@ -86,7 +86,7 @@ gnuv2_is_operator_name (const char *name +--- gdb-7.5.50.20130118.orig/gdb/gnu-v2-abi.c 2013-01-18 23:27:22.082601339 +0100 ++++ gdb-7.5.50.20130118/gdb/gnu-v2-abi.c 2013-01-18 23:27:28.863607327 +0100 +@@ -85,7 +85,7 @@ gnuv2_is_operator_name (const char *name TYPE is the type in which F is located. */ static struct value * gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j, @@ -2208,7 +2208,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v2-abi.c { struct value *arg1 = *arg1p; struct type *type1 = check_typedef (value_type (arg1)); -@@ -187,7 +187,8 @@ gnuv2_virtual_fn_field (struct value **a +@@ -186,7 +186,8 @@ gnuv2_virtual_fn_field (struct value **a static struct type * @@ -2218,7 +2218,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v2-abi.c { struct type *known_type; struct type *rtti_type; -@@ -342,9 +343,9 @@ vb_match (struct type *type, int index, +@@ -341,9 +342,9 @@ vb_match (struct type *type, int index, target). The result is the offset of the baseclass value relative to (the address of)(ARG) + OFFSET. */ @@ -2230,7 +2230,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v2-abi.c CORE_ADDR address, const struct value *val) { struct type *basetype = TYPE_BASECLASS (type, index); -@@ -362,8 +363,8 @@ gnuv2_baseclass_offset (struct type *typ +@@ -361,8 +362,8 @@ gnuv2_baseclass_offset (struct type *typ if (vb_match (type, i, basetype)) { struct type *field_type; @@ -2241,7 +2241,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v2-abi.c CORE_ADDR addr; field_type = check_typedef (TYPE_FIELD_TYPE (type, i)); -@@ -387,7 +388,7 @@ gnuv2_baseclass_offset (struct type *typ +@@ -386,7 +387,7 @@ gnuv2_baseclass_offset (struct type *typ /* Don't go through baseclass_offset, as that wraps exceptions, thus, inner exceptions would be wrapped more than once. */ @@ -2250,11 +2250,11 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v2-abi.c gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); -Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c +Index: gdb-7.5.50.20130118/gdb/gnu-v3-abi.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gnu-v3-abi.c 2012-05-21 21:47:53.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/gnu-v3-abi.c 2012-11-07 22:09:29.872140740 +0100 -@@ -105,7 +105,7 @@ build_gdb_vtable_type (struct gdbarch *a +--- gdb-7.5.50.20130118.orig/gdb/gnu-v3-abi.c 2013-01-18 23:27:22.083601341 +0100 ++++ gdb-7.5.50.20130118/gdb/gnu-v3-abi.c 2013-01-18 23:27:28.864607329 +0100 +@@ -106,7 +106,7 @@ build_gdb_vtable_type (struct gdbarch *a { struct type *t; struct field *field_list, *field; @@ -2263,7 +2263,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c struct type *void_ptr_type = builtin_type (arch)->builtin_data_ptr; -@@ -181,7 +181,7 @@ vtable_ptrdiff_type (struct gdbarch *gdb +@@ -182,7 +182,7 @@ vtable_ptrdiff_type (struct gdbarch *gdb /* Return the offset from the start of the imaginary `struct gdb_gnu_v3_abi_vtable' object to the vtable's "address point" (i.e., where objects' virtual table pointers point). */ @@ -2272,7 +2272,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c vtable_address_point_offset (struct gdbarch *gdbarch) { struct type *vtable_type = gdbarch_data (gdbarch, vtable_type_gdbarch_data); -@@ -272,7 +272,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarc +@@ -273,7 +273,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarc static struct type * gnuv3_rtti_type (struct value *value, @@ -2281,7 +2281,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c { struct gdbarch *gdbarch; struct type *values_type = check_typedef (value_type (value)); -@@ -384,7 +384,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gd +@@ -385,7 +385,7 @@ gnuv3_get_virtual_fn (struct gdbarch *gd static struct value * gnuv3_virtual_fn_field (struct value **value_p, struct fn_field *f, int j, @@ -2290,7 +2290,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c { struct type *values_type = check_typedef (value_type (*value_p)); struct gdbarch *gdbarch; -@@ -414,16 +414,16 @@ gnuv3_virtual_fn_field (struct value **v +@@ -415,16 +415,16 @@ gnuv3_virtual_fn_field (struct value **v -1 is returned on error. */ @@ -2310,7 +2310,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c /* Determine architecture. */ gdbarch = get_type_arch (type); -@@ -447,7 +447,7 @@ gnuv3_baseclass_offset (struct type *typ +@@ -448,7 +448,7 @@ gnuv3_baseclass_offset (struct type *typ cur_base_offset = cur_base_offset + vtable_address_point_offset (gdbarch); if ((- cur_base_offset) % TYPE_LENGTH (ptr_type) != 0) error (_("Misaligned vbase offset.")); @@ -2319,7 +2319,7 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c vtable = gnuv3_get_vtable (gdbarch, type, address + embedded_offset); gdb_assert (vtable != NULL); -@@ -491,7 +491,7 @@ gnuv3_find_method_in (struct type *domai +@@ -492,7 +492,7 @@ gnuv3_find_method_in (struct type *domai we're out of luck. */ for (i = 0; i < TYPE_N_BASECLASSES (domain); i++) { @@ -2328,11 +2328,11 @@ Index: gdb-7.5.0.20120926/gdb/gnu-v3-abi.c struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) -Index: gdb-7.5.0.20120926/gdb/go-lang.h +Index: gdb-7.5.50.20130118/gdb/go-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/go-lang.h 2012-04-25 16:07:20.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/go-lang.h 2012-11-07 22:09:29.874140737 +0100 -@@ -80,7 +80,7 @@ extern void go_print_type (struct type * +--- gdb-7.5.50.20130118.orig/gdb/go-lang.h 2013-01-18 23:27:22.083601341 +0100 ++++ gdb-7.5.50.20130118/gdb/go-lang.h 2013-01-18 23:27:28.864607329 +0100 +@@ -83,7 +83,7 @@ extern void go_print_type (struct type * /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, const gdb_byte *valaddr, @@ -2341,10 +2341,10 @@ Index: gdb-7.5.0.20120926/gdb/go-lang.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.5.0.20120926/gdb/go-valprint.c +Index: gdb-7.5.50.20130118/gdb/go-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/go-valprint.c 2012-05-18 17:29:12.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/go-valprint.c 2012-11-07 22:09:29.874140737 +0100 +--- gdb-7.5.50.20130118.orig/gdb/go-valprint.c 2013-01-18 23:27:22.083601341 +0100 ++++ gdb-7.5.50.20130118/gdb/go-valprint.c 2013-01-18 23:27:28.864607329 +0100 @@ -37,7 +37,7 @@ static void @@ -2367,11 +2367,11 @@ Index: gdb-7.5.0.20120926/gdb/go-valprint.c const struct value_print_options *options) { CHECK_TYPEDEF (type); -Index: gdb-7.5.0.20120926/gdb/i386-nat.c +Index: gdb-7.5.50.20130118/gdb/i386-nat.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/i386-nat.c 2012-01-24 14:49:56.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/i386-nat.c 2012-11-07 22:09:29.876140733 +0100 -@@ -293,7 +293,7 @@ static int i386_remove_aligned_watchpoin +--- gdb-7.5.50.20130118.orig/gdb/i386-nat.c 2013-01-18 23:27:22.084601343 +0100 ++++ gdb-7.5.50.20130118/gdb/i386-nat.c 2013-01-18 23:27:28.864607329 +0100 +@@ -292,7 +292,7 @@ static int i386_remove_aligned_watchpoin valid value, bombs through internal_error. */ static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, i386_wp_op_t what, @@ -2380,7 +2380,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-nat.c enum target_hw_bp_type type); /* Implementation. */ -@@ -505,8 +505,8 @@ i386_remove_aligned_watchpoint (struct i +@@ -504,8 +504,8 @@ i386_remove_aligned_watchpoint (struct i static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, @@ -2391,7 +2391,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-nat.c { int retval = 0; int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4; -@@ -663,7 +663,7 @@ i386_remove_watchpoint (CORE_ADDR addr, +@@ -662,7 +662,7 @@ i386_remove_watchpoint (CORE_ADDR addr, address ADDR and whose length is LEN bytes. */ static int @@ -2400,10 +2400,10 @@ Index: gdb-7.5.0.20120926/gdb/i386-nat.c { struct i386_debug_reg_state *state = i386_debug_reg_state (); int nregs; -Index: gdb-7.5.0.20120926/gdb/inf-ttrace.c +Index: gdb-7.5.50.20130118/gdb/inf-ttrace.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/inf-ttrace.c 2012-06-14 20:21:31.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/inf-ttrace.c 2012-11-07 22:09:29.877140732 +0100 +--- gdb-7.5.50.20130118.orig/gdb/inf-ttrace.c 2013-01-18 23:27:22.084601343 +0100 ++++ gdb-7.5.50.20130118/gdb/inf-ttrace.c 2013-01-18 23:27:28.864607329 +0100 @@ -364,7 +364,7 @@ inf_ttrace_can_use_hw_breakpoint (int ty } @@ -2413,11 +2413,11 @@ Index: gdb-7.5.0.20120926/gdb/inf-ttrace.c { return 1; } -Index: gdb-7.5.0.20120926/gdb/jv-lang.c +Index: gdb-7.5.50.20130118/gdb/jv-lang.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/jv-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/jv-lang.c 2012-11-07 22:09:29.894140708 +0100 -@@ -440,7 +440,7 @@ java_link_class_type (struct gdbarch *gd +--- gdb-7.5.50.20130118.orig/gdb/jv-lang.c 2013-01-18 23:27:22.084601343 +0100 ++++ gdb-7.5.50.20130118/gdb/jv-lang.c 2013-01-18 23:27:28.865607331 +0100 +@@ -439,7 +439,7 @@ java_link_class_type (struct gdbarch *gd for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) { int accflags; @@ -2426,7 +2426,7 @@ Index: gdb-7.5.0.20120926/gdb/jv-lang.c if (fields == NULL) { -@@ -890,7 +890,7 @@ java_printchar (int c, struct type *type +@@ -889,7 +889,7 @@ java_printchar (int c, struct type *type static void java_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -2435,10 +2435,10 @@ Index: gdb-7.5.0.20120926/gdb/jv-lang.c const struct value_print_options *options) { const char *type_encoding = java_get_encoding (type); -Index: gdb-7.5.0.20120926/gdb/jv-lang.h +Index: gdb-7.5.50.20130118/gdb/jv-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/jv-lang.h 2012-03-01 20:26:13.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/jv-lang.h 2012-11-07 22:09:29.902140696 +0100 +--- gdb-7.5.50.20130118.orig/gdb/jv-lang.h 2013-01-18 23:27:22.085601345 +0100 ++++ gdb-7.5.50.20130118/gdb/jv-lang.h 2013-01-18 23:27:28.865607331 +0100 @@ -42,8 +42,8 @@ struct builtin_java_type extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); @@ -2450,10 +2450,10 @@ Index: gdb-7.5.0.20120926/gdb/jv-lang.h const struct value *, const struct value_print_options *); -Index: gdb-7.5.0.20120926/gdb/jv-valprint.c +Index: gdb-7.5.50.20130118/gdb/jv-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/jv-valprint.c 2012-05-18 17:29:12.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/jv-valprint.c 2012-11-07 22:09:29.903140694 +0100 +--- gdb-7.5.50.20130118.orig/gdb/jv-valprint.c 2013-01-18 23:27:22.085601345 +0100 ++++ gdb-7.5.50.20130118/gdb/jv-valprint.c 2013-01-18 23:27:28.865607331 +0100 @@ -266,7 +266,7 @@ java_value_print (struct value *val, str static void @@ -2463,7 +2463,7 @@ Index: gdb-7.5.0.20120926/gdb/jv-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -484,7 +484,7 @@ java_print_value_fields (struct type *ty +@@ -465,7 +465,7 @@ java_print_value_fields (struct type *ty void java_val_print (struct type *type, const gdb_byte *valaddr, @@ -2472,11 +2472,11 @@ Index: gdb-7.5.0.20120926/gdb/jv-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.5.0.20120926/gdb/language.c +Index: gdb-7.5.50.20130118/gdb/language.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/language.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/language.c 2012-11-07 22:09:29.905140691 +0100 -@@ -724,7 +724,7 @@ unk_lang_printchar (int c, struct type * +--- gdb-7.5.50.20130118.orig/gdb/language.c 2013-01-18 23:27:22.085601345 +0100 ++++ gdb-7.5.50.20130118/gdb/language.c 2013-01-18 23:27:28.865607331 +0100 +@@ -720,7 +720,7 @@ unk_lang_printchar (int c, struct type * static void unk_lang_printstr (struct ui_file *stream, struct type *type, @@ -2485,7 +2485,7 @@ Index: gdb-7.5.0.20120926/gdb/language.c const char *encoding, int force_ellipses, const struct value_print_options *options) { -@@ -742,7 +742,7 @@ unk_lang_print_type (struct type *type, +@@ -739,7 +739,7 @@ unk_lang_print_type (struct type *type, static void unk_lang_val_print (struct type *type, const gdb_byte *valaddr, @@ -2494,10 +2494,10 @@ Index: gdb-7.5.0.20120926/gdb/language.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.5.0.20120926/gdb/language.h +Index: gdb-7.5.50.20130118/gdb/language.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/language.h 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/language.h 2012-11-07 22:09:29.906140690 +0100 +--- gdb-7.5.50.20130118.orig/gdb/language.h 2013-01-18 23:27:22.086601346 +0100 ++++ gdb-7.5.50.20130118/gdb/language.h 2013-01-18 23:27:28.865607331 +0100 @@ -175,7 +175,7 @@ struct language_defn struct ui_file * stream); @@ -2516,11 +2516,11 @@ Index: gdb-7.5.0.20120926/gdb/language.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.5.0.20120926/gdb/m2-lang.c +Index: gdb-7.5.50.20130118/gdb/m2-lang.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m2-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/m2-lang.c 2012-11-07 22:09:29.908140688 +0100 -@@ -104,10 +104,10 @@ m2_printchar (int c, struct type *type, +--- gdb-7.5.50.20130118.orig/gdb/m2-lang.c 2013-01-18 23:27:22.086601346 +0100 ++++ gdb-7.5.50.20130118/gdb/m2-lang.c 2013-01-18 23:27:28.866607333 +0100 +@@ -103,10 +103,10 @@ m2_printchar (int c, struct type *type, static void m2_printstr (struct ui_file *stream, struct type *type, const gdb_byte *string, @@ -2533,7 +2533,7 @@ Index: gdb-7.5.0.20120926/gdb/m2-lang.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -122,9 +122,9 @@ m2_printstr (struct ui_file *stream, str +@@ -121,9 +121,9 @@ m2_printstr (struct ui_file *stream, str { /* Position of the character we are examining to see whether it is repeated. */ @@ -2545,7 +2545,7 @@ Index: gdb-7.5.0.20120926/gdb/m2-lang.c QUIT; -@@ -153,7 +153,7 @@ m2_printstr (struct ui_file *stream, str +@@ -149,7 +149,7 @@ m2_printstr (struct ui_file *stream, str in_quotes = 0; } m2_printchar (string[i], type, stream); @@ -2554,11 +2554,11 @@ Index: gdb-7.5.0.20120926/gdb/m2-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-7.5.0.20120926/gdb/m2-lang.h +Index: gdb-7.5.50.20130118/gdb/m2-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m2-lang.h 2012-03-01 20:26:13.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/m2-lang.h 2012-11-07 22:09:29.909140686 +0100 -@@ -32,7 +32,7 @@ extern void m2_print_typedef (struct typ +--- gdb-7.5.50.20130118.orig/gdb/m2-lang.h 2013-01-18 23:27:22.086601346 +0100 ++++ gdb-7.5.50.20130118/gdb/m2-lang.h 2013-01-18 23:27:28.866607333 +0100 +@@ -33,7 +33,7 @@ extern void m2_print_typedef (struct typ extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); @@ -2567,11 +2567,11 @@ Index: gdb-7.5.0.20120926/gdb/m2-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -Index: gdb-7.5.0.20120926/gdb/m2-typeprint.c +Index: gdb-7.5.50.20130118/gdb/m2-typeprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m2-typeprint.c 2012-11-07 22:02:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/m2-typeprint.c 2012-11-07 22:09:29.910140684 +0100 -@@ -228,9 +228,12 @@ static void m2_array (struct type *type, +--- gdb-7.5.50.20130118.orig/gdb/m2-typeprint.c 2013-01-18 23:27:28.866607333 +0100 ++++ gdb-7.5.50.20130118/gdb/m2-typeprint.c 2013-01-18 23:31:45.832877805 +0100 +@@ -236,9 +236,12 @@ static void m2_array (struct type *type, m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); } else @@ -2586,12 +2586,12 @@ Index: gdb-7.5.0.20120926/gdb/m2-typeprint.c + } } fprintf_filtered (stream, "] OF "); - m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level); -Index: gdb-7.5.0.20120926/gdb/m2-valprint.c + m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); +Index: gdb-7.5.50.20130118/gdb/m2-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m2-valprint.c 2012-11-07 22:02:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/m2-valprint.c 2012-11-07 22:09:29.911140682 +0100 -@@ -36,7 +36,7 @@ static int print_unpacked_pointer (struc +--- gdb-7.5.50.20130118.orig/gdb/m2-valprint.c 2013-01-18 23:27:22.087601347 +0100 ++++ gdb-7.5.50.20130118/gdb/m2-valprint.c 2013-01-18 23:27:28.866607333 +0100 +@@ -35,7 +35,7 @@ static int print_unpacked_pointer (struc struct ui_file *stream); static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, @@ -2600,7 +2600,7 @@ Index: gdb-7.5.0.20120926/gdb/m2-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -68,7 +68,7 @@ get_long_set_bounds (struct type *type, +@@ -67,7 +67,7 @@ get_long_set_bounds (struct type *type, static void m2_print_long_set (struct type *type, const gdb_byte *valaddr, @@ -2609,7 +2609,7 @@ Index: gdb-7.5.0.20120926/gdb/m2-valprint.c struct ui_file *stream) { int empty_set = 1; -@@ -159,7 +159,7 @@ m2_print_long_set (struct type *type, co +@@ -158,7 +158,7 @@ m2_print_long_set (struct type *type, co static void m2_print_unbounded_array (struct type *type, const gdb_byte *valaddr, @@ -2618,7 +2618,7 @@ Index: gdb-7.5.0.20120926/gdb/m2-valprint.c struct ui_file *stream, int recurse, const struct value_print_options *options) { -@@ -263,7 +263,7 @@ print_variable_at_address (struct type * +@@ -262,7 +262,7 @@ print_variable_at_address (struct type * static void m2_print_array_contents (struct type *type, const gdb_byte *valaddr, @@ -2627,7 +2627,7 @@ Index: gdb-7.5.0.20120926/gdb/m2-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -309,14 +309,15 @@ static const struct generic_val_print_de +@@ -308,14 +308,15 @@ static const struct generic_val_print_de function; they are identical. */ void @@ -2647,7 +2647,7 @@ Index: gdb-7.5.0.20120926/gdb/m2-valprint.c struct type *elttype; CORE_ADDR addr; -@@ -341,7 +342,7 @@ m2_val_print (struct type *type, const g +@@ -340,7 +341,7 @@ m2_val_print (struct type *type, const g elements up to it. */ if (options->stop_print_at_null) { @@ -2656,10 +2656,10 @@ Index: gdb-7.5.0.20120926/gdb/m2-valprint.c /* Look for a NULL char. */ for (temp_len = 0; -Index: gdb-7.5.0.20120926/gdb/memrange.c +Index: gdb-7.5.50.20130118/gdb/memrange.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/memrange.c 2012-01-04 09:17:06.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/memrange.c 2012-11-07 22:09:29.916140676 +0100 +--- gdb-7.5.50.20130118.orig/gdb/memrange.c 2013-01-18 23:27:22.087601347 +0100 ++++ gdb-7.5.50.20130118/gdb/memrange.c 2013-01-18 23:27:28.866607333 +0100 @@ -21,8 +21,8 @@ #include "memrange.h" @@ -2671,10 +2671,10 @@ Index: gdb-7.5.0.20120926/gdb/memrange.c { ULONGEST h, l; -Index: gdb-7.5.0.20120926/gdb/memrange.h +Index: gdb-7.5.50.20130118/gdb/memrange.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/memrange.h 2012-01-04 09:17:06.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/memrange.h 2012-11-07 22:09:29.917140674 +0100 +--- gdb-7.5.50.20130118.orig/gdb/memrange.h 2013-01-18 23:27:22.087601347 +0100 ++++ gdb-7.5.50.20130118/gdb/memrange.h 2013-01-18 23:27:28.866607333 +0100 @@ -30,7 +30,7 @@ struct mem_range CORE_ADDR start; @@ -2695,10 +2695,10 @@ Index: gdb-7.5.0.20120926/gdb/memrange.h /* Sort ranges by start address, then coalesce contiguous or overlapping ranges. */ -Index: gdb-7.5.0.20120926/gdb/mips-linux-nat.c +Index: gdb-7.5.50.20130118/gdb/mips-linux-nat.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/mips-linux-nat.c 2012-05-22 20:12:13.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/mips-linux-nat.c 2012-11-07 22:09:29.918140672 +0100 +--- gdb-7.5.50.20130118.orig/gdb/mips-linux-nat.c 2013-01-18 23:27:22.087601347 +0100 ++++ gdb-7.5.50.20130118/gdb/mips-linux-nat.c 2013-01-18 23:27:28.867607334 +0100 @@ -938,7 +938,7 @@ try_one_watch (struct pt_watch_regs *reg the specified region can be covered by the watch registers. */ @@ -2708,49 +2708,10 @@ Index: gdb-7.5.0.20120926/gdb/mips-linux-nat.c { struct pt_watch_regs dummy_regs; int i; -Index: gdb-7.5.0.20120926/gdb/objc-lang.c +Index: gdb-7.5.50.20130118/gdb/opencl-lang.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/objc-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/objc-lang.c 2012-11-07 22:09:29.920140670 +0100 -@@ -347,11 +347,11 @@ objc_printchar (int c, struct type *type - - static void - objc_printstr (struct ui_file *stream, struct type *type, -- const gdb_byte *string, unsigned int length, -+ const gdb_byte *string, ULONGEST length, - const char *encoding, int force_ellipses, - const struct value_print_options *options) - { -- unsigned int i; -+ ULONGEST i; - unsigned int things_printed = 0; - int in_quotes = 0; - int need_comma = 0; -@@ -372,9 +372,9 @@ objc_printstr (struct ui_file *stream, s - { - /* Position of the character we are examining to see whether it - is repeated. */ -- unsigned int rep1; -+ ULONGEST rep1; - /* Number of repetitions we have detected so far. */ -- unsigned int reps; -+ ULONGEST reps; - - QUIT; - -@@ -403,7 +403,7 @@ objc_printstr (struct ui_file *stream, s - in_quotes = 0; - } - objc_printchar (string[i], type, stream); -- fprintf_filtered (stream, " ", reps); -+ fprintf_filtered (stream, " ", pulongest (reps)); - i = rep1 - 1; - things_printed += options->repeat_count_threshold; - need_comma = 1; -Index: gdb-7.5.0.20120926/gdb/opencl-lang.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/opencl-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/opencl-lang.c 2012-11-07 22:09:29.921140669 +0100 +--- gdb-7.5.50.20130118.orig/gdb/opencl-lang.c 2013-01-18 23:27:22.088601349 +0100 ++++ gdb-7.5.50.20130118/gdb/opencl-lang.c 2013-01-18 23:27:28.868607335 +0100 @@ -80,11 +80,11 @@ builtin_opencl_type (struct gdbarch *gdb static struct type * @@ -2877,11 +2838,11 @@ Index: gdb-7.5.0.20120926/gdb/opencl-lang.c if (!value_bits_synthetic_pointer (c->val, c->indices[i] * elsize + comp_offset, -Index: gdb-7.5.0.20120926/gdb/p-lang.c +Index: gdb-7.5.50.20130118/gdb/p-lang.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/p-lang.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/p-lang.c 2012-11-07 22:09:29.922140667 +0100 -@@ -96,8 +96,8 @@ pascal_main_name (void) +--- gdb-7.5.50.20130118.orig/gdb/p-lang.c 2013-01-18 23:27:22.089601351 +0100 ++++ gdb-7.5.50.20130118/gdb/p-lang.c 2013-01-18 23:27:28.868607335 +0100 +@@ -95,8 +95,8 @@ pascal_main_name (void) are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ int @@ -2892,7 +2853,7 @@ Index: gdb-7.5.0.20120926/gdb/p-lang.c struct type **char_type, const char **arrayname) { -@@ -217,12 +217,12 @@ pascal_printchar (int c, struct type *ty +@@ -216,12 +216,12 @@ pascal_printchar (int c, struct type *ty void pascal_printstr (struct ui_file *stream, struct type *type, @@ -2907,7 +2868,7 @@ Index: gdb-7.5.0.20120926/gdb/p-lang.c unsigned int things_printed = 0; int in_quotes = 0; int need_comma = 0; -@@ -250,9 +250,9 @@ pascal_printstr (struct ui_file *stream, +@@ -249,9 +249,9 @@ pascal_printstr (struct ui_file *stream, { /* Position of the character we are examining to see whether it is repeated. */ @@ -2919,7 +2880,7 @@ Index: gdb-7.5.0.20120926/gdb/p-lang.c unsigned long int current_char; QUIT; -@@ -287,7 +287,7 @@ pascal_printstr (struct ui_file *stream, +@@ -283,7 +283,7 @@ pascal_printstr (struct ui_file *stream, in_quotes = 0; } pascal_printchar (current_char, type, stream); @@ -2928,10 +2889,10 @@ Index: gdb-7.5.0.20120926/gdb/p-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-7.5.0.20120926/gdb/p-lang.h +Index: gdb-7.5.50.20130118/gdb/p-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/p-lang.h 2012-03-01 20:26:13.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/p-lang.h 2012-11-07 22:09:29.923140665 +0100 +--- gdb-7.5.50.20130118.orig/gdb/p-lang.h 2013-01-18 23:27:22.089601351 +0100 ++++ gdb-7.5.50.20130118/gdb/p-lang.h 2013-01-18 23:32:17.358916426 +0100 @@ -35,7 +35,7 @@ extern void pascal_print_type (struct ty extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); @@ -2957,8 +2918,8 @@ Index: gdb-7.5.0.20120926/gdb/p-lang.h const struct value_print_options *); extern struct type **const (pascal_builtin_types[]); -@@ -69,7 +69,7 @@ extern void - pascal_type_print_varspec_prefix (struct type *, struct ui_file *, int, int); +@@ -71,7 +71,7 @@ extern void + const struct type_print_options *); extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, - int, @@ -2966,11 +2927,11 @@ Index: gdb-7.5.0.20120926/gdb/p-lang.h CORE_ADDR, struct ui_file *, int, const struct value *, -Index: gdb-7.5.0.20120926/gdb/p-valprint.c +Index: gdb-7.5.50.20130118/gdb/p-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/p-valprint.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/p-valprint.c 2012-11-07 22:09:29.930140655 +0100 -@@ -59,7 +59,7 @@ static const struct generic_val_print_de +--- gdb-7.5.50.20130118.orig/gdb/p-valprint.c 2013-01-18 23:27:22.089601351 +0100 ++++ gdb-7.5.50.20130118/gdb/p-valprint.c 2013-01-18 23:27:28.868607335 +0100 +@@ -58,7 +58,7 @@ static const struct generic_val_print_de void pascal_val_print (struct type *type, const gdb_byte *valaddr, @@ -2979,7 +2940,7 @@ Index: gdb-7.5.0.20120926/gdb/p-valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) -@@ -70,8 +70,8 @@ pascal_val_print (struct type *type, con +@@ -69,8 +69,8 @@ pascal_val_print (struct type *type, con unsigned len; LONGEST low_bound, high_bound; struct type *elttype; @@ -2990,7 +2951,7 @@ Index: gdb-7.5.0.20120926/gdb/p-valprint.c struct type *char_type; CORE_ADDR addr; int want_space = 0; -@@ -504,7 +504,7 @@ static void pascal_object_print_static_f +@@ -493,7 +493,7 @@ static void pascal_object_print_static_f const struct value_print_options *); static void pascal_object_print_value (struct type *, const gdb_byte *, @@ -2999,7 +2960,7 @@ Index: gdb-7.5.0.20120926/gdb/p-valprint.c CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, -@@ -563,7 +563,7 @@ pascal_object_is_vtbl_member (struct typ +@@ -552,7 +552,7 @@ pascal_object_is_vtbl_member (struct typ void pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, @@ -3008,7 +2969,7 @@ Index: gdb-7.5.0.20120926/gdb/p-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -758,7 +758,7 @@ pascal_object_print_value_fields (struct +@@ -728,7 +728,7 @@ pascal_object_print_value_fields (struct static void pascal_object_print_value (struct type *type, const gdb_byte *valaddr, @@ -3017,7 +2978,7 @@ Index: gdb-7.5.0.20120926/gdb/p-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -781,11 +781,11 @@ pascal_object_print_value (struct type * +@@ -751,11 +751,11 @@ pascal_object_print_value (struct type * for (i = 0; i < n_baseclasses; i++) { @@ -3031,11 +2992,11 @@ Index: gdb-7.5.0.20120926/gdb/p-valprint.c volatile struct gdb_exception ex; int skip = 0; -Index: gdb-7.5.0.20120926/gdb/ppc-linux-nat.c +Index: gdb-7.5.50.20130118/gdb/ppc-linux-nat.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ppc-linux-nat.c 2012-07-06 18:49:43.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ppc-linux-nat.c 2012-11-07 22:09:29.933140651 +0100 -@@ -1493,7 +1493,7 @@ ppc_linux_can_use_hw_breakpoint (int typ +--- gdb-7.5.50.20130118.orig/gdb/ppc-linux-nat.c 2013-01-18 23:27:22.090601353 +0100 ++++ gdb-7.5.50.20130118/gdb/ppc-linux-nat.c 2013-01-18 23:27:28.869607337 +0100 +@@ -1492,7 +1492,7 @@ ppc_linux_can_use_hw_breakpoint (int typ } static int @@ -3044,11 +3005,11 @@ Index: gdb-7.5.0.20120926/gdb/ppc-linux-nat.c { /* Handle sub-8-byte quantities. */ if (len <= 0) -Index: gdb-7.5.0.20120926/gdb/printcmd.c +Index: gdb-7.5.50.20130118/gdb/printcmd.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/printcmd.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/printcmd.c 2012-11-07 22:09:29.940140641 +0100 -@@ -291,7 +291,7 @@ print_formatted (struct value *val, int +--- gdb-7.5.50.20130118.orig/gdb/printcmd.c 2013-01-18 23:27:22.091601355 +0100 ++++ gdb-7.5.50.20130118/gdb/printcmd.c 2013-01-18 23:27:28.869607337 +0100 +@@ -289,7 +289,7 @@ print_formatted (struct value *val, int struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); @@ -3057,7 +3018,7 @@ Index: gdb-7.5.0.20120926/gdb/printcmd.c if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; -@@ -369,7 +369,7 @@ print_scalar_formatted (const void *vala +@@ -367,7 +367,7 @@ print_scalar_formatted (const void *vala { struct gdbarch *gdbarch = get_type_arch (type); LONGEST val_long = 0; @@ -3066,11 +3027,11 @@ Index: gdb-7.5.0.20120926/gdb/printcmd.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* String printing should go through val_print_scalar_formatted. */ -Index: gdb-7.5.0.20120926/gdb/procfs.c +Index: gdb-7.5.50.20130118/gdb/procfs.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/procfs.c 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/procfs.c 2012-11-07 22:09:29.945140633 +0100 -@@ -4966,7 +4966,7 @@ procfs_remove_watchpoint (CORE_ADDR addr +--- gdb-7.5.50.20130118.orig/gdb/procfs.c 2013-01-18 23:27:22.092601357 +0100 ++++ gdb-7.5.50.20130118/gdb/procfs.c 2013-01-18 23:27:28.870607340 +0100 +@@ -4926,7 +4926,7 @@ procfs_remove_watchpoint (CORE_ADDR addr } static int @@ -3079,11 +3040,11 @@ Index: gdb-7.5.0.20120926/gdb/procfs.c { /* The man page for proc(4) on Solaris 2.6 and up says that the system can support "thousands" of hardware watchpoints, but gives -Index: gdb-7.5.0.20120926/gdb/python/py-prettyprint.c +Index: gdb-7.5.50.20130118/gdb/python/py-prettyprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/python/py-prettyprint.c 2012-01-04 09:17:25.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/python/py-prettyprint.c 2012-11-07 22:09:29.969140598 +0100 -@@ -676,7 +676,7 @@ print_children (PyObject *printer, const +--- gdb-7.5.50.20130118.orig/gdb/python/py-prettyprint.c 2013-01-18 23:27:22.092601357 +0100 ++++ gdb-7.5.50.20130118/gdb/python/py-prettyprint.c 2013-01-18 23:27:28.870607340 +0100 +@@ -689,7 +689,7 @@ print_children (PyObject *printer, const int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, @@ -3092,7 +3053,7 @@ Index: gdb-7.5.0.20120926/gdb/python/py-prettyprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -824,7 +824,7 @@ gdbpy_default_visualizer (PyObject *self +@@ -837,7 +837,7 @@ gdbpy_default_visualizer (PyObject *self int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, @@ -3101,10 +3062,10 @@ Index: gdb-7.5.0.20120926/gdb/python/py-prettyprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -Index: gdb-7.5.0.20120926/gdb/python/python.h +Index: gdb-7.5.50.20130118/gdb/python/python.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/python/python.h 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/python/python.h 2012-11-07 22:10:46.010030115 +0100 +--- gdb-7.5.50.20130118.orig/gdb/python/python.h 2013-01-18 23:27:22.092601357 +0100 ++++ gdb-7.5.50.20130118/gdb/python/python.h 2013-01-18 23:27:28.870607340 +0100 @@ -37,7 +37,7 @@ void source_python_script (FILE *file, c void run_python_script (int argc, char **argv); @@ -3114,11 +3075,11 @@ Index: gdb-7.5.0.20120926/gdb/python/python.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -Index: gdb-7.5.0.20120926/gdb/regcache.c +Index: gdb-7.5.50.20130118/gdb/regcache.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/regcache.c 2012-01-04 09:17:09.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/regcache.c 2012-11-07 22:09:29.988140571 +0100 -@@ -902,7 +902,7 @@ typedef void (regcache_write_ftype) (str +--- gdb-7.5.50.20130118.orig/gdb/regcache.c 2013-01-18 23:27:22.093601359 +0100 ++++ gdb-7.5.50.20130118/gdb/regcache.c 2013-01-18 23:27:28.871607342 +0100 +@@ -901,7 +901,7 @@ typedef void (regcache_write_ftype) (str static enum register_status regcache_xfer_part (struct regcache *regcache, int regnum, @@ -3127,7 +3088,7 @@ Index: gdb-7.5.0.20120926/gdb/regcache.c enum register_status (*read) (struct regcache *regcache, int regnum, gdb_byte *buf), -@@ -946,7 +946,7 @@ regcache_xfer_part (struct regcache *reg +@@ -945,7 +945,7 @@ regcache_xfer_part (struct regcache *reg enum register_status regcache_raw_read_part (struct regcache *regcache, int regnum, @@ -3136,7 +3097,7 @@ Index: gdb-7.5.0.20120926/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -@@ -957,7 +957,7 @@ regcache_raw_read_part (struct regcache +@@ -956,7 +956,7 @@ regcache_raw_read_part (struct regcache void regcache_raw_write_part (struct regcache *regcache, int regnum, @@ -3145,7 +3106,7 @@ Index: gdb-7.5.0.20120926/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -@@ -968,7 +968,7 @@ regcache_raw_write_part (struct regcache +@@ -967,7 +967,7 @@ regcache_raw_write_part (struct regcache enum register_status regcache_cooked_read_part (struct regcache *regcache, int regnum, @@ -3154,7 +3115,7 @@ Index: gdb-7.5.0.20120926/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -@@ -979,7 +979,7 @@ regcache_cooked_read_part (struct regcac +@@ -978,7 +978,7 @@ regcache_cooked_read_part (struct regcac void regcache_cooked_write_part (struct regcache *regcache, int regnum, @@ -3163,11 +3124,11 @@ Index: gdb-7.5.0.20120926/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -Index: gdb-7.5.0.20120926/gdb/regcache.h +Index: gdb-7.5.50.20130118/gdb/regcache.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/regcache.h 2012-01-04 09:17:10.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/regcache.h 2012-11-07 22:09:29.990140568 +0100 -@@ -90,9 +90,9 @@ extern void regcache_raw_write_unsigned +--- gdb-7.5.50.20130118.orig/gdb/regcache.h 2013-01-18 23:27:22.093601359 +0100 ++++ gdb-7.5.50.20130118/gdb/regcache.h 2013-01-18 23:27:28.871607342 +0100 +@@ -89,9 +89,9 @@ extern void regcache_raw_write_unsigned extern enum register_status regcache_raw_read_part (struct regcache *regcache, int regnum, @@ -3179,7 +3140,7 @@ Index: gdb-7.5.0.20120926/gdb/regcache.h void regcache_invalidate (struct regcache *regcache, int regnum); -@@ -129,10 +129,11 @@ extern void regcache_cooked_write_unsign +@@ -128,10 +128,11 @@ extern void regcache_cooked_write_unsign write style operations. */ enum register_status regcache_cooked_read_part (struct regcache *regcache, @@ -3194,11 +3155,11 @@ Index: gdb-7.5.0.20120926/gdb/regcache.h /* Special routines to read/write the PC. */ -Index: gdb-7.5.0.20120926/gdb/remote.c +Index: gdb-7.5.50.20130118/gdb/remote.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/remote.c 2012-11-07 22:00:42.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/remote.c 2012-11-07 22:09:29.994140562 +0100 -@@ -8119,7 +8119,7 @@ int remote_hw_watchpoint_length_limit = +--- gdb-7.5.50.20130118.orig/gdb/remote.c 2013-01-18 23:27:22.095601362 +0100 ++++ gdb-7.5.50.20130118/gdb/remote.c 2013-01-18 23:27:28.872607343 +0100 +@@ -8174,7 +8174,7 @@ int remote_hw_watchpoint_length_limit = int remote_hw_breakpoint_limit = -1; static int @@ -3207,11 +3168,11 @@ Index: gdb-7.5.0.20120926/gdb/remote.c { if (remote_hw_watchpoint_length_limit == 0) return 0; -Index: gdb-7.5.0.20120926/gdb/s390-nat.c +Index: gdb-7.5.50.20130118/gdb/s390-nat.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/s390-nat.c 2012-03-05 20:05:09.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/s390-nat.c 2012-11-07 22:09:30.016140531 +0100 -@@ -572,7 +572,7 @@ s390_can_use_hw_breakpoint (int type, in +--- gdb-7.5.50.20130118.orig/gdb/s390-nat.c 2013-01-18 23:27:22.096601363 +0100 ++++ gdb-7.5.50.20130118/gdb/s390-nat.c 2013-01-18 23:27:28.872607343 +0100 +@@ -571,7 +571,7 @@ s390_can_use_hw_breakpoint (int type, in } static int @@ -3220,10 +3181,10 @@ Index: gdb-7.5.0.20120926/gdb/s390-nat.c { return 1; } -Index: gdb-7.5.0.20120926/gdb/spu-multiarch.c +Index: gdb-7.5.50.20130118/gdb/spu-multiarch.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/spu-multiarch.c 2012-05-18 23:02:50.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/spu-multiarch.c 2012-11-07 22:09:30.021140523 +0100 +--- gdb-7.5.50.20130118.orig/gdb/spu-multiarch.c 2013-01-18 23:27:22.096601363 +0100 ++++ gdb-7.5.50.20130118/gdb/spu-multiarch.c 2013-01-18 23:27:28.873607344 +0100 @@ -118,7 +118,7 @@ spu_thread_architecture (struct target_o /* Override the to_region_ok_for_hw_watchpoint routine. */ @@ -3233,10 +3194,10 @@ Index: gdb-7.5.0.20120926/gdb/spu-multiarch.c { struct target_ops *ops_beneath = find_target_beneath (&spu_ops); while (ops_beneath && !ops_beneath->to_region_ok_for_hw_watchpoint) -Index: gdb-7.5.0.20120926/gdb/stack.c +Index: gdb-7.5.50.20130118/gdb/stack.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/stack.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/stack.c 2012-11-07 22:09:30.024140518 +0100 +--- gdb-7.5.50.20130118.orig/gdb/stack.c 2013-01-18 23:27:22.096601363 +0100 ++++ gdb-7.5.50.20130118/gdb/stack.c 2013-01-18 23:27:28.873607344 +0100 @@ -173,7 +173,7 @@ print_stack_frame (struct frame_info *fr argument (not just the first nameless argument). */ @@ -3275,11 +3236,11 @@ Index: gdb-7.5.0.20120926/gdb/stack.c if (highest_offset == -1) start = gdbarch_frame_args_skip (get_frame_arch (frame)); -Index: gdb-7.5.0.20120926/gdb/symmisc.c +Index: gdb-7.5.50.20130118/gdb/symmisc.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/symmisc.c 2012-11-07 22:00:42.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/symmisc.c 2012-11-07 22:09:30.026140516 +0100 -@@ -517,11 +517,11 @@ print_symbol (void *args) +--- gdb-7.5.50.20130118.orig/gdb/symmisc.c 2013-01-18 23:27:22.097601365 +0100 ++++ gdb-7.5.50.20130118/gdb/symmisc.c 2013-01-18 23:27:28.873607344 +0100 +@@ -524,11 +524,11 @@ print_symbol (void *args) case LOC_CONST_BYTES: { @@ -3294,10 +3255,10 @@ Index: gdb-7.5.0.20120926/gdb/symmisc.c for (i = 0; i < TYPE_LENGTH (type); i++) fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); -Index: gdb-7.5.0.20120926/gdb/target.c +Index: gdb-7.5.50.20130118/gdb/target.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/target.c 2012-07-02 17:29:35.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/target.c 2012-11-07 22:09:30.029140511 +0100 +--- gdb-7.5.50.20130118.orig/gdb/target.c 2013-01-18 23:27:22.098601367 +0100 ++++ gdb-7.5.50.20130118/gdb/target.c 2013-01-18 23:32:39.159943674 +0100 @@ -51,7 +51,7 @@ static void default_terminal_info (char static int default_watchpoint_addr_within_range (struct target_ops *, CORE_ADDR, CORE_ADDR, int); @@ -3316,16 +3277,16 @@ Index: gdb-7.5.0.20120926/gdb/target.c static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int, struct expression *); -@@ -3546,7 +3546,7 @@ target_fileio_read_stralloc (const char +@@ -3552,7 +3552,7 @@ target_fileio_read_stralloc (const char static int -default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) +default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) { - return (len <= gdbarch_ptr_bit (target_gdbarch) / TARGET_CHAR_BIT); + return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT); } -@@ -4197,7 +4197,7 @@ debug_to_can_use_hw_breakpoint (int type +@@ -4253,7 +4253,7 @@ debug_to_can_use_hw_breakpoint (int type } static int @@ -3334,11 +3295,11 @@ Index: gdb-7.5.0.20120926/gdb/target.c { CORE_ADDR retval; -Index: gdb-7.5.0.20120926/gdb/target.h +Index: gdb-7.5.50.20130118/gdb/target.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/target.h 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/target.h 2012-11-07 22:09:30.055140474 +0100 -@@ -478,7 +478,7 @@ struct target_ops +--- gdb-7.5.50.20130118.orig/gdb/target.h 2013-01-18 23:27:22.099601369 +0100 ++++ gdb-7.5.50.20130118/gdb/target.h 2013-01-18 23:27:28.874607346 +0100 +@@ -482,7 +482,7 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ @@ -3347,10 +3308,10 @@ Index: gdb-7.5.0.20120926/gdb/target.h int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int, struct expression *); -Index: gdb-7.5.0.20120926/gdb/tracepoint.c +Index: gdb-7.5.50.20130118/gdb/tracepoint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/tracepoint.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/tracepoint.c 2012-11-07 22:09:30.065140459 +0100 +--- gdb-7.5.50.20130118.orig/gdb/tracepoint.c 2013-01-18 23:27:22.100601371 +0100 ++++ gdb-7.5.50.20130118/gdb/tracepoint.c 2013-01-18 23:27:28.875607349 +0100 @@ -934,13 +934,13 @@ add_register (struct collection_list *co static void add_memrange (struct collection_list *memranges, @@ -3420,7 +3381,7 @@ Index: gdb-7.5.0.20120926/gdb/tracepoint.c printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } -@@ -2617,7 +2617,8 @@ scope_info (char *args, int from_tty) +@@ -2620,7 +2620,8 @@ scope_info (char *args, int from_tty) const char *symname; char *save_args = args; struct block_iterator iter; @@ -3430,7 +3391,7 @@ Index: gdb-7.5.0.20120926/gdb/tracepoint.c struct gdbarch *gdbarch; int regno; -@@ -2747,8 +2748,11 @@ scope_info (char *args, int from_tty) +@@ -2750,8 +2751,11 @@ scope_info (char *args, int from_tty) break; } if (SYMBOL_TYPE (sym)) @@ -3444,11 +3405,11 @@ Index: gdb-7.5.0.20120926/gdb/tracepoint.c } if (BLOCK_FUNCTION (block)) break; -Index: gdb-7.5.0.20120926/gdb/typeprint.c +Index: gdb-7.5.50.20130118/gdb/typeprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/typeprint.c 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/typeprint.c 2012-11-07 22:09:30.066140457 +0100 -@@ -123,7 +123,7 @@ whatis_exp (char *exp, int show) +--- gdb-7.5.50.20130118.orig/gdb/typeprint.c 2013-01-18 23:27:28.876607351 +0100 ++++ gdb-7.5.50.20130118/gdb/typeprint.c 2013-01-18 23:33:02.702973610 +0100 +@@ -409,7 +409,7 @@ whatis_exp (char *exp, int show) struct type *real_type = NULL; struct type *type; int full = 0; @@ -3456,12 +3417,12 @@ Index: gdb-7.5.0.20120926/gdb/typeprint.c + LONGEST top = -1; int using_enc = 0; struct value_print_options opts; - -Index: gdb-7.5.0.20120926/gdb/valarith.c + struct type_print_options flags = default_ptype_flags; +Index: gdb-7.5.50.20130118/gdb/valarith.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valarith.c 2012-11-07 22:02:18.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/valarith.c 2012-11-07 22:13:31.145867519 +0100 -@@ -192,15 +192,15 @@ value_subscript (struct value *array, LO +--- gdb-7.5.50.20130118.orig/gdb/valarith.c 2013-01-18 23:27:22.101601373 +0100 ++++ gdb-7.5.50.20130118/gdb/valarith.c 2013-01-18 23:27:28.876607351 +0100 +@@ -190,15 +190,15 @@ value_subscript (struct value *array, LO to doubles, but no longer does. */ struct value * @@ -3481,7 +3442,7 @@ Index: gdb-7.5.0.20120926/gdb/valarith.c struct value *v; if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) -@@ -678,7 +678,7 @@ value_concat (struct value *arg1, struct +@@ -636,7 +636,7 @@ value_concat (struct value *arg1, struct struct value *inval1; struct value *inval2; struct value *outval = NULL; @@ -3490,7 +3451,7 @@ Index: gdb-7.5.0.20120926/gdb/valarith.c int count, idx; char *ptr; char inchar; -@@ -1489,7 +1489,7 @@ value_binop (struct value *arg1, struct +@@ -1444,7 +1444,7 @@ value_binop (struct value *arg1, struct int value_logical_not (struct value *arg1) { @@ -3499,7 +3460,7 @@ Index: gdb-7.5.0.20120926/gdb/valarith.c const gdb_byte *p; struct type *type1; -@@ -1520,11 +1520,11 @@ value_logical_not (struct value *arg1) +@@ -1475,11 +1475,11 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { @@ -3514,10 +3475,10 @@ Index: gdb-7.5.0.20120926/gdb/valarith.c for (i = 0; i < len; i++) { -Index: gdb-7.5.0.20120926/gdb/valops.c +Index: gdb-7.5.50.20130118/gdb/valops.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valops.c 2012-11-07 22:06:35.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/valops.c 2012-11-07 22:09:30.074140445 +0100 +--- gdb-7.5.50.20130118.orig/gdb/valops.c 2013-01-18 23:27:22.104601379 +0100 ++++ gdb-7.5.50.20130118/gdb/valops.c 2013-01-18 23:27:28.877607352 +0100 @@ -54,11 +54,11 @@ static int typecmp (int staticp, int var struct field t1[], struct value *t2[]); @@ -3661,7 +3622,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c int changed_len; gdb_byte buffer[sizeof (LONGEST)]; int optim, unavail; -@@ -1892,7 +1894,7 @@ value_array (int lowbound, int highbound +@@ -1891,7 +1893,7 @@ value_array (int lowbound, int highbound { int nelem; int idx; @@ -3670,7 +3631,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c struct value *val; struct type *arraytype; -@@ -2080,7 +2082,7 @@ typecmp (int staticp, int varargs, int n +@@ -2066,7 +2068,7 @@ typecmp (int staticp, int varargs, int n static void update_search_result (struct value **result_ptr, struct value *v, @@ -3679,7 +3640,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c const char *name, struct type *type) { if (v != NULL) -@@ -2104,10 +2106,10 @@ update_search_result (struct value **res +@@ -2090,10 +2092,10 @@ update_search_result (struct value **res lookup is ambiguous. */ static void @@ -3692,7 +3653,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c struct type *outermost_type) { int i; -@@ -2162,7 +2164,7 @@ do_search_struct_field (const char *name +@@ -2148,7 +2150,7 @@ do_search_struct_field (const char *name . */ struct value *v = NULL; @@ -3701,7 +3662,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c /* This is pretty gross. In G++, the offset in an anonymous union is relative to the beginning of the -@@ -2201,7 +2203,7 @@ do_search_struct_field (const char *name +@@ -2187,7 +2189,7 @@ do_search_struct_field (const char *name && (strcmp_iw (name, TYPE_BASECLASS_NAME (type, i)) == 0)); @@ -3710,7 +3671,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (type, i)) { -@@ -2276,11 +2278,11 @@ do_search_struct_field (const char *name +@@ -2262,11 +2264,11 @@ do_search_struct_field (const char *name fields, look for a baseclass named NAME. */ static struct value * @@ -3724,7 +3685,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c do_search_struct_field (name, arg1, offset, type, looking_for_baseclass, &result, &boffset, type); -@@ -2297,7 +2299,7 @@ search_struct_field (const char *name, s +@@ -2283,7 +2285,7 @@ search_struct_field (const char *name, s static struct value * search_struct_method (const char *name, struct value **arg1p, @@ -3733,7 +3694,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c int *static_memfuncp, struct type *type) { int i; -@@ -2361,9 +2363,9 @@ search_struct_method (const char *name, +@@ -2347,9 +2349,9 @@ search_struct_method (const char *name, for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { @@ -3745,7 +3706,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (type, i)) { -@@ -2545,8 +2547,8 @@ value_struct_elt (struct value **argp, s +@@ -2531,8 +2533,8 @@ value_struct_elt (struct value **argp, s static struct fn_field * find_method_list (struct value **argp, const char *method, @@ -3756,7 +3717,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c { int i; struct fn_field *f; -@@ -2579,7 +2581,7 @@ find_method_list (struct value **argp, c +@@ -2565,7 +2567,7 @@ find_method_list (struct value **argp, c /* Not found in object, check in base subobjects. */ for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { @@ -3765,7 +3726,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (type, i)) { -@@ -2615,7 +2617,7 @@ find_method_list (struct value **argp, c +@@ -2601,7 +2603,7 @@ find_method_list (struct value **argp, c static struct fn_field * value_find_oload_method_list (struct value **argp, const char *method, int offset, int *num_fns, @@ -3774,7 +3735,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c { struct type *t; -@@ -2707,7 +2709,7 @@ find_overload_match (struct value **args +@@ -2693,7 +2695,7 @@ find_overload_match (struct value **args /* Number of overloaded instances being considered. */ int num_fns = 0; struct type *basetype = NULL; @@ -3783,7 +3744,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); -@@ -3413,7 +3415,7 @@ compare_parameters (struct type *t1, str +@@ -3363,7 +3365,7 @@ compare_parameters (struct type *t1, str the form "DOMAIN::NAME". */ static struct value * @@ -3792,7 +3753,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c struct type *curtype, char *name, struct type *intype, int want_address, -@@ -3450,7 +3452,7 @@ value_struct_elt_for_reference (struct t +@@ -3400,7 +3402,7 @@ value_struct_elt_for_reference (struct t if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), @@ -3801,7 +3762,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c else if (noside == EVAL_AVOID_SIDE_EFFECTS) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3593,7 +3595,7 @@ value_struct_elt_for_reference (struct t +@@ -3543,7 +3545,7 @@ value_struct_elt_for_reference (struct t for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -3810,7 +3771,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3683,7 +3685,7 @@ value_maybe_namespace_elt (const struct +@@ -3633,7 +3635,7 @@ value_maybe_namespace_elt (const struct struct type * value_rtti_indirect_type (struct value *v, int *full, @@ -3819,7 +3780,7 @@ Index: gdb-7.5.0.20120926/gdb/valops.c { struct value *target; struct type *type, *real_type, *target_type; -@@ -3733,12 +3735,12 @@ value_rtti_indirect_type (struct value * +@@ -3683,12 +3685,12 @@ value_rtti_indirect_type (struct value * struct value * value_full_object (struct value *argp, struct type *rtype, @@ -3834,11 +3795,11 @@ Index: gdb-7.5.0.20120926/gdb/valops.c int using_enc = 0; struct value *new_val; -Index: gdb-7.5.0.20120926/gdb/valprint.c +Index: gdb-7.5.50.20130118/gdb/valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valprint.c 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/valprint.c 2012-11-07 22:11:49.313938133 +0100 -@@ -264,7 +264,7 @@ scalar_type_p (struct type *type) +--- gdb-7.5.50.20130118.orig/gdb/valprint.c 2013-01-18 23:27:22.105601380 +0100 ++++ gdb-7.5.50.20130118/gdb/valprint.c 2013-01-18 23:27:28.877607352 +0100 +@@ -299,7 +299,7 @@ scalar_type_p (struct type *type) int valprint_check_validity (struct ui_file *stream, struct type *type, @@ -3847,7 +3808,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c const struct value *val) { CHECK_TYPEDEF (type); -@@ -328,7 +328,7 @@ val_print_invalid_address (struct ui_fil +@@ -363,7 +363,7 @@ val_print_invalid_address (struct ui_fil void generic_val_print (struct type *type, const gdb_byte *valaddr, @@ -3856,7 +3817,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, -@@ -691,7 +691,7 @@ generic_val_print (struct type *type, co +@@ -726,7 +726,7 @@ generic_val_print (struct type *type, co RECURSE. */ void @@ -3865,7 +3826,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -903,7 +903,7 @@ val_print_type_code_flags (struct type * +@@ -938,7 +938,7 @@ val_print_type_code_flags (struct type * void val_print_scalar_formatted (struct type *type, @@ -3874,7 +3835,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c const struct value *val, const struct value_print_options *options, int size, -@@ -1444,7 +1444,7 @@ print_decimal_chars (struct ui_file *str +@@ -1479,7 +1479,7 @@ print_decimal_chars (struct ui_file *str void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, @@ -3883,7 +3844,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c { const gdb_byte *p; -@@ -1561,23 +1561,23 @@ maybe_print_array_index (struct type *in +@@ -1596,23 +1596,23 @@ maybe_print_array_index (struct type *in void val_print_array_elements (struct type *type, @@ -3913,7 +3874,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c LONGEST low_bound, high_bound; struct cleanup *back_to; CORE_ADDR saved_address = address; -@@ -1672,7 +1672,7 @@ val_print_array_elements (struct type *t +@@ -1707,7 +1707,7 @@ val_print_array_elements (struct type *t address, stream, recurse + 1, val, options, current_language); annotate_elt_rep (reps); @@ -3922,7 +3883,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c annotate_elt_rep_end (); i = rep1 - 1; -@@ -2085,7 +2085,7 @@ generic_emit_char (int c, struct type *t +@@ -2358,7 +2358,7 @@ print_converted_chars_to_obstack (struct void generic_printstr (struct ui_file *stream, struct type *type, @@ -3931,11 +3892,11 @@ Index: gdb-7.5.0.20120926/gdb/valprint.c const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) -Index: gdb-7.5.0.20120926/gdb/valprint.h +Index: gdb-7.5.50.20130118/gdb/valprint.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valprint.h 2012-05-18 17:31:40.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/valprint.h 2012-11-07 22:09:30.093140418 +0100 -@@ -117,11 +117,11 @@ extern void maybe_print_array_index (str +--- gdb-7.5.50.20130118.orig/gdb/valprint.h 2013-01-18 23:27:22.106601381 +0100 ++++ gdb-7.5.50.20130118/gdb/valprint.h 2013-01-18 23:27:28.878607353 +0100 +@@ -113,11 +113,11 @@ extern void maybe_print_array_index (str struct ui_file *stream, const struct value_print_options *); @@ -3949,7 +3910,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.h extern void val_print_type_code_int (struct type *, const gdb_byte *, struct ui_file *); -@@ -131,7 +131,7 @@ extern void val_print_type_code_flags (s +@@ -127,7 +127,7 @@ extern void val_print_type_code_flags (s struct ui_file *stream); extern void val_print_scalar_formatted (struct type *, @@ -3958,7 +3919,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.h const struct value *, const struct value_print_options *, int, -@@ -147,7 +147,7 @@ extern void print_decimal_chars (struct +@@ -143,7 +143,7 @@ extern void print_decimal_chars (struct unsigned int, enum bfd_endian); extern void print_hex_chars (struct ui_file *, const gdb_byte *, @@ -3967,7 +3928,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.h extern void print_char_chars (struct ui_file *, struct type *, const gdb_byte *, unsigned int, enum bfd_endian); -@@ -191,7 +191,7 @@ struct generic_val_print_decorations +@@ -188,7 +188,7 @@ struct generic_val_print_decorations extern void generic_val_print (struct type *type, const gdb_byte *valaddr, @@ -3976,7 +3937,7 @@ Index: gdb-7.5.0.20120926/gdb/valprint.h struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, -@@ -201,7 +201,7 @@ extern void generic_emit_char (int c, st +@@ -198,7 +198,7 @@ extern void generic_emit_char (int c, st int quoter, const char *encoding); extern void generic_printstr (struct ui_file *stream, struct type *type, @@ -3985,10 +3946,10 @@ Index: gdb-7.5.0.20120926/gdb/valprint.h const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); -Index: gdb-7.5.0.20120926/gdb/value.c +Index: gdb-7.5.50.20130118/gdb/value.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/value.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/value.c 2012-11-07 22:09:30.096140414 +0100 +--- gdb-7.5.50.20130118.orig/gdb/value.c 2013-01-18 23:27:22.108601385 +0100 ++++ gdb-7.5.50.20130118/gdb/value.c 2013-01-18 23:27:28.878607353 +0100 @@ -68,10 +68,10 @@ struct internal_function struct range { @@ -4100,7 +4061,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { value->offset = offset; } -@@ -924,8 +926,9 @@ value_contents_all (struct value *value) +@@ -928,8 +930,9 @@ value_contents_all (struct value *value) DST_OFFSET+LENGTH) range are wholly available. */ void @@ -4112,7 +4073,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { range_s *r; int i; -@@ -973,8 +976,8 @@ value_contents_copy_raw (struct value *d +@@ -977,8 +980,8 @@ value_contents_copy_raw (struct value *d DST_OFFSET+LENGTH) range are wholly available. */ void @@ -4123,7 +4084,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { require_not_optimized_out (src); -@@ -1068,7 +1071,7 @@ value_entirely_optimized_out (const stru +@@ -1072,7 +1075,7 @@ value_entirely_optimized_out (const stru } int @@ -4132,7 +4093,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { if (!value->optimized_out) return 1; -@@ -1081,7 +1084,7 @@ value_bits_valid (const struct value *va +@@ -1085,7 +1088,7 @@ value_bits_valid (const struct value *va int value_bits_synthetic_pointer (const struct value *value, @@ -4141,7 +4102,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { if (value->lval != lval_computed || !value->location.computed.funcs->check_synthetic_pointer) -@@ -1091,26 +1094,26 @@ value_bits_synthetic_pointer (const stru +@@ -1095,26 +1098,26 @@ value_bits_synthetic_pointer (const stru length); } @@ -4172,7 +4133,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { value->pointed_to_offset = val; } -@@ -1970,7 +1973,7 @@ get_internalvar_function (struct interna +@@ -1974,7 +1977,7 @@ get_internalvar_function (struct interna } void @@ -4181,7 +4142,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c int bitsize, struct value *newval) { gdb_byte *addr; -@@ -2671,7 +2674,7 @@ set_value_enclosing_type (struct value * +@@ -2681,7 +2684,7 @@ set_value_enclosing_type (struct value * FIELDNO says which field. */ struct value * @@ -4190,7 +4151,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c int fieldno, struct type *arg_type) { struct value *v; -@@ -2701,7 +2704,7 @@ value_primitive_field (struct value *arg +@@ -2711,7 +2714,7 @@ value_primitive_field (struct value *arg bit. Assume that the address, offset, and embedded offset are sufficiently aligned. */ @@ -4199,7 +4160,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c int container_bitsize = TYPE_LENGTH (type) * 8; v = allocate_value_lazy (type); -@@ -2724,7 +2727,7 @@ value_primitive_field (struct value *arg +@@ -2734,7 +2737,7 @@ value_primitive_field (struct value *arg /* This field is actually a base subobject, so preserve the entire object's contents for later references to virtual bases, etc. */ @@ -4208,7 +4169,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c /* Lazy register values with offsets are not supported. */ if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) -@@ -2801,7 +2804,7 @@ value_field (struct value *arg1, int fie +@@ -2811,7 +2814,7 @@ value_field (struct value *arg1, int fie struct value * value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type, @@ -4217,7 +4178,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { struct value *v; struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); -@@ -2861,8 +2864,8 @@ value_fn_field (struct value **arg1p, st +@@ -2871,8 +2874,8 @@ value_fn_field (struct value **arg1p, st static int unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, @@ -4228,7 +4189,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c LONGEST *result) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); -@@ -2870,7 +2873,7 @@ unpack_value_bits_as_long_1 (struct type +@@ -2880,7 +2883,7 @@ unpack_value_bits_as_long_1 (struct type ULONGEST valmask; int lsbcount; int bytes_read; @@ -4237,7 +4198,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c /* Read the minimum number of bytes required; there may not be enough bytes to read an entire ULONGEST. */ -@@ -2940,7 +2943,7 @@ unpack_value_bits_as_long_1 (struct type +@@ -2950,7 +2953,7 @@ unpack_value_bits_as_long_1 (struct type int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, @@ -4246,7 +4207,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c const struct value *original_value, LONGEST *result) { -@@ -2958,10 +2961,10 @@ unpack_value_bits_as_long (struct type * +@@ -2968,10 +2971,10 @@ unpack_value_bits_as_long (struct type * static int unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, @@ -4259,7 +4220,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); -@@ -2977,7 +2980,7 @@ unpack_value_field_as_long_1 (struct typ +@@ -2987,7 +2990,7 @@ unpack_value_field_as_long_1 (struct typ int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, @@ -4268,7 +4229,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c const struct value *val, LONGEST *result) { gdb_assert (val != NULL); -@@ -3009,7 +3012,7 @@ unpack_field_as_long (struct type *type, +@@ -3019,7 +3022,7 @@ unpack_field_as_long (struct type *type, struct value * value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, @@ -4277,7 +4238,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c { LONGEST l; -@@ -3036,12 +3039,12 @@ value_field_bitfield (struct type *type, +@@ -3046,12 +3049,12 @@ value_field_bitfield (struct type *type, void modify_field (struct type *type, gdb_byte *addr, @@ -4292,10 +4253,10 @@ Index: gdb-7.5.0.20120926/gdb/value.c /* Normalize BITPOS. */ addr += bitpos / 8; -Index: gdb-7.5.0.20120926/gdb/value.h +Index: gdb-7.5.50.20130118/gdb/value.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/value.h 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/value.h 2012-11-07 22:09:30.104140403 +0100 +--- gdb-7.5.50.20130118.orig/gdb/value.h 2013-01-18 23:27:22.109601387 +0100 ++++ gdb-7.5.50.20130118/gdb/value.h 2013-01-18 23:27:28.879607355 +0100 @@ -82,8 +82,8 @@ extern void set_value_parent (struct val within the registers structure. Note also the member embedded_offset below. */ @@ -4440,7 +4401,7 @@ Index: gdb-7.5.0.20120926/gdb/value.h const struct value *val); extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); -@@ -578,12 +580,12 @@ extern struct value *default_read_var_va +@@ -579,12 +581,12 @@ extern struct value *default_read_var_va extern struct value *allocate_value (struct type *type); extern struct value *allocate_value_lazy (struct type *type); extern void allocate_value_contents (struct value *value); @@ -4459,7 +4420,7 @@ Index: gdb-7.5.0.20120926/gdb/value.h extern struct value *allocate_repeat_value (struct type *type, int count); -@@ -657,16 +659,16 @@ extern int find_overload_match (struct v +@@ -656,16 +658,16 @@ extern int find_overload_match (struct v extern struct value *value_field (struct value *arg1, int fieldno); @@ -4479,7 +4440,7 @@ Index: gdb-7.5.0.20120926/gdb/value.h extern struct value *value_cast_pointers (struct type *, struct value *, int); -@@ -756,7 +758,7 @@ extern void set_internalvar_string (stru +@@ -755,7 +757,7 @@ extern void set_internalvar_string (stru extern void clear_internalvar (struct internalvar *var); extern void set_internalvar_component (struct internalvar *var, @@ -4488,7 +4449,7 @@ Index: gdb-7.5.0.20120926/gdb/value.h int bitpos, int bitsize, struct value *newvalue); -@@ -838,7 +840,7 @@ extern struct value *value_x_unop (struc +@@ -837,7 +839,7 @@ extern struct value *value_x_unop (struc enum noside noside); extern struct value *value_fn_field (struct value **arg1p, struct fn_field *f, @@ -4497,7 +4458,7 @@ Index: gdb-7.5.0.20120926/gdb/value.h extern int binop_types_user_defined_p (enum exp_opcode op, struct type *type1, -@@ -866,7 +868,8 @@ extern void release_value_or_incref (str +@@ -865,7 +867,8 @@ extern void release_value_or_incref (str extern int record_latest_value (struct value *val); extern void modify_field (struct type *type, gdb_byte *addr, @@ -4507,7 +4468,7 @@ Index: gdb-7.5.0.20120926/gdb/value.h extern void type_print (struct type *type, const char *varstring, struct ui_file *stream, int show); -@@ -896,7 +899,7 @@ extern void value_print_array_elements ( +@@ -895,7 +898,7 @@ extern void value_print_array_elements ( extern struct value *value_release_to_mark (struct value *mark); extern void val_print (struct type *type, const gdb_byte *valaddr, @@ -4516,7 +4477,7 @@ Index: gdb-7.5.0.20120926/gdb/value.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -947,10 +950,11 @@ extern struct value *value_literal_compl +@@ -944,10 +947,11 @@ extern struct value *value_literal_compl extern struct value *find_function_in_inferior (const char *, struct objfile **); diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch index 0aea5ef..81124fb 100644 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ b/gdb-rhbz795424-bitpos-21of25.patch @@ -52,10 +52,10 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch -Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c +Index: gdb-7.5.50.20130118/gdb/alpha-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/alpha-tdep.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/alpha-tdep.c 2012-11-07 22:46:00.042902382 +0100 +--- gdb-7.5.50.20130118.orig/gdb/alpha-tdep.c 2013-01-18 23:33:59.277047324 +0100 ++++ gdb-7.5.50.20130118/gdb/alpha-tdep.c 2013-01-18 23:34:02.678051846 +0100 @@ -414,6 +414,13 @@ alpha_push_dummy_call (struct gdbarch *g accumulate_size = 0; else @@ -70,11 +70,11 @@ Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c sp -= accumulate_size; /* Keep sp aligned to a multiple of 16 as the ABI requires. */ -Index: gdb-7.5.0.20120926/gdb/cp-valprint.c +Index: gdb-7.5.50.20130118/gdb/cp-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/cp-valprint.c 2012-11-07 22:12:14.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/cp-valprint.c 2012-11-07 22:46:00.043902381 +0100 -@@ -561,6 +561,8 @@ cp_print_value (struct type *type, struc +--- gdb-7.5.50.20130118.orig/gdb/cp-valprint.c 2013-01-18 23:33:59.278047326 +0100 ++++ gdb-7.5.50.20130118/gdb/cp-valprint.c 2013-01-18 23:34:02.679051848 +0100 +@@ -540,6 +540,8 @@ cp_print_value (struct type *type, struc gdb_byte *buf; struct cleanup *back_to; @@ -83,10 +83,10 @@ Index: gdb-7.5.0.20120926/gdb/cp-valprint.c buf = xmalloc (TYPE_LENGTH (baseclass)); back_to = make_cleanup (xfree, buf); -Index: gdb-7.5.0.20120926/gdb/dwarf2loc.c +Index: gdb-7.5.50.20130118/gdb/dwarf2loc.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/dwarf2loc.c 2012-11-07 22:09:29.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/dwarf2loc.c 2012-11-07 22:46:00.070902342 +0100 +--- gdb-7.5.50.20130118.orig/gdb/dwarf2loc.c 2013-01-18 23:33:59.280047332 +0100 ++++ gdb-7.5.50.20130118/gdb/dwarf2loc.c 2013-01-18 23:34:02.680051851 +0100 @@ -1784,6 +1784,8 @@ read_pieced_value (struct value *v) this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8; @@ -104,10 +104,10 @@ Index: gdb-7.5.0.20120926/gdb/dwarf2loc.c if (buffer_size < this_size) { buffer_size = this_size; -Index: gdb-7.5.0.20120926/gdb/findcmd.c +Index: gdb-7.5.50.20130118/gdb/findcmd.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/findcmd.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/findcmd.c 2012-11-07 22:46:00.153902249 +0100 +--- gdb-7.5.50.20130118.orig/gdb/findcmd.c 2013-01-18 23:33:59.280047332 +0100 ++++ gdb-7.5.50.20130118/gdb/findcmd.c 2013-01-18 23:34:02.680051851 +0100 @@ -187,6 +187,7 @@ parse_find_args (char *args, ULONGEST *m size_t current_offset = pattern_buf_end - pattern_buf; @@ -116,11 +116,11 @@ Index: gdb-7.5.0.20120926/gdb/findcmd.c pattern_buf = xrealloc (pattern_buf, pattern_buf_size); pattern_buf_end = pattern_buf + current_offset; } -Index: gdb-7.5.0.20120926/gdb/p-valprint.c +Index: gdb-7.5.50.20130118/gdb/p-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/p-valprint.c 2012-11-07 22:09:29.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/p-valprint.c 2012-11-07 22:46:00.163902208 +0100 -@@ -827,6 +827,7 @@ pascal_object_print_value (struct type * +--- gdb-7.5.50.20130118.orig/gdb/p-valprint.c 2013-01-18 23:33:59.281047334 +0100 ++++ gdb-7.5.50.20130118/gdb/p-valprint.c 2013-01-18 23:34:02.680051851 +0100 +@@ -797,6 +797,7 @@ pascal_object_print_value (struct type * gdb_byte *buf; struct cleanup *back_to; @@ -128,11 +128,11 @@ Index: gdb-7.5.0.20120926/gdb/p-valprint.c buf = xmalloc (TYPE_LENGTH (baseclass)); back_to = make_cleanup (xfree, buf); -Index: gdb-7.5.0.20120926/gdb/utils.c +Index: gdb-7.5.50.20130118/gdb/utils.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/utils.c 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/utils.c 2012-11-07 22:46:00.166902202 +0100 -@@ -3135,6 +3135,18 @@ host_address_to_string (const void *addr +--- gdb-7.5.50.20130118.orig/gdb/utils.c 2013-01-18 23:33:59.282047336 +0100 ++++ gdb-7.5.50.20130118/gdb/utils.c 2013-01-18 23:34:02.681051854 +0100 +@@ -3219,6 +3219,18 @@ host_address_to_string (const void *addr return str; } @@ -151,11 +151,11 @@ Index: gdb-7.5.0.20120926/gdb/utils.c char * gdb_realpath (const char *filename) { -Index: gdb-7.5.0.20120926/gdb/valops.c +Index: gdb-7.5.50.20130118/gdb/valops.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valops.c 2012-11-07 22:09:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/valops.c 2012-11-07 22:46:00.181902181 +0100 -@@ -2383,6 +2383,7 @@ search_struct_method (const char *name, +--- gdb-7.5.50.20130118.orig/gdb/valops.c 2013-01-18 23:33:59.283047338 +0100 ++++ gdb-7.5.50.20130118/gdb/valops.c 2013-01-18 23:34:02.682051856 +0100 +@@ -2369,6 +2369,7 @@ search_struct_method (const char *name, struct cleanup *back_to; CORE_ADDR address; @@ -163,10 +163,10 @@ Index: gdb-7.5.0.20120926/gdb/valops.c tmp = xmalloc (TYPE_LENGTH (baseclass)); back_to = make_cleanup (xfree, tmp); address = value_address (*arg1p); -Index: gdb-7.5.0.20120926/gdb/value.c +Index: gdb-7.5.50.20130118/gdb/value.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/value.c 2012-11-07 22:09:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/value.c 2012-11-07 22:46:00.184902176 +0100 +--- gdb-7.5.50.20130118.orig/gdb/value.c 2013-01-18 23:33:59.285047342 +0100 ++++ gdb-7.5.50.20130118/gdb/value.c 2013-01-18 23:34:02.683051858 +0100 @@ -663,6 +663,7 @@ allocate_value_lazy (struct type *type) description correctly. */ check_typedef (type); @@ -184,7 +184,7 @@ Index: gdb-7.5.0.20120926/gdb/value.c if (!val->contents) val->contents = (gdb_byte *) xzalloc (TYPE_LENGTH (val->enclosing_type)); } -@@ -2662,8 +2665,12 @@ void +@@ -2672,8 +2675,12 @@ void set_value_enclosing_type (struct value *val, struct type *new_encl_type) { if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val))) @@ -199,25 +199,25 @@ Index: gdb-7.5.0.20120926/gdb/value.c val->enclosing_type = new_encl_type; } -Index: gdb-7.5.0.20120926/gdb/vax-tdep.c +Index: gdb-7.5.50.20130118/gdb/vax-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/vax-tdep.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/vax-tdep.c 2012-11-07 22:46:56.810819878 +0100 +--- gdb-7.5.50.20130118.orig/gdb/vax-tdep.c 2013-01-18 23:34:02.683051858 +0100 ++++ gdb-7.5.50.20130118/gdb/vax-tdep.c 2013-01-18 23:34:34.950094198 +0100 @@ -223,6 +223,7 @@ vax_return_value (struct gdbarch *gdbarc ULONGEST addr; regcache_raw_read_unsigned (regcache, VAX_R0_REGNUM, &addr); + ulongest_fits_host_or_error (TYPE_LENGTH (type)); - read_memory (addr, readbuf, TYPE_LENGTH (type)); + read_memory (addr, readbuf, len); } -Index: gdb-7.5.0.20120926/gdb/defs.h +Index: gdb-7.5.50.20130118/gdb/defs.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/defs.h 2012-11-07 22:00:43.111906109 +0100 -+++ gdb-7.5.0.20120926/gdb/defs.h 2012-11-07 22:47:46.001001239 +0100 -@@ -1170,4 +1170,6 @@ enum block_enum - FIRST_LOCAL_BLOCK = 2 - }; +--- gdb-7.5.50.20130118.orig/gdb/defs.h 2013-01-18 23:34:02.684051860 +0100 ++++ gdb-7.5.50.20130118/gdb/defs.h 2013-01-18 23:34:14.238067193 +0100 +@@ -801,4 +801,6 @@ enum block_enum + + #include "utils.h" +extern void ulongest_fits_host_or_error (ULONGEST num); + diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index dd77f03..8e34e74 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -96,11 +96,11 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-wp.patch -diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c -index 231b008..6deb23d 100644 ---- a/gdb/arm-linux-nat.c -+++ b/gdb/arm-linux-nat.c -@@ -1105,7 +1105,7 @@ arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) +Index: gdb-7.5.50.20130118/gdb/arm-linux-nat.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/arm-linux-nat.c 2013-01-18 23:34:43.930106839 +0100 ++++ gdb-7.5.50.20130118/gdb/arm-linux-nat.c 2013-01-18 23:34:51.206116513 +0100 +@@ -1105,7 +1105,7 @@ arm_linux_region_ok_for_hw_watchpoint (C /* Insert a Hardware breakpoint. */ static int @@ -109,7 +109,7 @@ index 231b008..6deb23d 100644 struct expression *cond) { struct lwp_info *lp; -@@ -1123,7 +1123,7 @@ arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +@@ -1123,7 +1123,7 @@ arm_linux_insert_watchpoint (CORE_ADDR a /* Remove a hardware breakpoint. */ static int @@ -127,11 +127,11 @@ index 231b008..6deb23d 100644 { return start <= addr && start + length - 1 >= addr; } -diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c -index 76c51a8..9e293fe 100644 ---- a/gdb/i386-nat.c -+++ b/gdb/i386-nat.c -@@ -592,7 +592,7 @@ i386_update_inferior_debug_regs (struct i386_debug_reg_state *new_state) +Index: gdb-7.5.50.20130118/gdb/i386-nat.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/i386-nat.c 2013-01-18 23:34:43.931106841 +0100 ++++ gdb-7.5.50.20130118/gdb/i386-nat.c 2013-01-18 23:34:51.206116513 +0100 +@@ -591,7 +591,7 @@ i386_update_inferior_debug_regs (struct of the type TYPE. Return 0 on success, -1 on failure. */ static int @@ -140,7 +140,7 @@ index 76c51a8..9e293fe 100644 struct expression *cond) { struct i386_debug_reg_state *state = i386_debug_reg_state (); -@@ -629,7 +629,7 @@ i386_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -628,7 +628,7 @@ i386_insert_watchpoint (CORE_ADDR addr, address ADDR, whose length is LEN bytes, and for accesses of the type TYPE. Return 0 on success, -1 on failure. */ static int @@ -149,10 +149,10 @@ index 76c51a8..9e293fe 100644 struct expression *cond) { struct i386_debug_reg_state *state = i386_debug_reg_state (); -diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c -index 9b5fbf3..6061eae 100644 ---- a/gdb/ia64-linux-nat.c -+++ b/gdb/ia64-linux-nat.c +Index: gdb-7.5.50.20130118/gdb/ia64-linux-nat.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/ia64-linux-nat.c 2013-01-18 23:34:43.931106841 +0100 ++++ gdb-7.5.50.20130118/gdb/ia64-linux-nat.c 2013-01-18 23:34:51.206116513 +0100 @@ -542,7 +542,7 @@ is_power_of_2 (int val) } @@ -162,7 +162,7 @@ index 9b5fbf3..6061eae 100644 struct expression *cond) { struct lwp_info *lp; -@@ -596,7 +596,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +@@ -596,7 +596,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR } static int @@ -171,11 +171,11 @@ index 9b5fbf3..6061eae 100644 struct expression *cond) { int idx; -diff --git a/gdb/inf-ttrace.c b/gdb/inf-ttrace.c -index d60eddb..c33db45 100644 ---- a/gdb/inf-ttrace.c -+++ b/gdb/inf-ttrace.c -@@ -313,14 +313,14 @@ inf_ttrace_disable_page_protections (pid_t pid) +Index: gdb-7.5.50.20130118/gdb/inf-ttrace.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/inf-ttrace.c 2013-01-18 23:34:43.932106844 +0100 ++++ gdb-7.5.50.20130118/gdb/inf-ttrace.c 2013-01-18 23:34:51.206116513 +0100 +@@ -313,14 +313,14 @@ inf_ttrace_disable_page_protections (pid type TYPE. */ static int @@ -193,7 +193,7 @@ index d60eddb..c33db45 100644 gdb_assert (type == hw_write); -@@ -337,14 +337,14 @@ inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -337,14 +337,14 @@ inf_ttrace_insert_watchpoint (CORE_ADDR type TYPE. */ static int @@ -211,11 +211,11 @@ index d60eddb..c33db45 100644 gdb_assert (type == hw_write); -diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c -index 5566d0c..7467d11 100644 ---- a/gdb/mips-linux-nat.c -+++ b/gdb/mips-linux-nat.c -@@ -1017,7 +1017,7 @@ populate_regs_from_watches (struct pt_watch_regs *regs) +Index: gdb-7.5.50.20130118/gdb/mips-linux-nat.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/mips-linux-nat.c 2013-01-18 23:34:43.932106844 +0100 ++++ gdb-7.5.50.20130118/gdb/mips-linux-nat.c 2013-01-18 23:34:51.208116518 +0100 +@@ -1017,7 +1017,7 @@ populate_regs_from_watches (struct pt_wa watch. Return zero on success. */ static int @@ -224,7 +224,7 @@ index 5566d0c..7467d11 100644 struct expression *cond) { struct pt_watch_regs regs; -@@ -1067,7 +1067,7 @@ mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -1067,7 +1067,7 @@ mips_linux_insert_watchpoint (CORE_ADDR Return zero on success. */ static int @@ -233,10 +233,10 @@ index 5566d0c..7467d11 100644 struct expression *cond) { int retval; -diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c -index b58f318..25fecf3 100644 ---- a/gdb/nto-procfs.c -+++ b/gdb/nto-procfs.c +Index: gdb-7.5.50.20130118/gdb/nto-procfs.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/nto-procfs.c 2013-01-18 23:34:43.933106847 +0100 ++++ gdb-7.5.50.20130118/gdb/nto-procfs.c 2013-01-18 23:34:51.208116518 +0100 @@ -69,10 +69,10 @@ static ptid_t do_attach (ptid_t ptid); static int procfs_can_use_hw_breakpoint (int, int, int); @@ -250,7 +250,7 @@ index b58f318..25fecf3 100644 struct expression *cond); static int procfs_stopped_by_watchpoint (void); -@@ -1493,14 +1493,14 @@ procfs_can_use_hw_breakpoint (int type, int cnt, int othertype) +@@ -1493,14 +1493,14 @@ procfs_can_use_hw_breakpoint (int type, } static int @@ -267,11 +267,11 @@ index b58f318..25fecf3 100644 struct expression *cond) { return procfs_hw_watchpoint (addr, len, type); -diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c -index 67e1cac..abfb2fc 100644 ---- a/gdb/ppc-linux-nat.c -+++ b/gdb/ppc-linux-nat.c -@@ -1839,11 +1839,11 @@ can_use_watchpoint_cond_accel (void) +Index: gdb-7.5.50.20130118/gdb/ppc-linux-nat.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/ppc-linux-nat.c 2013-01-18 23:34:43.934106849 +0100 ++++ gdb-7.5.50.20130118/gdb/ppc-linux-nat.c 2013-01-18 23:34:51.208116518 +0100 +@@ -1838,11 +1838,11 @@ can_use_watchpoint_cond_accel (void) CONDITION_VALUE will hold the value which should be put in the DVC register. */ static void @@ -286,7 +286,7 @@ index 67e1cac..abfb2fc 100644 CORE_ADDR addr_end_data, addr_end_dvc; /* The DVC register compares bytes within fixed-length windows which -@@ -1930,7 +1930,7 @@ num_memory_accesses (struct value *v) +@@ -1929,7 +1929,7 @@ num_memory_accesses (struct value *v) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, @@ -295,7 +295,7 @@ index 67e1cac..abfb2fc 100644 { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val, *left_chain, *right_chain; -@@ -1997,7 +1997,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond, +@@ -1996,7 +1996,7 @@ check_condition (CORE_ADDR watch_addr, s the condition expression, thus only triggering the watchpoint when it is true. */ static int @@ -304,7 +304,7 @@ index 67e1cac..abfb2fc 100644 struct expression *cond) { CORE_ADDR data_value; -@@ -2014,7 +2014,7 @@ ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, +@@ -2013,7 +2013,7 @@ ppc_linux_can_accel_watchpoint_condition static void create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, @@ -313,7 +313,7 @@ index 67e1cac..abfb2fc 100644 int insert) { if (len == 1 -@@ -2059,7 +2059,7 @@ create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, +@@ -2058,7 +2058,7 @@ create_watchpoint_request (struct ppc_hw } static int @@ -322,7 +322,7 @@ index 67e1cac..abfb2fc 100644 struct expression *cond) { struct lwp_info *lp; -@@ -2127,7 +2127,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, +@@ -2126,7 +2126,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR a } static int @@ -331,7 +331,7 @@ index 67e1cac..abfb2fc 100644 struct expression *cond) { struct lwp_info *lp; -@@ -2267,7 +2267,7 @@ ppc_linux_stopped_by_watchpoint (void) +@@ -2266,7 +2266,7 @@ ppc_linux_stopped_by_watchpoint (void) static int ppc_linux_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -340,11 +340,11 @@ index 67e1cac..abfb2fc 100644 { int mask; -diff --git a/gdb/procfs.c b/gdb/procfs.c -index 4a9336f..26accd8 100644 ---- a/gdb/procfs.c -+++ b/gdb/procfs.c -@@ -2470,7 +2470,7 @@ procfs_address_to_host_pointer (CORE_ADDR addr) +Index: gdb-7.5.50.20130118/gdb/procfs.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/procfs.c 2013-01-18 23:34:43.937106855 +0100 ++++ gdb-7.5.50.20130118/gdb/procfs.c 2013-01-18 23:35:12.598145073 +0100 +@@ -2433,7 +2433,7 @@ procfs_address_to_host_pointer (CORE_ADD #endif static int @@ -353,7 +353,7 @@ index 4a9336f..26accd8 100644 { #if !defined (PCWATCH) && !defined (PIOCSWATCH) /* If neither or these is defined, we can't support watchpoints. -@@ -4816,7 +4816,7 @@ procfs_pid_to_str (struct target_ops *ops, ptid_t ptid) +@@ -4777,7 +4777,7 @@ procfs_pid_to_str (struct target_ops *op /* Insert a watchpoint. */ static int @@ -361,8 +361,8 @@ index 4a9336f..26accd8 100644 +procfs_set_watchpoint (ptid_t ptid, CORE_ADDR addr, LONGEST len, int rwflag, int after) { - #ifndef UNIXWARE -@@ -4938,7 +4938,7 @@ procfs_stopped_data_address (struct target_ops *targ, CORE_ADDR *addr) + #ifndef AIX5 +@@ -4897,7 +4897,7 @@ procfs_stopped_data_address (struct targ } static int @@ -371,7 +371,7 @@ index 4a9336f..26accd8 100644 struct expression *cond) { if (!target_have_steppable_watchpoint -@@ -4960,7 +4960,7 @@ procfs_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -4919,7 +4919,7 @@ procfs_insert_watchpoint (CORE_ADDR addr } static int @@ -380,11 +380,11 @@ index 4a9336f..26accd8 100644 struct expression *cond) { return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0); -diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c -index 748aeba..b385c3f 100644 ---- a/gdb/remote-m32r-sdi.c -+++ b/gdb/remote-m32r-sdi.c -@@ -1417,14 +1417,14 @@ m32r_can_use_hw_watchpoint (int type, int cnt, int othertype) +Index: gdb-7.5.50.20130118/gdb/remote-m32r-sdi.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/remote-m32r-sdi.c 2013-01-18 23:34:51.211116523 +0100 ++++ gdb-7.5.50.20130118/gdb/remote-m32r-sdi.c 2013-01-18 23:36:50.004276296 +0100 +@@ -1417,14 +1417,15 @@ m32r_can_use_hw_watchpoint (int type, in watchpoint. */ static int @@ -396,13 +396,14 @@ index 748aeba..b385c3f 100644 if (remote_debug) - fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n", -- paddress (target_gdbarch, addr), len, type); +- paddress (target_gdbarch (), addr), len, type); + fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%s,%d)\n", -+ paddress (target_gdbarch, addr), plongest (len), type); ++ paddress (target_gdbarch (), addr), plongest (len), ++ type); for (i = 0; i < MAX_ACCESS_BREAKS; i++) { -@@ -1442,14 +1442,14 @@ m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -1442,14 +1443,15 @@ m32r_insert_watchpoint (CORE_ADDR addr, } static int @@ -414,16 +415,17 @@ index 748aeba..b385c3f 100644 if (remote_debug) - fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n", -- paddress (target_gdbarch, addr), len, type); +- paddress (target_gdbarch (), addr), len, type); + fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%s,%d)\n", -+ paddress (target_gdbarch, addr), plongest (len), type); ++ paddress (target_gdbarch (), addr), plongest (len), ++ type); for (i = 0; i < MAX_ACCESS_BREAKS; i++) { -diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c -index eee2460..9a9265a 100644 ---- a/gdb/remote-mips.c -+++ b/gdb/remote-mips.c +Index: gdb-7.5.50.20130118/gdb/remote-mips.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/remote-mips.c 2013-01-18 23:34:43.939106860 +0100 ++++ gdb-7.5.50.20130118/gdb/remote-mips.c 2013-01-18 23:34:51.212116525 +0100 @@ -2419,7 +2419,7 @@ calculate_mask (CORE_ADDR addr, int len) watchpoint. */ @@ -433,7 +435,7 @@ index eee2460..9a9265a 100644 struct expression *cond) { if (mips_set_breakpoint (addr, len, type)) -@@ -2431,7 +2431,7 @@ mips_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -2431,7 +2431,7 @@ mips_insert_watchpoint (CORE_ADDR addr, /* Remove a watchpoint. */ static int @@ -442,11 +444,11 @@ index eee2460..9a9265a 100644 struct expression *cond) { if (mips_clear_breakpoint (addr, len, type)) -diff --git a/gdb/remote.c b/gdb/remote.c -index 8c27390..bcec331 100644 ---- a/gdb/remote.c -+++ b/gdb/remote.c -@@ -8035,7 +8035,7 @@ watchpoint_to_Z_packet (int type) +Index: gdb-7.5.50.20130118/gdb/remote.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/remote.c 2013-01-18 23:34:43.943106869 +0100 ++++ gdb-7.5.50.20130118/gdb/remote.c 2013-01-18 23:34:51.214116529 +0100 +@@ -8093,7 +8093,7 @@ watchpoint_to_Z_packet (int type) } static int @@ -455,7 +457,7 @@ index 8c27390..bcec331 100644 struct expression *cond) { struct remote_state *rs = get_remote_state (); -@@ -8050,7 +8050,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -8108,7 +8108,7 @@ remote_insert_watchpoint (CORE_ADDR addr p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -464,7 +466,7 @@ index 8c27390..bcec331 100644 putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -8070,7 +8070,7 @@ remote_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -8128,7 +8128,7 @@ remote_insert_watchpoint (CORE_ADDR addr static int remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -473,7 +475,7 @@ index 8c27390..bcec331 100644 { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -8079,7 +8079,7 @@ remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, +@@ -8137,7 +8137,7 @@ remote_watchpoint_addr_within_range (str static int @@ -482,7 +484,7 @@ index 8c27390..bcec331 100644 struct expression *cond) { struct remote_state *rs = get_remote_state (); -@@ -8094,7 +8094,7 @@ remote_remove_watchpoint (CORE_ADDR addr, int len, int type, +@@ -8152,7 +8152,7 @@ remote_remove_watchpoint (CORE_ADDR addr p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -491,11 +493,11 @@ index 8c27390..bcec331 100644 putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -diff --git a/gdb/s390-nat.c b/gdb/s390-nat.c -index 4974bad..3f41519 100644 ---- a/gdb/s390-nat.c -+++ b/gdb/s390-nat.c -@@ -517,7 +517,7 @@ s390_fix_watch_points (struct lwp_info *lp) +Index: gdb-7.5.50.20130118/gdb/s390-nat.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/s390-nat.c 2013-01-18 23:34:43.944106871 +0100 ++++ gdb-7.5.50.20130118/gdb/s390-nat.c 2013-01-18 23:34:51.215116531 +0100 +@@ -516,7 +516,7 @@ s390_fix_watch_points (struct lwp_info * } static int @@ -504,7 +506,7 @@ index 4974bad..3f41519 100644 struct expression *cond) { struct lwp_info *lp; -@@ -538,7 +538,7 @@ s390_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -537,7 +537,7 @@ s390_insert_watchpoint (CORE_ADDR addr, } static int @@ -513,10 +515,10 @@ index 4974bad..3f41519 100644 struct expression *cond) { struct lwp_info *lp; -diff --git a/gdb/target.c b/gdb/target.c -index f7207c0..a69fb06 100644 ---- a/gdb/target.c -+++ b/gdb/target.c +Index: gdb-7.5.50.20130118/gdb/target.c +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/target.c 2013-01-18 23:34:43.947106878 +0100 ++++ gdb-7.5.50.20130118/gdb/target.c 2013-01-18 23:34:51.216116533 +0100 @@ -49,7 +49,8 @@ static void target_info (char *, int); static void default_terminal_info (char *, int); @@ -527,7 +529,7 @@ index f7207c0..a69fb06 100644 static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); -@@ -114,10 +115,10 @@ static int debug_to_insert_hw_breakpoint (struct gdbarch *, +@@ -114,10 +115,10 @@ static int debug_to_insert_hw_breakpoint static int debug_to_remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *); @@ -540,7 +542,7 @@ index f7207c0..a69fb06 100644 struct expression *); static int debug_to_stopped_by_watchpoint (void); -@@ -125,11 +126,12 @@ static int debug_to_stopped_by_watchpoint (void); +@@ -125,11 +126,12 @@ static int debug_to_stopped_by_watchpoin static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); static int debug_to_watchpoint_addr_within_range (struct target_ops *, @@ -577,7 +579,7 @@ index f7207c0..a69fb06 100644 return_zero); de_fault (to_terminal_init, (void (*) (void)) -@@ -3558,7 +3560,7 @@ default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) +@@ -3560,7 +3562,7 @@ default_region_ok_for_hw_watchpoint (COR static int default_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -586,7 +588,7 @@ index f7207c0..a69fb06 100644 { return addr >= start && addr < start + length; } -@@ -4263,7 +4265,7 @@ debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) +@@ -4267,7 +4269,7 @@ debug_to_region_ok_for_hw_watchpoint (CO } static int @@ -595,7 +597,7 @@ index f7207c0..a69fb06 100644 struct expression *cond) { int retval; -@@ -4273,8 +4275,8 @@ debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, +@@ -4277,8 +4279,8 @@ debug_to_can_accel_watchpoint_condition fprintf_unfiltered (gdb_stdlog, "target_can_accel_watchpoint_condition " @@ -606,7 +608,7 @@ index f7207c0..a69fb06 100644 host_address_to_string (cond), (unsigned long) retval); return retval; } -@@ -4309,7 +4311,7 @@ debug_to_stopped_data_address (struct target_ops *target, CORE_ADDR *addr) +@@ -4313,7 +4315,7 @@ debug_to_stopped_data_address (struct ta static int debug_to_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -615,7 +617,7 @@ index f7207c0..a69fb06 100644 { int retval; -@@ -4317,9 +4319,9 @@ debug_to_watchpoint_addr_within_range (struct target_ops *target, +@@ -4321,9 +4323,9 @@ debug_to_watchpoint_addr_within_range (s start, length); fprintf_filtered (gdb_stdlog, @@ -627,7 +629,7 @@ index f7207c0..a69fb06 100644 return retval; } -@@ -4354,7 +4356,7 @@ debug_to_remove_hw_breakpoint (struct gdbarch *gdbarch, +@@ -4358,7 +4360,7 @@ debug_to_remove_hw_breakpoint (struct gd } static int @@ -636,7 +638,7 @@ index f7207c0..a69fb06 100644 struct expression *cond) { int retval; -@@ -4362,14 +4364,14 @@ debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type, +@@ -4366,14 +4368,14 @@ debug_to_insert_watchpoint (CORE_ADDR ad retval = debug_target.to_insert_watchpoint (addr, len, type, cond); fprintf_unfiltered (gdb_stdlog, @@ -654,7 +656,7 @@ index f7207c0..a69fb06 100644 struct expression *cond) { int retval; -@@ -4377,8 +4379,8 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type, +@@ -4381,8 +4383,8 @@ debug_to_remove_watchpoint (CORE_ADDR ad retval = debug_target.to_remove_watchpoint (addr, len, type, cond); fprintf_unfiltered (gdb_stdlog, @@ -665,10 +667,10 @@ index f7207c0..a69fb06 100644 host_address_to_string (cond), (unsigned long) retval); return retval; } -diff --git a/gdb/target.h b/gdb/target.h -index 69228e1..4b52d53 100644 ---- a/gdb/target.h -+++ b/gdb/target.h +Index: gdb-7.5.50.20130118/gdb/target.h +=================================================================== +--- gdb-7.5.50.20130118.orig/gdb/target.h 2013-01-18 23:34:43.947106878 +0100 ++++ gdb-7.5.50.20130118/gdb/target.h 2013-01-18 23:34:51.217116536 +0100 @@ -466,8 +466,8 @@ struct target_ops /* Documentation of what the two routines below are expected to do is @@ -696,6 +698,3 @@ index 69228e1..4b52d53 100644 struct expression *); int (*to_masked_watch_num_registers) (struct target_ops *, CORE_ADDR, CORE_ADDR); - ---MP_/6HRlH6vpyqtSy4CYyMrX6b2-- - diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index 91f6ad5..9e6b712 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -137,10 +137,10 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-tdep.patch -Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c +Index: gdb-7.5.50.20130118/gdb/alpha-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/alpha-tdep.c 2012-11-07 22:46:00.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/alpha-tdep.c 2012-11-07 22:47:57.371984929 +0100 +--- gdb-7.5.50.20130118.orig/gdb/alpha-tdep.c 2013-01-18 23:36:59.954290362 +0100 ++++ gdb-7.5.50.20130118/gdb/alpha-tdep.c 2013-01-18 23:37:12.465307566 +0100 @@ -299,18 +299,18 @@ alpha_push_dummy_call (struct gdbarch *g { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -184,11 +184,11 @@ Index: gdb-7.5.0.20120926/gdb/alpha-tdep.c memcpy (arg_reg_buffer + offset, contents, tlen); offset += tlen; contents += tlen; -Index: gdb-7.5.0.20120926/gdb/amd64-tdep.c +Index: gdb-7.5.50.20130118/gdb/amd64-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/amd64-tdep.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/amd64-tdep.c 2012-11-07 22:47:57.374984923 +0100 -@@ -599,7 +599,7 @@ amd64_return_value (struct gdbarch *gdba +--- gdb-7.5.50.20130118.orig/gdb/amd64-tdep.c 2013-01-18 23:36:59.955290365 +0100 ++++ gdb-7.5.50.20130118/gdb/amd64-tdep.c 2013-01-18 23:37:12.466307569 +0100 +@@ -616,7 +616,7 @@ amd64_return_value (struct gdbarch *gdba { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum amd64_reg_class class[2]; @@ -197,7 +197,7 @@ Index: gdb-7.5.0.20120926/gdb/amd64-tdep.c static int integer_regnum[] = { AMD64_RAX_REGNUM, AMD64_RDX_REGNUM }; static int sse_regnum[] = { AMD64_XMM0_REGNUM, AMD64_XMM1_REGNUM }; int integer_reg = 0; -@@ -728,8 +728,8 @@ amd64_push_arguments (struct regcache *r +@@ -769,8 +769,8 @@ amd64_push_arguments (struct regcache *r that register number (or a negative value otherwise). */ int *arg_addr_regno = alloca (nargs * sizeof (int)); int num_stack_args = 0; @@ -208,7 +208,7 @@ Index: gdb-7.5.0.20120926/gdb/amd64-tdep.c int integer_reg = 0; int sse_reg = 0; int i; -@@ -743,7 +743,7 @@ amd64_push_arguments (struct regcache *r +@@ -784,7 +784,7 @@ amd64_push_arguments (struct regcache *r for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -217,11 +217,11 @@ Index: gdb-7.5.0.20120926/gdb/amd64-tdep.c enum amd64_reg_class class[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; -Index: gdb-7.5.0.20120926/gdb/amd64-windows-tdep.c +Index: gdb-7.5.50.20130118/gdb/amd64-windows-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/amd64-windows-tdep.c 2012-06-05 15:50:57.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/amd64-windows-tdep.c 2012-11-07 22:47:57.413984867 +0100 -@@ -78,7 +78,7 @@ amd64_windows_return_value (struct gdbar +--- gdb-7.5.50.20130118.orig/gdb/amd64-windows-tdep.c 2013-01-18 23:36:59.956290369 +0100 ++++ gdb-7.5.50.20130118/gdb/amd64-windows-tdep.c 2013-01-18 23:37:12.466307569 +0100 +@@ -79,7 +79,7 @@ amd64_windows_return_value (struct gdbar struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { @@ -230,11 +230,11 @@ Index: gdb-7.5.0.20120926/gdb/amd64-windows-tdep.c int regnum = -1; /* See if our value is returned through a register. If it is, then -Index: gdb-7.5.0.20120926/gdb/arm-tdep.c +Index: gdb-7.5.50.20130118/gdb/arm-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/arm-tdep.c 2012-06-25 14:32:45.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/arm-tdep.c 2012-11-07 22:47:57.422984855 +0100 -@@ -3377,7 +3377,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc +--- gdb-7.5.50.20130118.orig/gdb/arm-tdep.c 2013-01-18 23:36:59.961290378 +0100 ++++ gdb-7.5.50.20130118/gdb/arm-tdep.c 2013-01-18 23:37:12.469307573 +0100 +@@ -3496,7 +3496,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc array). Vectors and complex types are not currently supported, matching the generic AAPCS support. */ @@ -243,7 +243,7 @@ Index: gdb-7.5.0.20120926/gdb/arm-tdep.c arm_vfp_cprc_sub_candidate (struct type *t, enum arm_vfp_cprc_base_type *base_type) { -@@ -3408,7 +3408,7 @@ arm_vfp_cprc_sub_candidate (struct type +@@ -3527,7 +3527,7 @@ arm_vfp_cprc_sub_candidate (struct type case TYPE_CODE_ARRAY: { @@ -252,7 +252,7 @@ Index: gdb-7.5.0.20120926/gdb/arm-tdep.c unsigned unitlen; count = arm_vfp_cprc_sub_candidate (TYPE_TARGET_TYPE (t), base_type); if (count == -1) -@@ -3428,13 +3428,15 @@ arm_vfp_cprc_sub_candidate (struct type +@@ -3547,13 +3547,15 @@ arm_vfp_cprc_sub_candidate (struct type case TYPE_CODE_STRUCT: { @@ -271,7 +271,7 @@ Index: gdb-7.5.0.20120926/gdb/arm-tdep.c if (sub_count == -1) return -1; count += sub_count; -@@ -3454,13 +3456,15 @@ arm_vfp_cprc_sub_candidate (struct type +@@ -3573,13 +3575,15 @@ arm_vfp_cprc_sub_candidate (struct type case TYPE_CODE_UNION: { @@ -290,7 +290,7 @@ Index: gdb-7.5.0.20120926/gdb/arm-tdep.c if (sub_count == -1) return -1; count = (count > sub_count ? count : sub_count); -@@ -3496,7 +3500,7 @@ arm_vfp_call_candidate (struct type *t, +@@ -3615,7 +3619,7 @@ arm_vfp_call_candidate (struct type *t, int *count) { enum arm_vfp_cprc_base_type b = VFP_CPRC_UNKNOWN; @@ -299,7 +299,7 @@ Index: gdb-7.5.0.20120926/gdb/arm-tdep.c if (c <= 0 || c > 4) return 0; *base_type = b; -@@ -3577,7 +3581,7 @@ arm_push_dummy_call (struct gdbarch *gdb +@@ -3696,7 +3700,7 @@ arm_push_dummy_call (struct gdbarch *gdb for (argnum = 0; argnum < nargs; argnum++) { @@ -308,10 +308,10 @@ Index: gdb-7.5.0.20120926/gdb/arm-tdep.c struct type *arg_type; struct type *target_type; enum type_code typecode; -Index: gdb-7.5.0.20120926/gdb/avr-tdep.c +Index: gdb-7.5.50.20130118/gdb/avr-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/avr-tdep.c 2012-05-18 23:02:47.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/avr-tdep.c 2012-11-07 22:47:57.444984823 +0100 +--- gdb-7.5.50.20130118.orig/gdb/avr-tdep.c 2013-01-18 23:36:59.963290385 +0100 ++++ gdb-7.5.50.20130118/gdb/avr-tdep.c 2013-01-18 23:37:12.470307574 +0100 @@ -1170,13 +1170,14 @@ avr_dummy_id (struct gdbarch *gdbarch, s struct stack_item @@ -345,10 +345,10 @@ Index: gdb-7.5.0.20120926/gdb/avr-tdep.c /* Calculate the potential last register needed. */ last_regnum = regnum - (len + (len & 1)); -Index: gdb-7.5.0.20120926/gdb/bfin-tdep.c +Index: gdb-7.5.50.20130118/gdb/bfin-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/bfin-tdep.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/bfin-tdep.c 2012-11-07 22:47:57.450984814 +0100 +--- gdb-7.5.50.20130118.orig/gdb/bfin-tdep.c 2013-01-18 23:36:59.963290385 +0100 ++++ gdb-7.5.50.20130118/gdb/bfin-tdep.c 2013-01-18 23:37:12.470307574 +0100 @@ -506,7 +506,7 @@ bfin_push_dummy_call (struct gdbarch *gd char buf[4]; int i; @@ -367,10 +367,10 @@ Index: gdb-7.5.0.20120926/gdb/bfin-tdep.c sp -= container_len; write_memory (sp, value_contents_writeable (args[i]), container_len); -Index: gdb-7.5.0.20120926/gdb/cris-tdep.c +Index: gdb-7.5.50.20130118/gdb/cris-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/cris-tdep.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/cris-tdep.c 2012-11-07 22:47:57.453984810 +0100 +--- gdb-7.5.50.20130118.orig/gdb/cris-tdep.c 2013-01-18 23:36:59.965290390 +0100 ++++ gdb-7.5.50.20130118/gdb/cris-tdep.c 2013-01-18 23:37:12.471307578 +0100 @@ -670,13 +670,13 @@ static CORE_ADDR cris_unwind_sp (struct struct stack_item @@ -405,11 +405,11 @@ Index: gdb-7.5.0.20120926/gdb/cris-tdep.c /* How may registers worth of storage do we need for this argument? */ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); -Index: gdb-7.5.0.20120926/gdb/h8300-tdep.c +Index: gdb-7.5.50.20130118/gdb/h8300-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/h8300-tdep.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/h8300-tdep.c 2012-11-07 22:47:57.456984806 +0100 -@@ -641,7 +641,7 @@ h8300_push_dummy_call (struct gdbarch *g +--- gdb-7.5.50.20130118.orig/gdb/h8300-tdep.c 2013-01-18 23:36:59.966290392 +0100 ++++ gdb-7.5.50.20130118/gdb/h8300-tdep.c 2013-01-18 23:37:12.472307583 +0100 +@@ -640,7 +640,7 @@ h8300_push_dummy_call (struct gdbarch *g int struct_return, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -418,7 +418,7 @@ Index: gdb-7.5.0.20120926/gdb/h8300-tdep.c int wordsize = BINWORD (gdbarch); int reg = E_ARG0_REGNUM; int argument; -@@ -668,11 +668,11 @@ h8300_push_dummy_call (struct gdbarch *g +@@ -667,11 +667,11 @@ h8300_push_dummy_call (struct gdbarch *g { struct cleanup *back_to; struct type *type = value_type (args[argument]); @@ -432,7 +432,7 @@ Index: gdb-7.5.0.20120926/gdb/h8300-tdep.c gdb_byte *padded = xmalloc (padded_len); back_to = make_cleanup (xfree, padded); -@@ -701,7 +701,7 @@ h8300_push_dummy_call (struct gdbarch *g +@@ -700,7 +700,7 @@ h8300_push_dummy_call (struct gdbarch *g /* Heavens to Betsy --- it's really going in registers! Note that on the h8/300s, there are gaps between the registers in the register file. */ @@ -441,11 +441,11 @@ Index: gdb-7.5.0.20120926/gdb/h8300-tdep.c for (offset = 0; offset < padded_len; offset += wordsize) { -Index: gdb-7.5.0.20120926/gdb/hppa-tdep.c +Index: gdb-7.5.50.20130118/gdb/hppa-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/hppa-tdep.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/hppa-tdep.c 2012-11-07 22:48:31.378936083 +0100 -@@ -962,7 +962,7 @@ hppa64_push_dummy_call (struct gdbarch * +--- gdb-7.5.50.20130118.orig/gdb/hppa-tdep.c 2013-01-18 23:36:59.966290392 +0100 ++++ gdb-7.5.50.20130118/gdb/hppa-tdep.c 2013-01-18 23:37:44.228351370 +0100 +@@ -961,7 +961,7 @@ hppa64_push_dummy_call (struct gdbarch * { struct value *arg = args[i]; struct type *type = value_type (arg); @@ -454,7 +454,7 @@ Index: gdb-7.5.0.20120926/gdb/hppa-tdep.c const bfd_byte *valbuf; bfd_byte fptrbuf[8]; int regnum; -@@ -1157,7 +1157,7 @@ hppa64_return_value (struct gdbarch *gdb +@@ -1156,7 +1156,7 @@ hppa64_return_value (struct gdbarch *gdb struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) { @@ -462,11 +462,11 @@ Index: gdb-7.5.0.20120926/gdb/hppa-tdep.c + LONGEST len = TYPE_LENGTH (type); int regnum, offset; - if (TYPE_LENGTH (type) > 16) -Index: gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c + if (len > 16) +Index: gdb-7.5.50.20130118/gdb/i386-darwin-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/i386-darwin-tdep.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c 2012-11-07 22:47:57.470984786 +0100 +--- gdb-7.5.50.20130118.orig/gdb/i386-darwin-tdep.c 2013-01-18 23:36:59.967290394 +0100 ++++ gdb-7.5.50.20130118/gdb/i386-darwin-tdep.c 2013-01-18 23:37:12.473307586 +0100 @@ -166,7 +166,7 @@ i386_darwin_push_dummy_call (struct gdba for (write_pass = 0; write_pass < 2; write_pass++) @@ -476,11 +476,11 @@ Index: gdb-7.5.0.20120926/gdb/i386-darwin-tdep.c int num_m128 = 0; if (struct_return) -Index: gdb-7.5.0.20120926/gdb/i386-tdep.c +Index: gdb-7.5.50.20130118/gdb/i386-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/i386-tdep.c 2012-11-07 22:00:42.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/i386-tdep.c 2012-11-07 22:47:57.474984780 +0100 -@@ -2358,7 +2358,7 @@ i386_push_dummy_call (struct gdbarch *gd +--- gdb-7.5.50.20130118.orig/gdb/i386-tdep.c 2013-01-18 23:36:59.969290398 +0100 ++++ gdb-7.5.50.20130118/gdb/i386-tdep.c 2013-01-18 23:37:12.475307589 +0100 +@@ -2407,7 +2407,7 @@ i386_push_dummy_call (struct gdbarch *gd gdb_byte buf[4]; int i; int write_pass; @@ -489,7 +489,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-tdep.c /* Determine the total space required for arguments and struct return address in a first pass (allowing for 16-byte-aligned -@@ -2366,7 +2366,7 @@ i386_push_dummy_call (struct gdbarch *gd +@@ -2415,7 +2415,7 @@ i386_push_dummy_call (struct gdbarch *gd for (write_pass = 0; write_pass < 2; write_pass++) { @@ -498,7 +498,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-tdep.c if (struct_return) { -@@ -2383,7 +2383,7 @@ i386_push_dummy_call (struct gdbarch *gd +@@ -2432,7 +2432,7 @@ i386_push_dummy_call (struct gdbarch *gd for (i = 0; i < nargs; i++) { @@ -507,7 +507,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-tdep.c if (write_pass) { -@@ -2590,7 +2590,7 @@ i386_reg_struct_return_p (struct gdbarch +@@ -2639,7 +2639,7 @@ i386_reg_struct_return_p (struct gdbarch { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum type_code code = TYPE_CODE (type); @@ -516,7 +516,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-tdep.c gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION -@@ -3042,7 +3042,7 @@ static int +@@ -3094,7 +3094,7 @@ static int i386_convert_register_p (struct gdbarch *gdbarch, int regnum, struct type *type) { @@ -525,7 +525,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-tdep.c /* Values may be spread across multiple registers. Most debugging formats aren't expressive enough to specify the locations, so -@@ -3075,7 +3075,7 @@ i386_register_to_value (struct frame_inf +@@ -3127,7 +3127,7 @@ i386_register_to_value (struct frame_inf int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -534,7 +534,7 @@ Index: gdb-7.5.0.20120926/gdb/i386-tdep.c if (i386_fp_regnum_p (gdbarch, regnum)) return i387_register_to_value (frame, regnum, type, to, -@@ -3111,7 +3111,7 @@ static void +@@ -3163,7 +3163,7 @@ static void i386_value_to_register (struct frame_info *frame, int regnum, struct type *type, const gdb_byte *from) { @@ -543,10 +543,10 @@ Index: gdb-7.5.0.20120926/gdb/i386-tdep.c if (i386_fp_regnum_p (get_frame_arch (frame), regnum)) { -Index: gdb-7.5.0.20120926/gdb/ia64-tdep.c +Index: gdb-7.5.50.20130118/gdb/ia64-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ia64-tdep.c 2012-11-07 22:00:42.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/ia64-tdep.c 2012-11-07 22:47:57.491984756 +0100 +--- gdb-7.5.50.20130118.orig/gdb/ia64-tdep.c 2013-01-18 23:36:59.970290400 +0100 ++++ gdb-7.5.50.20130118/gdb/ia64-tdep.c 2013-01-18 23:37:12.476307589 +0100 @@ -3974,8 +3974,10 @@ ia64_push_dummy_call (struct gdbarch *gd int argno; struct value *arg; @@ -560,11 +560,11 @@ Index: gdb-7.5.0.20120926/gdb/ia64-tdep.c int floatreg; ULONGEST bsp; CORE_ADDR funcdescaddr, pc, global_pointer; -Index: gdb-7.5.0.20120926/gdb/iq2000-tdep.c +Index: gdb-7.5.50.20130118/gdb/iq2000-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/iq2000-tdep.c 2012-05-16 16:35:06.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/iq2000-tdep.c 2012-11-07 22:47:57.509984729 +0100 -@@ -655,8 +655,9 @@ iq2000_push_dummy_call (struct gdbarch * +--- gdb-7.5.50.20130118.orig/gdb/iq2000-tdep.c 2013-01-18 23:36:59.970290400 +0100 ++++ gdb-7.5.50.20130118/gdb/iq2000-tdep.c 2013-01-18 23:37:12.476307589 +0100 +@@ -654,8 +654,9 @@ iq2000_push_dummy_call (struct gdbarch * const bfd_byte *val; bfd_byte buf[4]; struct type *type; @@ -576,11 +576,11 @@ Index: gdb-7.5.0.20120926/gdb/iq2000-tdep.c /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; -Index: gdb-7.5.0.20120926/gdb/m32r-tdep.c +Index: gdb-7.5.50.20130118/gdb/m32r-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m32r-tdep.c 2012-05-18 23:02:49.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/m32r-tdep.c 2012-11-07 22:47:57.516984719 +0100 -@@ -696,7 +696,7 @@ m32r_push_dummy_call (struct gdbarch *gd +--- gdb-7.5.50.20130118.orig/gdb/m32r-tdep.c 2013-01-18 23:36:59.971290402 +0100 ++++ gdb-7.5.50.20130118/gdb/m32r-tdep.c 2013-01-18 23:37:12.476307589 +0100 +@@ -695,7 +695,7 @@ m32r_push_dummy_call (struct gdbarch *gd CORE_ADDR regval; gdb_byte *val; gdb_byte valbuf[MAX_REGISTER_SIZE]; @@ -589,10 +589,10 @@ Index: gdb-7.5.0.20120926/gdb/m32r-tdep.c /* First force sp to a 4-byte alignment. */ sp = sp & ~3; -Index: gdb-7.5.0.20120926/gdb/m68k-tdep.c +Index: gdb-7.5.50.20130118/gdb/m68k-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m68k-tdep.c 2012-11-07 22:02:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/m68k-tdep.c 2012-11-07 22:49:45.881829032 +0100 +--- gdb-7.5.50.20130118.orig/gdb/m68k-tdep.c 2013-01-18 23:36:59.971290402 +0100 ++++ gdb-7.5.50.20130118/gdb/m68k-tdep.c 2013-01-18 23:39:06.474459041 +0100 @@ -384,7 +384,7 @@ m68k_reg_struct_return_p (struct gdbarch { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -600,9 +600,9 @@ Index: gdb-7.5.0.20120926/gdb/m68k-tdep.c - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); - gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION); - -@@ -513,9 +513,9 @@ m68k_push_dummy_call (struct gdbarch *gd + gdb_assert (code == TYPE_CODE_STRUCT || code == TYPE_CODE_UNION + || code == TYPE_CODE_COMPLEX); +@@ -516,9 +516,9 @@ m68k_push_dummy_call (struct gdbarch *gd for (i = nargs - 1; i >= 0; i--) { struct type *value_type = value_enclosing_type (args[i]); @@ -615,10 +615,10 @@ Index: gdb-7.5.0.20120926/gdb/m68k-tdep.c /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ -Index: gdb-7.5.0.20120926/gdb/m88k-tdep.c +Index: gdb-7.5.50.20130118/gdb/m88k-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/m88k-tdep.c 2012-05-16 16:35:06.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/m88k-tdep.c 2012-11-07 22:47:57.520984714 +0100 +--- gdb-7.5.50.20130118.orig/gdb/m88k-tdep.c 2013-01-18 23:36:59.971290402 +0100 ++++ gdb-7.5.50.20130118/gdb/m88k-tdep.c 2013-01-18 23:37:12.477307590 +0100 @@ -260,13 +260,13 @@ m88k_store_arguments (struct regcache *r { struct gdbarch *gdbarch = get_regcache_arch (regcache); @@ -646,10 +646,10 @@ Index: gdb-7.5.0.20120926/gdb/m88k-tdep.c if (m88k_in_register_p (type)) { -Index: gdb-7.5.0.20120926/gdb/mep-tdep.c +Index: gdb-7.5.50.20130118/gdb/mep-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/mep-tdep.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/mep-tdep.c 2012-11-07 22:47:57.522984712 +0100 +--- gdb-7.5.50.20130118.orig/gdb/mep-tdep.c 2013-01-18 23:36:59.972290404 +0100 ++++ gdb-7.5.50.20130118/gdb/mep-tdep.c 2013-01-18 23:37:12.477307590 +0100 @@ -2279,7 +2279,7 @@ push_large_arguments (CORE_ADDR sp, int for (i = 0; i < argc; i++) @@ -659,10 +659,10 @@ Index: gdb-7.5.0.20120926/gdb/mep-tdep.c if (arg_len > MEP_GPR_SIZE) { -Index: gdb-7.5.0.20120926/gdb/mips-tdep.c +Index: gdb-7.5.50.20130118/gdb/mips-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/mips-tdep.c 2012-11-07 22:02:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/mips-tdep.c 2012-11-07 22:47:57.534984694 +0100 +--- gdb-7.5.50.20130118.orig/gdb/mips-tdep.c 2013-01-18 23:36:59.975290414 +0100 ++++ gdb-7.5.50.20130118/gdb/mips-tdep.c 2013-01-18 23:37:12.479307599 +0100 @@ -396,7 +396,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, @@ -683,7 +683,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c if (mips_debug && out != NULL) { int i; -@@ -4295,13 +4295,13 @@ mips_eabi_push_dummy_call (struct gdbarc +@@ -4345,13 +4345,13 @@ mips_eabi_push_dummy_call (struct gdbarc gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -700,7 +700,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c /* Function pointer arguments to mips16 code need to be made into mips16 pointers. */ -@@ -4586,7 +4586,7 @@ mips_eabi_return_value (struct gdbarch * +@@ -4636,7 +4636,7 @@ mips_eabi_return_value (struct gdbarch * static int mips_n32n64_fp_arg_chunk_p (struct gdbarch *gdbarch, struct type *arg_type, @@ -709,7 +709,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c { int i; -@@ -4601,7 +4601,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbar +@@ -4651,7 +4651,7 @@ mips_n32n64_fp_arg_chunk_p (struct gdbar for (i = 0; i < TYPE_NFIELDS (arg_type); i++) { @@ -718,7 +718,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c struct type *field_type; /* We're only looking at normal fields. */ -@@ -4643,7 +4643,7 @@ mips_n32n64_push_dummy_call (struct gdba +@@ -4693,7 +4693,7 @@ mips_n32n64_push_dummy_call (struct gdba int argreg; int float_argreg; int argnum; @@ -727,7 +727,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -4994,11 +4994,11 @@ mips_n32n64_return_value (struct gdbarch +@@ -5044,11 +5044,11 @@ mips_n32n64_return_value (struct gdbarch : MIPS_V0_REGNUM); field < TYPE_NFIELDS (type); field++, regnum += 2) { @@ -743,7 +743,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c if (TYPE_LENGTH (TYPE_FIELD_TYPE (type, field)) == 16) { /* A 16-byte long double field goes in two consecutive -@@ -5040,8 +5040,8 @@ mips_n32n64_return_value (struct gdbarch +@@ -5090,8 +5090,8 @@ mips_n32n64_return_value (struct gdbarch if (offset + xfer > TYPE_LENGTH (type)) xfer = TYPE_LENGTH (type) - offset; if (mips_debug) @@ -754,7 +754,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c mips_xfer_register (gdbarch, regcache, gdbarch_num_regs (gdbarch) + regnum, xfer, BFD_ENDIAN_UNKNOWN, readbuf, writebuf, -@@ -5099,7 +5099,7 @@ mips_o32_push_dummy_call (struct gdbarch +@@ -5149,7 +5149,7 @@ mips_o32_push_dummy_call (struct gdbarch int argreg; int float_argreg; int argnum; @@ -763,7 +763,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c int stack_offset = 0; enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5163,13 +5163,13 @@ mips_o32_push_dummy_call (struct gdbarch +@@ -5213,13 +5213,13 @@ mips_o32_push_dummy_call (struct gdbarch const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -780,7 +780,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c val = value_contents (arg); -@@ -5627,8 +5627,8 @@ mips_o64_push_dummy_call (struct gdbarch +@@ -5677,8 +5677,8 @@ mips_o64_push_dummy_call (struct gdbarch int argreg; int float_argreg; int argnum; @@ -791,7 +791,7 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR func_addr = find_function_addr (function, NULL); -@@ -5689,13 +5689,13 @@ mips_o64_push_dummy_call (struct gdbarch +@@ -5739,13 +5739,13 @@ mips_o64_push_dummy_call (struct gdbarch gdb_byte valbuf[MAX_REGISTER_SIZE]; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -808,10 +808,10 @@ Index: gdb-7.5.0.20120926/gdb/mips-tdep.c val = value_contents (arg); -Index: gdb-7.5.0.20120926/gdb/mn10300-tdep.c +Index: gdb-7.5.50.20130118/gdb/mn10300-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/mn10300-tdep.c 2012-05-18 23:02:49.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/mn10300-tdep.c 2012-11-07 22:47:57.542984682 +0100 +--- gdb-7.5.50.20130118.orig/gdb/mn10300-tdep.c 2013-01-18 23:36:59.976290416 +0100 ++++ gdb-7.5.50.20130118/gdb/mn10300-tdep.c 2013-01-18 23:37:12.479307599 +0100 @@ -1228,7 +1228,7 @@ mn10300_push_dummy_call (struct gdbarch enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); @@ -821,10 +821,10 @@ Index: gdb-7.5.0.20120926/gdb/mn10300-tdep.c int stack_offset = 0; int argnum; char *val, valbuf[MAX_REGISTER_SIZE]; -Index: gdb-7.5.0.20120926/gdb/mt-tdep.c +Index: gdb-7.5.50.20130118/gdb/mt-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/mt-tdep.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/mt-tdep.c 2012-11-07 22:47:57.544984680 +0100 +--- gdb-7.5.50.20130118.orig/gdb/mt-tdep.c 2013-01-18 23:36:59.976290416 +0100 ++++ gdb-7.5.50.20130118/gdb/mt-tdep.c 2013-01-18 23:37:12.479307599 +0100 @@ -783,9 +783,9 @@ mt_push_dummy_call (struct gdbarch *gdba gdb_byte buf[MT_MAX_STRUCT_SIZE]; int argreg = MT_1ST_ARGREG; @@ -837,11 +837,11 @@ Index: gdb-7.5.0.20120926/gdb/mt-tdep.c int i, j; /* First handle however many args we can fit into MT_1ST_ARGREG thru -Index: gdb-7.5.0.20120926/gdb/ppc-sysv-tdep.c +Index: gdb-7.5.50.20130118/gdb/ppc-sysv-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/ppc-sysv-tdep.c 2012-05-18 23:02:49.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/ppc-sysv-tdep.c 2012-11-07 22:47:57.551984669 +0100 -@@ -69,7 +69,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb +--- gdb-7.5.50.20130118.orig/gdb/ppc-sysv-tdep.c 2013-01-18 23:36:59.977290417 +0100 ++++ gdb-7.5.50.20130118/gdb/ppc-sysv-tdep.c 2013-01-18 23:37:12.480307602 +0100 +@@ -68,7 +68,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function)); ULONGEST saved_sp; @@ -850,7 +850,7 @@ Index: gdb-7.5.0.20120926/gdb/ppc-sysv-tdep.c int write_pass; gdb_assert (tdep->wordsize == 4); -@@ -100,9 +100,9 @@ ppc_sysv_abi_push_dummy_call (struct gdb +@@ -99,9 +99,9 @@ ppc_sysv_abi_push_dummy_call (struct gdb /* Next available vector register for vector arguments. */ int vreg = 2; /* Arguments start above the "LR save word" and "Back chain". */ @@ -862,7 +862,7 @@ Index: gdb-7.5.0.20120926/gdb/ppc-sysv-tdep.c /* If the function is returning a `struct', then the first word (which will be passed in r3) is used for struct return -@@ -121,7 +121,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb +@@ -120,7 +120,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb { struct value *arg = args[argno]; struct type *type = check_typedef (value_type (arg)); @@ -871,7 +871,7 @@ Index: gdb-7.5.0.20120926/gdb/ppc-sysv-tdep.c const bfd_byte *val = value_contents (arg); if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 -@@ -1557,14 +1557,14 @@ ppc64_sysv_abi_push_dummy_call (struct g +@@ -1556,14 +1556,14 @@ ppc64_sysv_abi_push_dummy_call (struct g } else { @@ -888,7 +888,7 @@ Index: gdb-7.5.0.20120926/gdb/ppc-sysv-tdep.c if (len > tdep->wordsize) len = tdep->wordsize; memset (regval, 0, sizeof regval); -@@ -1592,7 +1592,7 @@ ppc64_sysv_abi_push_dummy_call (struct g +@@ -1591,7 +1591,7 @@ ppc64_sysv_abi_push_dummy_call (struct g register. Work around this by always writing the value to memory. Fortunately, doing this simplifies the code. */ @@ -897,10 +897,10 @@ Index: gdb-7.5.0.20120926/gdb/ppc-sysv-tdep.c if (len < tdep->wordsize) write_memory (gparam + tdep->wordsize - len, val, len); else -Index: gdb-7.5.0.20120926/gdb/rl78-tdep.c +Index: gdb-7.5.50.20130118/gdb/rl78-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/rl78-tdep.c 2012-05-18 23:02:50.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/rl78-tdep.c 2012-11-07 22:47:57.557984660 +0100 +--- gdb-7.5.50.20130118.orig/gdb/rl78-tdep.c 2013-01-18 23:36:59.977290417 +0100 ++++ gdb-7.5.50.20130118/gdb/rl78-tdep.c 2013-01-18 23:37:12.480307602 +0100 @@ -1019,8 +1019,8 @@ rl78_push_dummy_call (struct gdbarch *gd for (i = nargs - 1; i >= 0; i--) { @@ -912,11 +912,11 @@ Index: gdb-7.5.0.20120926/gdb/rl78-tdep.c sp -= container_len; write_memory (rl78_make_data_address (sp), -Index: gdb-7.5.0.20120926/gdb/rs6000-aix-tdep.c +Index: gdb-7.5.50.20130118/gdb/rs6000-aix-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/rs6000-aix-tdep.c 2012-05-18 23:02:50.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/rs6000-aix-tdep.c 2012-11-07 22:47:57.560984657 +0100 -@@ -197,9 +197,9 @@ rs6000_push_dummy_call (struct gdbarch * +--- gdb-7.5.50.20130118.orig/gdb/rs6000-aix-tdep.c 2013-01-18 23:36:59.978290418 +0100 ++++ gdb-7.5.50.20130118/gdb/rs6000-aix-tdep.c 2013-01-18 23:37:12.480307602 +0100 +@@ -198,9 +198,9 @@ rs6000_push_dummy_call (struct gdbarch * struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int ii; @@ -928,7 +928,7 @@ Index: gdb-7.5.0.20120926/gdb/rs6000-aix-tdep.c gdb_byte tmp_buffer[50]; int f_argno = 0; /* current floating point argno */ int wordsize = gdbarch_tdep (gdbarch)->wordsize; -@@ -327,7 +327,7 @@ ran_out_of_registers_for_arguments: +@@ -328,7 +328,7 @@ ran_out_of_registers_for_arguments: if ((argno < nargs) || argbytes) { @@ -937,11 +937,11 @@ Index: gdb-7.5.0.20120926/gdb/rs6000-aix-tdep.c if (argbytes) { -Index: gdb-7.5.0.20120926/gdb/s390-tdep.c +Index: gdb-7.5.50.20130118/gdb/s390-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/s390-tdep.c 2012-11-07 22:03:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/s390-tdep.c 2012-11-07 22:47:57.569984644 +0100 -@@ -2481,7 +2481,7 @@ is_float_like (struct type *type) +--- gdb-7.5.50.20130118.orig/gdb/s390-tdep.c 2013-01-18 23:36:59.979290420 +0100 ++++ gdb-7.5.50.20130118/gdb/s390-tdep.c 2013-01-18 23:37:12.480307602 +0100 +@@ -2482,7 +2482,7 @@ is_float_like (struct type *type) static int @@ -950,7 +950,7 @@ Index: gdb-7.5.0.20120926/gdb/s390-tdep.c { return ((n & (n - 1)) == 0); } -@@ -2667,7 +2667,7 @@ s390_push_dummy_call (struct gdbarch *gd +@@ -2668,7 +2668,7 @@ s390_push_dummy_call (struct gdbarch *gd { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); @@ -959,10 +959,10 @@ Index: gdb-7.5.0.20120926/gdb/s390-tdep.c if (s390_function_arg_pass_by_reference (type)) { -Index: gdb-7.5.0.20120926/gdb/score-tdep.c +Index: gdb-7.5.50.20130118/gdb/score-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/score-tdep.c 2012-05-18 23:02:50.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/score-tdep.c 2012-11-07 22:47:57.571984640 +0100 +--- gdb-7.5.50.20130118.orig/gdb/score-tdep.c 2013-01-18 23:36:59.979290420 +0100 ++++ gdb-7.5.50.20130118/gdb/score-tdep.c 2013-01-18 23:37:12.481307604 +0100 @@ -515,7 +515,7 @@ score_push_dummy_call (struct gdbarch *g enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argnum; @@ -972,11 +972,11 @@ Index: gdb-7.5.0.20120926/gdb/score-tdep.c CORE_ADDR stack_offset = 0; CORE_ADDR addr = 0; -Index: gdb-7.5.0.20120926/gdb/sh-tdep.c +Index: gdb-7.5.50.20130118/gdb/sh-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/sh-tdep.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/sh-tdep.c 2012-11-07 22:47:57.579984628 +0100 -@@ -805,7 +805,7 @@ sh_skip_prologue (struct gdbarch *gdbarc +--- gdb-7.5.50.20130118.orig/gdb/sh-tdep.c 2013-01-18 23:36:59.980290423 +0100 ++++ gdb-7.5.50.20130118/gdb/sh-tdep.c 2013-01-18 23:37:12.481307604 +0100 +@@ -807,7 +807,7 @@ sh_skip_prologue (struct gdbarch *gdbarc static int sh_use_struct_convention (int renesas_abi, struct type *type) { @@ -985,7 +985,7 @@ Index: gdb-7.5.0.20120926/gdb/sh-tdep.c int nelem = TYPE_NFIELDS (type); /* The Renesas ABI returns aggregate types always on stack. */ -@@ -907,7 +907,7 @@ sh_frame_align (struct gdbarch *ignore, +@@ -909,7 +909,7 @@ sh_frame_align (struct gdbarch *ignore, /* Helper function to justify value in register according to endianess. */ static char * @@ -994,7 +994,7 @@ Index: gdb-7.5.0.20120926/gdb/sh-tdep.c { static char valbuf[4]; -@@ -1067,7 +1067,8 @@ sh_push_dummy_call_fpu (struct gdbarch * +@@ -1069,7 +1069,8 @@ sh_push_dummy_call_fpu (struct gdbarch * struct type *type; CORE_ADDR regval; char *val; @@ -1004,7 +1004,7 @@ Index: gdb-7.5.0.20120926/gdb/sh-tdep.c int pass_on_stack = 0; int treat_as_flt; int last_reg_arg = INT_MAX; -@@ -1208,7 +1209,8 @@ sh_push_dummy_call_nofpu (struct gdbarch +@@ -1210,7 +1211,8 @@ sh_push_dummy_call_nofpu (struct gdbarch struct type *type; CORE_ADDR regval; char *val; @@ -1014,10 +1014,10 @@ Index: gdb-7.5.0.20120926/gdb/sh-tdep.c int pass_on_stack = 0; int last_reg_arg = INT_MAX; -Index: gdb-7.5.0.20120926/gdb/sh64-tdep.c +Index: gdb-7.5.50.20130118/gdb/sh64-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/sh64-tdep.c 2012-06-06 20:03:53.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/sh64-tdep.c 2012-11-07 22:47:57.582984625 +0100 +--- gdb-7.5.50.20130118.orig/gdb/sh64-tdep.c 2013-01-18 23:36:59.980290423 +0100 ++++ gdb-7.5.50.20130118/gdb/sh64-tdep.c 2013-01-18 23:37:12.482307606 +0100 @@ -1058,7 +1058,7 @@ sh64_push_dummy_call (struct gdbarch *gd CORE_ADDR struct_addr) { @@ -1036,11 +1036,11 @@ Index: gdb-7.5.0.20120926/gdb/sh64-tdep.c int argreg_size; int fp_args[12]; -Index: gdb-7.5.0.20120926/gdb/sparc-tdep.c +Index: gdb-7.5.50.20130118/gdb/sparc-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/sparc-tdep.c 2012-11-07 22:00:43.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/sparc-tdep.c 2012-11-07 22:47:57.593984609 +0100 -@@ -470,7 +470,7 @@ sparc32_store_arguments (struct regcache +--- gdb-7.5.50.20130118.orig/gdb/sparc-tdep.c 2013-01-18 23:36:59.981290427 +0100 ++++ gdb-7.5.50.20130118/gdb/sparc-tdep.c 2013-01-18 23:37:12.482307606 +0100 +@@ -471,7 +471,7 @@ sparc32_store_arguments (struct regcache for (i = 0; i < nargs; i++) { struct type *type = value_type (args[i]); @@ -1049,10 +1049,10 @@ Index: gdb-7.5.0.20120926/gdb/sparc-tdep.c if (sparc_structure_or_union_p (type) || (sparc_floating_p (type) && len == 16) -Index: gdb-7.5.0.20120926/gdb/sparc64-tdep.c +Index: gdb-7.5.50.20130118/gdb/sparc64-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/sparc64-tdep.c 2012-05-16 16:35:07.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/sparc64-tdep.c 2012-11-07 22:47:57.595984605 +0100 +--- gdb-7.5.50.20130118.orig/gdb/sparc64-tdep.c 2013-01-18 23:36:59.982290430 +0100 ++++ gdb-7.5.50.20130118/gdb/sparc64-tdep.c 2013-01-18 23:37:12.482307606 +0100 @@ -639,7 +639,8 @@ sparc64_16_byte_align_p (struct type *ty static void @@ -1108,11 +1108,11 @@ Index: gdb-7.5.0.20120926/gdb/sparc64-tdep.c int regnum = -1; gdb_byte buf[16]; -Index: gdb-7.5.0.20120926/gdb/spu-tdep.c +Index: gdb-7.5.50.20130118/gdb/spu-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/spu-tdep.c 2012-11-07 22:09:24.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/spu-tdep.c 2012-11-07 22:47:57.598984602 +0100 -@@ -1372,7 +1372,7 @@ spu_push_dummy_call (struct gdbarch *gdb +--- gdb-7.5.50.20130118.orig/gdb/spu-tdep.c 2013-01-18 23:36:59.982290430 +0100 ++++ gdb-7.5.50.20130118/gdb/spu-tdep.c 2013-01-18 23:37:12.483307607 +0100 +@@ -1373,7 +1373,7 @@ spu_push_dummy_call (struct gdbarch *gdb struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); const gdb_byte *contents = value_contents (arg); @@ -1121,7 +1121,7 @@ Index: gdb-7.5.0.20120926/gdb/spu-tdep.c /* If the argument doesn't wholly fit into registers, it and all subsequent arguments go to the stack. */ -@@ -1404,7 +1404,7 @@ spu_push_dummy_call (struct gdbarch *gdb +@@ -1405,7 +1405,7 @@ spu_push_dummy_call (struct gdbarch *gdb { struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); @@ -1130,20 +1130,20 @@ Index: gdb-7.5.0.20120926/gdb/spu-tdep.c int preferred_slot; if (spu_scalar_value_p (type)) -Index: gdb-7.5.0.20120926/gdb/tic6x-tdep.c +Index: gdb-7.5.50.20130118/gdb/tic6x-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/tic6x-tdep.c 2012-06-08 16:24:57.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/tic6x-tdep.c 2012-11-07 22:50:31.792763178 +0100 -@@ -918,7 +918,7 @@ tic6x_push_dummy_call (struct gdbarch *g +--- gdb-7.5.50.20130118.orig/gdb/tic6x-tdep.c 2013-01-18 23:36:59.983290432 +0100 ++++ gdb-7.5.50.20130118/gdb/tic6x-tdep.c 2013-01-18 23:39:27.770484516 +0100 +@@ -896,7 +896,7 @@ tic6x_push_dummy_call (struct gdbarch *g + int argreg = 0; int argnum; - int len = 0; int stack_offset = 4; - int references_offset = 4; + LONGEST references_offset = 4; CORE_ADDR func_addr = find_function_addr (function, NULL); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct type *func_type = value_type (function); -@@ -952,7 +952,7 @@ tic6x_push_dummy_call (struct gdbarch *g +@@ -930,7 +930,7 @@ tic6x_push_dummy_call (struct gdbarch *g /* Now make space on the stack for the args. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1152,7 +1152,7 @@ Index: gdb-7.5.0.20120926/gdb/tic6x-tdep.c if (argnum >= 10 - argreg) references_offset += len; stack_offset += len; -@@ -971,7 +971,7 @@ tic6x_push_dummy_call (struct gdbarch *g +@@ -949,7 +949,7 @@ tic6x_push_dummy_call (struct gdbarch *g const gdb_byte *val; struct value *arg = args[argnum]; struct type *arg_type = check_typedef (value_type (arg)); @@ -1161,7 +1161,7 @@ Index: gdb-7.5.0.20120926/gdb/tic6x-tdep.c enum type_code typecode = TYPE_CODE (arg_type); val = value_contents (arg); -@@ -1131,7 +1131,8 @@ tic6x_push_dummy_call (struct gdbarch *g +@@ -1109,7 +1109,8 @@ tic6x_push_dummy_call (struct gdbarch *g } else internal_error (__FILE__, __LINE__, @@ -1171,10 +1171,10 @@ Index: gdb-7.5.0.20120926/gdb/tic6x-tdep.c addr = sp + stack_offset; write_memory (addr, val, len); -Index: gdb-7.5.0.20120926/gdb/tilegx-tdep.c +Index: gdb-7.5.50.20130118/gdb/tilegx-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/tilegx-tdep.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/tilegx-tdep.c 2012-11-07 22:47:57.610984584 +0100 +--- gdb-7.5.50.20130118.orig/gdb/tilegx-tdep.c 2013-01-18 23:36:59.983290432 +0100 ++++ gdb-7.5.50.20130118/gdb/tilegx-tdep.c 2013-01-18 23:37:12.483307607 +0100 @@ -291,7 +291,7 @@ tilegx_push_dummy_call (struct gdbarch * CORE_ADDR stack_dest = sp; int argreg = TILEGX_R0_REGNUM; @@ -1184,11 +1184,11 @@ Index: gdb-7.5.0.20120926/gdb/tilegx-tdep.c static const gdb_byte two_zero_words[8] = { 0 }; /* If struct_return is 1, then the struct return address will -Index: gdb-7.5.0.20120926/gdb/v850-tdep.c +Index: gdb-7.5.50.20130118/gdb/v850-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/v850-tdep.c 2012-05-18 23:02:50.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/v850-tdep.c 2012-11-07 22:47:57.617984575 +0100 -@@ -809,7 +809,7 @@ v850_push_dummy_call (struct gdbarch *gd +--- gdb-7.5.50.20130118.orig/gdb/v850-tdep.c 2013-01-18 23:36:59.984290434 +0100 ++++ gdb-7.5.50.20130118/gdb/v850-tdep.c 2013-01-18 23:37:12.484307608 +0100 +@@ -808,7 +808,7 @@ v850_push_dummy_call (struct gdbarch *gd enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; int argnum; @@ -1197,7 +1197,7 @@ Index: gdb-7.5.0.20120926/gdb/v850-tdep.c int stack_offset; /* The offset onto the stack at which we will start copying parameters -@@ -834,7 +834,7 @@ v850_push_dummy_call (struct gdbarch *gd +@@ -833,7 +833,7 @@ v850_push_dummy_call (struct gdbarch *gd in four registers available. Loop thru args from first to last. */ for (argnum = 0; argnum < nargs; argnum++) { @@ -1206,11 +1206,11 @@ Index: gdb-7.5.0.20120926/gdb/v850-tdep.c gdb_byte *val; gdb_byte valbuf[v850_reg_size]; -Index: gdb-7.5.0.20120926/gdb/vax-tdep.c +Index: gdb-7.5.50.20130118/gdb/vax-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/vax-tdep.c 2012-11-07 22:46:56.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/vax-tdep.c 2012-11-07 22:47:57.618984573 +0100 -@@ -116,7 +116,7 @@ vax_store_arguments (struct regcache *re +--- gdb-7.5.50.20130118.orig/gdb/vax-tdep.c 2013-01-18 23:36:59.984290434 +0100 ++++ gdb-7.5.50.20130118/gdb/vax-tdep.c 2013-01-18 23:37:12.484307608 +0100 +@@ -115,7 +115,7 @@ vax_store_arguments (struct regcache *re struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); gdb_byte buf[4]; @@ -1219,7 +1219,7 @@ Index: gdb-7.5.0.20120926/gdb/vax-tdep.c int i; /* We create an argument list on the stack, and make the argument -@@ -125,7 +125,7 @@ vax_store_arguments (struct regcache *re +@@ -124,7 +124,7 @@ vax_store_arguments (struct regcache *re /* Push arguments in reverse order. */ for (i = nargs - 1; i >= 0; i--) { @@ -1228,10 +1228,10 @@ Index: gdb-7.5.0.20120926/gdb/vax-tdep.c sp -= (len + 3) & ~3; count += (len + 3) / 4; -Index: gdb-7.5.0.20120926/gdb/xstormy16-tdep.c +Index: gdb-7.5.50.20130118/gdb/xstormy16-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/xstormy16-tdep.c 2012-11-07 22:00:44.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/xstormy16-tdep.c 2012-11-07 22:47:57.626984562 +0100 +--- gdb-7.5.50.20130118.orig/gdb/xstormy16-tdep.c 2013-01-18 23:36:59.984290434 +0100 ++++ gdb-7.5.50.20130118/gdb/xstormy16-tdep.c 2013-01-18 23:37:12.484307608 +0100 @@ -235,8 +235,9 @@ xstormy16_push_dummy_call (struct gdbarc enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; @@ -1244,10 +1244,10 @@ Index: gdb-7.5.0.20120926/gdb/xstormy16-tdep.c const gdb_byte *val; char buf[xstormy16_pc_size]; -Index: gdb-7.5.0.20120926/gdb/xtensa-tdep.c +Index: gdb-7.5.50.20130118/gdb/xtensa-tdep.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/xtensa-tdep.c 2012-05-18 23:02:51.000000000 +0200 -+++ gdb-7.5.0.20120926/gdb/xtensa-tdep.c 2012-11-07 22:47:57.629984557 +0100 +--- gdb-7.5.50.20130118.orig/gdb/xtensa-tdep.c 2013-01-18 23:36:59.985290436 +0100 ++++ gdb-7.5.50.20130118/gdb/xtensa-tdep.c 2013-01-18 23:37:12.484307608 +0100 @@ -1653,8 +1653,7 @@ xtensa_store_return_value (struct type * if (len > (callsize > 8 ? 8 : 16)) diff --git a/gdb-rhbz795424-bitpos-24of25.patch b/gdb-rhbz795424-bitpos-24of25.patch deleted file mode 100644 index 59d8439..0000000 --- a/gdb-rhbz795424-bitpos-24of25.patch +++ /dev/null @@ -1,113 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2012-09/msg00160.html - -### src/gdb/ChangeLog 2012/09/26 23:53:53 1.14709 -### src/gdb/ChangeLog 2012/09/27 08:57:14 1.14710 -## -1,3 +1,16 @@ -+2012-09-27 Siddhesh Poyarekar -+ -+ * gdbtypes.c (lookup_array_range_type): Expand parameters -+ LOW_BOUND and HIGH_BOUND to LONGEST. -+ (lookup_string_range_type): Likewise. -+ * gdbtypes.h (lookup_array_range_type): Likewise. -+ (lookup_string_range_type): Likewise. -+ * valops.c (value_cstring): Expand parameter LEN to ssize_t. -+ Expand HIGHBOUND to ssize_t. -+ (value_string): Likewise. -+ * value.h (value_cstring): Expand parameter LEN to ssize_t. -+ (value_string): Likewise. -+ - 2012-09-27 Yao Qi - - PR breakpoints/13898 -Index: gdb-7.5.0.20120926/gdb/gdbtypes.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbtypes.c 2012-11-07 22:09:57.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/gdbtypes.c 2012-11-07 22:50:47.048741164 +0100 -@@ -1022,7 +1022,7 @@ create_array_type (struct type *result_t - - struct type * - lookup_array_range_type (struct type *element_type, -- int low_bound, int high_bound) -+ LONGEST low_bound, LONGEST high_bound) - { - struct gdbarch *gdbarch = get_type_arch (element_type); - struct type *index_type = builtin_type (gdbarch)->builtin_int; -@@ -1058,7 +1058,7 @@ create_string_type (struct type *result_ - - struct type * - lookup_string_range_type (struct type *string_char_type, -- int low_bound, int high_bound) -+ LONGEST low_bound, LONGEST high_bound) - { - struct type *result_type; - -Index: gdb-7.5.0.20120926/gdb/gdbtypes.h -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/gdbtypes.h 2012-11-07 22:09:29.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/gdbtypes.h 2012-11-07 22:51:46.440655817 +0100 -@@ -1640,7 +1640,7 @@ extern struct type *create_range_type (s - - extern struct type *create_array_type (struct type *, struct type *, - struct type *); --extern struct type *lookup_array_range_type (struct type *, int, int); -+extern struct type *lookup_array_range_type (struct type *, LONGEST, LONGEST); - - extern CORE_ADDR type_range_any_field_internal (struct type *range_type, - int fieldno); -@@ -1656,7 +1656,7 @@ extern void finalize_type (struct type * - - extern struct type *create_string_type (struct type *, struct type *, - struct type *); --extern struct type *lookup_string_range_type (struct type *, int, int); -+extern struct type *lookup_string_range_type (struct type *, LONGEST, LONGEST); - - extern struct type *create_set_type (struct type *, struct type *); - -Index: gdb-7.5.0.20120926/gdb/valops.c -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/valops.c 2012-11-07 22:46:00.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/valops.c 2012-11-07 22:50:47.091741104 +0100 -@@ -1937,11 +1937,11 @@ value_array (int lowbound, int highbound - } - - struct value * --value_cstring (char *ptr, int len, struct type *char_type) -+value_cstring (char *ptr, ssize_t len, struct type *char_type) - { - struct value *val; - int lowbound = current_language->string_lower_bound; -- int highbound = len / TYPE_LENGTH (char_type); -+ ssize_t highbound = len / TYPE_LENGTH (char_type); - struct type *stringtype - = lookup_array_range_type (char_type, lowbound, highbound + lowbound - 1); - -@@ -1960,11 +1960,11 @@ value_cstring (char *ptr, int len, struc - string may contain embedded null bytes. */ - - struct value * --value_string (char *ptr, int len, struct type *char_type) -+value_string (char *ptr, ssize_t len, struct type *char_type) - { - struct value *val; - int lowbound = current_language->string_lower_bound; -- int highbound = len / TYPE_LENGTH (char_type); -+ ssize_t highbound = len / TYPE_LENGTH (char_type); - struct type *stringtype - = lookup_string_range_type (char_type, lowbound, highbound + lowbound - 1); - -Index: gdb-7.5.0.20120926/gdb/value.h -=================================================================== ---- gdb-7.5.0.20120926.orig/gdb/value.h 2012-11-07 22:09:30.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/value.h 2012-11-07 22:51:11.744705614 +0100 -@@ -593,9 +593,9 @@ extern struct value *value_mark (void); - - extern void value_free_to_mark (struct value *mark); - --extern struct value *value_cstring (char *ptr, int len, -+extern struct value *value_cstring (char *ptr, ssize_t len, - struct type *char_type); --extern struct value *value_string (char *ptr, int len, -+extern struct value *value_string (char *ptr, ssize_t len, - struct type *char_type); - extern struct value *value_bitstring (char *ptr, int len, - struct type *index_type); diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch index fa3a6be..1c39b9e 100644 --- a/gdb-rhbz795424-bitpos-25of25.patch +++ b/gdb-rhbz795424-bitpos-25of25.patch @@ -47,13 +47,13 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=f77-bounds.patch -Index: gdb-7.5.0.20120926/gdb/f-lang.h +Index: gdb-7.5.50.20130118/gdb/f-lang.h =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/f-lang.h 2012-11-07 22:12:39.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/f-lang.h 2012-11-07 22:52:02.688632498 +0100 -@@ -66,9 +66,9 @@ enum f90_range_type - extern char *real_main_name; /* Name of main function. */ - extern int real_main_c_value; /* C_value field of main function. */ +--- gdb-7.5.50.20130118.orig/gdb/f-lang.h 2013-01-18 23:39:40.209500968 +0100 ++++ gdb-7.5.50.20130118/gdb/f-lang.h 2013-01-18 23:40:04.010531177 +0100 +@@ -65,9 +65,9 @@ struct common_block + struct symbol *contents[1]; + }; -extern int f77_get_upperbound (struct type *); +extern LONGEST f77_get_upperbound (struct type *); @@ -63,11 +63,11 @@ Index: gdb-7.5.0.20120926/gdb/f-lang.h extern void f77_get_dynamic_array_length (struct type *); -Index: gdb-7.5.0.20120926/gdb/f-typeprint.c +Index: gdb-7.5.50.20130118/gdb/f-typeprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/f-typeprint.c 2012-11-07 22:00:41.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/f-typeprint.c 2012-11-07 22:52:02.689632497 +0100 -@@ -182,7 +182,7 @@ f_type_print_varspec_suffix (struct type +--- gdb-7.5.50.20130118.orig/gdb/f-typeprint.c 2013-01-18 23:39:37.564497620 +0100 ++++ gdb-7.5.50.20130118/gdb/f-typeprint.c 2013-01-18 23:39:40.210500970 +0100 +@@ -180,7 +180,7 @@ f_type_print_varspec_suffix (struct type int show, int passed_a_ptr, int demangled_args, int arrayprint_recurse_level) { @@ -76,7 +76,7 @@ Index: gdb-7.5.0.20120926/gdb/f-typeprint.c /* No static variables are permitted as an error call may occur during execution of this function. */ -@@ -212,7 +212,7 @@ f_type_print_varspec_suffix (struct type +@@ -210,7 +210,7 @@ f_type_print_varspec_suffix (struct type lower_bound = f77_get_lowerbound (type); if (lower_bound != 1) /* Not the default. */ @@ -85,7 +85,7 @@ Index: gdb-7.5.0.20120926/gdb/f-typeprint.c /* Make sure that, if we have an assumed size array, we print out a warning and print the upperbound as '*'. */ -@@ -222,7 +222,7 @@ f_type_print_varspec_suffix (struct type +@@ -220,7 +220,7 @@ f_type_print_varspec_suffix (struct type else { upper_bound = f77_get_upperbound (type); @@ -94,7 +94,7 @@ Index: gdb-7.5.0.20120926/gdb/f-typeprint.c } if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -@@ -291,7 +291,7 @@ void +@@ -288,7 +288,7 @@ void f_type_print_base (struct type *type, struct ui_file *stream, int show, int level) { @@ -103,7 +103,7 @@ Index: gdb-7.5.0.20120926/gdb/f-typeprint.c int index; QUIT; -@@ -373,7 +373,7 @@ f_type_print_base (struct type *type, st +@@ -370,7 +370,7 @@ f_type_print_base (struct type *type, st else { upper_bound = f77_get_upperbound (type); @@ -112,10 +112,10 @@ Index: gdb-7.5.0.20120926/gdb/f-typeprint.c } break; -Index: gdb-7.5.0.20120926/gdb/f-valprint.c +Index: gdb-7.5.50.20130118/gdb/f-valprint.c =================================================================== ---- gdb-7.5.0.20120926.orig/gdb/f-valprint.c 2012-11-07 22:09:29.000000000 +0100 -+++ gdb-7.5.0.20120926/gdb/f-valprint.c 2012-11-07 22:52:21.888604907 +0100 +--- gdb-7.5.50.20130118.orig/gdb/f-valprint.c 2013-01-18 23:39:37.564497620 +0100 ++++ gdb-7.5.50.20130118/gdb/f-valprint.c 2013-01-18 23:39:40.210500970 +0100 @@ -57,7 +57,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN #define F77_DIM_BYTE_STRIDE(n) (f77_array_offset_tbl[n][0]) diff --git a/gdb-rhbz795424-bitpos-lazyvalue.patch b/gdb-rhbz795424-bitpos-lazyvalue.patch index 20e8e51..64e1565 100644 --- a/gdb-rhbz795424-bitpos-lazyvalue.patch +++ b/gdb-rhbz795424-bitpos-lazyvalue.patch @@ -9,7 +9,7 @@ val->contents = NULL; val->next = all_values; --- /dev/null 2012-10-18 11:08:13.202328239 +0200 -+++ gdb-7.5.0.20120926-m64-test/gdb/testsuite/gdb.base/longest-types.exp 2012-11-09 18:13:56.286587994 +0100 ++++ gdb-7.5.0.20120926-m64-test/gdb/testsuite/gdb.base/longest-types-64bit.exp 2012-11-09 18:13:56.286587994 +0100 @@ -0,0 +1,59 @@ +# This testcase is part of GDB, the GNU debugger. + @@ -71,7 +71,7 @@ + +test "native" --- /dev/null 2012-10-18 11:08:13.202328239 +0200 -+++ ./gdb/testsuite/gdb.base/longest-types.c 2012-11-09 17:08:51.374406344 +0100 ++++ ./gdb/testsuite/gdb.base/longest-types-64bit.c 2012-11-09 17:08:51.374406344 +0100 @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + diff --git a/gdb-rhbz890900-ppc-dis-1of2.patch b/gdb-rhbz890900-ppc-dis-1of2.patch deleted file mode 100644 index 811c6c4..0000000 --- a/gdb-rhbz890900-ppc-dis-1of2.patch +++ /dev/null @@ -1,228 +0,0 @@ -http://sourceware.org/ml/binutils/2012-11/msg00352.html -Subject: Re: [PATCH] Fix gdb disassemble for power6/power7 instructions - -On Wed, Nov 14, 2012 at 10:16:38AM +1030, Alan Modra wrote: -> What I think should happen is that the default handling, ie. the block -> that starts with -> if ((dialect & ~(ppc_cpu_t) PPC_OPCODE_64) == 0) -> should be deleted and a switch on info->mach setting up dialect added -> before we parse disassembler_options. That way -m32 and -m64 can -> override the default as they are supposed to. See bfd/archures.c for -> values of bfd_mach_ppc_*. - -Well that idea didn't turn out to be simple. If we want to bring the -default up to something more up-to-date than the current ppc601, then -you run into difficulty with "retain_mask" in ppc_parse_cpu. Choosing -any of the bits in that mask as a default, eg. PPC_OPCODE_VSX, results -in not being able to get rid of those bits. - -Now the idea of "retain_mask" was to cover cases where people pass -something like -mppc -maltivec (or even -maltivec -mppc) to the -assembler. Historically that has resulted in both PPC_OPCODE_PPC and -PPC_OPCODE_ALTIVEC being set; Some options accumulate. So I've -redone code handling these sticky options to just keep track of the -bits selected by ppc_opts.sticky. Any default selection won't make -these bits sticky, you'll only get that effect from -maltivec, -many, --mspe, -mvle and -mvsx on the command line or in .machine directives -(and similarly for the corresponding -M disassembler options). I'm -not sure why PPC_OPCODE_PMR was ever in "retain_mask". People -interested in VLE might need to investigate that. - -One of the effects of updating to a power7 default is that conditional -branch hints are displayed for "at" style hints rather than the older -"y" hints. When using "y" hints the disassembler always showed the -hint, eg. "bne-" or "bne+". Now you'll see "bne" most times. This -meant updating the testsuite. I made one gas test disassemble for -plain ppc just to ensure the older "y" hints continue to be available. - -Committed. - -include/opcode/ - * ppc.h (ppc_parse_cpu): Update prototype. -opcodes/ - * ppc-dis.c (ppc_parse_cpu): Add "sticky" param. Track bits - set from ppc_opts.sticky in it. Delete "retain_mask". - (powerpc_init_dialect): Choose default dialect from info->mach - before parsing -M options. Handle more bfd_mach_ppc variants. - Update common default to power7. -gas/ - * config/tc-ppc.c (sticky): New var. - (md_parse_option, ppc_machine): Update ppc_parse_cpu calls. -gas/testsuite/ - * gas/ppc/astest2.d: Pass -Mppc to objdump. -ld/testsuite/ - * ld-powerpc/plt1.d: Update for default "at" branch hints. - * ld-powerpc/tlsexe.d: Likewise. - * ld-powerpc/tlsexetoc.d: Likewise. - * ld-powerpc/tlsopt1.d: Likewise. - * ld-powerpc/tlsopt1_32.d: Likewise. - * ld-powerpc/tlsopt2.d: Likewise. - * ld-powerpc/tlsopt2_32.d: Likewise. - * ld-powerpc/tlsopt4.d: Likewise. - * ld-powerpc/tlsopt4_32.d: Likewise. - * ld-powerpc/tlsso.d: Likewise. - * ld-powerpc/tlstocso.d: Likewise. - -Index: include/opcode/ppc.h -=================================================================== -RCS file: /cvs/src/src/include/opcode/ppc.h,v -retrieving revision 1.44 -diff -u -p -r1.44 ppc.h ---- ./include/opcode/ppc.h 14 May 2012 19:45:27 -0000 1.44 -+++ ./include/opcode/ppc.h 22 Nov 2012 22:45:18 -0000 -@@ -400,6 +400,6 @@ struct powerpc_macro - extern const struct powerpc_macro powerpc_macros[]; - extern const int powerpc_num_macros; - --extern ppc_cpu_t ppc_parse_cpu (ppc_cpu_t, const char *); -+extern ppc_cpu_t ppc_parse_cpu (ppc_cpu_t, ppc_cpu_t *, const char *); - - #endif /* PPC_H */ -Index: opcodes/ppc-dis.c -=================================================================== -RCS file: /cvs/src/src/opcodes/ppc-dis.c,v -retrieving revision 1.60 -diff -u -p -r1.60 ppc-dis.c ---- ./opcodes/ppc-dis.c 5 Oct 2012 14:06:20 -0000 1.60 -+++ ./opcodes/ppc-dis.c 22 Nov 2012 22:45:19 -0000 -@@ -211,13 +211,8 @@ get_powerpc_dialect (struct disassemble_ - /* Handle -m and -M options that set cpu type, and .machine arg. */ - - ppc_cpu_t --ppc_parse_cpu (ppc_cpu_t ppc_cpu, const char *arg) -+ppc_parse_cpu (ppc_cpu_t ppc_cpu, ppc_cpu_t *sticky, const char *arg) - { -- const ppc_cpu_t retain_mask = (PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX -- | PPC_OPCODE_SPE | PPC_OPCODE_ANY -- | PPC_OPCODE_VLE | PPC_OPCODE_PMR); -- /* Sticky bits. */ -- ppc_cpu_t retain_flags = ppc_cpu & retain_mask; - unsigned int i; - - for (i = 0; i < sizeof (ppc_opts) / sizeof (ppc_opts[0]); i++) -@@ -225,8 +220,8 @@ ppc_parse_cpu (ppc_cpu_t ppc_cpu, const - { - if (ppc_opts[i].sticky) - { -- retain_flags |= ppc_opts[i].sticky; -- if ((ppc_cpu & ~retain_mask) != 0) -+ *sticky |= ppc_opts[i].sticky; -+ if ((ppc_cpu & ~*sticky) != 0) - break; - } - ppc_cpu = ppc_opts[i].cpu; -@@ -235,7 +230,7 @@ ppc_parse_cpu (ppc_cpu_t ppc_cpu, const - if (i >= sizeof (ppc_opts) / sizeof (ppc_opts[0])) - return 0; - -- ppc_cpu |= retain_flags; -+ ppc_cpu |= *sticky; - return ppc_cpu; - } - -@@ -245,12 +240,75 @@ static void - powerpc_init_dialect (struct disassemble_info *info) - { - ppc_cpu_t dialect = 0; -+ ppc_cpu_t sticky = 0; - char *arg; - struct dis_private *priv = calloc (sizeof (*priv), 1); - - if (priv == NULL) - priv = &private; - -+ switch (info->mach) -+ { -+ case bfd_mach_ppc_403: -+ case bfd_mach_ppc_403gc: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_403); -+ break; -+ case bfd_mach_ppc_405: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_403 | PPC_OPCODE_405); -+ break; -+ case bfd_mach_ppc_601: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_601); -+ break; -+ case bfd_mach_ppc_a35: -+ case bfd_mach_ppc_rs64ii: -+ case bfd_mach_ppc_rs64iii: -+ dialect = (PPC_OPCODE_POWER | PPC_OPCODE_POWER2 | PPC_OPCODE_64); -+ break; -+ case bfd_mach_ppc_e500: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_SPE -+ | PPC_OPCODE_ISEL | PPC_OPCODE_EFS | PPC_OPCODE_BRLOCK -+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI -+ | PPC_OPCODE_E500); -+ break; -+ case bfd_mach_ppc_e500mc: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_ISEL -+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI -+ | PPC_OPCODE_E500MC); -+ break; -+ case bfd_mach_ppc_e500mc64: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_ISEL -+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI -+ | PPC_OPCODE_E500MC | PPC_OPCODE_64 | PPC_OPCODE_POWER5 -+ | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7); -+ break; -+ case bfd_mach_ppc_e5500: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_ISEL -+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI -+ | PPC_OPCODE_E500MC | PPC_OPCODE_64 | PPC_OPCODE_POWER4 -+ | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 -+ | PPC_OPCODE_POWER7); -+ break; -+ case bfd_mach_ppc_e6500: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_ISEL -+ | PPC_OPCODE_PMR | PPC_OPCODE_CACHELCK | PPC_OPCODE_RFMCI -+ | PPC_OPCODE_E500MC | PPC_OPCODE_64 | PPC_OPCODE_ALTIVEC -+ | PPC_OPCODE_ALTIVEC2 | PPC_OPCODE_E6500 | PPC_OPCODE_POWER4 -+ | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7); -+ break; -+ case bfd_mach_ppc_titan: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_BOOKE | PPC_OPCODE_PMR -+ | PPC_OPCODE_RFMCI | PPC_OPCODE_TITAN); -+ break; -+ case bfd_mach_ppc_vle: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_VLE); -+ break; -+ default: -+ dialect = (PPC_OPCODE_PPC | PPC_OPCODE_ISEL | PPC_OPCODE_64 -+ | PPC_OPCODE_POWER4 | PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 -+ | PPC_OPCODE_POWER7 | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX -+ | PPC_OPCODE_ANY); -+ } -+ - arg = info->disassembler_options; - while (arg != NULL) - { -@@ -260,7 +318,7 @@ powerpc_init_dialect (struct disassemble - if (end != NULL) - *end = 0; - -- if ((new_cpu = ppc_parse_cpu (dialect, arg)) != 0) -+ if ((new_cpu = ppc_parse_cpu (dialect, &sticky, arg)) != 0) - dialect = new_cpu; - else if (strcmp (arg, "32") == 0) - dialect &= ~(ppc_cpu_t) PPC_OPCODE_64; -@@ -274,20 +332,6 @@ powerpc_init_dialect (struct disassemble - arg = end; - } - -- if ((dialect & ~(ppc_cpu_t) PPC_OPCODE_64) == 0) -- { -- if (info->mach == bfd_mach_ppc64) -- dialect |= PPC_OPCODE_64; -- else -- dialect &= ~(ppc_cpu_t) PPC_OPCODE_64; -- if (info->mach == bfd_mach_ppc_vle) -- dialect |= PPC_OPCODE_PPC | PPC_OPCODE_VLE; -- else -- /* Choose a reasonable default. */ -- dialect |= (PPC_OPCODE_PPC | PPC_OPCODE_COMMON | PPC_OPCODE_601 -- | PPC_OPCODE_ALTIVEC); -- } -- - info->private_data = priv; - POWERPC_DIALECT(info) = dialect; - } diff --git a/gdb-rhbz890900-ppc-dis-2of2.patch b/gdb-rhbz890900-ppc-dis-2of2.patch deleted file mode 100644 index 41374ec..0000000 --- a/gdb-rhbz890900-ppc-dis-2of2.patch +++ /dev/null @@ -1,60 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2012-11/msg00624.html -Subject: Re: [PATCH] Fix gdb disassemble for power6/power7 instructions - -On 11/23/2012 01:28 AM, Alan Modra wrote: -> One of the effects of updating to a power7 default is that conditional -> branch hints are displayed for "at" style hints rather than the older -> "y" hints. When using "y" hints the disassembler always showed the -> hint, eg. "bne-" or "bne+". Now you'll see "bne" most times. This -> meant updating the testsuite. I made one gas test disassemble for -> plain ppc just to ensure the older "y" hints continue to be available. -> -> Committed. - -Thanks a lot for the patch, Alan. This also fixes the issues with gdb -disassemble for power6 and power7 instructions. - -With these changes on powerpc_init_dialect(), I'd suggest to remove the info->mach -checking from gdb. Ok? - --- -Edjunior - -2012-11-23 Edjunior Machado - - * rs6000-tdep.c (gdb_print_insn_powerpc): Remove info->mach checking, - since now it is being done in binutils' powerpc_init_dialect(). - ---- - gdb/rs6000-tdep.c | 15 --------------- - 1 files changed, 0 insertions(+), 15 deletions(-) - -diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c -index 1797cc5..07b81bc 100644 ---- a/gdb/rs6000-tdep.c -+++ b/gdb/rs6000-tdep.c -@@ -3084,21 +3084,6 @@ find_variant_by_arch (enum bfd_architecture arch, unsigned long mach) - static int - gdb_print_insn_powerpc (bfd_vma memaddr, disassemble_info *info) - { -- if (!info->disassembler_options) -- { -- /* When debugging E500 binaries and disassembling code containing -- E500-specific (SPE) instructions, one sometimes sees AltiVec -- instructions instead. The opcode spaces for SPE instructions -- and AltiVec instructions overlap, and specifiying the "any" cpu -- looks for AltiVec instructions first. If we know we're -- debugging an E500 binary, however, we can specify the "e500x2" -- cpu and get much more sane disassembly output. */ -- if (info->mach == bfd_mach_ppc_e500) -- info->disassembler_options = "e500x2"; -- else -- info->disassembler_options = "any"; -- } -- - if (info->endian == BFD_ENDIAN_BIG) - return print_insn_big_powerpc (memaddr, info); - else --- -1.7.1 - diff --git a/gdb-rhel5-gcc44.patch b/gdb-rhel5-gcc44.patch index 241795a..172d067 100644 --- a/gdb-rhel5-gcc44.patch +++ b/gdb-rhel5-gcc44.patch @@ -1,10 +1,10 @@ Some functionality is available on RHEL-5.4+ only with gcc44 and gfortran44 as the default gcc and gfortran binaries are from gcc-4.1. -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/vla.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/vla.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/vla.exp 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/vla.exp 2012-07-03 17:50:57.999207540 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.base/vla.exp 2013-01-18 23:43:04.455756362 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/vla.exp 2013-01-18 23:43:08.082761164 +0100 @@ -16,7 +16,25 @@ set testfile vla set srcfile ${testfile}.c @@ -32,10 +32,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/vla.exp untested "Couldn't compile test program" return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/break-interp.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-interp.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/break-interp.exp 2012-07-03 17:44:45.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/break-interp.exp 2012-07-03 17:50:58.000207539 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.base/break-interp.exp 2013-01-18 23:43:04.456756365 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/break-interp.exp 2013-01-18 23:43:08.082761164 +0100 @@ -34,9 +34,29 @@ if [get_compiler_info] { return -1 } @@ -67,15 +67,16 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/break-interp.exp return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/common-block.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/common-block.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/common-block.exp 2012-07-03 17:36:21.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/common-block.exp 2012-07-03 17:50:58.001207537 +0200 -@@ -20,7 +20,25 @@ set testfile "common-block" - set srcfile ${testfile}.f90 - set binfile ${objdir}/${subdir}/${testfile} +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/common-block.exp 2013-01-18 23:43:08.082761164 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/common-block.exp 2013-01-18 23:44:23.047856182 +0100 +@@ -22,8 +22,25 @@ if {[skip_fortran_tests]} { --if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } { + standard_testfile .f90 + +-if {[prepare_for_testing ${testfile}.exp ${testfile} \ +- $srcfile {debug f90 quiet}]} { +# Temporarily provide f90compiler=gfortran44 saving the original value around. + +set board [target_info name] @@ -87,21 +88,21 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/common-block.exp +} +set_board_info f90compiler gfortran44 + -+set err [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] ++set err [prepare_for_testing ${testfile}.exp ${testfile} $srcfile {debug f90 quiet}] + +unset_board_info f90compiler +if [info exists old_f90compiler] { + set_board_info f90compiler $old_f90compiler +} + -+if { $err != "" } { - untested "Couldn't compile ${srcfile}" ++if {$err} { return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dwarf-stride.exp + +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/dwarf-stride.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2012-07-03 17:50:58.002207535 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2013-01-18 23:43:04.456756365 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2013-01-18 23:43:08.083761148 +0100 @@ -27,7 +27,25 @@ set testfile dwarf-stride set srcfile ${testfile}.f90 @@ -129,10 +130,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dwarf-stride.exp return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dynamic.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/dynamic.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/dynamic.exp 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dynamic.exp 2012-07-03 17:50:58.002207535 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/dynamic.exp 2013-01-18 23:43:04.457756367 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/dynamic.exp 2013-01-18 23:43:08.083761148 +0100 @@ -25,7 +25,25 @@ set testfile "dynamic" set srcfile ${testfile}.f90 set binfile ${objdir}/${subdir}/${testfile} @@ -160,10 +161,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dynamic.exp untested "Couldn't compile ${srcfile}" return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/library-module.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/library-module.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/library-module.exp 2012-06-25 22:51:35.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/library-module.exp 2012-07-03 17:52:57.666062981 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/library-module.exp 2013-01-18 23:43:04.457756367 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/library-module.exp 2013-01-18 23:43:08.083761148 +0100 @@ -23,16 +23,34 @@ if [get_compiler_info] { return -1 } @@ -203,10 +204,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/library-module.exp untested "Couldn't compile ${srcfile}" return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/module.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/module.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/module.exp 2012-06-25 22:51:35.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/module.exp 2012-07-03 17:53:56.464992086 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/module.exp 2013-01-18 23:43:04.457756367 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/module.exp 2013-01-18 23:43:08.083761148 +0100 @@ -15,7 +15,25 @@ standard_testfile .f90 @@ -234,10 +235,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/module.exp return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/string.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/string.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/string.exp 2012-07-03 17:30:07.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/string.exp 2012-07-03 17:50:58.005207532 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/string.exp 2013-01-18 23:43:04.457756367 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/string.exp 2013-01-18 23:43:08.083761148 +0100 @@ -23,7 +23,25 @@ set testfile "string" set srcfile ${testfile}.f90 set binfile ${objdir}/${subdir}/${testfile} @@ -265,10 +266,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/string.exp untested "Couldn't compile ${srcfile}" return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/omp-step.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/omp-step.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/omp-step.exp 2012-07-03 17:36:21.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/omp-step.exp 2012-07-03 17:50:58.006207531 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/omp-step.exp 2013-01-18 23:43:04.458756369 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/omp-step.exp 2013-01-18 23:43:08.083761148 +0100 @@ -15,7 +15,26 @@ set testfile "omp-step" @@ -297,10 +298,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/omp-step.exp return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/derived-type.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/derived-type.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/derived-type.exp 2012-06-25 22:51:35.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/derived-type.exp 2012-07-03 17:55:46.583858849 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/derived-type.exp 2013-01-18 23:43:04.458756369 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/derived-type.exp 2013-01-18 23:43:08.084761135 +0100 @@ -22,7 +22,25 @@ if { [skip_fortran_tests] } { return -1 standard_testfile .f90 @@ -328,10 +329,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/derived-type.exp return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/subarray.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/subarray.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/subarray.exp 2012-06-25 22:51:35.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/subarray.exp 2012-07-03 17:56:20.454818198 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.fortran/subarray.exp 2013-01-18 23:43:04.458756369 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.fortran/subarray.exp 2013-01-18 23:43:08.084761135 +0100 @@ -22,7 +22,25 @@ if { [skip_fortran_tests] } { return -1 standard_testfile .f @@ -359,10 +360,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/subarray.exp return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/tls-sepdebug.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.threads/tls-sepdebug.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2012-07-03 17:32:05.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2012-07-03 17:50:58.007207530 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2013-01-18 23:43:04.459756371 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2013-01-18 23:43:08.084761135 +0100 @@ -32,7 +32,25 @@ set binshareddebugfile ${objdir}/${subdi # FIXME: gcc dependency (-Wl,-soname). @@ -390,10 +391,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/tls-sepdebug.exp untested "Couldn't compile test library" return -1 } -Index: gdb-7.4.50.20120703/gdb/testsuite/lib/prelink-support.exp +Index: gdb-7.5.50.20130118/gdb/testsuite/lib/prelink-support.exp =================================================================== ---- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/prelink-support.exp 2012-07-03 17:44:45.000000000 +0200 -+++ gdb-7.4.50.20120703/gdb/testsuite/lib/prelink-support.exp 2012-07-03 17:50:58.008207529 +0200 +--- gdb-7.5.50.20130118.orig/gdb/testsuite/lib/prelink-support.exp 2013-01-18 23:43:04.459756371 +0100 ++++ gdb-7.5.50.20130118/gdb/testsuite/lib/prelink-support.exp 2013-01-18 23:43:08.084761135 +0100 @@ -119,9 +119,31 @@ proc file_copy {src dest} { proc build_executable_own_libs {testname executable sources options {interp ""} {dir ""}} { global objdir subdir diff --git a/gdb-upstream.patch b/gdb-upstream.patch deleted file mode 100644 index 3551247..0000000 --- a/gdb-upstream.patch +++ /dev/null @@ -1,26 +0,0 @@ -FYI: set dwz_file in dwarf2read.c -http://sourceware.org/ml/gdb-patches/2012-12/msg00354.html -http://sourceware.org/ml/gdb-cvs/2012-12/msg00058.html - -### src/gdb/ChangeLog 2012/12/11 18:45:23 1.14904 -### src/gdb/ChangeLog 2012/12/11 19:50:52 1.14905 -## -1,5 +1,9 @@ - 2012-12-11 Tom Tromey - -+ * dwarf2read.c (dwarf2_get_dwz_file): Set 'dwz_file'. -+ -+2012-12-11 Tom Tromey -+ - * dsrec.c (report_transfer_performance): Don't declare. - (load_srec): Use gettimeofday, print_transfer_performance. - * symfile.c (report_transfer_performance): Remove. ---- src/gdb/dwarf2read.c 2012/12/10 22:02:34 1.720 -+++ src/gdb/dwarf2read.c 2012/12/11 19:50:53 1.721 -@@ -2112,6 +2112,7 @@ - - do_cleanups (cleanup); - -+ dwarf2_per_objfile->dwz_file = result; - return result; - } - diff --git a/gdb.spec b/gdb.spec index 055cd7f..f414aa3 100644 --- a/gdb.spec +++ b/gdb.spec @@ -30,11 +30,11 @@ Name: %{?scl_prefix}gdb %global snap 20120817 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20120623 -Version: 7.5.1 +Version: 7.5.50.20130118 # 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: 35%{?dist} +Release: 1%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -261,7 +261,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch # Backported fixups post the source tarball. #Xdrop: Just backports. -Patch232: gdb-upstream.patch +#Patch232: gdb-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). #=fedoratest+ppc @@ -374,10 +374,6 @@ Patch329: gdb-6.8-bz254229-gcore-prpsinfo.patch #=push+work: This fix is incorrect. Patch330: gdb-6.8-bz436037-reg-no-longer-active.patch -# Make the GDB quit processing non-abortable to cleanup everything properly. -#=push: It was useful only after gdb-6.8-attach-signalled-detach-stopped.patch . -Patch331: gdb-6.8-quit-never-aborts.patch - # [RHEL5] Workaround kernel for detaching SIGSTOPped processes (BZ 809382). #=fedora Patch335: gdb-rhel5-compat.patch @@ -433,12 +429,6 @@ Patch397: gdb-follow-child-stale-parent.patch #=fedoratest: ccache is rarely used and it is even fixed now. Patch403: gdb-ccache-workaround.patch -# Implement `info common' for Fortran. -#=push -Patch404: gdb-fortran-common-reduce.patch -#=push -Patch405: gdb-fortran-common.patch - # Testcase for "Do not make up line information" fix by Daniel Jacobowitz. #=fedoratest Patch407: gdb-lineno-makeup-test.patch @@ -476,10 +466,6 @@ Patch491: gdb-gdb-add-index-script.patch #=drop+work: Inferior objects should be read in parts, then this patch gets obsoleted. Patch496: gdb-bz568248-oom-is-error.patch -# Fix gcore writer for -Wl,-z,relro (PR corefiles/11804). -#=push: There is different patch on gdb-patches, waiting now for resolution in kernel. -Patch504: gdb-bz623749-gcore-relro.patch - # Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). #=fedoratest Patch526: gdb-bz634108-solib_address.patch @@ -512,8 +498,6 @@ Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch # Fix dlopen of libpthread.so, patched glibc required (Gary Benson, BZ 669432). #=push -Patch618: gdb-dlopen-stap-probe-1of7.patch -Patch717: gdb-dlopen-stap-probe-2of7.patch Patch718: gdb-dlopen-stap-probe-3of7.patch Patch719: gdb-dlopen-stap-probe-4of7.patch Patch720: gdb-dlopen-stap-probe-5of7.patch @@ -550,7 +534,7 @@ Patch657: gdb-attach-fail-reasons-5of5configure.patch Patch661: gdb-stale-frame_info.patch # Workaround PR libc/14166 for inferior calls of strstr. -#=push+work: But push it to glibc. +#=fedora: Compatibility with RHELs (unchecked which ones). Patch690: gdb-glibc-strstr-workaround.patch # Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). @@ -562,50 +546,18 @@ Patch698: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch #=fedoratest Patch703: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -# Implement MiniDebugInfo F-18 Feature consumer (Alexander Larsson, BZ 834068). -#=fedora -Patch716: gdb-minidebuginfo.patch - -# Fix crash printing classes (BZ 849357, Tom Tromey). -Patch726: gdb-print-class.patch - -# Permit passing pointers as address number even for C++ methods (Keith Seitz). -Patch728: gdb-check-type.patch - -# entry values: Fix resolving in inlined frames. -Patch729: gdb-entryval-inlined.patch - # Fix `GDB cannot access struct member whose offset is larger than 256MB' # (RH BZ 795424). -Patch797: gdb-rhbz795424-bitpos-06of25.patch -Patch798: gdb-rhbz795424-bitpos-07of25.patch -Patch799: gdb-rhbz795424-bitpos-08of25.patch -Patch800: gdb-rhbz795424-bitpos-09of25.patch -Patch801: gdb-rhbz795424-bitpos-10of25.patch -Patch802: gdb-rhbz795424-bitpos-11of25.patch -Patch803: gdb-rhbz795424-bitpos-12of25.patch -Patch804: gdb-rhbz795424-bitpos-13of25.patch -Patch805: gdb-rhbz795424-bitpos-14of25.patch -Patch806: gdb-rhbz795424-bitpos-15of25.patch -Patch807: gdb-rhbz795424-bitpos-16of25.patch -Patch808: gdb-rhbz795424-bitpos-17of25.patch -Patch809: gdb-rhbz795424-bitpos-18of25.patch -Patch810: gdb-rhbz795424-bitpos-19of25.patch Patch811: gdb-rhbz795424-bitpos-20of25.patch Patch812: gdb-rhbz795424-bitpos-21of25.patch Patch813: gdb-rhbz795424-bitpos-22of25.patch Patch814: gdb-rhbz795424-bitpos-23of25.patch -Patch815: gdb-rhbz795424-bitpos-24of25.patch Patch816: gdb-rhbz795424-bitpos-25of25.patch Patch817: gdb-rhbz795424-bitpos-25of25-test.patch Patch818: gdb-rhbz795424-bitpos-lazyvalue.patch -# Fix DW_OP_GNU_implicit_pointer offset bug (Tom Tromey). -Patch819: gdb-implicitpointer-offset.patch - -# [ppc*] Fix PowerPC disassembly regression (Alan Modra, Edjunior Machado). -Patch820: gdb-rhbz890900-ppc-dis-1of2.patch -Patch821: gdb-rhbz890900-ppc-dis-2of2.patch +# Fix gdb.fortran/common-block.exp in PIE mode. +Patch823: gdb-commonblock-pie.patch %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: @@ -806,7 +758,7 @@ find -name "*.info*"|xargs rm -f %patch2 -p1 %patch349 -p1 -%patch232 -p1 +#patch232 -p1 %patch1 -p1 %patch3 -p1 @@ -869,7 +821,6 @@ find -name "*.info*"|xargs rm -f %patch320 -p1 %patch329 -p1 %patch330 -p1 -%patch331 -p1 %patch343 -p1 %patch348 -p1 %patch360 -p1 @@ -879,8 +830,6 @@ find -name "*.info*"|xargs rm -f %patch392 -p1 %patch397 -p1 %patch403 -p1 -%patch404 -p1 -%patch405 -p1 %patch389 -p1 %patch394 -p1 %patch407 -p1 @@ -894,14 +843,11 @@ find -name "*.info*"|xargs rm -f %patch490 -p1 %patch491 -p1 %patch496 -p1 -%patch504 -p1 %patch526 -p1 %patch542 -p1 %patch547 -p1 %patch548 -p1 %patch579 -p1 -%patch618 -p1 -%patch717 -p1 %patch718 -p1 %patch719 -p1 %patch720 -p1 @@ -919,35 +865,14 @@ find -name "*.info*"|xargs rm -f %patch690 -p1 %patch698 -p1 %patch703 -p1 -%patch716 -p1 -%patch726 -p1 -%patch728 -p1 -%patch729 -p1 -%patch797 -p1 -%patch798 -p1 -%patch799 -p1 -%patch800 -p1 -%patch801 -p1 -%patch802 -p1 -%patch803 -p1 -%patch804 -p1 -%patch805 -p1 -%patch806 -p1 -%patch807 -p1 -%patch808 -p1 -%patch809 -p1 -%patch810 -p1 %patch811 -p1 %patch812 -p1 %patch813 -p1 %patch814 -p1 -%patch815 -p1 %patch816 -p1 %patch817 -p1 %patch818 -p1 -%patch819 -p1 -%patch820 -p1 -%patch821 -p1 +%patch823 -p1 %patch393 -p1 %if 0%{!?el5:1} || 0%{?scl:1} @@ -1446,6 +1371,9 @@ fi %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %changelog +* Sat Jan 19 2013 Jan Kratochvil - 7.5.50.20130118-1.fc19 +- Rebase to FSF GDB 7.5.50.20130118 (pre-7.6 snapshot). + * Sun Jan 13 2013 Jan Kratochvil - 7.5.1-35.fc18 - [testsuite] Fix gdb-orphanripper.c lockup on F-17 (/dev/pts/* glibc chown). @@ -3014,7 +2942,7 @@ fi * Sun Oct 14 2007 Jan Kratochvil - 6.6-36 - Fix hardware watchpoints after inferior forks-off some process. -* Fri Oct 13 2007 Jan Kratochvil - 6.6-35 +* Sat Oct 13 2007 Jan Kratochvil - 6.6-35 - Fix non-threaded watchpoints CTRL-C regression on `set follow child'. * Fri Oct 12 2007 Jan Kratochvil - 6.6-34 @@ -3161,7 +3089,7 @@ fi * Mon Jan 15 2007 Jan Kratochvil - 6.5-27 - Fix the testsuite results broken in 6.5-26, stop invalid testsuite runs. -* Fri Jan 13 2007 Jan Kratochvil - 6.5-26 +* Sat Jan 13 2007 Jan Kratochvil - 6.5-26 - Fix unwinding of non-debug (.eh_frame) PPC code, Andreas Schwab (BZ 140532). - Fix unwinding of debug (.debug_frame) PPC code, workaround GCC (BZ 140532). - Fix missing testsuite .log output of testcases using get_compiler_info(). @@ -3195,16 +3123,16 @@ fi * Sat Nov 25 2006 Jan Kratochvil - 6.5-18 - Fix readline history for input mode commands like `command' (BZ 215816). -* Wed Nov 16 2006 Jan Kratochvil - 6.5-17 +* Thu Nov 16 2006 Jan Kratochvil - 6.5-17 - Bugfix testcase typo of gdb-6.5-16. -* Wed Nov 16 2006 Jan Kratochvil - 6.5-16 +* Thu Nov 16 2006 Jan Kratochvil - 6.5-16 - Provide testcase for accessing the last address space byte. -* Wed Nov 9 2006 Jan Kratochvil - 6.5-15 +* Thu Nov 9 2006 Jan Kratochvil - 6.5-15 - Fix readline segfault on excessively long hand-typed lines. -* Sat Nov 2 2006 Jan Kratochvil - 6.5-14 +* Thu Nov 2 2006 Jan Kratochvil - 6.5-14 - Fix "??" resolving of symbols from (non-prelinked) debuginfo packages. - Fix "??" resolving of symbols from overlapping functions (nanosleep(3)). - Also disable testcase "checkpoint.exp" for a possible kernel Bug 207002. @@ -3227,7 +3155,7 @@ fi - Support IPv6 for gdbserver (BZ 198365). - Temporarily disable testcase "chng-syms.exp" for a possible kernel Bug 207002. -* Wed Sep 21 2006 Jan Kratochvil - 6.5-9 +* Thu Sep 21 2006 Jan Kratochvil - 6.5-9 - Fix crash on C++ symbol failing to be demangled (BZ 206813). - Fix attach to stopped process, supersede `gdb-6.3-attach-stop-20051011.patch'. - Fix TLS symbols resolving for objects with separate .debug file (-debuginfo). @@ -3762,11 +3690,11 @@ Bugzilla 135633 - For 64-bit PPC, convert _dl_debug_state descriptor into a code address. - Fix --ignore option. -* Mon Oct 10 2004 Andrew Cagney - 1.200400607.40 +* Sun Oct 10 2004 Andrew Cagney - 1.200400607.40 - Disable attach-pie.exp test, hangs on amd64 without auxv. - Move pie tests to pie. -* Mon Oct 10 2004 Andrew Cagney - 1.200400607.39 +* Sun Oct 10 2004 Andrew Cagney - 1.200400607.39 - Fix comment bug in sigstep.exp. * Thu Oct 07 2004 Jeff Johnston - 1.200400607.38 @@ -3939,17 +3867,17 @@ Bugzilla 135633 * Tue Mar 30 2004 Elena Zannoni - 0.20040223.13 - Fix testsuite glitches. -* Thu Mar 24 2004 Elena Zannoni - 0.20040223.12 +* Wed Mar 24 2004 Elena Zannoni - 0.20040223.12 - Fix typo. -* Thu Mar 24 2004 Elena Zannoni - 0.20040223.11 +* Wed Mar 24 2004 Elena Zannoni - 0.20040223.11 - Make gdb compile w/o warnings with gcc-3.4. - Reenable PIE support code. -* Wed Mar 23 2004 Elena Zannoni - 0.20040223.10 +* Tue Mar 23 2004 Elena Zannoni - 0.20040223.10 - Bump version number -* Wed Mar 23 2004 Elena Zannoni - 0.20040223.9 +* Tue Mar 23 2004 Elena Zannoni - 0.20040223.9 - temporarily disable PIE support. - Add section to obsolete gdb64 package. @@ -4138,7 +4066,7 @@ to pointers when the address is in the ".opd" section. * Wed Aug 06 2003 Andrew Cagney - 0.20030710.10 - Sync to gdb-5.3.90-sync-20030806.patch. -* Wed Jul 29 2003 Andrew Cagney - 0.20030710.9 +* Tue Jul 29 2003 Andrew Cagney - 0.20030710.9 - add x86-64 i386 fixes * Tue Jul 29 2003 Elena Zannoni - 0.20030710.8 @@ -4525,7 +4453,7 @@ General revamp. * Fri Mar 16 2001 Trond Eivind Glomsrod - build with old headers, new compiler -* Wed Mar 16 2001 Trond Eivind Glomsrod +* Fri Mar 16 2001 Trond Eivind Glomsrod - new snapshot * Mon Feb 26 2001 Trond Eivind Glomsrod @@ -4548,7 +4476,7 @@ General revamp. * Fri Jan 19 2001 Trond Eivind Glomsrod - new snapshot -* Thu Dec 20 2000 Trond Eivind Glomsrod +* Wed Dec 20 2000 Trond Eivind Glomsrod - new snapshot * Mon Dec 04 2000 Trond Eivind Glomsrod @@ -4568,7 +4496,7 @@ General revamp. * Wed Aug 09 2000 Trond Eivind Glomsrod - added patch from GDB team for C++ symbol handling -* Mon Jul 25 2000 Trond Eivind Glomsrod +* Tue Jul 25 2000 Trond Eivind Glomsrod - upgrade to CVS snapshot - excludearch SPARC, build on IA61 @@ -4581,7 +4509,7 @@ General revamp. * Sun Jul 02 2000 Trond Eivind Glomsrod - rebuild -* Fri Jun 08 2000 Trond Eivind Glomsrod +* Thu Jun 08 2000 Trond Eivind Glomsrod - use %%configure, %%makeinstall, %%{_infodir}, %%{_mandir}, and %%{_tmppath} - the install scripts for info are broken(they don't care about @@ -4620,7 +4548,7 @@ sigtramp, sparc, xref, and threads patches. Update sparcmin patch. * Mon Aug 23 1999 Jim Kingdon - Omit readline manpage. -* Tue Aug 7 1999 Jim Kingdon +* Sat Aug 7 1999 Jim Kingdon - Remove H.J. Lu's patches (they had been commented out). - Add sigtramp patch (from gdb.cygnus.com) and threads patch (adapted from code fusion CD-ROM). diff --git a/sources b/sources index 6f2429f..10a5597 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 4981307aa9619bbec5b73261e4e41c8d gdb-libstdc++-v3-python-r155978.tar.bz2 -3f48f468b24447cf24820054ff6e85b1 gdb-7.5.1.tar.bz2 +889f62ad99a041daf5143c61a559cf2f gdb-7.5.50.20130118.tar.bz2