aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDodji Seketeli <dodji@redhat.com>2012-01-02 17:08:45 +0000
committerDodji Seketeli <dodji@redhat.com>2012-01-02 17:08:45 +0000
commite6fe0da748766144d44998b2a4dcf591cc745121 (patch)
tree0d557e229f6898e2c54468a1a70b788eeba9da2c
parent16ecb5c6981523052baa55f771cae81a8dbd5bae (diff)
PR debug/49951 - jumpy stepping at end of scope in C++
gcc/cp/ PR debug/49951 * decl.c (cxx_maybe_build_cleanup): Don't set location of the call to the destructor. gcc/testsuite/ PR debug/49951 * g++.dg/gcov/gcov-2.C: Adjust. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/gcc-4_6-branch@182807 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/gcov/gcov-2.C2
4 files changed, 21 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 24d2b924a93..9bb03662552 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/49951
+ * decl.c (cxx_maybe_build_cleanup): Don't set location of the call
+ to the destructor.
+
2011-12-16 Jason Merrill <jason@redhat.com>
PR c++/51416
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index fdf3ca155ed..a2e52613fce 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -13363,8 +13363,17 @@ cxx_maybe_build_cleanup (tree decl)
cleanup = call;
}
+ /* build_delete sets the location of the destructor call to the
+ current location, even though the destructor is going to be
+ called later, at the end of the current scope. This can lead to
+ a "jumpy" behaviour for users of debuggers when they step around
+ the end of the block. So let's unset the location of the
+ destructor call instead. */
+ if (cleanup != NULL && EXPR_P (cleanup))
+ SET_EXPR_LOCATION (cleanup, UNKNOWN_LOCATION);
return cleanup;
}
+
/* When a stmt has been parsed, this function is called. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 2ce065e8003..d2b3eb91a55 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2011-12-20 Dodji Seketeli <dodji@redhat.com>
+
+ PR debug/49951
+ * g++.dg/gcov/gcov-2.C: Adjust.
+
2012-01-01 Thomas König <tkoenig@gcc.gnu.org>
Backport from trunk
diff --git a/gcc/testsuite/g++.dg/gcov/gcov-2.C b/gcc/testsuite/g++.dg/gcov/gcov-2.C
index 6d002f5d2cd..66d8af39bce 100644
--- a/gcc/testsuite/g++.dg/gcov/gcov-2.C
+++ b/gcc/testsuite/g++.dg/gcov/gcov-2.C
@@ -20,7 +20,7 @@ private:
void foo()
{
- C c; /* count(2) */
+ C c; /* count(1) */
c.seti (1); /* count(1) */
}