From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28111 invoked by alias); 12 Apr 2011 21:22:25 -0000 Received: (qmail 28100 invoked by uid 22791); 12 Apr 2011 21:22:24 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from e24smtp05.br.ibm.com (HELO e24smtp05.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Apr 2011 21:22:20 +0000 Received: from /spool/local by e24smtp05.br.ibm.com with XMail ESMTP for from ; Tue, 12 Apr 2011 18:22:17 -0300 Received: from mailhub3.br.ibm.com ([9.18.232.110]) by e24smtp05.br.ibm.com ([10.172.0.141]) with XMail ESMTP; Tue, 12 Apr 2011 18:21:56 -0300 Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by mailhub3.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p3CLMj6i2494618 for ; Tue, 12 Apr 2011 18:22:45 -0300 Received: from d24av01.br.ibm.com (loopback [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p3CJLrZG007732 for ; Tue, 12 Apr 2011 16:21:53 -0300 Received: from [9.12.224.102] ([9.12.224.102]) by d24av01.br.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with ESMTP id p3CJLpqw007715; Tue, 12 Apr 2011 16:21:52 -0300 Message-ID: <4DA4C26C.8010304@linux.vnet.ibm.com> Date: Tue, 12 Apr 2011 21:22:00 -0000 From: Edjunior Barbosa Machado User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20110303 Lightning/1.0b1 Icedove/3.0.11 MIME-Version: 1.0 To: Jan Kratochvil CC: Yao Qi , "gdb-patches@sourceware.org" Subject: [patch] Re: "optimized out" on gdb.base/gdb1090.exp References: <4DA3A7D0.2000701@linux.vnet.ibm.com> <4DA3B701.3060902@codesourcery.com> <4DA4573D.1040101@linux.vnet.ibm.com> <20110412160220.GA18580@host1.jankratochvil.net> In-Reply-To: <20110412160220.GA18580@host1.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit x-cbid: 11041221-2362-0000-0000-00000283B9F4 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-04/txt/msg00175.txt.bz2 Thanks Jan for reviewing this. This is the updated patch with the suggested modifications. Checking out the original PR 1090 that originated this testcase, it doesn't mention any particularity regarding frame or backtrace, which leads me to believe that changing where 'print' is called should not affect the main focus of the testcase. Thanks, -- Edjunior 2011-04-12 Edjunior Machado * testsuite/gdb.base/gdb1090.exp: change breakpoint location to read the content of 's24' correctly (avoiding "optimized out"). * testsuite/gdb.base/gdb1090.c: add comment in order to set breakpoint. diff --git a/gdb/testsuite/gdb.base/gdb1090.c b/gdb/testsuite/gdb.base/gdb1090.c index 22f2cec..8933952 100644 --- a/gdb/testsuite/gdb.base/gdb1090.c +++ b/gdb/testsuite/gdb.base/gdb1090.c @@ -36,7 +36,7 @@ void foo () register struct s_2_by_4 s24; s24.field_0 = 1170; s24.field_1 = 64701; - marker (s24); + marker (s24); /* break-here */ return; } diff --git a/gdb/testsuite/gdb.base/gdb1090.exp b/gdb/testsuite/gdb.base/gdb1090.exp index a15fd04..ab568ab 100644 --- a/gdb/testsuite/gdb.base/gdb1090.exp +++ b/gdb/testsuite/gdb.base/gdb1090.exp @@ -40,11 +40,13 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -if ![runto marker] then { - perror "couldn't run to breakpoint" - continue -} -gdb_test "up" ".*foo.*" "up from marker" +if ![runto_main] then { + fail "Can't run to main" + return 1 +} + +gdb_breakpoint [gdb_get_line_number "break-here"] +gdb_continue_to_breakpoint "break-here" ".* break-here .*" gdb_test_multiple "print s24" "print s24" { -re "\\\$\[0-9\]* = \\{field_0 = 1170, field_1 = 64701\\}\r\n$gdb_prompt $" {