From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19674 invoked by alias); 16 Oct 2014 04:03:11 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 19644 invoked by uid 48); 16 Oct 2014 04:03:11 -0000 From: "sergiodj at redhat dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/10737] catch syscall name mappings (xml) should be per-arch or per-target, not global Date: Thu, 16 Oct 2014 04:03:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 6.50 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: sergiodj at redhat dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: sergiodj at redhat dot com X-Bugzilla-Target-Milestone: 6.8 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q4/txt/msg00081.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=10737 --- Comment #4 from Sergio Durigan Junior --- BTW, the test needs to be different than what Pedro suggested. When you start GDB with an inferior, it sets the architecture correspondingly. Then, when you call "catch syscall", GDB loads the syscall names from the XML file related to the current architecture. Therefore, in this scenario, you *will* see the correct syscall, even if the inferior is not of the same architecture as your host. What this means is that triggering the bug is a bit simpler, and you don't even need an inferior for that (I discovered this while writing the testcase for the patch). For example, on i386 the "open" syscall is 5, but on x86_64 the "fstat" is 5. Therefore, to see the bug you can only do: (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'open' [5]) With my patch: (gdb) set architecture i386 The target architecture is assumed to be i386 (gdb) catch syscall 5 Catchpoint 1 (syscall 'open' [5]) (gdb) set architecture i386:x86-64 The target architecture is assumed to be i386:x86-64 (gdb) catch syscall 5 Catchpoint 2 (syscall 'fstat' [5]) This is also the approach I will use to test the patch. -- You are receiving this mail because: You are on the CC list for the bug.