From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9889 invoked by alias); 9 Aug 2010 09:10:06 -0000 Received: (qmail 9840 invoked by uid 22791); 9 Aug 2010 09:10:04 -0000 X-SWARE-Spam-Status: No, hits=-0.2 required=5.0 tests=AWL,BAYES_40,MSGID_MULTIPLE_AT X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 09 Aug 2010 09:09:55 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o7999eXg080022 ; Mon, 9 Aug 2010 11:09:41 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms6.u-strasbg.fr [IPv6:2001:660:2402:d::15]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o7999eMl026399 ; Mon, 9 Aug 2010 11:09:40 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (gw-ics.u-strasbg.fr [130.79.210.225]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.4/jtpda-5.5pre1) with ESMTP id o7999dsJ099287 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Mon, 9 Aug 2010 11:09:40 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: "'Jan Kratochvil'" Cc: References: <001801cb3578$15f7a550$41e6eff0$@muller@ics-cnrs.unistra.fr> <20100806150750.GA25094@host1.dyn.jankratochvil.net> <003501cb357e$bdf17320$39d45960$@muller@ics-cnrs.unistra.fr> In-Reply-To: <003501cb357e$bdf17320$39d45960$@muller@ics-cnrs.unistra.fr> Subject: RE: [RFA] testsuite: Avoid buffer overrun in gdb.base/default.exp Date: Mon, 09 Aug 2010 09:10:00 -0000 Message-ID: <004201cb37a2$9a029040$ce07b0c0$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable x-cr-hashedpuzzle: BVkS DhHU EFJg JzJS J6Hc KAxx N7aa Ojt/ OzSu O6zy RC4m RllT Rtew R+ZY TWjI T5F0;2;ZwBkAGIALQBwAGEAdABjAGgAZQBzAEAAcwBvAHUAcgBjAGUAdwBhAHIAZQAuAG8AcgBnADsAagBhAG4ALgBrAHIAYQB0AG8AYwBoAHYAaQBsAEAAcgBlAGQAaABhAHQALgBjAG8AbQA=;Sosha1_v1;7;{7115CE0B-AB42-40B6-BB6D-E343639937DA};cABpAGUAcgByAGUALgBtAHUAbABsAGUAcgBAAGkAYwBzAC0AYwBuAHIAcwAuAHUAbgBpAHMAdAByAGEALgBmAHIA;Mon, 09 Aug 2010 09:09:36 GMT;UgBFADoAIABbAFIARgBBAF0AIAB0AGUAcwB0AHMAdQBpAHQAZQA6ACAAQQB2AG8AaQBkACAAYgB1AGYAZgBlAHIAIABvAHYAZQByAHIAdQBuACAAaQBuACAAZwBkAGIALgBiAGEAcwBlAC8AZABlAGYAYQB1AGwAdAAuAGUAeABwAA== x-cr-puzzleid: {7115CE0B-AB42-40B6-BB6D-E343639937DA} 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-08/txt/msg00100.txt.bz2 As reported to me by Jan, the previous email is not a valid patch (due to Outlook inserting line breaks inside the patch itself). I finally found a fix that seems to remove that automatic line break inse= rtion. The same patch is appended again below, but it should normally be usable without problems. Thanks to Jan for the feedback, Pierre Muller Pascal language support maintainer for GDB PS: For those interested, the fix consists for Outlook 2007 at least in the addition of a registry key entry=20 at HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Common\MailSettings level named `WrapLines' type REG_DWORD and with value zero=20 (displayed as "0x00000000 (0)" inside regedit32). Other Outlook versions might need other keys (especially the 12.0 level, Outlook 2003 seems to use 11.0 at that level, see http://support.microsoft.com/?id=3D823921). Here is the patch itself: 2010-08-06 Pierre Muller * gdb.base/default.exp (info set): Avoid full buffer error and force reading up to final gdb prompt. (show): Likewise. Index: src/gdb/testsuite/gdb.base/default.exp =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/testsuite/gdb.base/default.exp,v retrieving revision 1.43 diff -u -p -r1.43 default.exp --- src/gdb/testsuite/gdb.base/default.exp 7 Jul 2010 18:49:51 -0000 1.43 +++ src/gdb/testsuite/gdb.base/default.exp 6 Aug 2010 13:41:24 -0000 @@ -316,10 +316,37 @@ gdb_test "info s" "No stack." "info stac #test info stack gdb_test "info stack" "No stack." "info stack" #test info set -# FIXME -- needs to match the entire output -# FIXME -- on native solaris 2.8, this test fails due to this line: +# Test improved to check three parts: +# 1) confirm +# 2) prompt +# 3) write +# And only succeed if all three are matched. +# This should fix an old problem on native solaris 2.8, +# where this test fails due to this line: # prompt: Gdb's prompt is "(gdb) ".^M -gdb_test "info set" "confirm: Whether to confirm potentially dangerous op= erations is o\[a-z\]*.(\[^\r\n\]*\[\r\n\])+history filename: The filename = in which to record the command history is (\[^\r\n\]*\[\r\n\])+listsize: N= umber of source lines gdb will list by default is 10.*" "info set" +set set_confirm_seen 0 +set set_prompt_seen 0 +gdb_test_multiple "info set" "info set" { + -re "confirm: Whether to confirm potentially dangerous operations is = o\[a-z\]*.(\[^\r\n\]*\[\r\n\])+history filename: The filename in which to = record the command history is (\[^\r\n\]*\[\r\n\])+listsize: Number of sou= rce lines gdb will list by default is 10" { + verbose "Confirm dislayed" + set set_confirm_seen 1 + exp_continue + } + -re "Gdb's prompt is \"$gdb_prompt \"" { + verbose "GDB prompt displayed" + set set_prompt_seen 1 + exp_continue + } + -re "Writing into executable.*$gdb_prompt $" { + verbose "write displayed" + if { $set_prompt_seen && $set_confirm_seen } { + pass "info set" + } else { + verbose "prompt $set_prompt_seen confirm $set_confirm_seen" + fail "info set (incomplete output)" + } + } +} gdb_test "info symbol" "Argument required .address.." #test info source gdb_test "info source" "No current source file..*" "info source" @@ -651,7 +678,29 @@ gdb_test "show width" "Number of charact # This is only supported on targets which use exec.o. gdb_test "show write" "Writing into executable and core files is o.*" "sho= w write" #test show -gdb_test "show" "confirm: *Whether to confirm potentially dangerous opera= tions is on.(\[^\r\n\]*\[\r\n\])+history filename: *The filename in which = to record the command history is (\[^\r\n\]*\[\r\n\])+history save: *Savin= g of the history record on exit is on.(\[^\r\n\]*\[\r\n\])+history size: *= The size of the command history is(\[^\r\n\]*\[\r\n\])+listsize: *Number o= f source lines gdb will list by default is 10(\[^\r\n]*\[\r\n\])+print elem= ents: *Limit on string chars or array elements to print is 200..*" "show" +set show_confirm_seen 0 +set show_prompt_seen 0 +gdb_test_multiple "show" "show" { + -re "confirm: *Whether to confirm potentially dangerous operations is= on.(\[^\r\n\]*\[\r\n\])+history filename: *The filename in which to recor= d the command history is (\[^\r\n\]*\[\r\n\])+history save: *Saving of the= history record on exit is on.(\[^\r\n\]*\[\r\n\])+history size: *The size= of the command history is(\[^\r\n\]*\[\r\n\])+listsize: *Number of source= lines gdb will list by default is 10(\[^\r\n]*\[\r\n\])+print elements: *= Limit on string chars or array elements to print is 200." { + verbose "Confirm dislayed" + set show_confirm_seen 1 + exp_continue + } + -re "Gdb's prompt is \"$gdb_prompt \"" { + verbose "GDB prompt displayed" + set show_prompt_seen 1 + exp_continue + } + -re "Writing into executable.*$gdb_prompt $" { + verbose "write displayed" + if { $show_prompt_seen && $show_confirm_seen } { + pass "show" + } else { + verbose "prompt $show_prompt_seen confirm $show_confirm_seen" + fail "show (incomplete output)" + } + } +} #test stepi "si" abbreviation gdb_test "si" "The program is not being run." "stepi \"si\" abbreviation" #test stepi