From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12327 invoked by alias); 30 Apr 2008 03:12:36 -0000 Received: (qmail 12307 invoked by uid 22791); 30 Apr 2008 03:12:34 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 30 Apr 2008 03:12:08 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Jr2jl-0005bL-Ru for gdb-patches@sources.redhat.com; Wed, 30 Apr 2008 03:12:05 +0000 Received: from cpe0040f4e853ad-cm001692f4e452.cpe.net.cable.rogers.com ([99.224.129.162]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Apr 2008 03:12:05 +0000 Received: from aristovski by cpe0040f4e853ad-cm001692f4e452.cpe.net.cable.rogers.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Apr 2008 03:12:05 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: Re: [patch] PR gdb/1665 pending catch/throw catchpoints Date: Wed, 30 Apr 2008 07:09:00 -0000 Message-ID: <4817E37A.8020705@qnx.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------060600040309050609040402" Cc: gdb-patches@sources.redhat.com User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) In-Reply-To: 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: 2008-04/txt/msg00681.txt.bz2 This is a multi-part message in MIME format. --------------060600040309050609040402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 537 Aleksandar Ristovski wrote: > Hello, > > As per discussion here: http://sourceware.org/ml/gdb/2008-04/msg00241.html > > Catchpoints for 'catch catch' and 'catch throw' will be made pending if > the command is issued before first inferior run. > Thanks, > In addition to the patch, a patch for the test 'exception.exp' (attached). This patch adds 14 new PASS-es to the testsuite. Thanks, Aleksandar testuite/ChangeLog * gdb.cp/exception.exp: Test pending catchpoints and finish the test to remove unresolved and failed tests. --------------060600040309050609040402 Content-Type: text/plain; name="exception.exp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="exception.exp.diff" Content-length: 6300 Index: exception.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/exception.exp,v retrieving revision 1.12 diff -u -p -r1.12 exception.exp --- exception.exp 1 Jan 2008 22:53:19 -0000 1.12 +++ exception.exp 30 Apr 2008 03:06:57 -0000 @@ -67,57 +67,68 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} -if ![runto_main] then { - perror "couldn't run to breakpoint" - continue -} - -# As I said before, this test script is not ready yet! - -continue - # Set a catch catchpoint -gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" +gdb_test "catch catch" "Catchpoint \[0-9\]+ \\(catch\\)" \ + "catch catch (static executable)" # Set a throw catchpoint gdb_test "catch throw" "Catchpoint \[0-9\]+ \\(throw\\)" \ "catch throw (static executable)" + # The catchpoints should be listed in the list of breakpoints. +set addr "" +set re_head "Num${ws}Type${ws}Disp${ws}Enb${ws}Address${ws}What" +set re_2_bp "1${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception catch" +set re_3_bp "2${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception throw" + +set name "info breakpoints (pending)" +gdb_test_multiple "info breakpoints" $name { + -re "$re_head${ws}$re_2_bp${ws}$re_3_bp\r\n$gdb_prompt $" { + pass $name + } + -re ".*$gdb_prompt $" + { + fail $name + } +} + +gdb_test "tbreak main" "Temporary breakpoint 3.*" \ + "Set temporary breakpoint at main" + +gdb_test "run" "Temporary breakpoint 3,.*" "Run to main" +set addr "$hex" set re_head "Num${ws}Type${ws}Disp${ws}Enb${ws}Address${ws}What" -set re_1_main "1${ws}breakpoint${ws}keep${ws}y${ws}$hex${ws}in main.*breakpoint already hit.*" -set re_2_catch "2${ws}catch catch${ws}keep${ws}y${ws}$hex${ws}exception catch" -set re_3_catch "3${ws}catch throw${ws}keep${ws}y${ws}$hex${ws}exception throw" -set re_2_bp "2${ws}breakpoint${ws}keep${ws}y${ws}$hex${ws}exception catch" -set re_3_bp "3${ws}breakpoint${ws}keep${ws}y${ws}$hex${ws}exception throw" +set re_2_bp "1${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception catch" +set re_3_bp "2${ws}breakpoint${ws}keep${ws}y${ws}$addr${ws}exception throw" set name "info breakpoints" gdb_test_multiple "info breakpoints" $name { - -re "$re_head${ws}$re_1_main${ws}$re_2_catch${ws}$re_3_catch\r\n$gdb_prompt $" { + -re "$re_head${ws}$re_2_bp${ws}$re_3_bp\r\n$gdb_prompt $" { pass $name } - -re "$re_head${ws}$re_1_main${ws}$re_2_bp${ws}$re_3_bp\r\n$gdb_prompt $" { - # TODO: gdb HEAD 2004-01-08 does this. Is this okay? - unresolved $name - } + -re ".*$gdb_prompt $" + { + fail $name + } } # Some targets support "info catch". # Some do not. -set name "info catch" -gdb_test_multiple "info catch" $name { - -re "Info catch not supported with this target/compiler combination.\r\n$gdb_prompt $" { - unsupported $name - } - -re "No catches.\r\n$gdb_prompt $" { - # TODO: gdb HEAD 2004-01-08 does this. Is this okay? - unresolved $name - } -} +#set name "info catch" +#gdb_test_multiple "info catch" $name { +# -re "Info catch not supported with this target/compiler combination.\r\n$gdb_prompt $" { +# unsupported $name +# } +# -re "No catches.\r\n$gdb_prompt $" { +# # TODO: gdb HEAD 2004-01-08 does this. Is this okay? +# unresolved $name +# } +#} # Get the first exception thrown @@ -127,8 +138,7 @@ gdb_test_multiple "continue" $name { pass $name } -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception thrown\\)\r\n.*\r\n$gdb_prompt $" { - # TODO: gdb HEAD 2004-01-08 does this. Is this okay? - unresolved $name + pass $name } } @@ -137,7 +147,7 @@ gdb_test_multiple "continue" $name { set name "backtrace after first throw" gdb_test_multiple "backtrace" $name { - -re ".*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:30\r\n#\[0-9\]+${ws}$hex in main \\((void|)\\) at .*${srcfile}:48\r\n$gdb_prompt $" { + -re ".*#\[0-9\]+${ws}$hex in __cxa_throw.*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { pass $name } } @@ -150,8 +160,7 @@ gdb_test_multiple "continue" $name { pass $name } -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\)\r\n.*\r\n$gdb_prompt $" { - # TODO: gdb HEAD 2004-01-08 does this. Is this okay? - unresolved $name + pass $name } } @@ -160,7 +169,7 @@ gdb_test_multiple "continue" $name { set name "backtrace after first catch" gdb_test_multiple "backtrace" $name { - -re ".*#\[0-9\]+${ws}$hex in main \\((void|)\\) at .*$srcfile:50\r\n$gdb_prompt $" { + -re ".*#\[0-9\]+${ws}$hex in __cxa_begin_catch.*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { pass $name } } @@ -173,8 +182,7 @@ gdb_test_multiple "continue" $name { pass $name } -re "Continuing.${ws}Got an except 13${ws}Catchpoint \[0-9\]+ \\(exception thrown\\)\r\n.*\r\n$gdb_prompt $" { - # TODO: gdb HEAD 2004-01-08 does this. Is this okay? - unresolved $name + pass $name } } @@ -183,7 +191,7 @@ gdb_test_multiple "continue" $name { set name "backtrace after second throw" gdb_test_multiple "backtrace" $name { - -re ".*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:30\r\n#\[0-9\]+${ws}$hex in main \\((void|)\\) at .*${srcfile}:56\r\n$gdb_prompt $" { + -re ".*#\[0-9\]+${ws}$hex in __cxa_throw.*#\[0-9\]+${ws}$hex in foo \\(i=20\\) at .*${srcfile}:\[0-9\]+\r\n#\[0-9\]+${ws}$hex in main \\(.*\\) at .*${srcfile}:\[0-9\]+\r\n$gdb_prompt $" { pass $name } } @@ -196,8 +204,7 @@ gdb_test_multiple "continue" $name { pass $name } -re "Continuing.${ws}Catchpoint \[0-9\]+ \\(exception caught\\)\r\n.*\r\n$gdb_prompt $" { - # TODO: gdb HEAD 2004-01-08 does this. Is this okay? - unresolved $name + pass $name } } @@ -206,7 +213,7 @@ gdb_test_multiple "continue" $name { set name "backtrace after second catch" gdb_test_multiple "backtrace" $name { - -re ".*#\[0-9\]+${ws}$hex in main \\((void|)\\) at .*$srcfile:58\r\n$gdb_prompt $" { + -re ".*#\[0-9\]+${ws}$hex in __cxa_begin_catch.*#\[0-9\]+${ws}$hex in main \\(.*\\) at .*$srcfile:\[0-9\]+\r\n$gdb_prompt $" { pass $name } } --------------060600040309050609040402--