diff options
author | Dodji Seketeli <dodji@redhat.com> | 2011-12-20 13:36:04 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2011-12-20 14:36:04 +0100 |
commit | 9a417f117e8124d6c164f08c4c2c409a291b1622 (patch) | |
tree | dfac68fcfed7216b7f0f0d5a043e43c28cb27efa /gcc/cp | |
parent | 08b2f8e637423f97ef11f8fca86bf2cb8d5cffa6 (diff) | |
download | gcc-9a417f117e8124d6c164f08c4c2c409a291b1622.zip gcc-9a417f117e8124d6c164f08c4c2c409a291b1622.tar.gz gcc-9a417f117e8124d6c164f08c4c2c409a291b1622.tar.bz2 |
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.
From-SVN: r182532
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/decl.c | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6fbd652..0e570f8 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-20 Paolo Carlini <paolo.carlini@oracle.com> PR c++/51612 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 0a43fb8..2fc794b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -13805,8 +13805,17 @@ cxx_maybe_build_cleanup (tree decl, tsubst_flags_t complain) 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. */ |