From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 3FE783858C52; Thu, 29 Feb 2024 11:07:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3FE783858C52 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1709204859; bh=N8d8FpiOJI9l3tSANbqOvRCIIFauFlCX+QMuMWo+5hA=; h=From:To:Subject:Date:From; b=D/CgtQY/dsSyIZE04TIO3iYyoORRQlcSohHL8Uw5q9+IzlETSl4QRi6ksnzG5DR7I NuR+qvrPwN1LktArNQtoTOJN01QgdQ9g2xcA4TN8URD29yxFyfsRm0bhHMWnMH7VjI 8x9Yv6vrlmKCrxsEXcVwxSOdzasHtzti1WXbM8Uw= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug dap/31433] New: [gdb/dap] Cancel generates StoppedEvent with reason signal Date: Thu, 29 Feb 2024 11:07:38 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: dap X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vries at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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 target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31433 Bug ID: 31433 Summary: [gdb/dap] Cancel generates StoppedEvent with reason signal Product: gdb Version: HEAD Status: NEW Severity: normal Priority: P2 Component: dap Assignee: unassigned at sourceware dot org Reporter: vries at gcc dot gnu.org Target Milestone: --- Consider this bit from gdb.dap/pause.exp dap.log: ... READ: <<<{"seq": 6, "type": "request", "command": "pause", "arguments": {"threadId": 1}}>>> WROTE: <<<{"request_seq": 6, "type": "response", "command": "pause", "succe= ss": true}>>> WROTE: <<<{"type": "event", "event": "module", "body": {"reason": "new", "module": {"id": "/lib64/ld-linux-x86-64.so.2", "name": "/lib64/ld-linux-x86-64.so.2", "path": "/lib64/ld-linux-x86-64.so.2"}}}>>> WROTE: <<<{"type": "event", "event": "module", "body": {"reason": "new", "module": {"id": "system-supplied DSO at 0x7ffff7fcf000", "name": "system-supplied DSO at 0x7ffff7fcf000"}}}>>> _suppress_cont case +++ interrupt -a entering _on_stop: details: {'reason': 'signal-received', 'signal-name': 'SIGINT', 'signal-meaning': 'Interrupt'} WROTE: <<<{"type": "event", "event": "stopped", "body": {"threadId": 1, "allThreadsStopped": true, "reason": "pause"}}>>> ... So the client requests a pause, which is translated into an "interrupt -a".= =20 When the interrupt arrives, it's processed by _on_stop, and generates a sto= pped event with reason "pause". Now consider: ... READ: <<<{"seq": 8, "type": "request", "command": "evaluate", "arguments": {"expression": "continue", "context": "repl"}}>>> WROTE: <<<{"type": "event", "event": "continued", "body": {"threadId": 1, "allThreadsContinued": true}}>>> READ: <<<{"seq": 9, "type": "request", "command": "cancel", "arguments": {"requestId": 8}}>>> WROTE: <<<{"type": "event", "event": "module", "body": {"reason": "new", "module": {"id": "/lib64/libm.so.6", "name": "/lib64/libm.so.6", "path": "/lib64/libm.so.6"}}}>>> WROTE: <<<{"type": "event", "event": "module", "body": {"reason": "new", "module": {"id": "/lib64/libc.so.6", "name": "/lib64/libc.so.6", "path": "/lib64/libc.so.6"}}}>>> entering _on_stop: details: {'reason': 'signal-received', 'signal-name': 'SIGINT', 'signal-meaning': 'Interrupt'} WROTE: <<<{"type": "event", "event": "stopped", "body": {"threadId": 1, "allThreadsStopped": true, "reason": "signal"}}>>> WROTE: <<<{"request_seq": 8, "type": "response", "command": "evaluate", "bo= dy": {"result": "Continuing.\n", "variablesReference": 0}, "success": true}>>> WROTE: <<<{"request_seq": 9, "type": "response", "command": "cancel", "success": true}>>> ... The client requests a continue, followed by a cancel. The cancel is transl= ated into a gdb.interrupt. When the interrupt arrives, it's processed by _on_st= op, and generates a stopped event with reason "signal". I wonder if the reason should be "cancel" or some such, to allow the client= to differentiate between events generated by a cancel, and external signal eve= nts. --=20 You are receiving this mail because: You are on the CC list for the bug.=