public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/26652] New: Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex
@ 2020-09-22 18:04 simark at simark dot ca
  2020-09-22 18:08 ` [Bug gdb/26652] " simark at simark dot ca
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: simark at simark dot ca @ 2020-09-22 18:04 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 26652
           Summary: Unexpected prompt when using "continue" breakpoint
                    commands and mix of -x and -ex
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: simark at simark dot ca
  Target Milestone: ---

Sorry, I couldn't think of a better bug title, it's a mix of a few things.

I have a test program like this:

 void bar(int n)
 {
 }

 int main() {
     for (int i = 0; i < 2; i++) {
         bar(i);
     }
 }

-- 
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/26652] Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex
  2020-09-22 18:04 [Bug gdb/26652] New: Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex simark at simark dot ca
@ 2020-09-22 18:08 ` simark at simark dot ca
  2024-01-05 13:49 ` ssbssa at sourceware dot org
  2024-01-05 17:13 ` simon.marchi at polymtl dot ca
  2 siblings, 0 replies; 4+ messages in thread
From: simark at simark dot ca @ 2020-09-22 18:08 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Simon Marchi <simark at simark dot ca> ---
Oops, I hit submit too soon, here's the rest.

I have this GDB script:

 b bar
 commands
   print n
   continue
 end

I run GDB like this:

  $ ./gdb -nx --data-directory=data-directory ./test -x script -ex r

I would expect the breakpoint on bar to be hit twice, then the program to exit.
 What I see is:

$ ./gdb -q -nx --data-directory=data-directory ./test -x script -ex r
Reading symbols from ./test...
Breakpoint 1 at 0x4004dd: file test.c, line 3.
Starting program: /home/smarchi/build/binutils-gdb/gdb/test 

Breakpoint 1, bar (n=0) at test.c:3
3       }
(gdb) 


And the execution appears to stop here.  However, if I then type any command
(like print 1), execution appears to resume until the program exits:

(gdb) print 1
$1 = 1
$2 = 0

Breakpoint 1, bar (n=1) at test.c:3
3       }
$3 = 1
[Inferior 1 (process 29906) exited normally]
(gdb) 


So, it looks like some event gets stuck somewhere and doesn't get pulled by
infrun until the event loop is woken up by the command handler.

-- 
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/26652] Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex
  2020-09-22 18:04 [Bug gdb/26652] New: Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex simark at simark dot ca
  2020-09-22 18:08 ` [Bug gdb/26652] " simark at simark dot ca
@ 2024-01-05 13:49 ` ssbssa at sourceware dot org
  2024-01-05 17:13 ` simon.marchi at polymtl dot ca
  2 siblings, 0 replies; 4+ messages in thread
From: ssbssa at sourceware dot org @ 2024-01-05 13:49 UTC (permalink / raw)
  To: gdb-prs

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

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.1
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
                 CC|                            |ssbssa at sourceware dot org

--- Comment #2 from Hannes Domani <ssbssa at sourceware dot org> ---
Works since gdb-11.1:
```
$ gdb -q gdb-26652.exe -x gdb-26652.gdb -ex r
Reading symbols from gdb-26652.exe...
Breakpoint 1 at 0x140001607: file gdb-26652.c, line 3, column 1.
Starting program: C:\src\tests\gdb-26652.exe

Breakpoint 1, bar (n=0) at gdb-26652.c:3
3       }
$1 = 0

Breakpoint 1, bar (n=1) at gdb-26652.c:3
3       }
$2 = 1
[Inferior 1 (process 2308) exited normally]
(gdb)
```

-- 
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/26652] Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex
  2020-09-22 18:04 [Bug gdb/26652] New: Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex simark at simark dot ca
  2020-09-22 18:08 ` [Bug gdb/26652] " simark at simark dot ca
  2024-01-05 13:49 ` ssbssa at sourceware dot org
@ 2024-01-05 17:13 ` simon.marchi at polymtl dot ca
  2 siblings, 0 replies; 4+ messages in thread
From: simon.marchi at polymtl dot ca @ 2024-01-05 17:13 UTC (permalink / raw)
  To: gdb-prs

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

Simon Marchi <simon.marchi at polymtl dot ca> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |simon.marchi at polymtl dot ca

--- Comment #3 from Simon Marchi <simon.marchi at polymtl dot ca> ---
Indeed, fixed by:

https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=21e051b3d666bcd614391142a936a8a8cccfa3cb

-- 
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-05 17:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-22 18:04 [Bug gdb/26652] New: Unexpected prompt when using "continue" breakpoint commands and mix of -x and -ex simark at simark dot ca
2020-09-22 18:08 ` [Bug gdb/26652] " simark at simark dot ca
2024-01-05 13:49 ` ssbssa at sourceware dot org
2024-01-05 17:13 ` simon.marchi at polymtl dot ca

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