From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28794 invoked by alias); 18 Jan 2004 18:35:41 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28785 invoked from network); 18 Jan 2004 18:35:40 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (213.93.115.144) by sources.redhat.com with SMTP; 18 Jan 2004 18:35:40 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i0IIZceT007952 for ; Sun, 18 Jan 2004 19:35:38 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6) with ESMTP id i0IIZcBd054184 for ; Sun, 18 Jan 2004 19:35:38 +0100 (CET) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p3/8.12.6/Submit) id i0IIZcwu054181; Sun, 18 Jan 2004 19:35:38 +0100 (CET) Date: Sun, 18 Jan 2004 18:35:00 -0000 Message-Id: <200401181835.i0IIZcwu054181@elgar.kettenis.dyndns.org> From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] Fix PR testsuite/1504 X-SW-Source: 2004-01/txt/msg00476.txt.bz2 Turns out there is an inconsistency between platforms in the error message one gets when reading from a bit of memory that isn't readable: void memory_error (int status, CORE_ADDR memaddr) { struct ui_file *tmp_stream = mem_fileopen (); make_cleanup_ui_file_delete (tmp_stream); if (status == EIO) { /* Actually, address between memaddr and memaddr + len was out of bounds. */ fprintf_unfiltered (tmp_stream, "Cannot access memory at address "); print_address_numeric (memaddr, 1, tmp_stream); } else { fprintf_filtered (tmp_stream, "Error accessing memory address "); print_address_numeric (memaddr, 1, tmp_stream); fprintf_filtered (tmp_stream, ": %s.", safe_strerror (status)); } error_stream (tmp_stream); } I wonder whether we should try to unify this. In the meantime, this patch fixes the fall-out in the testsuite. Mark Index: testsuite/ChangeLog from Mark Kettenis * gdb.base/gdb1476.exp: Accept alternat pattern for failed memory read at address 0. This fixes PR testsuite/1504. Index: testsuite/gdb.base/gdb1476.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.base/gdb1476.exp,v retrieving revision 1.3 diff -u -p -r1.3 gdb1476.exp --- testsuite/gdb.base/gdb1476.exp 9 Jan 2004 16:43:05 -0000 1.3 +++ testsuite/gdb.base/gdb1476.exp 18 Jan 2004 15:55:05 -0000 @@ -56,6 +56,7 @@ if ![runto_main] then { send_gdb "x 0\n" gdb_expect { + -re "0x0:.*Cannot access memory at address 0x0.*$gdb_prompt $" { } -re "0x0:.*Error accessing memory address 0x0.*$gdb_prompt $" { } -re ".*$gdb_prompt $" { untested "Memory at address 0 is possibly executable" @@ -68,4 +69,4 @@ gdb_test "continue" "Program received si gdb_test "backtrace 10" \ "#0\[ \t\]*0x0* in .*\r\n#1\[ \t\]*$hex in x.*\r\n#2\[ \t\]*$hex in main.*" \ - "backtrace from null pointer call" \ No newline at end of file + "backtrace from null pointer call"