From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ArGVNaILJ2gtLCUAWB0awg (envelope-from ) for ; Fri, 16 May 2025 05:55:46 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=Y5YC+jtX; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C7A0A1E10E; Fri, 16 May 2025 05:55:46 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 5665F1E092 for ; Fri, 16 May 2025 05:55:46 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D0A3A3858433 for ; Fri, 16 May 2025 09:55:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D0A3A3858433 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1747389345; bh=wfg6Ih3kNwtiU5JwtuoNULczbxefQXhOPnJVANzKmC0=; h=To:Cc:Subject:In-Reply-To:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=Y5YC+jtXpEv4S+Hs5w3EwiFbYBESBDvR2ZP7PdENgIVN23v/uIR4Ks1s5S0Vp3j3+ NF778A2TPw/ZEDlfadBDvalNJPbSi8f5Ng/Yto2SPVJJvmyJbbKBHCNmObpZXr5oOo ZJiY0LlwamuC1ThzQGANpZ3ho9xU01db02SP7L1o= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id F1FCC3858C56 for ; Fri, 16 May 2025 09:54:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F1FCC3858C56 ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F1FCC3858C56 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1747389299; cv=none; b=TqVpediHRT0bvz0WdUN0TI0Jz14yY7pBGqYJiRbeg13RUV981MWrgbSqJytZlPIoEo3PQ+iDqzuuVLrPz3wdo5s4uqrWL39GGga3Cf3Q07+RnayuV6bPS9OCr9F8BTw4FZ7EC++58Jyb5lnOLLobjQ6hBt3WJ7kDQMEa/qFLnQM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1747389299; c=relaxed/simple; bh=Qa8z45D+FshNKT8wLHsuzLleMa5nfwM3Ggmf3EipAyc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=qBygbiiWo1TayiOiI3JqS9Ppi2CqR/Z/H+yXnhH3OCtL+Hh3BgYM+MRvjt2V1aeYjMhyUTB7CATCem9vthf27LAo/iRw0KBPh4tVGbW5+1rbv4nMIGoSdYJDb8jsKkbyjjqviVDkqZBNdXHiRXsoSUId/ef/Pvgel0srS8U7jzg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F1FCC3858C56 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-117-BYzWZPJyOWaRN66-RnmbRQ-1; Fri, 16 May 2025 05:54:57 -0400 X-MC-Unique: BYzWZPJyOWaRN66-RnmbRQ-1 X-Mimecast-MFC-AGG-ID: BYzWZPJyOWaRN66-RnmbRQ_1747389296 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43cfda30a3cso10507965e9.3 for ; Fri, 16 May 2025 02:54:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747389296; x=1747994096; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ogg8GsI2Fl5mWAh1s/8LrqfBDTNUsyfwR8cYnxsml0Q=; b=gxDRujudJSn35AKJWTGbjbfsOIGfFp+11r8sMDnpR5tdY16fODSlBKO9t+NCuvbx/+ PjdyWTMqxrksJP2SKCezneYU87KplaIOH3P2f9OpjSW1MtahuAuD9Rc3e7qDvneDzvvc PjAMtu7SFCu9uQlJh5LOZxsI9HI2OWbl7DsiBYg2lmQZ4VmbVH7im8u/xMCndjYgqJ/u 7Z0qOhsFAtyV/hHxqpHNYfXe6KqaPIklQ9WXDNKlOqa/Pai0cFs60sC9HaFCtUoQo4/C fXm4Azwa3R4CloBQgNYUzNLkL0mQ0e85NN5Qgh0/F+HmX9hH8dAicNCu3FVVf87OBcwg xgTw== X-Forwarded-Encrypted: i=1; AJvYcCV62ZK9tkyyV1wCvE8L7BvlQb3qXSR7oguFouETT74XaxAdsVVu3bTetmXH7ArVgMtego4=@sourceware.org X-Gm-Message-State: AOJu0Yy4JOg9gZyxDezwB1KrTsUyA5ee95a8fDtxOQI/3wlqbTCE9vW+ g5m1+197xK8zN3lN4oXcIiHcK9GnhaP8S/m/ZCejbaOq/p298I0OGg3hR2UQOYIuFFyz9p8+eyl zUBa3BIEcHxOyt5zrd1P5gbJ4X07T1hl7OfNll/aRaEQ1WkxWe8V5 X-Gm-Gg: ASbGncsPO8eAUgnobvN7/75wgtrfunYSvNlaYvmcLOPUYJT7LVkRhXqpX2QrDDRYybx 3IIsdFts11kuIvMtoZr3SGfolU31Y4hhWeK0SdvgS9NxjPcA/8DB+99oZBo+gyJnqloOb1HgOQL Iyikmg2Xd5wNN3wylZ3ArhtN2IniZn0SK7oSIyWnDjtp3RpdnQbIkx9+66oDDJzn2IIZnQoH+4j FDFIwcsHSGbOUR4CyRLZa8Lb9LKszEMepfejqNYdYtFg4+D/oxlZfNt/70K9hGd1Ca6bUG8+22F qdA6qUSkA13iuBUZtbMCkV+vNUzeWoMq9zMy X-Received: by 2002:a05:600d:4:b0:43c:ef13:7e5e with SMTP id 5b1f17b1804b1-442ffc60ecfmr10958465e9.26.1747389296393; Fri, 16 May 2025 02:54:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5W9CAgVuP6S9fKPyJz6uD8MYd/BqBlj2eXFAJ9BpzJ2rlQLdvCnYydO0kT9wHdXh03Mifcw== X-Received: by 2002:a05:600d:4:b0:43c:ef13:7e5e with SMTP id 5b1f17b1804b1-442ffc60ecfmr10958305e9.26.1747389296020; Fri, 16 May 2025 02:54:56 -0700 (PDT) Received: from localhost (30.226.159.143.dyn.plus.net. [143.159.226.30]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-442fd4fdbdesm27926995e9.1.2025.05.16.02.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 May 2025 02:54:55 -0700 (PDT) To: Basile Starynkevitch , Gdb@sourceware.org Cc: team@refpersys.org Subject: Re: GDB process (on Linux) cooperating with the debugged process (some particular pthread on it) In-Reply-To: References: <87plganni8.fsf@redhat.com> Date: Fri, 16 May 2025 10:54:55 +0100 Message-ID: <87ecwoop74.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Z3PSzbYnU0j8yEUQLwBwvmyJ95KyquPk5a3Stv6y9pw_1747389296 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb Reply-To: Andrew Burgess Errors-To: gdb-bounces~public-inbox=simark.ca@sourceware.org Sender: "Gdb" Basile Starynkevitch writes: > On Thu, 2025-05-15 at 12:04 +0100, Andrew Burgess via Gdb wrote: >> Basile Starynkevitch writes: >>=20 >> > Hello all, >> >=20 >> > Is it possible for the debugged process (for me the RefPerSys inferenc= e >> > engine, >> > GPL licensed, see below) which has several threads to send GDB command= s or >> > interact with the debugger process. >>=20 >> I'm not aware of any existing, general technique for having the debuggee >> send commands to the debugger.=C2=A0 There is some limited support for J= IT >> like processes to allow the process to give GDB debug information for >> the dynamically generated code, but nothing beyond that. > > Thanks. Do you mind explaining how that works? or in what GDB source file= s does > that happen? Start by reading: https://sourceware.org/gdb/current/onlinedocs/gdb.html/JIT-Interface.html#= JIT-Interface Though the documentation isn't great, I think it could be improved with some examples maybe. But you can find some example code in the testsuite, look in gdb/testsuite/gdb.base/ and read through any of the files starting with 'jit-'. In GDB source the entry point for jit handling is in jit.c, but if your interest is being a user then hopefully the docs should be enough. Thanks, Andrew