From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10245 invoked by alias); 25 Jun 2010 15:36:58 -0000 Received: (qmail 10224 invoked by uid 22791); 25 Jun 2010 15:36:55 -0000 X-SWARE-Spam-Status: No, hits=-5.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,TW_JF,TW_JS,T_RP_MATCHES_RCVD 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; Fri, 25 Jun 2010 15:36:50 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5PFanLL016828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 25 Jun 2010 11:36:49 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5PFakXT019170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 25 Jun 2010 11:36:48 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o5PFakkO010997; Fri, 25 Jun 2010 17:36:46 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o5PFak6F010996; Fri, 25 Jun 2010 17:36:46 +0200 Date: Fri, 25 Jun 2010 15:36:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org, Phil Muldoon Subject: Re: [patch 2/2] testsuite: dw2-ref-missing-frame for PR python/11407 Message-ID: <20100625153646.GB10875@host0.dyn.jankratochvil.net> References: <20100623203039.GB15544@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-06/txt/msg00578.txt.bz2 On Thu, 24 Jun 2010 20:12:01 +0200, Tom Tromey wrote: > >>>>> "Jan" == Jan Kratochvil writes: > > Jan> 2010-06-23 Jan Kratochvil > Jan> * gdb.dwarf2/dw2-ref-missing-frame-func.c: New file. > Jan> * gdb.dwarf2/dw2-ref-missing-frame.S: Use cu_text_start and cu_text_end. > Jan> Split main into func_nofb and func_loopfb dropping NO_FRAME_BASE. > Jan> * gdb.dwarf2/dw2-ref-missing-frame.exp: Remove variables sources, > Jan> executable_nofb and executable_fb. New variables srcsfile, objsfile, > Jan> srcfuncfile, objfuncfile, srcmainfile, objmainfile, executable and > Jan> binfile. Call gdb_compile with clean_restart twice. > Jan> (func_nofb print, func_nofb backtrace, func_loopfb print) > Jan> (func_loopfb backtrace): New. Use KFAIL python/11407. > > This is ok. Checked-in without the KFAILs now after the fix has been checked in: http://sourceware.org/ml/gdb-cvs/2010-06/msg00169.html Thanks, Jan http://sourceware.org/ml/gdb-cvs/2010-06/msg00171.html --- src/gdb/testsuite/ChangeLog 2010/06/25 15:32:48 1.2350 +++ src/gdb/testsuite/ChangeLog 2010/06/25 15:34:45 1.2351 @@ -1,5 +1,18 @@ 2010-06-25 Jan Kratochvil + Test PR python/11407. + * gdb.dwarf2/dw2-ref-missing-frame-func.c: New file. + * gdb.dwarf2/dw2-ref-missing-frame.S: Use cu_text_start and cu_text_end. + Split main into func_nofb and func_loopfb dropping NO_FRAME_BASE. + * gdb.dwarf2/dw2-ref-missing-frame.exp: Remove variables sources, + executable_nofb and executable_fb. New variables srcsfile, objsfile, + srcfuncfile, objfuncfile, srcmainfile, objmainfile, executable and + binfile. Call gdb_compile with clean_restart twice. + (func_nofb print, func_nofb backtrace, func_loopfb print) + (func_loopfb backtrace): New. + +2010-06-25 Jan Kratochvil + * gdb.dwarf2/dw2-ref-missing-frame-main.c: New. * gdb.dwarf2/dw2-ref-missing-frame.S: Replace compiler generated output by a hand made one. --- src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c +++ src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-func.c 2010-06-25 15:35:32.782106000 +0000 @@ -0,0 +1,46 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2010 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +asm (".globl cu_text_start"); +asm ("cu_text_start:"); + +asm (".globl func_nofb_start"); +asm ("func_nofb_start:"); + +void +func_nofb (void) +{ + /* int func_nofb_var; */ +} + +asm (".globl func_nofb_end"); +asm ("func_nofb_end:"); + +asm (".globl func_loopfb_start"); +asm ("func_loopfb_start:"); + +void +func_loopfb (void) +{ + /* int func_loopfb_var; */ +} + +asm (".globl func_loopfb_end"); +asm ("func_loopfb_end:"); + +asm (".globl cu_text_end"); +asm ("cu_text_end:"); --- src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-main.c 2010/06/25 15:32:49 1.1 +++ src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame-main.c 2010/06/25 15:34:46 1.2 @@ -15,16 +15,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -asm (".globl main_start"); -asm ("main_start:"); +extern void func_nofb (void); +extern void func_loopfb (void); int main (void) { - /* int main_var; */ + int main_var = 1; + + func_nofb (); + func_loopfb (); return 0; } - -asm (".globl main_end"); -asm ("main_end:"); --- src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S 2010/06/25 15:32:49 1.2 +++ src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.S 2010/06/25 15:34:46 1.3 @@ -28,8 +28,8 @@ /* CU die */ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ - .4byte main_end /* DW_AT_high_pc */ - .4byte main_start /* DW_AT_low_pc */ + .4byte cu_text_end /* DW_AT_high_pc */ + .4byte cu_text_start /* DW_AT_low_pc */ .ascii "file1.txt\0" /* DW_AT_name */ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ .byte 1 /* DW_AT_language (C) */ @@ -40,20 +40,33 @@ .byte 4 /* DW_AT_byte_size */ .byte 5 /* DW_AT_encoding */ - /* func */ - .uleb128 6 /* Abbrev: DW_TAG_subprogram */ - .ascii "main\0" /* DW_AT_name */ - .4byte main_start /* DW_AT_low_pc */ - .4byte main_end /* DW_AT_high_pc */ -#ifndef NO_FRAME_BASE + /* func_nofb */ + .uleb128 5 /* Abbrev: DW_TAG_subprogram (no fb) */ + .ascii "func_nofb\0" /* DW_AT_name */ + .4byte func_nofb_start /* DW_AT_low_pc */ + .4byte func_nofb_end /* DW_AT_high_pc */ + + .uleb128 7 /* Abbrev: DW_TAG_variable (location) */ + .ascii "func_nofb_var\0" /* DW_AT_name */ + .byte 2f - 1f /* DW_AT_location */ +1: .byte 0x91 /* DW_OP_fbreg */ + .sleb128 0 /* 0 */ +2: .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */ + + .byte 0 /* End of children of func */ + + /* func_loopfb */ + .uleb128 6 /* Abbrev: DW_TAG_subprogram (loop fb) */ + .ascii "func_loopfb\0" /* DW_AT_name */ + .4byte func_loopfb_start /* DW_AT_low_pc */ + .4byte func_loopfb_end /* DW_AT_high_pc */ .byte 2f - 1f /* DW_AT_frame_base */ 1: .byte 0x91 /* DW_OP_fbreg */ .sleb128 0 /* 0 */ 2: -#endif .uleb128 7 /* Abbrev: DW_TAG_variable (location) */ - .ascii "main_var\0" /* DW_AT_name */ + .ascii "func_loopfb_var\0" /* DW_AT_name */ .byte 2f - 1f /* DW_AT_location */ 1: .byte 0x91 /* DW_OP_fbreg */ .sleb128 0 /* 0 */ @@ -96,8 +109,20 @@ .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ + .uleb128 5 /* Abbrev code */ + .uleb128 0x2e /* DW_TAG_subprogram (no fb) */ + .byte 1 /* has_children */ + .uleb128 0x3 /* DW_AT_name */ + .uleb128 0x8 /* DW_FORM_string */ + .uleb128 0x11 /* DW_AT_low_pc */ + .uleb128 0x1 /* DW_FORM_addr */ + .uleb128 0x12 /* DW_AT_high_pc */ + .uleb128 0x1 /* DW_FORM_addr */ + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ + .uleb128 6 /* Abbrev code */ - .uleb128 0x2e /* DW_TAG_subprogram */ + .uleb128 0x2e /* DW_TAG_subprogram (loop fb) */ .byte 1 /* has_children */ .uleb128 0x3 /* DW_AT_name */ .uleb128 0x8 /* DW_FORM_string */ @@ -105,10 +130,8 @@ .uleb128 0x1 /* DW_FORM_addr */ .uleb128 0x12 /* DW_AT_high_pc */ .uleb128 0x1 /* DW_FORM_addr */ -#ifndef NO_FRAME_BASE .uleb128 0x40 /* DW_AT_frame_base */ .uleb128 0xa /* DW_FORM_block1 */ -#endif .byte 0x0 /* Terminator */ .byte 0x0 /* Terminator */ --- src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp 2010/06/25 15:32:49 1.4 +++ src/gdb/testsuite/gdb.dwarf2/dw2-ref-missing-frame.exp 2010/06/25 15:34:46 1.5 @@ -25,25 +25,36 @@ } set testfile "dw2-ref-missing-frame" -set sources [list ${testfile}-main.c ${testfile}.S] +set srcsfile ${testfile}.S +set objsfile ${objdir}/${subdir}/${testfile}.o +set srcfuncfile ${testfile}-func.c +set objfuncfile ${objdir}/${subdir}/${testfile}-func.o +set srcmainfile ${testfile}-main.c +set objmainfile ${objdir}/${subdir}/${testfile}-main.o +set executable ${testfile} +set binfile ${objdir}/${subdir}/${executable} -# First try referencing DW_AT_frame_base which is not defined. -set executable_nofb ${testfile}-nofb -if { [prepare_for_testing ${testfile}.exp $executable_nofb $sources {nodebug additional_flags=-DNO_FRAME_BASE}] } { +if { [gdb_compile "${srcdir}/${subdir}/${srcsfile}" $objsfile object {}] != "" + || [gdb_compile "${srcdir}/${subdir}/${srcfuncfile}" $objfuncfile object {}] != "" + || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" $objmainfile object {debug}] != "" + || [gdb_compile "$objsfile $objfuncfile $objmainfile" $binfile executable {}] != "" } { return -1 } -if [runto_main] { - gdb_test "p main_var" {Could not find the frame base for "main".} +clean_restart $executable + +# First try referencing DW_AT_frame_base which is not defined. +if [runto func_nofb] { + gdb_test "p func_nofb_var" {Could not find the frame base for "func_nofb".} "func_nofb print" + gdb_test "bt full" " in main .* main_var = 1" "func_nofb backtrace" } +# GDB could have crashed. +clean_restart $executable + # And now try referencing DW_AT_frame_base defined using a self-reference # (DW_OP_fbreg). -set executable_fb ${testfile}-fb -if { [prepare_for_testing ${testfile}.exp $executable_fb $sources {nodebug}] } { - return -1 -} - -if [runto_main] { - gdb_test "p main_var" "DWARF-2 expression error: Loop detected .*" +if [runto func_loopfb] { + gdb_test "p func_loopfb_var" "DWARF-2 expression error: Loop detected .*" "func_loopfb print" + gdb_test "bt full" " in main .* main_var = 1" "func_loopfb backtrace" }