From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04olkn0830.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0c::830]) by sourceware.org (Postfix) with ESMTPS id 6B039386103B for ; Thu, 17 Sep 2020 08:47:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6B039386103B ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JJDQSkPnJgWIQEHmB4mOKIJjOICSt+r8zBQSFPb8FArNvrPwpFnNqR+aryhFvEfqb8sKADo27QTn+g/S10cCw08+6RdYiNNepA9UGs1YOUB6meNAdyVeQANgOXmwX1BYdfplzmsWAhOcpghU15TGpuxF9bkc2r+LJhgcSVkslXus53VLYT5yzUnG0L3uBjfZStDQPx58/xrPt2x1wbodM3Xxs3CyaSkYyTIpDdA2ryq/RC1S53psx4EK7jQFR4jZnHqv4rHLQfYM9I+5nmOgvDoeCtUoLeJIHrzX4cuGSBoaFXSPf8TeVHbwtM6M3JxtZdV6XWJZ+A+U1ndP5iFT3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Oiwu52PVvzl1o6D11vUvOtIXvhv5THt76UkYesXUrdE=; b=eCZjqh8f2qQrTILnJEol9ZXHgyL9a0VqJtuTUVrXvwJmts9Vgk5jgZehzxFTdCg4GRIehcDEjcXwUClAresviPc+pO1+tOP6fERuxnJGIwme2yHIorvI8X6PhoLCmuRV25zUjDOqupfsIR4Pdcvqc9EHZhKOwjsQCp2ZMyKIltaPpmySxsxXM2J6cn+R9c71SkqvyN3YJTK/vDK0aMriOM9ORdzxKppvzK0l2IYLeYt6jyckrs7ZXNuJujpOqDd1bNgO0inIbYtOKHGVxl8NwOqHk157Kjd1Y3jTfRt71HgLtVOABIIc6GaepSIYbk7EOqQK67lbwx953Dd1Chkg2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from HE1EUR04FT010.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::52) by HE1EUR04HT055.eop-eur04.prod.protection.outlook.com (2a01:111:e400:7e0d::130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.15; Thu, 17 Sep 2020 08:47:54 +0000 Received: from AM0PR04MB5378.eurprd04.prod.outlook.com (2a01:111:e400:7e0d::4f) by HE1EUR04FT010.mail.protection.outlook.com (2a01:111:e400:7e0d::280) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.15 via Frontend Transport; Thu, 17 Sep 2020 08:47:54 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:159285C0914DCDEFD84DB7982095F243460E95A00EE483BD89E71996FD76DEF4; UpperCasedChecksum:E100DCC40961A951806DE4967C7DBD0A2E0BDCA7387D5ED82D4B4ED6C229214B; SizeAsReceived:8712; Count:46 Received: from AM0PR04MB5378.eurprd04.prod.outlook.com ([fe80::fd56:f907:2672:6832]) by AM0PR04MB5378.eurprd04.prod.outlook.com ([fe80::fd56:f907:2672:6832%5]) with mapi id 15.20.3370.019; Thu, 17 Sep 2020 08:47:54 +0000 From: "A. M. Miera" Subject: debugger-only log on Linux, equivalent of OutputDebugString To: gdb@sourceware.org Message-ID: Date: Thu, 17 Sep 2020 10:48:00 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: pl Content-Transfer-Encoding: 7bit X-ClientProxiedBy: AM6PR10CA0081.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::22) To AM0PR04MB5378.eurprd04.prod.outlook.com (2603:10a6:208:10f::32) X-Microsoft-Original-Message-ID: <57449eb8-b30a-7ab5-8b73-0b6b6769ecd1@hotmail.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2a02:a314:a340:2d80:6962:4d57:2702:754a] (2a02:a314:a340:2d80:6962:4d57:2702:754a) by AM6PR10CA0081.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:209:8c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.11 via Frontend Transport; Thu, 17 Sep 2020 08:47:54 +0000 X-Microsoft-Original-Message-ID: <57449eb8-b30a-7ab5-8b73-0b6b6769ecd1@hotmail.com> X-TMN: [wodJazc9nrgOHDL9tcrT++WcyW6+eRl9ZjgTmyg3rBQXOMPOcPf9dXxw4iLWQXDty9AHxbIXQMU=] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 46 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: c4757d7f-2e8a-425d-b0a1-08d85ae65e2a X-MS-TrafficTypeDiagnostic: HE1EUR04HT055: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TxTLE4ys/I3CVqValF6FW/rpfx6jQ8kXiia4EzkE0vFIBQcjs92TexiVbTz1KE0zb0bK12Ol6FRsDdvJHqid3xEE93gkdLrZS/fDrnWkMct28zCIMMTcBdtcN/L3fgQsQpbxuSKP7l5wkp/9kb5Cd+FzSWUUTSTqDYE58LnBIpENetQWJK5x3Ml9sOBY/160MbPGVfjwsz9iQt8Y0wctvf1TuVktVefXiQSMr2qde+DKV9rQdf1CoQaxgu8/+RVd X-MS-Exchange-AntiSpam-MessageData: H5TCOOSDjjMelyPwq0LbjCVCZHjqmkH3hcKOCymvSBunA9grhOufDlE3wlGarw2+EeAuImRINS9TEwbgutFMsktOEm9bwYjqOj9C7hl3taxXTXsIxl7J+G16B6O3DEmBXeo+X5DKYQqNYxplOd3ZA5mk0crRzfZJHFcKR2ueDJ6JfRBzLiTVRer4ER7AhtayP4uejTCLJqs6XC4JhSIr3g== X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-Network-Message-Id: c4757d7f-2e8a-425d-b0a1-08d85ae65e2a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2020 08:47:54.5247 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-AuthSource: HE1EUR04FT010.eop-eur04.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1EUR04HT055 X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FORGED_MUA_MOZILLA, FREEMAIL_FROM, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2020 08:47:57 -0000 Hello, I've been recently looking for sth equivalent of Windows's OutputDebugString for Linux. Fiddling with built-in python, I have managed to create a named pipe that GDB would read in the background (via python), while the inferior writes to it (using some simple API, which I have currently implemented as a shared lib). Despite being in early prototype stage (with all its problems) my code works. The main question I'd like to ask though, is this: is that actually the right way to go, or can this be done better in terms of operation principles? I have several concerns here: a. this might be very system-specific, e.g. for bare-metal Cortex-Mx targets there's sth called "semihosting", which effectively does the same (though is something different in principle). Windows already its own call, too, etc. b. most likely a simple pipe-based solution is not going to work with remote targets, e.g. gdbserver? Should it be added? c. and last but not least: maybe a mechanism already exists and I'm reinventing the wheel now? If someone wants to have a look, the code's here (again, please keep in mind it's just proof of concept, not production quality): https://gitlab.com/alagner/gdbprint Looking forward to hear all the criticism on the idea. Best regards, Aleksander "Alagner" Miera