From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24287 invoked by alias); 29 Oct 2011 07:23:06 -0000 Received: (qmail 24276 invoked by uid 22791); 29 Oct 2011 07:23:04 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ,TW_SM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 29 Oct 2011 07:22:42 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9T7MfPq008547 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 29 Oct 2011 03:22:41 -0400 Received: from host1.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9T7Mdvq009246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sat, 29 Oct 2011 03:22:41 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p9T7MdXC027340; Sat, 29 Oct 2011 09:22:39 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p9T7McmI027325; Sat, 29 Oct 2011 09:22:38 +0200 Date: Sat, 29 Oct 2011 07:42:00 -0000 From: Jan Kratochvil To: asmwarrior Cc: gdb@sourceware.org Subject: Re: Why running the next command will jump back to the previous line position Message-ID: <20111029072237.GA3977@host1.jankratochvil.net> References: <4EABA71D.600@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4EABA71D.600@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00211.txt.bz2 On Sat, 29 Oct 2011 09:11:25 +0200, asmwarrior wrote: [...] > This was quite strange, it looks like the instruction will return to some > previous position. (I guess that the destructor of the "std::map" was > called. yes, objdump -dSC shows there: std::map m; 400bab: 48 8d 45 b0 lea -0x50(%rbp),%rax 400baf: 48 89 c7 mov %rax,%rdi 400bb2: e8 43 00 00 00 callq 400bfa , std::allocator > >::~map()> 400bb7: 89 d8 mov %ebx,%eax > My question is: This behavior is quite anti-friendly, Maybe GCC could produce there DW_LNS_negate_stmt so that the variable declaration line is still shown in backtraces (if the destructor crashes) but it is skipped over during stepping/nexting; but GDB currently would not show such line in backtraces, GCC currently does not produce DW_LNS_negate_stmt anyway. Regards, Jan