From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32743 invoked by alias); 30 Oct 2014 18:23:30 -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 32718 invoked by uid 48); 30 Oct 2014 18:23:30 -0000 From: "brobecker at gnat dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/17525] New: target-async: breakpoint commands not executed when program run from -x script Date: Thu, 30 Oct 2014 18:23:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: brobecker at gnat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: 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/msg00165.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=17525 Bug ID: 17525 Summary: target-async: breakpoint commands not executed when program run from -x script Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: brobecker at gnat dot com We stumbled onto a regression that is making me think we should be making a GDB 7.8.2 release, after all. On x86_64-linux, with current HEAD or 7.8, consider the following C program: % cat foo.c int increment (int i) { return i + 1; } #define N_INCR 20 int main (void) { int val = 1; int j; for (j = 0; j < N_INCR; j++) val = increment (val); return val == N_INCR; } And the following GDB script: % cat cmds.gdb file foo break increment commands cont end run The script inserts a breakpoint on a function that gets called repetitively, and adds a commands-list to that breakpoint that just "cont"s (until we reach the end of the program). However, trying to execute that script by passing it as a -x argument on the command line yields the following behavior: % /t.a/brobecke/bld/gdb-public/gdb/gdb -q -x cmds.gdb Breakpoint 1 at 0x40049d: file foo.c, line 4. Breakpoint 1, increment (i=1) at foo.c:4 4 return i + 1; Breakpoint 1, increment (i=2) at foo.c:4 4 return i + 1; (gdb) Adding "maintenance set target-async off" makes the problem disappear. -- You are receiving this mail because: You are on the CC list for the bug.