Remove some code duplication in py-objfile.c, py-progspace.c.
[binutils-gdb.git] / gdb / dwarf2-frame-tailcall.c
index f284d98dd2126e468600eee229469d11cff041ff..7580c02c634134b64e213a0799e26a0623eafa4b 100644 (file)
@@ -1,6 +1,6 @@
 /* Virtual tail call frames unwinder for GDB.
 
-   Copyright (C) 2010-2012 Free Software Foundation, Inc.
+   Copyright (C) 2010-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_assert.h"
 #include "frame.h"
 #include "dwarf2-frame-tailcall.h"
 #include "dwarf2loc.h"
 #include "frame-unwind.h"
 #include "block.h"
 #include "hashtab.h"
-#include "exceptions.h"
 #include "gdbtypes.h"
 #include "regcache.h"
 #include "value.h"
@@ -374,7 +372,9 @@ dwarf2_tailcall_sniffer_first (struct frame_info *this_frame,
 
   gdb_assert (*tailcall_cachep == NULL);
 
-  this_pc = get_frame_pc (this_frame);
+  /* PC may be after the function if THIS_FRAME calls noreturn function,
+     get_frame_address_in_block will decrease it by 1 in such case.  */
+  this_pc = get_frame_address_in_block (this_frame);
 
   /* Catch any unwinding errors.  */
   TRY_CATCH (except, RETURN_MASK_ERROR)