Compare commits

...

7 Commits
master ... f10

Author SHA1 Message Date
Fedora Release Engineering a6822ca205 dist-git conversion 2010-07-28 15:15:29 +00:00
Bill Nottingham 7eb013ccc5 Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:53:58 +00:00
Jan Kratochvil 4a33efb09a - Fix crash on pending breakpoints with PIE (position-indep.-exec.) (BZ
505943).
2009-06-15 12:55:54 +00:00
Jan Kratochvil 743d2ee5f1 - Fix an occasional crash during printing of missing debuginfo rpms (BZ
505401).
2009-06-13 08:54:50 +00:00
Jan Kratochvil 329bfe12ba - Fix dereferencing unbound C arrays (BZ 505163). 2009-06-11 21:30:48 +00:00
Jan Kratochvil b6b183bc5f - Fix more the variable-length-arrays support (BZ 468266, feature BZ
377541).
- Integrate the `bt full' protection (for BZ 466901) into the VLA patch.
2008-11-09 15:22:32 +00:00
Jesse Keating 43b82a7e6e Initialize branch F-10 for gdb 2008-11-07 03:50:59 +00:00
10 changed files with 768 additions and 233 deletions

View File

View File

@ -1,21 +0,0 @@
# Makefile for source rpm: gdb
# $Id: Makefile,v 1.2 2007/05/30 14:38:39 kasal Exp $
NAME := gdb
SPECFILE = $(firstword $(wildcard *.spec))
define find-makefile-common
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
endef
MAKEFILE_COMMON := $(shell $(find-makefile-common))
ifeq ($(MAKEFILE_COMMON),)
# attempt a checkout
define checkout-makefile-common
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
endef
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
endif
include $(MAKEFILE_COMMON)

View File

@ -262,7 +262,7 @@
+ if (((b->type == bp_breakpoint) ||
+ (b->type == bp_hardware_breakpoint)) &&
+ b->enable_state == bp_enabled &&
+ !b->loc->duplicate)
+ b->loc != NULL && !b->loc->duplicate)
+ {
+ b->enable_state = bp_startup_disabled;
+ if (!silent)

View File

@ -868,7 +868,7 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.5/gdb/testsuite/gdb.pie/break.exp 2006-07-07 01:13:23.000000000 -0300
@@ -0,0 +1,973 @@
@@ -0,0 +1,977 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004
+# Free Software Foundation, Inc.
@ -1050,6 +1050,9 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp
+set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1]
+set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1]
+
+# Test a pending breakpoint in PIE executable does not crash later GDB.
+gdb_breakpoint "non_existent_function" allow-pending
+
+gdb_test "info break" \
+ "Num\[ \]+Type\[ \]+Disp Enb Address\[ \]+What.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.*
@ -1059,7 +1062,8 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location2.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_if_conditional at .*$srcfile:$bp_location3.*
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4" \
+\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4.*
+\[0-9\]+\[\t \]+breakpoint keep y.* <PENDING> *non_existent_function" \
+ "breakpoint info"
+
+# FIXME: The rest of this test doesn't work with anything that can't
@ -1485,7 +1489,7 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp
+}
+send_gdb "print marker2(99)\n"
+gdb_expect {
+ -re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2$proto. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\
+ -re "The program being debugged stopped while in a function called from GDB.\r\nEvaluation of the expression containing the function\r\n.marker2$proto. will be abandoned.\r\nWhen the function is done executing, GDB will silently stop.\r\n$gdb_prompt $"\
+ {pass "hit breakpoint on called function"}
+ -re "$gdb_prompt $"\
+ {fail "hit breakpoint on called function"}

View File

@ -786,7 +786,7 @@
if (retval != NULL && !build_id_verify (retval, build_id))
{
@@ -1314,9 +1714,424 @@ build_id_to_debug_filename (struct build
@@ -1314,9 +1714,432 @@ build_id_to_debug_filename (struct build
retval = NULL;
}
@ -1103,8 +1103,8 @@
+ const struct missing_filepair *elem2)
+{
+ return strcmp (elem1->binary, elem2->binary) == 0
+ && ((elem1->debug == NULL && elem2->debug == NULL)
+ || strcmp (elem1->debug, elem2->debug) == 0);
+ && ((elem1->debug == NULL) == (elem2->debug == NULL))
+ && (elem1->debug == NULL || strcmp (elem1->debug, elem2->debug) == 0);
+}
+
+static void
@ -1137,6 +1137,7 @@
+{
+ size_t binary_len0 = strlen (binary) + 1;
+ size_t debug_len0 = debug ? strlen (debug) + 1 : 0;
+ struct missing_filepair missing_filepair_find;
+ struct missing_filepair *missing_filepair;
+ struct missing_filepair **slot;
+
@ -1152,6 +1153,27 @@
+ missing_filepair_xcalloc, NULL);
+ }
+
+ /* Use MISSING_FILEPAIR_FIND first instead of calling obstack_alloc with
+ obstack_free in the case of a (rare) match. The problem is ALLOC_F for
+ MISSING_FILEPAIR_HASH allocates from MISSING_FILEPAIR_OBSTACK maintenance
+ structures for MISSING_FILEPAIR_HASH. Calling obstack_free would possibly
+ not to free only MISSING_FILEPAIR but also some such structures (allocated
+ during the htab_find_slot call). */
+
+ missing_filepair_find.binary = (char *) binary;
+ missing_filepair_find.debug = (char *) debug;
+ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
+ &missing_filepair_find,
+ INSERT);
+
+ /* While it may be still printed duplicitely with the missing debuginfo file
+ * it is due to once printing about the binary file build-id link and once
+ * about the .debug file build-id link as both the build-id symlinks are
+ * located in the debuginfo package. */
+
+ if (*slot != NULL)
+ return;
+
+ missing_filepair = obstack_alloc (&missing_filepair_obstack,
+ sizeof (*missing_filepair) - 1
+ + binary_len0 + debug_len0);
@ -1165,20 +1187,6 @@
+ else
+ missing_filepair->debug = NULL;
+
+ slot = (struct missing_filepair **) htab_find_slot (missing_filepair_hash,
+ missing_filepair,
+ INSERT);
+
+ /* While it may be still printed duplicitely with the missing debuginfo file
+ * it is due to once printing about the binary file build-id link and once
+ * about the .debug file build-id link as both the build-id symlinks are
+ * located in the debuginfo package. */
+
+ if (*slot != NULL)
+ {
+ obstack_free (&missing_filepair_obstack, missing_filepair);
+ return;
+ }
+ *slot = missing_filepair;
+
+ if (missing_exec == MISSING_EXEC_NOT_TRIED)

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
--- /dev/null 2008-11-06 15:02:28.406299691 +0100
+++ gdb-6.8/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp 2008-11-06 23:11:02.000000000 +0100
@@ -0,0 +1,102 @@
+# Copyright 2006 Free Software Foundation, Inc.
+# 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

View File

@ -1,93 +0,0 @@
# Never terminate `bt full' on a problem of variable resolving (BZ 466901).
--- ./gdb/f-valprint.c 2008-11-06 22:05:16.000000000 +0100
+++ ./gdb/f-valprint.c 2008-11-06 22:09:10.000000000 +0100
@@ -611,8 +611,7 @@ info_common_command (char *comname, int
while (entry != NULL)
{
printf_filtered ("%s = ", DEPRECATED_SYMBOL_NAME (entry->symbol));
- print_variable_value (entry->symbol, fi, gdb_stdout);
- printf_filtered ("\n");
+ print_variable_value_nl (entry->symbol, fi, gdb_stdout);
entry = entry->next;
}
}
--- ./gdb/printcmd.c 2008-11-06 22:05:16.000000000 +0100
+++ ./gdb/printcmd.c 2008-11-06 22:06:55.000000000 +0100
@@ -42,6 +42,7 @@
#include "block.h"
#include "disasm.h"
#include "dfp.h"
+#include "exceptions.h"
#ifdef TUI
#include "tui/tui.h" /* For tui_active et.al. */
@@ -1721,15 +1722,26 @@ disable_display_command (char *args, int
/* Print the value in stack frame FRAME of a variable specified by a
- struct symbol. */
+ struct symbol. Printed value gets terminated by a newline. */
void
-print_variable_value (struct symbol *var, struct frame_info *frame,
- struct ui_file *stream)
+print_variable_value_nl (struct symbol *var, struct frame_info *frame,
+ struct ui_file *stream)
{
- struct value *val = read_var_value (var, frame);
+ struct value *val = NULL; /* A false GCC warning. */
+ struct gdb_exception e;
- value_print (val, stream, 0, Val_pretty_default);
+ TRY_CATCH (e, RETURN_MASK_ERROR)
+ {
+ val = read_var_value (var, frame);
+ }
+ if (e.reason < 0)
+ exception_print (stream, e);
+ else
+ {
+ value_print (val, stream, 0, Val_pretty_default);
+ fprintf_filtered (stream, "\n");
+ }
}
static void
--- ./gdb/stack.c 2008-11-06 22:05:16.000000000 +0100
+++ ./gdb/stack.c 2008-11-06 22:08:45.000000000 +0100
@@ -1412,8 +1412,7 @@ print_block_frame_locals (struct block *
fputs_filtered ("\t", stream);
fputs_filtered (SYMBOL_PRINT_NAME (sym), stream);
fputs_filtered (" = ", stream);
- print_variable_value (sym, frame, stream);
- fprintf_filtered (stream, "\n");
+ print_variable_value_nl (sym, frame, stream);
break;
default:
@@ -1633,8 +1632,7 @@ print_frame_arg_vars (struct frame_info
sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym),
b, VAR_DOMAIN, NULL, NULL);
- print_variable_value (sym2, frame, stream);
- fprintf_filtered (stream, "\n");
+ print_variable_value_nl (sym2, frame, stream);
break;
default:
--- ./gdb/value.h 2008-11-06 22:05:16.000000000 +0100
+++ ./gdb/value.h 2008-11-06 22:08:07.000000000 +0100
@@ -526,9 +526,9 @@ extern int common_val_print (struct valu
extern int val_print_string (CORE_ADDR addr, int len, int width,
struct ui_file *stream);
-extern void print_variable_value (struct symbol *var,
- struct frame_info *frame,
- struct ui_file *stream);
+extern void print_variable_value_nl (struct symbol *var,
+ struct frame_info *frame,
+ struct ui_file *stream);
extern int check_field (struct value *, const char *);

View File

@ -0,0 +1,72 @@
From 30c13da4efe18f43ee34aa4b29bc86e1a53de548 Mon Sep 17 00:00:00 2001
From: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date: Thu, 11 Jun 2009 00:23:54 +0200
Subject: [PATCH] cherry-pick: Fix dereferencing unbound C arrays (RHBZ#505163).
gdb/
* gdbtypes.c (get_discrete_bounds): Remove the VLA-introduced check for
TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED and
TYPE_RANGE_LOWER_BOUND_IS_UNDEFINED.
gdb/testsuite/
* gdb.base/arrayidx.c (unbound): New variable.
* gdb.base/arrayidx.exp (p unbound.a == &unbound.a[0]): New test.
---
gdb/gdbtypes.c | 3 ---
gdb/testsuite/gdb.base/arrayidx.c | 7 +++++++
gdb/testsuite/gdb.base/arrayidx.exp | 10 +++++++++-
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 012485c..9899727 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -769,9 +769,6 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp)
switch (TYPE_CODE (type))
{
case TYPE_CODE_RANGE:
- if (TYPE_RANGE_UPPER_BOUND_IS_UNDEFINED (type)
- || TYPE_RANGE_LOWER_BOUND_IS_UNDEFINED (type))
- return -1;
*lowp = TYPE_LOW_BOUND (type);
*highp = TYPE_HIGH_BOUND (type);
return 1;
diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c
index 98d4d35..f98a656 100644
--- a/gdb/testsuite/gdb.base/arrayidx.c
+++ b/gdb/testsuite/gdb.base/arrayidx.c
@@ -17,6 +17,13 @@
int array[] = {1, 2, 3, 4};
+#ifdef __GNUC__
+struct
+ {
+ int a[0];
+ } unbound;
+#endif
+
int
main (void)
{
diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp
index 71ce4aa..af0e5f8 100644
--- a/gdb/testsuite/gdb.base/arrayidx.exp
+++ b/gdb/testsuite/gdb.base/arrayidx.exp
@@ -59,4 +59,12 @@ gdb_test "print array" \
"\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \
"Print array with array-indexes on"
-
+set test "p unbound.a == &unbound.a\[0\]"
+gdb_test_multiple $test $test {
+ -re " = 1\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" {
+ unsupported "$test (no GCC)"
+ }
+}
--
1.6.0.6

View File

@ -13,7 +13,7 @@ Version: 6.8
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 28%{?_with_upstream:.upstream}%{?dist}
Release: 32%{?_with_upstream:.upstream}%{?dist}
License: GPLv3+
Group: Development/Debuggers
@ -422,12 +422,12 @@ Patch342: gdb-6.8-ia64-breakpoint-restoration.patch
# Test the watchpoints conditionals works.
Patch343: gdb-6.8-watchpoint-conditionals-test.patch
# Never terminate `bt full' on a problem of variable resolving (for BZ 466901).
Patch347: gdb-6.8-bz466901-backtrace-never-aborts.patch
# Fix resolving of variables at locations lists in prelinked libs (BZ 466901).
Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch
# Fix dereferencing unbound C arrays (BZ 505163).
Patch372: gdb-bz505163-unbound-array-deref.patch
BuildRequires: ncurses-devel glibc-devel gcc make gzip texinfo dejagnu gettext
BuildRequires: flex bison sharutils expat-devel
Requires: readline
@ -631,8 +631,8 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch338 -p1
%patch342 -p1
%patch343 -p1
%patch347 -p1
%patch348 -p1
%patch372 -p1
%patch124 -p1
find -name "*.orig" | xargs rm -f
@ -896,6 +896,19 @@ fi
%endif
%changelog
* Mon Jun 15 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-32
- Fix crash on pending breakpoints with PIE (position-indep.-exec.) (BZ 505943).
* Sat Jun 13 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-31
- Fix an occasional crash during printing of missing debuginfo rpms (BZ 505401).
* Thu Jun 11 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-30
- Fix dereferencing unbound C arrays (BZ 505163).
* Sun Nov 9 2008 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-29
- Fix more the variable-length-arrays support (BZ 468266, feature BZ 377541).
- Integrate the `bt full' protection (for BZ 466901) into the VLA patch.
* Thu Nov 6 2008 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8-28
- Fix the "never terminate `bt full'" patch false GCC warning / build error.