From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 06B943858436; Fri, 16 Feb 2024 09:36:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06B943858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708076213; bh=cVzQI067qM2r91U64NPl2El73yYn54iXOqtZt5rtrBM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=u+XOsyxW6CnD3GLEfuInEYBWIR2RbmvqL5dS9/X26Pxt7MiBCBETdl+oujQmFMtac sXCprNShA2WCps3qAyEinQkgzhlMPOFKyJyyPMcokZ2+KeIptRC07JteD1I5f8yly0 ukEtY6uwjzeVNz9Ci0OHV+HtS+1Kmga95OtmvIwY= From: "vries at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug dap/31386] [gdb/dap] Race between dap startup and dap log file initialization Date: Fri, 16 Feb 2024 09:36:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed 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: Message-ID: In-Reply-To: References: 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=3D31386 --- Comment #3 from Tom de Vries --- (In reply to Tom Tromey from comment #2) > (In reply to Tom de Vries from comment #1) > > One way to address this is to keep the log in a string until a file is = set. >=20 I have a patch for this. > That may never happen, so we'd end up accumulating a large string. >=20 > There should probably be some way for the DAP interpreter to not > start accepting requests until all the command-line options have > been handled. Maybe a new interpreter method is needed. I've written a patch adding a gdb_starting_session observer/event (based on gdb_exiting), which can be used for this. However, when trying to use this into dap I noticed that the first log is d= one by dap setup in the gdb main thread, so that's too early to fix in this way. The way to fix this is start log output in a string. At the gdb_starting_session event, we either: - have switched over to a log file, in which case the string is already printed, or, - have not switched over to a log file, in which case we discard the string= and stop collecting the output in a string. So, I'll combine the two patches to fix this. --=20 You are receiving this mail because: You are on the CC list for the bug.=