public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/17198] New: Batch cmd file abandoned when breakpoint hit
@ 2014-07-24 18:49 eager at eagercon dot com
  2014-07-24 18:58 ` [Bug gdb/17198] " eager at eagercon dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: eager at eagercon dot com @ 2014-07-24 18:49 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17198

            Bug ID: 17198
           Summary: Batch cmd file abandoned when breakpoint hit
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: eager at eagercon dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug gdb/17198] Batch cmd file abandoned when breakpoint hit
  2014-07-24 18:49 [Bug gdb/17198] New: Batch cmd file abandoned when breakpoint hit eager at eagercon dot com
@ 2014-07-24 18:58 ` eager at eagercon dot com
  2014-07-24 20:53 ` msebor at gmail dot com
  2024-01-02 16:32 ` ssbssa at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: eager at eagercon dot com @ 2014-07-24 18:58 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17198

--- Comment #1 from eager at eagercon dot com ---
I noticed some unexpected behavior with a batch command file which calls a
target function and encounters a breakpoint.  The batch command file is
abandoned, rather than continuing to be executed following the breakpoint.

$ cat t.c
#include <stdio.h>
void foo (int a)  {
  printf ("a = %d\n", a);
}
void main (void) {
  foo (123);
}

$cat gdb.cmd
b main
b foo
run
call foo(234)
p a
c

$ gdb -x gdb.cmd t
...
Breakpoint 1 at 0x400551: file t.c, line 7.
Breakpoint 2 at 0x400537: file t.c, line 3.

Breakpoint 1, main () at t.c:7
7         foo (123);

Breakpoint 2, foo (a=234) at t.c:3
3         printf ("a = %d\n", a);
gdb.cmd:4: Error in sourced command file:
The program being debugged stopped while in a function called from GDB.
Evaluation of the expression containing the function
(foo) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb)

The breakpoint during the target function call apparently causes gdb to decide
that there is an error in the batch file which it abandons.  Subsequent
commands in the batch file are ignored.  It doesn't seem to matter whether the
target generates an interrupt from a breakpoint or a SEGV.

If run with --batch --command instead of -x, gdb terminates rather than
generating the CLI prompt, but does not execute the remaining commands.

Being able to include commands in a batch command file which are executed after
a brakepoint is hit is useful in a couple cases.  The first is to create a
script which demonstrates a gdb bug.  Second is for automated testing.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug gdb/17198] Batch cmd file abandoned when breakpoint hit
  2014-07-24 18:49 [Bug gdb/17198] New: Batch cmd file abandoned when breakpoint hit eager at eagercon dot com
  2014-07-24 18:58 ` [Bug gdb/17198] " eager at eagercon dot com
@ 2014-07-24 20:53 ` msebor at gmail dot com
  2024-01-02 16:32 ` ssbssa at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: msebor at gmail dot com @ 2014-07-24 20:53 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17198

Martin Sebor <msebor at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gmail dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug gdb/17198] Batch cmd file abandoned when breakpoint hit
  2014-07-24 18:49 [Bug gdb/17198] New: Batch cmd file abandoned when breakpoint hit eager at eagercon dot com
  2014-07-24 18:58 ` [Bug gdb/17198] " eager at eagercon dot com
  2014-07-24 20:53 ` msebor at gmail dot com
@ 2024-01-02 16:32 ` ssbssa at sourceware dot org
  2 siblings, 0 replies; 4+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-02 16:32 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17198

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

--- Comment #2 from Hannes Domani <ssbssa at sourceware dot org> ---
Not sure if this is a dup of PR8487.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2024-01-02 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-24 18:49 [Bug gdb/17198] New: Batch cmd file abandoned when breakpoint hit eager at eagercon dot com
2014-07-24 18:58 ` [Bug gdb/17198] " eager at eagercon dot com
2014-07-24 20:53 ` msebor at gmail dot com
2024-01-02 16:32 ` ssbssa at sourceware dot org

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).