- Support also the $allocate' and
$delete' ctor/dtor variants (BZ
301701). - Fix the build compatibility with texinfo >= 4.10. - Fix the testcase for pending signals (from BZ 233852).
This commit is contained in:
parent
41705867ad
commit
add1a2d48d
@ -1,6 +1,11 @@
|
||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=193763
|
||||
|
||||
[base]
|
||||
|
||||
2007-09-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
Updated for the longer `$allocate' marker.
|
||||
|
||||
Index: gdb-6.5/gdb/linespec.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linespec.c 2006-08-24 02:57:04.000000000 -0300
|
||||
@ -10,7 +15,7 @@ Index: gdb-6.5/gdb/linespec.c
|
||||
the function signature. */
|
||||
completion_name = xmalloc (strlen (class_name) +
|
||||
- strlen (member_name) + 9);
|
||||
+ strlen (member_name) + strlen("'::$base(") + 1);
|
||||
+ strlen (member_name) + strlen("'::$allocate(") + 1);
|
||||
completion_name[0] = '\'';
|
||||
strcpy (completion_name+1, class_name);
|
||||
/* FIXME: make this the language class separator. */
|
||||
|
@ -21,6 +21,14 @@
|
||||
* tui/tui-win.c (make_visible_with_new_height): Ditto.
|
||||
* tui/tui-winsource.c (tui_update_source_windows_with_addr): Ditto.
|
||||
|
||||
2007-09-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* symtab.c (find_line_pc): Support also the `$allocate' and `$delete'
|
||||
variants. Support searching for the `$base' name even if the bare name
|
||||
was found first.
|
||||
* breakpoint.c (breakpoint_sals_to_pc): Support more than two returned
|
||||
PC values.
|
||||
|
||||
Index: gdb-6.5/gdb/mi/mi-cmd-disas.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/mi/mi-cmd-disas.c 2006-07-11 01:30:43.000000000 -0300
|
||||
@ -259,55 +267,78 @@ Index: gdb-6.5/gdb/symtab.c
|
||||
if (symtab == 0)
|
||||
return 0;
|
||||
|
||||
@@ -2336,7 +2357,50 @@ find_line_pc (struct symtab *symtab, int
|
||||
@@ -2336,7 +2357,73 @@ find_line_pc (struct symtab *symtab, int
|
||||
if (symtab != NULL)
|
||||
{
|
||||
l = LINETABLE (symtab);
|
||||
- *pc = l->item[ind].pc;
|
||||
+ main_pc = l->item[ind].pc;
|
||||
+ *pc_array = xmalloc (sizeof (CORE_ADDR) * 3);
|
||||
+ *num_elements = 0;
|
||||
+ (*pc_array)[(*num_elements)++] = main_pc;
|
||||
+ minsym = lookup_minimal_symbol_by_pc (main_pc);
|
||||
+ if (minsym != NULL && minsym->ginfo.language == language_cplus)
|
||||
+ {
|
||||
+ char *base_name =
|
||||
+ minsym->ginfo.language_specific.cplus_specific.demangled_name;
|
||||
+ char *tmp_ptr = strstr (base_name, "$base(");
|
||||
+ if (tmp_ptr != NULL)
|
||||
+ {
|
||||
+ char *regular_name = (char *)xmalloc (strlen (base_name));
|
||||
+ memcpy (regular_name, base_name, tmp_ptr - base_name);
|
||||
+ strcpy (regular_name + (tmp_ptr - base_name),
|
||||
+ tmp_ptr + sizeof ("$base") - 1);
|
||||
+ minsym2 = lookup_minimal_symbol (regular_name, NULL, NULL);
|
||||
+ xfree (regular_name);
|
||||
+ if (minsym2 != NULL)
|
||||
+ {
|
||||
+ /* We have recognized we have a ctor or dtor and have
|
||||
+ located our line in the not-in-charge version. We
|
||||
+ also have located the in-charge version's minsym.
|
||||
+ From this, we can find the index for the first line
|
||||
+ line in the in-charge ctor/dtor and then search forward
|
||||
+ for the specified line, thereby finding the 2nd match. */
|
||||
+ int exact;
|
||||
+ int ind = find_line_by_pc (l, minsym2->ginfo.value.address,
|
||||
+ &exact);
|
||||
+ if (ind >= 0)
|
||||
+ {
|
||||
+ char *src = minsym->ginfo.language_specific.cplus_specific.demangled_name;
|
||||
+ char *src_point = strchr (src, '(');
|
||||
+ char *s, *point;
|
||||
+ /* Keep "" last as the trimming part always matches it. */
|
||||
+ const char *variants[] = {"$base","$allocate","$delete",""};
|
||||
+ int i;
|
||||
+
|
||||
+ if (src_point != NULL)
|
||||
+ {
|
||||
+ char *dst = xmalloc (strlen (src) + strlen ("$allocate") + 1);
|
||||
+ char *dst_point = dst + (src_point - src);
|
||||
+
|
||||
+ memcpy (dst, src, src_point - src);
|
||||
+
|
||||
+ /* Trim out any variant markers there first. */
|
||||
+ for (i = 0; i < ARRAY_SIZE (variants); i++)
|
||||
+ {
|
||||
+ size_t len = strlen (variants[i]);
|
||||
+
|
||||
+ if (dst_point - dst >= len
|
||||
+ && memcmp (dst_point - len, variants[i], len) == 0)
|
||||
+ {
|
||||
+ ind = find_line_common (l, line, ind, &exact);
|
||||
+ dst_point -= len;
|
||||
+ /* In fact it should not be needed here. */
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* And now try to append all of them. */
|
||||
+ for (i = 0; i < ARRAY_SIZE (variants); i++)
|
||||
+ {
|
||||
+ size_t len = strlen (variants[i]);
|
||||
+ struct minimal_symbol *minsym2;
|
||||
+
|
||||
+ memcpy (dst_point, variants[i], len);
|
||||
+ strcpy (dst_point + len, src_point);
|
||||
+
|
||||
+ minsym2 = lookup_minimal_symbol (dst, NULL, NULL);
|
||||
+ if (minsym2 != NULL)
|
||||
+ {
|
||||
+ /* We have recognized we have a ctor or dtor and have
|
||||
+ located our line in the not-in-charge version. We
|
||||
+ also have located the in-charge version's minsym.
|
||||
+ From this, we can find the index for the first line
|
||||
+ line in the in-charge ctor/dtor and then search forward
|
||||
+ for the specified line, thereby finding the 2nd match. */
|
||||
+ int exact;
|
||||
+ int ind = find_line_by_pc (l, minsym2->ginfo.value.address,
|
||||
+ &exact);
|
||||
+ if (ind >= 0)
|
||||
+ {
|
||||
+ *pc_array = xmalloc (2 * sizeof (CORE_ADDR));
|
||||
+ (*pc_array)[0] = main_pc;
|
||||
+ (*pc_array)[1] = l->item[ind].pc;
|
||||
+ *num_elements = 2;
|
||||
+ return 1;
|
||||
+ {
|
||||
+ ind = find_line_common (l, line, ind, &exact);
|
||||
+ if (ind >= 0 && l->item[ind].pc != main_pc)
|
||||
+ (*pc_array)[(*num_elements)++] = l->item[ind].pc;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ *pc_array = xmalloc (sizeof (CORE_ADDR));
|
||||
+ (*pc_array)[0] = main_pc;
|
||||
+ *num_elements = 1;
|
||||
+ }
|
||||
+ xfree (dst);
|
||||
+ }
|
||||
+ }
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
@ -441,7 +472,7 @@ Index: gdb-6.5/gdb/breakpoint.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/breakpoint.c 2006-07-11 01:30:53.000000000 -0300
|
||||
+++ gdb-6.5/gdb/breakpoint.c 2006-07-11 01:39:20.000000000 -0300
|
||||
@@ -5268,10 +5268,40 @@ static void
|
||||
@@ -5268,10 +5268,44 @@ static void
|
||||
breakpoint_sals_to_pc (struct symtabs_and_lines *sals,
|
||||
char *address)
|
||||
{
|
||||
@ -469,8 +500,12 @@ Index: gdb-6.5/gdb/breakpoint.c
|
||||
+ * sizeof (struct symtab_and_line));
|
||||
+ memcpy (new_sals, sals->sals, (i + 1)
|
||||
+ * sizeof (struct symtab_and_line));
|
||||
+ memcpy (&(new_sals[i + 1]), &sals->sals[i],
|
||||
+ sizeof (struct symtab_and_line));
|
||||
+ /* The one returned SALS entry is copied for all the PCs. */
|
||||
+ for (j = 1; j < num_pc_values; ++j)
|
||||
+ {
|
||||
+ memcpy (&(new_sals[i + j]), &sals->sals[i],
|
||||
+ sizeof (struct symtab_and_line));
|
||||
+ }
|
||||
+ xfree (sals->sals);
|
||||
+ sals->sals = new_sals;
|
||||
+ sals->nelts += num_pc_values - 1;
|
||||
|
@ -1,3 +1,10 @@
|
||||
[base]
|
||||
|
||||
2007-09-21 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* linespec.c (add_minsym_members): Support also the `$allocate' and
|
||||
`$delete' variants.
|
||||
|
||||
Index: gdb-6.5/gdb/linespec.c
|
||||
===================================================================
|
||||
--- gdb-6.5.orig/gdb/linespec.c 2006-01-10 20:14:43.000000000 -0200
|
||||
@ -68,7 +75,7 @@ Index: gdb-6.5/gdb/linespec.c
|
||||
else if (strncmp (class_name, name, name_len) == 0
|
||||
&& (class_name[name_len] == '\0'
|
||||
|| class_name[name_len] == '<'))
|
||||
@@ -261,21 +274,83 @@ find_methods (struct type *t, char *name
|
||||
@@ -261,21 +274,101 @@ find_methods (struct type *t, char *name
|
||||
|
||||
if (i1 == 0)
|
||||
for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++)
|
||||
@ -131,6 +138,24 @@ Index: gdb-6.5/gdb/linespec.c
|
||||
+ ++counter;
|
||||
+ }
|
||||
+ xfree (list);
|
||||
+
|
||||
+ /* Target also the allocating/deleting variants. */
|
||||
+ if (member_name[0] == '~')
|
||||
+ strcpy (completion_name + comp_len - 1, "$delete(");
|
||||
+ else
|
||||
+ strcpy (completion_name + comp_len - 1, "$allocate(");
|
||||
+ list = make_symbol_completion_list (completion_name,
|
||||
+ completion_name+1);
|
||||
+
|
||||
+ /* Again we have a list. Add their minimal symbols to the array. */
|
||||
+ i = 0;
|
||||
+ while (list && list[i] != NULL)
|
||||
+ {
|
||||
+ msym_arr[counter] = lookup_minimal_symbol (list[i++], NULL, NULL);
|
||||
+ ++counter;
|
||||
+ }
|
||||
+ xfree (list);
|
||||
+
|
||||
+ xfree (completion_name);
|
||||
+
|
||||
+ return counter;
|
||||
|
@ -5,9 +5,14 @@ Index: gdb/testsuite/ChangeLog
|
||||
* gdb.cp/constructortest.cc: Ditto.
|
||||
* gdb.cp/templates.exp: Change break of dtor to be fully quoted.
|
||||
|
||||
2007-09-22 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||
|
||||
* gdb.cp/constructortest.exp, gdb.cp/constructortest.cc: Test also the
|
||||
`$delete' destructor variant.
|
||||
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc.fix Fri Jan 21 17:06:56 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.cc Fri Jan 21 17:05:18 2005
|
||||
@@ -0,0 +1,64 @@
|
||||
@@ -0,0 +1,99 @@
|
||||
+/* This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+ Copyright 2005 Free Software Foundation, Inc.
|
||||
@ -45,12 +50,33 @@ Index: gdb/testsuite/ChangeLog
|
||||
+ int y;
|
||||
+};
|
||||
+
|
||||
+/* C and D are for the $delete destructor. */
|
||||
+
|
||||
+class C
|
||||
+{
|
||||
+ public:
|
||||
+ C();
|
||||
+ virtual ~C();
|
||||
+ private:
|
||||
+ int x;
|
||||
+};
|
||||
+
|
||||
+class D: public C
|
||||
+{
|
||||
+ public:
|
||||
+ D();
|
||||
+ private:
|
||||
+ int y;
|
||||
+};
|
||||
+
|
||||
+int main(int argc, char *argv[])
|
||||
+{
|
||||
+ A* a = new A;
|
||||
+ B* b = new B;
|
||||
+ D* d = new D;
|
||||
+ delete a;
|
||||
+ delete b;
|
||||
+ delete d;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
@ -72,12 +98,26 @@ Index: gdb/testsuite/ChangeLog
|
||||
+ k = 5;
|
||||
+}
|
||||
+
|
||||
+C::C() /* Constructor C */
|
||||
+{
|
||||
+ x = 1; /* First line C */
|
||||
+}
|
||||
+
|
||||
+C::~C() /* Destructor C */
|
||||
+{
|
||||
+ x = 3; /* First line ~C */
|
||||
+}
|
||||
+
|
||||
+D::D()
|
||||
+{
|
||||
+ y = 2; /* First line D */
|
||||
+}
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp.fix Fri Jan 21 17:07:02 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/constructortest.exp Fri Jan 21 17:05:29 2005
|
||||
@@ -0,0 +1,98 @@
|
||||
@@ -0,0 +1,135 @@
|
||||
+# This testcase is part of GDB, the GNU debugger.
|
||||
+
|
||||
+# Copyright 2005 Free Software Foundation, Inc.
|
||||
+# Copyright 2005, 2007 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
|
||||
@ -173,6 +213,43 @@ Index: gdb/testsuite/ChangeLog
|
||||
+gdb_continue_to_breakpoint "Second line ~A"
|
||||
+gdb_test "bt" "#0.*A.*#1.*B.*#2.*main.*" "Verify in not-in-charge A::~A second line"
|
||||
+
|
||||
+
|
||||
+# Test now the $delete destructors.
|
||||
+
|
||||
+# FIXME: Without the full GDB restart we would hit a GDB memory corruption.
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+runto_main
|
||||
+
|
||||
+# Break on the various forms of the C::~C destructor
|
||||
+set test "breaking on C::~C"
|
||||
+gdb_test_multiple "break C\:\:~C" $test {
|
||||
+ -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*.2. C::~C\\(\\) at .*\[\r\n\]*.3. C::~C\\\$base\\(\\) at .*\[\r\n\]*4. C::~C\\\$delete\\(\\) at .*\[\r\n\]*> $" {
|
||||
+ gdb_test "1" \
|
||||
+ ".*Multiple breakpoints were set.*" \
|
||||
+ "break on multiple constructors"
|
||||
+ }
|
||||
+ -re "0. cancel.*\[\r\n\]*.1. all.*\[\r\n\]*> $" {
|
||||
+ fail $test
|
||||
+ }
|
||||
+}
|
||||
+gdb_continue_to_breakpoint "First line ~C"
|
||||
+
|
||||
+# Verify that we can break by line number in a destructor and find
|
||||
+# the $delete occurence
|
||||
+
|
||||
+# FIXME: Without the full GDB restart we would hit a GDB memory corruption.
|
||||
+gdb_exit
|
||||
+gdb_start
|
||||
+gdb_reinitialize_dir $srcdir/$subdir
|
||||
+gdb_load ${binfile}
|
||||
+runto_main
|
||||
+
|
||||
+set first_line_dtor [gdb_get_line_number "First line ~C"]
|
||||
+gdb_test "break $first_line_dtor" ".*$first_line_dtor.*$first_line_dtor.*Multiple breakpoints were set.*" "break by line in destructor"
|
||||
+gdb_continue_to_breakpoint "First line ~C"
|
||||
--- gdb-6.3/gdb/testsuite/gdb.cp/templates.exp.fix Fri Jan 21 17:07:10 2005
|
||||
+++ gdb-6.3/gdb/testsuite/gdb.cp/templates.exp Fri Jan 21 17:09:09 2005
|
||||
@@ -1,4 +1,4 @@
|
||||
|
@ -448,7 +448,7 @@
|
||||
+}
|
||||
--- /dev/null 1 Jan 1970 00:00:00 -0000
|
||||
+++ ./gdb/testsuite/gdb.threads/attach-into-signal.exp 29 Jun 2007 22:06:06 -0000
|
||||
@@ -0,0 +1,176 @@
|
||||
@@ -0,0 +1,179 @@
|
||||
+# Copyright 2007
|
||||
+
|
||||
+# This program is free software; you can redistribute it and/or modify
|
||||
@ -519,7 +519,10 @@
|
||||
+
|
||||
+ set stoppedtry 0
|
||||
+ while { $stoppedtry < 10 } {
|
||||
+ set fileid [open /proc/${testpid}/status r];
|
||||
+ if [catch {open /proc/${testpid}/status r} fileid] {
|
||||
+ set stoppedtry 10
|
||||
+ break
|
||||
+ }
|
||||
+ gets $fileid line1;
|
||||
+ gets $fileid line2;
|
||||
+ close $fileid;
|
||||
|
@ -1133,3 +1133,33 @@ http://sourceware.org/ml/binutils/2007-08/msg00296.html
|
||||
#define GNU_ABI_TAG_LINUX 0
|
||||
#define GNU_ABI_TAG_HURD 1
|
||||
#define GNU_ABI_TAG_SOLARIS 2
|
||||
|
||||
|
||||
|
||||
2007-09-15 Alan Modra <amodra@bigpond.net.au>
|
||||
|
||||
* configure.ac: Correct makeinfo version check.
|
||||
* configure: Regenerate.
|
||||
|
||||
#--- ./configure.ac 14 Sep 2007 14:51:36 -0000 1.25
|
||||
#+++ ./configure.ac 14 Sep 2007 15:47:01 -0000 1.26
|
||||
#@@ -2462,7 +2462,7 @@ changequote(,)
|
||||
# # For an installed makeinfo, we require it to be from texinfo 4.4 or
|
||||
# # higher, else we use the "missing" dummy.
|
||||
# if ${MAKEINFO} --version \
|
||||
#- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
|
||||
#+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
|
||||
# :
|
||||
# else
|
||||
# MAKEINFO="$MISSING makeinfo"
|
||||
--- ./configure 14 Sep 2007 14:51:36 -0000 1.277
|
||||
+++ ./configure 14 Sep 2007 15:47:01 -0000 1.278
|
||||
@@ -6192,7 +6192,7 @@ case " $build_configdirs " in
|
||||
# For an installed makeinfo, we require it to be from texinfo 4.4 or
|
||||
# higher, else we use the "missing" dummy.
|
||||
if ${MAKEINFO} --version \
|
||||
- | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then
|
||||
+ | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then
|
||||
:
|
||||
else
|
||||
MAKEINFO="$MISSING makeinfo"
|
||||
|
7
gdb.spec
7
gdb.spec
@ -11,7 +11,7 @@ Name: gdb
|
||||
Version: 6.6
|
||||
|
||||
# The release always contains a leading reserved number, start it at 1.
|
||||
Release: 27%{?dist}
|
||||
Release: 28%{?dist}
|
||||
|
||||
License: GPL
|
||||
Group: Development/Debuggers
|
||||
@ -683,6 +683,11 @@ fi
|
||||
# don't include the files in include, they are part of binutils
|
||||
|
||||
%changelog
|
||||
* Sat Sep 22 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-28
|
||||
- Support also the `$allocate' and `$delete' ctor/dtor variants (BZ 301701).
|
||||
- Fix the build compatibility with texinfo >= 4.10.
|
||||
- Fix the testcase for pending signals (from BZ 233852).
|
||||
|
||||
* Sun Sep 16 2007 Jan Kratochvil <jan.kratochvil@redhat.com> - 6.6-27
|
||||
- Fix attaching to stopped processes and/or pending signals.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user