From e51789606e7bc99bfd8ac5714774904c874e3387 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pawe=C5=82=20Sikora?= Date: Thu, 2 Jun 2011 09:22:03 +0000 Subject: [PATCH] - update some patches from gdb-7.2-51.fc14 (this fixes at least artifical arrays printing). - release 3 (there're more new patches in fc .src.rpm but... -enotime). Changed files: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -> 1.4 gdb-6.6-buildid-locate-rpm.patch -> 1.6 gdb-6.8-attach-signalled-detach-stopped.patch -> 1.4 gdb-6.8-bz254229-gcore-prpsinfo.patch -> 1.4 gdb-bz541866-rwatch-before-run.patch -> 1.2 gdb-gdbindex-bigendian.patch -> 1.2 gdb-upstream.patch -> 1.2 gdb.spec -> 1.136 --- ...337-resolve-tls-without-debuginfo-v2.patch | 149 +++----- gdb-6.6-buildid-locate-rpm.patch | 92 +++-- gdb-6.8-attach-signalled-detach-stopped.patch | 29 ++ gdb-6.8-bz254229-gcore-prpsinfo.patch | 5 +- gdb-bz541866-rwatch-before-run.patch | 41 +++ gdb-gdbindex-bigendian.patch | 6 +- gdb-upstream.patch | 346 ++++++++++++++++++ gdb.spec | 2 +- 8 files changed, 524 insertions(+), 146 deletions(-) diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index 94c0072..9943e60 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -19,6 +19,8 @@ will get: Attached suggestion patch how to deal with the most common "errno" symbol for the most common under-ggdb3 compiled programs. +Original patch hooked into target_translate_tls_address. But its inferior +call invalidates `struct frame *' in the callers - RH BZ 690908. 2007-11-03 Jan Kratochvil @@ -30,114 +32,55 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location -Index: gdb-7.0.50.20100128/gdb/gdbtypes.c +Index: gdb-7.2/gdb/printcmd.c =================================================================== ---- gdb-7.0.50.20100128.orig/gdb/gdbtypes.c 2010-01-28 12:52:17.000000000 +0100 -+++ gdb-7.0.50.20100128/gdb/gdbtypes.c 2010-01-28 12:52:48.000000000 +0100 -@@ -3978,6 +3978,9 @@ gdbtypes_post_init (struct gdbarch *gdba - = arch_type (gdbarch, TYPE_CODE_INTERNAL_FUNCTION, 0, - ""); +--- gdb-7.2.orig/gdb/printcmd.c 2011-03-29 10:55:32.000000000 +0200 ++++ gdb-7.2/gdb/printcmd.c 2011-03-29 10:56:00.000000000 +0200 +@@ -947,10 +947,10 @@ validate_format (struct format_data fmt, + static void + print_command_1 (char *exp, int inspect, int voidprint) + { +- struct expression *expr; + struct cleanup *old_chain = 0; + char format = 0; +- struct value *val; ++ /* False GCC warning due to the TRY_CATCH. */ ++ struct value *val = NULL; + struct format_data fmt; + int cleanup = 0; -+ builtin_type->nodebug_text_symbol_errno_location -+ = lookup_function_type (lookup_pointer_type (builtin_type->builtin_int)); -+ - return builtin_type; - } - -Index: gdb-7.0.50.20100128/gdb/gdbtypes.h -=================================================================== ---- gdb-7.0.50.20100128.orig/gdb/gdbtypes.h 2010-01-28 12:52:17.000000000 +0100 -+++ gdb-7.0.50.20100128/gdb/gdbtypes.h 2010-01-28 12:52:48.000000000 +0100 -@@ -1245,6 +1245,8 @@ struct builtin_type - - /* This type is used to represent a GDB internal function. */ - struct type *internal_fn; -+ -+ struct type *nodebug_text_symbol_errno_location; - }; - - /* Return the type table for the specified architecture. */ -Index: gdb-7.0.50.20100128/gdb/parse.c -=================================================================== ---- gdb-7.0.50.20100128.orig/gdb/parse.c 2010-01-28 12:52:19.000000000 +0100 -+++ gdb-7.0.50.20100128/gdb/parse.c 2010-01-28 12:53:20.000000000 +0100 -@@ -509,7 +509,11 @@ write_exp_msymbol (struct minimal_symbol - case mst_text: - case mst_file_text: - case mst_solib_trampoline: -- write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol); -+ if (builtin_type (gdbarch)->nodebug_text_symbol_errno_location != NULL -+ && strcmp (SYMBOL_LINKAGE_NAME (msymbol), "__errno_location") == 0) -+ write_exp_elt_type (builtin_type (gdbarch)->nodebug_text_symbol_errno_location); -+ else -+ write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol); - break; - - case mst_text_gnu_ifunc: -Index: gdb-7.0.50.20100128/gdb/target.c -=================================================================== ---- gdb-7.0.50.20100128.orig/gdb/target.c 2010-01-28 12:52:29.000000000 +0100 -+++ gdb-7.0.50.20100128/gdb/target.c 2010-01-28 12:52:48.000000000 +0100 -@@ -1000,6 +1000,25 @@ pop_all_targets (int quitting) - pop_all_targets_above (dummy_stratum, quitting); - } +@@ -971,10 +971,25 @@ print_command_1 (char *exp, int inspect, -+static int -+resolve_errno (void *arg) -+{ -+ CORE_ADDR *arg_addr = arg; -+ struct expression *expr; -+ struct cleanup *old_chain = 0; -+ struct value *val; -+ -+ expr = parse_expression ("__errno_location()"); -+ old_chain = make_cleanup (free_current_contents, &expr); -+ val = evaluate_expression (expr); -+ *arg_addr = value_as_address (val); -+ release_value (val); -+ value_free (val); -+ do_cleanups (old_chain); -+ -+ return 1; -+} -+ - /* Using the objfile specified in OBJFILE, find the address for the - current thread's thread-local storage with offset OFFSET. */ - CORE_ADDR -@@ -1090,7 +1109,28 @@ target_translate_tls_address (struct obj - /* It wouldn't be wrong here to try a gdbarch method, too; finding - TLS is an ABI-specific thing. But we don't do that yet. */ - else -- error (_("Cannot find thread-local variables on this target")); -+ { -+ struct minimal_symbol *msymbol; -+ -+ msymbol = lookup_minimal_symbol ("errno", NULL, NULL); -+ if (msymbol != NULL -+ && SYMBOL_VALUE_ADDRESS (msymbol) == offset -+ && (SYMBOL_OBJ_SECTION (msymbol)->objfile == objfile -+ || (objfile->separate_debug_objfile != NULL -+ && SYMBOL_OBJ_SECTION (msymbol)->objfile -+ == objfile->separate_debug_objfile) -+ || (objfile->separate_debug_objfile_backlink != NULL -+ && SYMBOL_OBJ_SECTION (msymbol)->objfile -+ == objfile->separate_debug_objfile_backlink))) + if (exp && *exp) + { ++ struct expression *expr; ++ volatile struct gdb_exception except; ++ + expr = parse_expression (exp); +- old_chain = make_cleanup (free_current_contents, &expr); ++ old_chain = make_cleanup (xfree, expr); + cleanup = 1; +- val = evaluate_expression (expr); ++ TRY_CATCH (except, RETURN_MASK_ERROR) + { -+ if (!catch_errors (resolve_errno, (void *) &addr, "", -+ RETURN_MASK_ALL)) -+ error (_("TLS symbol `errno' not resolved for non-TLS program." -+ " You should compile the program with `gcc -pthread'.")); ++ val = evaluate_expression (expr); + } -+ else -+ error (_("Cannot find thread-local variables on this target")); -+ } - - return addr; - } -Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c ++ if (except.reason < 0) ++ { ++ if (strcmp (exp, "errno") != 0) ++ throw_exception (except); ++ ++ expr = parse_expression ("*((int *(*) (void)) __errno_location) ()"); ++ make_cleanup (xfree, expr); ++ val = evaluate_expression (expr); ++ } + } + else + val = access_value_history (0); +Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2010-01-28 12:52:48.000000000 +0100 ++++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2011-03-29 10:55:35.000000000 +0200 @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -167,10 +110,10 @@ Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c + + return 0; /* breakpoint */ +} -Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp +Index: gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2010-01-28 12:52:48.000000000 +0100 ++++ gdb-7.2/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2011-03-29 10:55:35.000000000 +0200 @@ -0,0 +1,60 @@ +# Copyright 2007 Free Software Foundation, Inc. + diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index fc820d5..30832c6 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,7 +1,7 @@ -Index: gdb-7.1.90.20100806/gdb/event-top.c +Index: gdb-7.2/gdb/event-top.c =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/event-top.c 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/event-top.c 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/event-top.c 2010-06-26 08:44:47.000000000 +0200 ++++ gdb-7.2/gdb/event-top.c 2010-10-06 22:39:32.000000000 +0200 @@ -33,6 +33,7 @@ #include "cli/cli-script.h" /* for reset_command_nest_depth */ #include "main.h" @@ -28,10 +28,10 @@ Index: gdb-7.1.90.20100806/gdb/event-top.c /* Each interpreter has its own rules on displaying the command prompt. */ if (!current_interp_display_prompt_p ()) -Index: gdb-7.1.90.20100806/gdb/elfread.c +Index: gdb-7.2/gdb/elfread.c =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/elfread.c 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/elfread.c 2010-08-06 18:11:49.000000000 +0200 +--- gdb-7.2.orig/gdb/elfread.c 2010-10-06 22:39:32.000000000 +0200 ++++ gdb-7.2/gdb/elfread.c 2010-10-06 22:39:52.000000000 +0200 @@ -42,6 +42,7 @@ #include "gdbcore.h" #include "gdbcmd.h" @@ -40,7 +40,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c extern void _initialize_elfread (void); -@@ -1371,8 +1372,357 @@ build_id_to_filename (struct build_id *b +@@ -1371,8 +1372,361 @@ build_id_to_filename (struct build_id *b return retval; } @@ -114,6 +114,10 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c +#endif /* !DLOPEN_LIBRPM */ + + gdb_assert (filename != NULL); ++ ++ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0) ++ return 0; ++ + if (filename[0] != '/') + { + warning (_("Ignoring non-absolute filename: <%s>"), filename); @@ -399,7 +403,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c avoidance. */ struct missing_filepair -@@ -1426,11 +1776,17 @@ missing_filepair_change (void) +@@ -1426,11 +1780,17 @@ missing_filepair_change (void) /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -417,7 +421,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c missing_filepair_change (); } -@@ -1497,14 +1853,35 @@ debug_print_missing (const char *binary, +@@ -1497,14 +1857,35 @@ debug_print_missing (const char *binary, *slot = missing_filepair; @@ -460,22 +464,23 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c } static char * -Index: gdb-7.1.90.20100806/gdb/symfile.h +Index: gdb-7.2/gdb/symfile.h =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/symfile.h 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/symfile.h 2010-08-06 17:42:05.000000000 +0200 -@@ -577,6 +577,7 @@ extern struct build_id *build_id_addr_ge +--- gdb-7.2.orig/gdb/symfile.h 2010-10-06 22:39:32.000000000 +0200 ++++ gdb-7.2/gdb/symfile.h 2010-10-06 22:39:52.000000000 +0200 +@@ -577,6 +577,8 @@ extern struct build_id *build_id_addr_ge extern char *build_id_to_filename (struct build_id *build_id, char **link_return, int add_debug_suffix); extern void debug_print_missing (const char *binary, const char *debug); +extern void debug_flush_missing (void); ++#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file") /* From dwarf2read.c */ -Index: gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp +Index: gdb-7.2/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/testsuite/lib/gdb.exp 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/testsuite/lib/gdb.exp 2010-10-06 22:39:32.000000000 +0200 ++++ gdb-7.2/gdb/testsuite/lib/gdb.exp 2010-10-06 22:39:32.000000000 +0200 @@ -1359,7 +1359,7 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } @@ -485,10 +490,10 @@ Index: gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp send_gdb "set build-id-verbose 0\n" gdb_expect 10 { -re "$gdb_prompt $" { -Index: gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.2/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/testsuite/lib/mi-support.exp 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/testsuite/lib/mi-support.exp 2010-10-06 22:39:32.000000000 +0200 ++++ gdb-7.2/gdb/testsuite/lib/mi-support.exp 2010-10-06 22:39:32.000000000 +0200 @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } { } } @@ -498,10 +503,10 @@ Index: gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp send_gdb "190-gdb-set build-id-verbose 0\n" gdb_expect 10 { -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { -Index: gdb-7.1.90.20100806/gdb/tui/tui-interp.c +Index: gdb-7.2/gdb/tui/tui-interp.c =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/tui/tui-interp.c 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/tui/tui-interp.c 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/tui/tui-interp.c 2010-05-18 00:21:43.000000000 +0200 ++++ gdb-7.2/gdb/tui/tui-interp.c 2010-10-06 22:39:32.000000000 +0200 @@ -30,6 +30,7 @@ #include "tui/tui.h" #include "tui/tui-io.h" @@ -519,10 +524,10 @@ Index: gdb-7.1.90.20100806/gdb/tui/tui-interp.c /* Tell readline what the prompt to display is and what function it will need to call after a whole line is read. This also displays the first prompt. */ -Index: gdb-7.1.90.20100806/gdb/aclocal.m4 +Index: gdb-7.2/gdb/aclocal.m4 =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/aclocal.m4 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/aclocal.m4 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/aclocal.m4 2010-05-23 02:56:59.000000000 +0200 ++++ gdb-7.2/gdb/aclocal.m4 2010-10-06 22:39:32.000000000 +0200 @@ -19,6 +19,162 @@ You have another version of autoconf. I If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) @@ -686,10 +691,10 @@ Index: gdb-7.1.90.20100806/gdb/aclocal.m4 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation -Index: gdb-7.1.90.20100806/gdb/config.in +Index: gdb-7.2/gdb/config.in =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/config.in 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/config.in 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/config.in 2010-10-06 22:39:31.000000000 +0200 ++++ gdb-7.2/gdb/config.in 2010-10-06 22:39:32.000000000 +0200 @@ -46,6 +46,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -710,10 +715,10 @@ Index: gdb-7.1.90.20100806/gdb/config.in /* Define if libunwind library is being used. */ #undef HAVE_LIBUNWIND -Index: gdb-7.1.90.20100806/gdb/configure +Index: gdb-7.2/gdb/configure =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/configure 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/configure 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/configure 2010-10-06 22:39:31.000000000 +0200 ++++ gdb-7.2/gdb/configure 2010-10-06 22:39:32.000000000 +0200 @@ -679,6 +679,9 @@ REPORT_BUGS_TO PKGVERSION TARGET_OBS @@ -1247,10 +1252,10 @@ Index: gdb-7.1.90.20100806/gdb/configure -Index: gdb-7.1.90.20100806/gdb/configure.ac +Index: gdb-7.2/gdb/configure.ac =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/configure.ac 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/configure.ac 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/configure.ac 2010-10-06 22:39:31.000000000 +0200 ++++ gdb-7.2/gdb/configure.ac 2010-10-06 22:39:32.000000000 +0200 @@ -152,6 +152,198 @@ else fi AC_SUBST(pythondir) @@ -1450,10 +1455,10 @@ Index: gdb-7.1.90.20100806/gdb/configure.ac AC_CONFIG_SUBDIRS(doc testsuite) -Index: gdb-7.1.90.20100806/gdb/acinclude.m4 +Index: gdb-7.2/gdb/acinclude.m4 =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/acinclude.m4 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/acinclude.m4 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.orig/gdb/acinclude.m4 2010-05-27 05:40:45.000000000 +0200 ++++ gdb-7.2/gdb/acinclude.m4 2010-10-06 22:39:32.000000000 +0200 @@ -1,3 +1,5 @@ +# serial 1 + @@ -1469,3 +1474,16 @@ Index: gdb-7.1.90.20100806/gdb/acinclude.m4 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @ovindex CC +Index: gdb-7.2/gdb/corelow.c +=================================================================== +--- gdb-7.2.orig/gdb/corelow.c 2010-10-06 22:39:39.000000000 +0200 ++++ gdb-7.2/gdb/corelow.c 2010-10-06 22:39:52.000000000 +0200 +@@ -331,7 +331,7 @@ build_id_locate_exec (int from_tty) + symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; + } + else +- debug_print_missing (_("the main executable file"), build_id_filename); ++ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename); + + do_cleanups (back_to); + diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch index a518122..a18af1e 100644 --- a/gdb-6.8-attach-signalled-detach-stopped.patch +++ b/gdb-6.8-attach-signalled-detach-stopped.patch @@ -79,6 +79,35 @@ Index: gdb-7.0.50.20100115/gdb/linux-nat.c } /* Convert a native/host siginfo object, into/from the siginfo in the +Index: gdb-7.0.50.20100115/gdb/linux-nat.c +=================================================================== +--- gdb-7.0.50.20100115.orig/gdb/linux-nat.c 2010-01-15 22:19:27.000000000 +0100 ++++ gdb-7.0.50.20100115/gdb/linux-nat.c 2010-01-15 22:19:55.000000000 +0100 +@@ -1768,8 +1768,22 @@ GPT: lwp %s had signal %s, but it is in + target_signal_to_string (signo)); + } + +- if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped) +- *status = W_STOPCODE (SIGSTOP); ++ /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that ++ many TIDs are left unstopped). See RH Bug 496732. */ ++ if (GET_PID (lp->ptid) == pid_was_stopped) ++ { ++ int err; ++ ++ errno = 0; ++ err = kill_lwp (GET_LWP (lp->ptid), SIGSTOP); ++ if (debug_linux_nat) ++ { ++ fprintf_unfiltered (gdb_stdlog, ++ "SC: lwp kill %d %s\n", ++ err, ++ errno ? safe_strerror (errno) : "ERRNO-OK"); ++ } ++ } + + return 0; + } Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.threads/attach-stopped.exp =================================================================== --- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2010-01-01 08:32:06.000000000 +0100 diff --git a/gdb-6.8-bz254229-gcore-prpsinfo.patch b/gdb-6.8-bz254229-gcore-prpsinfo.patch index 87fd255..216a95d 100644 --- a/gdb-6.8-bz254229-gcore-prpsinfo.patch +++ b/gdb-6.8-bz254229-gcore-prpsinfo.patch @@ -2,11 +2,12 @@ Index: gdb-7.1.90.20100711/bfd/elf-bfd.h =================================================================== --- gdb-7.1.90.20100711.orig/bfd/elf-bfd.h 2010-06-27 06:07:51.000000000 +0200 +++ gdb-7.1.90.20100711/bfd/elf-bfd.h 2010-07-12 23:00:04.000000000 +0200 -@@ -2171,8 +2171,9 @@ extern Elf_Internal_Phdr * _bfd_elf_find +@@ -2171,8 +2171,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); -+#include ++struct elf_prpsinfo; ++typedef struct elf_prpsinfo prpsinfo_t; extern char *elfcore_write_prpsinfo - (bfd *, char *, int *, const char *, const char *); + (bfd *, char *, int *, const prpsinfo_t *); diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index f485b2f..0fcaa79 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -11,6 +11,47 @@ Index: gdb-7.1.90.20100711/gdb/config/i386/linux64.mh NAT_CDEPS = $(srcdir)/proc-service.list # The dynamically loaded libthread_db needs access to symbols in the +--- gdb-7.2/gdb/config/i386/linux.mh-orig 2010-06-11 14:08:51.000000000 +0200 ++++ gdb-7.2/gdb/config/i386/linux.mh 2011-03-18 12:00:32.000000000 +0100 +@@ -1,6 +1,6 @@ + # Host: Intel 386 running GNU/Linux. + +-NAT_FILE= config/nm-linux.h ++NAT_FILE= nm-linux.h + NATDEPFILES= inf-ptrace.o fork-child.o \ + i386-nat.o i386-linux-nat.o \ + proc-service.o linux-thread-db.o \ +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.1.90.20100711/gdb/config/i386/nm-linux.h 2010-07-13 19:02:28.000000000 +0200 +@@ -0,0 +1,28 @@ ++/* Native support for GNU/Linux i386. ++ ++ 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 . */ ++ ++#ifndef NM_LINUX_H ++#define NM_LINUX_H ++ ++#include "config/nm-linux.h" ++ ++/* Red Hat backward compatibility with gdb-6.8. */ ++#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 ++ ++#endif /* NM_LINUX64_H */ Index: gdb-7.1.90.20100711/gdb/config/i386/nm-linux64.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/gdb-gdbindex-bigendian.patch b/gdb-gdbindex-bigendian.patch index b03632f..edd4f4f 100644 --- a/gdb-gdbindex-bigendian.patch +++ b/gdb-gdbindex-bigendian.patch @@ -15,7 +15,7 @@ http://sourceware.org/ml/gdb-cvs/2010-09/msg00155.html * valops.c (find_oload_champ_namespace_loop): replace incorrect --- src/gdb/dwarf2read.c 2010/09/22 19:22:44 1.460 +++ src/gdb/dwarf2read.c 2010/09/24 16:11:46 1.461 -@@ -2248,10 +2248,12 @@ dw2_expand_symtabs_matching (struct objf +@@ -2382,10 +2382,12 @@ { int i; offset_type iter; @@ -26,8 +26,8 @@ http://sourceware.org/ml/gdb-cvs/2010-09/msg00155.html return; + index = dwarf2_per_objfile->index_table; - for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) - { + for (i = 0; i < (dwarf2_per_objfile->n_comp_units + + dwarf2_per_objfile->n_type_comp_units); ++i) @@ -2411,28 +2413,24 @@ } } diff --git a/gdb-upstream.patch b/gdb-upstream.patch index ad3d10c..934f528 100644 --- a/gdb-upstream.patch +++ b/gdb-upstream.patch @@ -465,3 +465,349 @@ http://sourceware.org/ml/gdb-cvs/2010-09/msg00080.html +gdb_test_no_output "python a = gdb.execute('help', to_string=True)" "collect help from uiout" + +gdb_test "python print a" ".*aliases -- Aliases of other commands.*" "verify help to uiout" + + + +http://sourceware.org/ml/gdb-cvs/2011-02/msg00063.html + +### src/gdb/ChangeLog 2011/02/12 13:07:38 1.12557 +### src/gdb/ChangeLog 2011/02/13 09:09:33 1.12558 +## -1,3 +1,9 @@ ++2011-02-13 Jan Kratochvil ++ ++ * symtab.c (find_pc_sect_line): New variable objfile, initialize it ++ from S. Iterate S using ALL_OBJFILE_SYMTABS. Verify BV for each S. ++ * symtab.h (struct symtab) : Comment extension. ++ + 2011-02-12 Yao Qi + + * Makefile.in (CLEANDIRS): Remove duplicated common dir. +--- src/gdb/symtab.c 2011/01/11 21:53:24 1.257 ++++ src/gdb/symtab.c 2011/02/13 09:09:36 1.258 +@@ -1904,6 +1904,7 @@ + struct blockvector *bv; + struct minimal_symbol *msymbol; + struct minimal_symbol *mfunsym; ++ struct objfile *objfile; + + /* Info on best line seen so far, and where it starts, and its file. */ + +@@ -2031,13 +2032,17 @@ + } + + bv = BLOCKVECTOR (s); ++ objfile = s->objfile; + + /* Look at all the symtabs that share this blockvector. + They all have the same apriori range, that we found was right; + but they have different line tables. */ + +- for (; s && BLOCKVECTOR (s) == bv; s = s->next) ++ ALL_OBJFILE_SYMTABS (objfile, s) + { ++ if (BLOCKVECTOR (s) != bv) ++ continue; ++ + /* Find the best line in this symtab. */ + l = LINETABLE (s); + if (!l) +--- src/gdb/symtab.h 2011/01/11 21:53:25 1.168 ++++ src/gdb/symtab.h 2011/02/13 09:09:36 1.169 +@@ -738,8 +738,7 @@ + + struct symtab + { +- +- /* Chain of all existing symtabs. */ ++ /* Unordered chain of all existing symtabs of this objfile. */ + + struct symtab *next; + + + + +http://sourceware.org/ml/gdb-cvs/2011-02/msg00064.html + +### src/gdb/ChangeLog 2011/02/13 09:09:33 1.12558 +### src/gdb/ChangeLog 2011/02/13 09:15:50 1.12559 +## -1,5 +1,12 @@ + 2011-02-13 Jan Kratochvil + ++ Fix const/volatile qualifiers of C++ types, PR c++/12328. ++ * c-typeprint.c (c_type_print_args): Update the function comment. New ++ variable param_type, initialize it. Remove const/volatile qualifiers ++ for language_cplus and !show_artificial. Use param_type. ++ ++2011-02-13 Jan Kratochvil ++ + * symtab.c (find_pc_sect_line): New variable objfile, initialize it + from S. Iterate S using ALL_OBJFILE_SYMTABS. Verify BV for each S. + * symtab.h (struct symtab) : Comment extension. +--- src/gdb/c-typeprint.c 2011/01/07 19:36:15 1.68 ++++ src/gdb/c-typeprint.c 2011/02/13 09:15:53 1.69 +@@ -371,9 +371,12 @@ c_type_print_modifier (struct type *type + /* Print out the arguments of TYPE, which should have TYPE_CODE_METHOD + or TYPE_CODE_FUNC, to STREAM. Artificial arguments, such as "this" + in non-static methods, are displayed if SHOW_ARTIFICIAL is +- non-zero. LANGUAGE is the language in which TYPE was defined. This is +- a necessary evil since this code is used by the C, C++, and Java +- backends. */ ++ non-zero. If SHOW_ARTIFICIAL is zero and LANGUAGE is language_cplus ++ the topmost parameter types get removed their possible const and volatile ++ qualifiers to match demangled linkage name parameters part of such function ++ type. LANGUAGE is the language in which TYPE was defined. This is ++ a necessary evil since this code is used by the C, C++, and Java backends. ++ */ + + void + c_type_print_args (struct type *type, struct ui_file *stream, +@@ -406,6 +409,8 @@ + + for (i = 0; i < TYPE_NFIELDS (type); i++) + { ++ struct type *param_type; ++ + if (TYPE_FIELD_ARTIFICIAL (type, i) && !show_artificial) + continue; + +@@ -398,10 +403,24 @@ c_type_print_args (struct type *type, st + wrap_here (" "); + } + ++ param_type = TYPE_FIELD_TYPE (type, i); ++ ++ if (language == language_cplus && !show_artificial) ++ { ++ /* C++ standard, 13.1 Overloadable declarations, point 3, item: ++ - Parameter declarations that differ only in the presence or ++ absence of const and/or volatile are equivalent. ++ ++ And the const/volatile qualifiers are not present in the mangled ++ names as produced by GCC. */ ++ ++ param_type = make_cv_type (0, 0, param_type, NULL); ++ } ++ + if (language == language_java) +- java_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0); ++ java_print_type (param_type, "", stream, -1, 0); + else +- c_print_type (TYPE_FIELD_TYPE (type, i), "", stream, -1, 0); ++ c_print_type (param_type, "", stream, -1, 0); + printed_any = 1; + } + +### src/gdb/testsuite/ChangeLog 2011/02/08 13:30:08 1.2576 +### src/gdb/testsuite/ChangeLog 2011/02/13 09:15:53 1.2577 +## -1,3 +1,9 @@ ++2011-02-13 Jan Kratochvil ++ ++ Fix const/volatile qualifiers of C++ types, PR c++/12328. ++ * gdb.cp/overload-const.exp: New file. ++ * gdb.cp/overload-const.cc: New file. ++ + 2011-02-08 Ulrich Weigand + + * gdb.opencl/callfuncs.cl: New file. +--- src/gdb/testsuite/gdb.cp/overload-const.cc ++++ src/gdb/testsuite/gdb.cp/overload-const.cc 2011-02-13 09:24:14.258748000 +0000 +@@ -0,0 +1,28 @@ ++/* This test case is part of GDB, the GNU debugger. ++ ++ Copyright 2011 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 . */ ++ ++class myclass ++{ ++public: ++ static void func(const int aa) {} ++}; ++ ++int ++main () ++{ ++ myclass::func (42); ++} +--- src/gdb/testsuite/gdb.cp/overload-const.exp ++++ src/gdb/testsuite/gdb.cp/overload-const.exp 2011-02-13 09:24:14.561175000 +0000 +@@ -0,0 +1,29 @@ ++# Copyright 2011 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 part of the gdb testsuite. ++ ++if {[skip_cplus_tests]} { continue } ++ ++set testfile "overload-const" ++if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] { ++ return -1 ++} ++ ++gdb_test_no_output "set language c++" ++ ++if [gdb_breakpoint "myclass::func"] { ++ pass "setting breakpoint at myclass::func" ++} + + + +https://bugzilla.redhat.com/show_bug.cgi?id=678454 +http://sourceware.org/ml/gdb-cvs/2011-02/msg00133.html + +### src/gdb/ChangeLog 2011/02/18 16:43:50 1.12607 +### src/gdb/ChangeLog 2011/02/18 19:10:44 1.12608 +## -1,3 +1,10 @@ ++2011-02-18 Jan Kratochvil ++ Tom Tromey ++ ++ * cp-support.c (make_symbol_overload_list_namespace): Do not call ++ make_symbol_overload_list_block with NULL BLOCK. ++ * valarith.c (unop_user_defined_p): Resolve also TYPE_CODE_TYPEDEF. ++ + 2011-02-18 Pedro Alves + + * breakpoint.c (get_number_trailer): No longer accept a NULL PP. +--- src/gdb/cp-support.c 2011/01/05 22:22:47 1.47 ++++ src/gdb/cp-support.c 2011/02/18 19:10:46 1.48 +@@ -778,11 +778,13 @@ + + /* Look in the static block. */ + block = block_static_block (get_selected_block (0)); +- make_symbol_overload_list_block (name, block); ++ if (block) ++ make_symbol_overload_list_block (name, block); + + /* Look in the global block. */ + block = block_global_block (block); +- make_symbol_overload_list_block (name, block); ++ if (block) ++ make_symbol_overload_list_block (name, block); + + } + +--- src/gdb/valarith.c 2011/02/14 11:30:37 1.98 ++++ src/gdb/valarith.c 2011/02/18 19:10:46 1.99 +@@ -315,15 +315,9 @@ + if (op == UNOP_ADDR) + return 0; + type1 = check_typedef (value_type (arg1)); +- for (;;) +- { +- if (TYPE_CODE (type1) == TYPE_CODE_STRUCT) +- return 1; +- else if (TYPE_CODE (type1) == TYPE_CODE_REF) +- type1 = TYPE_TARGET_TYPE (type1); +- else +- return 0; +- } ++ if (TYPE_CODE (type1) == TYPE_CODE_REF) ++ type1 = check_typedef (TYPE_TARGET_TYPE (type1)); ++ return TYPE_CODE (type1) == TYPE_CODE_STRUCT; + } + + /* Try to find an operator named OPERATOR which takes NARGS arguments +### src/gdb/testsuite/ChangeLog 2011/02/17 22:08:12 1.2594 +### src/gdb/testsuite/ChangeLog 2011/02/18 19:10:46 1.2595 +## -1,3 +1,8 @@ ++2011-02-18 Jan Kratochvil ++ ++ * gdb.cp/typedef-operator.exp: New file. ++ * gdb.cp/typedef-operator.cc: New file. ++ + 2011-02-17 Michael Snyder + + * gdb.threads/thread-find.exp: Fix regular expressions. +--- src/gdb/testsuite/gdb.cp/typedef-operator.cc ++++ src/gdb/testsuite/gdb.cp/typedef-operator.cc 2011-02-21 17:18:30.419734000 +0000 +@@ -0,0 +1,31 @@ ++/* This test case is part of GDB, the GNU debugger. ++ ++ Copyright 2011 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 . */ ++ ++class C ++{ ++public: ++ int operator* () { return 42; } ++}; ++typedef C D; ++ ++D u; ++D &v = u; ++ ++int main () ++{ ++ return *v; ++} +--- src/gdb/testsuite/gdb.cp/typedef-operator.exp ++++ src/gdb/testsuite/gdb.cp/typedef-operator.exp 2011-02-21 17:18:30.916753000 +0000 +@@ -0,0 +1,33 @@ ++# Copyright 2011 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 part of the gdb testsuite. ++ ++if {[skip_cplus_tests]} { continue } ++ ++set testfile "typedef-operator" ++if [prepare_for_testing $testfile $testfile $testfile.cc {c++ debug}] { ++ return -1 ++} ++ ++gdb_test_no_output "set language c++" ++ ++gdb_test "p *u" {You can't do that without a process to debug.} "test crash" ++ ++if ![runto_main] { ++ return -1 ++} ++ ++gdb_test "p *v" " = 42" "test typedef" diff --git a/gdb.spec b/gdb.spec index 5e7fe64..b07bdb7 100644 --- a/gdb.spec +++ b/gdb.spec @@ -20,7 +20,7 @@ Summary(zh_CN.UTF-8): [开发]C和其他语言的调试器 Summary(zh_TW.UTF-8): [.-A開發]C和.$)B其.-A他語.$)B言的調試器 Name: gdb Version: 7.2 -Release: 2 +Release: 3 License: GPL v3+ Group: Development/Debuggers Source0: http://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.bz2 -- 2.44.0