- Fix crash in the charset support.

This commit is contained in:
Jan Kratochvil 2009-04-16 19:09:09 +00:00
parent 8aaf99f932
commit 5db4c14168
2 changed files with 52 additions and 1 deletions

44
gdb-charset-crash.patch Executable file
View File

@ -0,0 +1,44 @@
http://sourceware.org/ml/gdb-patches/2009-04/msg00356.html
http://sourceware.org/ml/gdb-cvs/2009-04/msg00081.html
gdb/
2009-04-15 Tom Tromey <tromey@redhat.com>
* c-lang.c (evaluate_subexp_c): Correctly handle EVAL_SKIP.
gdb/testsuite/
2009-04-15 Tom Tromey <tromey@redhat.com>
* gdb.base/charset.exp: Add regression test.
--- src/gdb/c-lang.c 2009/04/14 21:54:33 1.64
+++ src/gdb/c-lang.c 2009/04/15 21:55:04 1.65
@@ -941,7 +941,15 @@
*pos += 2;
if (noside == EVAL_SKIP)
- return NULL;
+ {
+ /* Return a dummy value of the appropriate type. */
+ if ((dest_type & C_CHAR) != 0)
+ result = allocate_value (type);
+ else
+ result = value_typed_string ("", 0, type);
+ do_cleanups (cleanup);
+ return result;
+ }
if ((dest_type & C_CHAR) != 0)
{
--- src/gdb/testsuite/gdb.base/charset.exp 2009/03/25 19:25:49 1.13
+++ src/gdb/testsuite/gdb.base/charset.exp 2009/04/15 21:55:04 1.14
@@ -604,4 +604,9 @@
test_combination u UCS-2 U UCS-4
}
+# Regression test for a cleanup bug in the charset code.
+gdb_test "print 'a' == 'a' || 'b' == 'b'" \
+ ".* = 1" \
+ "EVAL_SKIP cleanup handling regression test"
+
gdb_exit

View File

@ -13,7 +13,7 @@ Version: 6.8.50.20090302
# 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: 19%{?_with_upstream:.upstream}%{?dist}
Release: 20%{?_with_upstream:.upstream}%{?dist}
License: GPLv3+
Group: Development/Debuggers
@ -378,6 +378,9 @@ Patch352: gdb-6.8-bz457187-largefile.patch
# Fix crash on pretty-printer reading uninitialized std::string (BZ 495781).
Patch357: gdb-c_get_string-xfree.patch
# Fix crash in the charset support.
Patch359: gdb-charset-crash.patch
BuildRequires: ncurses-devel texinfo gettext flex bison expat-devel
Requires: readline
BuildRequires: readline-devel
@ -573,6 +576,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch348 -p1
%patch352 -p1
%patch357 -p1
%patch359 -p1
%patch124 -p1
find -name "*.orig" | xargs rm -f
@ -855,6 +859,9 @@ fi
%endif
%changelog
* Thu Apr 16 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8.50.20090302-20
- Fix crash in the charset support.
* Wed Apr 15 2009 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.8.50.20090302-19
- Fix crash on pretty-printer reading uninitialized std::string (BZ 495781).