From 77f735272d51a2514ad18c05125a3809841a878d Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Tue, 6 Aug 2013 16:30:24 +0200 Subject: [PATCH] Simplify BuildRequires by texlive-collection-latexrecommended (see BZ 919891). - Fix crash on 'enable count' (Simon Marchi, BZ 993118). --- gdb-enable-count-crash.patch | 86 ++++++++++++++++++++++++++++++++++++ gdb.spec | 19 +++++--- 2 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 gdb-enable-count-crash.patch diff --git a/gdb-enable-count-crash.patch b/gdb-enable-count-crash.patch new file mode 100644 index 0000000..9461ee9 --- /dev/null +++ b/gdb-enable-count-crash.patch @@ -0,0 +1,86 @@ +http://sourceware.org/ml/gdb-patches/2013-06/msg00788.html +Subject: [PATCH] "enable count" user input error handling (PR gdb/15678) + +Typing "enable count" by itself crashes GDB. Also, if you omit the +breakpoint number/range, the error message is not very clear: + +(gdb) enable count 2 +warning: bad breakpoint number at or near '' +(gdb) enable count +Segmentation fault (core dumped) + +With this patch, the error messages are slightly more helpful: + +(gdb) enable count 2 +Argument required (one or more breakpoint numbers). +(gdb) enable count +Argument required (hit count). + +They are not as helpful to the user as I would like, but it's better +than crashing. Suggestions are welcome. + +Simon + +gdb/ChangeLog: +2013-06-26 Simon Marchi + + * breakpoint.c (map_breakpoint_numbers): Check for empty args + string. + (enable_count_command): Check args for NULL value. + +gdb/testsuite/ChangeLog: +2013-06-26 Simon Marchi + + * gdb.base/ena-dis-br.exp: Test "enable count" for bad user input. +--- + gdb/breakpoint.c | 9 +++++++-- + gdb/testsuite/gdb.base/ena-dis-br.exp | 8 ++++++++ + 2 files changed, 15 insertions(+), 2 deletions(-) + +diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c +index ccd05d9..5a0c5ab 100644 +--- a/gdb/breakpoint.c ++++ b/gdb/breakpoint.c +@@ -14389,7 +14389,7 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *, + int match; + struct get_number_or_range_state state; + +- if (args == 0) ++ if (args == 0 || *args == '\0') + error_no_arg (_("one or more breakpoint numbers")); + + init_number_or_range (&state, args); +@@ -14713,7 +14713,12 @@ do_map_enable_count_breakpoint (struct breakpoint *bpt, void *countptr) + static void + enable_count_command (char *args, int from_tty) + { +- int count = get_number (&args); ++ int count; ++ ++ if (args == NULL) ++ error_no_arg (_("hit count")); ++ ++ count = get_number (&args); + + map_breakpoint_numbers (args, do_map_enable_count_breakpoint, &count); + } +diff --git a/gdb/testsuite/gdb.base/ena-dis-br.exp b/gdb/testsuite/gdb.base/ena-dis-br.exp +index b08b709..82aef64 100644 +--- a/gdb/testsuite/gdb.base/ena-dis-br.exp ++++ b/gdb/testsuite/gdb.base/ena-dis-br.exp +@@ -173,6 +173,14 @@ set bp [break_at $bp_location7 "line $bp_location7"] + + set bp2 [break_at marker1 " line ($bp_location15|$bp_location16)"] + ++gdb_test "enable count" \ ++ "Argument required \\(hit count\\)\\." \ ++ "enable count missing arguments" ++ ++gdb_test "enable count 2" \ ++ "Argument required \\(one or more breakpoint numbers\\)\\." \ ++ "enable count missing last argument" ++ + gdb_test_no_output "enable count 2 $bp" "disable break with count" + + gdb_test "continue" \ + diff --git a/gdb.spec b/gdb.spec index 5be4c2a..5a70cb3 100644 --- a/gdb.spec +++ b/gdb.spec @@ -37,7 +37,7 @@ Version: 7.6.50.%{snap} # 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: 2%{?dist} +Release: 3%{?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 @@ -520,6 +520,9 @@ Patch818: gdb-rhbz795424-bitpos-lazyvalue.patch #=fedoratest Patch832: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +# Fix crash on 'enable count' (Simon Marchi, BZ 993118). +Patch843: gdb-enable-count-crash.patch + %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: # Patch642: gdb-readline62-ask-more-rh.patch @@ -551,14 +554,13 @@ BuildRequires: python-devel%{?_isa} BuildRequires: libstdc++%{?_isa} %endif # 0%{?rhel:1} && 0%{?rhel} <= 6 %endif # 0%{!?_without_python:1} -# gdb-doc in PDF: +# gdb-doc in PDF, see: https://bugzilla.redhat.com/show_bug.cgi?id=919891#c10 BuildRequires: texinfo-tex +%if 0%{!?rhel:1} || 0%{?rhel} > 6 +BuildRequires: texlive-collection-latexrecommended +%endif # Permit rebuilding *.[0-9] files even if they are distributed in gdb-*.tar: BuildRequires: /usr/bin/pod2man -# PDF doc workaround, see: # https://bugzilla.redhat.com/show_bug.cgi?id=919891 -%if 0%{!?rhel:1} || 0%{?rhel} > 6 -BuildRequires: texlive-ec texlive-cm-super -%endif # BuildArch would break RHEL-5 by overriding arch and not building noarch. %if 0%{?el5:1} @@ -812,6 +814,7 @@ find -name "*.info*"|xargs rm -f %patch817 -p1 %patch818 -p1 %patch832 -p1 +%patch843 -p1 %patch393 -p1 %if 0%{!?el5:1} || 0%{?scl:1} @@ -1310,6 +1313,10 @@ fi %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %changelog +* Tue Aug 6 2013 Jan Kratochvil - 7.6.50.20130731-3.fc20 +- Simplify BuildRequires by texlive-collection-latexrecommended (see BZ 919891). +- Fix crash on 'enable count' (Simon Marchi, BZ 993118). + * Fri Aug 2 2013 Jan Kratochvil - 7.6.50.20130731-2.fc20 - Drop ia64 patches and .spec support.