From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2id8DFmS+2I48ycAWB0awg (envelope-from ) for ; Tue, 16 Aug 2022 08:49:29 -0400 Received: by simark.ca (Postfix, from userid 112) id 2672C1E5EA; Tue, 16 Aug 2022 08:49:29 -0400 (EDT) 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=pol+69t3; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_DYNAMIC, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8DCC11E13B for ; Tue, 16 Aug 2022 08:49:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9F5783858282 for ; Tue, 16 Aug 2022 12:49:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9F5783858282 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1660654167; bh=L6kAaGSX/W0UUp38QxWUBa43cBfx7ADs84odeeH4O10=; h=Date:To:References:Subject:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=pol+69t3vL7S3NCb+iUgEB862o2j9jQ0LJBcTs9E1QKdM8KDcNiUjbuVe5d31peyp BT4WqfJr9zz/+7f3tIpXll3EPaqTIMN3/33cXiziR8xt8Dj55DNx9N4MqbiuvPaXBP kkKnxtQu2sWOFOfAm6XhW3pFJjmNj5MHYgl0oWHs= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 4FE5C3858C20 for ; Tue, 16 Aug 2022 12:49:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4FE5C3858C20 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-156-QrcMIIiFOeiJJcsrYbxIgA-1; Tue, 16 Aug 2022 08:48:59 -0400 X-MC-Unique: QrcMIIiFOeiJJcsrYbxIgA-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C99EF1C07823; Tue, 16 Aug 2022 12:48:58 +0000 (UTC) Received: from [10.33.36.178] (unknown [10.33.36.178]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B5C540CFD0A; Tue, 16 Aug 2022 12:48:58 +0000 (UTC) Message-ID: <6cfef95e-106b-0e06-368e-a340e8d77665@redhat.com> Date: Tue, 16 Aug 2022 13:48:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: hilbert References: <700833f8.5150.182a59bc271.Coremail.swdtian@163.com> <217b746f-65e8-66c0-1678-376eb8cb1aca@arm.com> <5c30085e.8da0.182a5f3377d.Coremail.swdtian@163.com> <2271bb26-4534-44ce-b7e4-551343ffa871@redhat.com> <7ffede02.9b19.182a627c39c.Coremail.swdtian@163.com> Subject: Re: How does GDB get the function call stack In-Reply-To: <7ffede02.9b19.182a627c39c.Coremail.swdtian@163.com> X-Scanned-By: MIMEDefang 2.84 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-GB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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: , From: Andrew Dinn via Gdb Reply-To: Andrew Dinn Cc: gdb@sourceware.org Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" On 16/08/2022 11:16, hilbert wrote: > @Andrew Dinn > Now I totally understand. Thank you very much for your patience. You are very welcome. > By the way, when a multithreaded program hits a breakpoint, GDB can use > the command: /*thread ID */ > /**/to switch between threads arbitrarily,  and view the memory and > other information of each thread. > This is also implemented using ptrace, right? I would assume it relies on ptrace to stop all the threads. However, I have almost zero knowledge of how gdb actually controls the inferior process (my knowledge of gdb is exclusively on the gdb-process side of the fence). You will need to find someone else to obtain a definitive answer. regards, Andrew Dinn ----------- Red Hat Distinguished Engineer Red Hat UK Ltd Registered in England and Wales under Company Registration No. 03798903 Directors: Michael Cunningham, Michael ("Mike") O'Neill