public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17525] New: target-async: breakpoint commands not executed when program run from -x script
@ 2014-10-30 18:23 brobecker at gnat dot com
  2014-10-30 18:37 ` [Bug gdb/17525] " brobecker at gnat dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: brobecker at gnat dot com @ 2014-10-30 18:23 UTC (permalink / raw)
  To: gdb-prs

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.


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2021-11-08  8:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 18:23 [Bug gdb/17525] New: target-async: breakpoint commands not executed when program run from -x script brobecker at gnat dot com
2014-10-30 18:37 ` [Bug gdb/17525] " brobecker at gnat dot com
2015-01-13 17:57 ` palves at redhat dot com
2015-01-13 19:01 ` palves at redhat dot com
2015-01-13 21:03 ` dje at google dot com
2015-01-14 12:38 ` cvs-commit at gcc dot gnu.org
2015-01-14 12:43 ` cvs-commit at gcc dot gnu.org
2015-01-14 13:18 ` cvs-commit at gcc dot gnu.org
2015-01-14 13:48 ` palves at redhat dot com
2021-11-08  8:28 ` richardshodges7 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).