public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: "Denio, Mike" <miked@ti.com>
To: Luis Machado <luis.machado@arm.com>,
	Pedro Alves <pedro@palves.net>,
	"gdb@sourceware.org" <gdb@sourceware.org>
Subject: RE: Step causes GDB to spin in infinite loop when PC doesn't change
Date: Fri, 18 Mar 2022 20:57:46 +0000	[thread overview]
Message-ID: <d7e84b5ca7434ea89fd0805a0eaea9fa@ti.com> (raw)
In-Reply-To: <928a31c6f548411084f4a30dff48e1fe@ti.com>

I have a work-around that is a bit of a hack. I realized that the issue is the ^C is being sent to me after I report stop, but before GDB processes the stop. This is very similar to my original issue on my first email thread.

The same fix can cannot be applied though. In that fix, I simply ignored vCont commands for event pended threads. In this case however, I need to send a Stop with Signal 02, but I have already sent that stop event with Signal 05. My hack fix is to apply the signal 02 to the subsequent event for that thread. Its messy, but it only affects vCtrlC, so hopefully won't cause any issues.

If there is some way for me so send a stop signal to a thread that is already stopped, that would be cleaner. So any advice is appreciated.

Thanks for all the feedback, as always.

Mike

//------------------------------------------------------------
// The ^C sequence in the log. Note the T02 is applied 
// to the vCont command that is AFTER the vCtrlC which
// I'm not 100% comfortable with

'vCont;s:2'             --->
                        <--- '$OK#9a'
                        <--- '%Stop:T05thread:2;#b8'
'vCtrlC'                --->
                        <--- '$OK#9a'
'vStopped'              --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000#84'
'vCont;s:2'             --->
                        <--- '$OK#9a'
                        <--- '%Stop:T02thread:2;#b5'
'vStopped'              --->
                        <--- '$OK#9a'
'g'                     --->
                        <--- '$000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000#84'
'qfThreadInfo'          --->
                        <--- '$m1,2#fc'
'qsThreadInfo'          --->
                        <--- '$l#6c'



//------------------------------------------------------------
// GDB Output

(gdb) tar ext :9998
Remote debugging using :9998
(gdb) interrupt -a
(gdb) 
Thread 1 stopped.
endz () at r5_tests/smoke/boot.S:8
8       endz: jal x0,endz

Thread 2 stopped.
endz () at r5_tests/smoke/boot.S:8
8       endz: jal x0,endz
s
^C
Thread 2 received signal SIGINT, Interrupt.
endz () at r5_tests/smoke/boot.S:8
8       endz: jal x0,endz

  parent reply	other threads:[~2022-03-18 20:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18 17:57 Denio, Mike
2022-03-18 18:39 ` Pedro Alves
     [not found] ` <928a31c6f548411084f4a30dff48e1fe@ti.com>
2022-03-18 20:57   ` Denio, Mike [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-03-18 17:33 Denio, Mike
2022-03-18 17:46 ` Luis Machado
2022-03-18 16:33 Denio, Mike
2022-03-18 17:28 ` Luis Machado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d7e84b5ca7434ea89fd0805a0eaea9fa@ti.com \
    --to=miked@ti.com \
    --cc=gdb@sourceware.org \
    --cc=luis.machado@arm.com \
    --cc=pedro@palves.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).