From patchwork Sat Oct 12 19:44:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 98800 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3544E3858402 for ; Sat, 12 Oct 2024 19:45:24 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 86A9F3858D20 for ; Sat, 12 Oct 2024 19:44:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 86A9F3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 86A9F3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728762298; cv=none; b=GpBb7kbSmhv7kzzuNZ52vjbLPl3WgxmOwTnRVF5ltAuxJ5q2/jggtF6AxalzuxXSq3ee3LO82SUqvEp0ckmaqk59+0jvtD/5ouWArrg6VRGOu16L7Sl7JsNhijQseUum26saRqKxH2K2VEU3k3ow0daGfyJk7uSLhmqr/P3XIm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728762298; c=relaxed/simple; bh=Tn2fxkREPzeDq6yak3FQz7oUdoRXApH7/9+x2XNSJ9A=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=aYZzwo6z2qQfnsa/WCkV9WrbpgYeZnNkZ5cwzti+WttF+g4negfkQu/9Fw+O5TXPy66k9052tT03oNrWXo6FbDqlT+TOrYKr70uDJXPdnny/v6+nIbWvQRpyEqzJZTyQsZZ1a8NI0fXl5FsMHXK0uHwjDbOPOb44lD7BCvD34IA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728762296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=cp3o/kaHQdMS8XgZbgyP7N2BRjpn7KfdHBF45/tYgFE=; b=BRiuaottkQ9FB6CizDi73jW0pV5cbbg8deuWNjkML1hV+oSL6ZfduF4BDKuyaoY7ZntVUC aUPfBmub/C3/H1KycO0LWNj8PPNKkc9wHvGqhiyeKweosES+d4pIKBtPJvTajbpoPgH6hg BrglOPNqff2K3nEaKJEwoxwlNV+rpJE= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-447-fc6Ch89PNE28UJ8yRynBPg-1; Sat, 12 Oct 2024 15:44:55 -0400 X-MC-Unique: fc6Ch89PNE28UJ8yRynBPg-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-37d60f3e458so432618f8f.1 for ; Sat, 12 Oct 2024 12:44:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728762293; x=1729367093; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=cp3o/kaHQdMS8XgZbgyP7N2BRjpn7KfdHBF45/tYgFE=; b=xA4//9+HkUNueT/8CZWpHGykGk/r35MU0kfGNZjYnAEaVzuY07glQqgiti7yPVLi9K JB34f4w3by0OWTbLQYeNIg+m0ajSWaCFvUATRfspZ1MndhyTmQVDM4qaVyt6OpXytKi+ WAB5xdx7aWu1+ggNBDmctzzF9gr34OOElKKWms3b/i7euUsusNND5If/Xtfep2l3k0Cg g236aXSiQVGIRgJ0XbL2q5+o5pEmEeCfr4pCnr5bu22nIJlNTP8yLDPsyJIPetK4xQT6 yHEbAh4E+zKllvvcmtZn4hGhVU6EN1Eb1EJ7eLphG6DDzbFYT8W3xjvssXVyYYFSDUc/ EhAQ== X-Gm-Message-State: AOJu0Yxf9e3XdrDk1mw6SPWYyGI3Z7kDRSobx7/selKdt5TWQKovabFj w/65+q6YhmKIKDXUIbUy5h2bFidUeonFc1eBuWYz0nhN/MqoHB0bJJjpRUiukItivdwm7ANrkK6 pFT1sbxfn7ht6IlvWTi9TrD0zZdD+vdlECvvjM7uUIHxiIDSu8hh9j7dx8YXReDO26Bcy679UCi sZ4Ai8KStTX/lADQAOVFZRtHvzVTIdcIMgoVu95hcnzKs= X-Received: by 2002:a5d:540a:0:b0:37d:47e0:45fb with SMTP id ffacd0b85a97d-37d5ff86f1dmr3004476f8f.21.1728762293009; Sat, 12 Oct 2024 12:44:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEaziZ7WpliWrUgLvsDGHuAfBSzL+7tzPLkALLZ8A/VXv+B7My1mqlL/bYyX+anreRaNdVZjQ== X-Received: by 2002:a5d:540a:0:b0:37d:47e0:45fb with SMTP id ffacd0b85a97d-37d5ff86f1dmr3004465f8f.21.1728762292427; Sat, 12 Oct 2024 12:44:52 -0700 (PDT) Received: from localhost ([195.213.152.26]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-37d4b6a8802sm6948910f8f.21.2024.10.12.12.44.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Oct 2024 12:44:52 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH] gdb/doc: some more details in the README file Date: Sat, 12 Oct 2024 20:44:45 +0100 Message-Id: <8ba49e21f99e8e08528f3053bbdc623d53669bc0.1728762272.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org After some recent discussions on the mailing list, I've made some changes to the README to (I hope) provide more clarity. The changes I made are: 1. Removed the use of a lone 'HOST' on the configure line. I tried this and 'configure' gave me a warning: configure: WARNING: you should use --build, --host, --target So I don't think this is approved practice any more. We should encourage users to use `--host` instead. 2. Added and reworded the --host, --target, and --enable-targets descriptions in the 'configure options' section. My goals here are to clarify that 'cross-debugging' is really the same as 'remote debugging', and also to make it clearer what the defaults are. 3. Added some additional text to the 'Remote debugging' section mentioning that 'remote debugging' is basically the same as 'cross debugging', given that we use 'cross-debugging' in the text above. Reviewed-By: Keith Seitz --- gdb/README | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) base-commit: 5bc1b13676bc5eeefc50d25379991f5f9255eb80 diff --git a/gdb/README b/gdb/README index d85c37d5d17..a52bad1ec55 100644 --- a/gdb/README +++ b/gdb/README @@ -354,7 +354,6 @@ explanation of `configure'. [--srcdir=PATH] [--target=TARGET] [--host=HOST] - [HOST] You may introduce options with a single `-' rather than `--' if you prefer; but you may abbreviate option names if you use `--'. Some @@ -380,19 +379,27 @@ more obscure GDB `configure' options are not listed here. directories below PATH. `--host=HOST' - Configure GDB to run on the specified HOST. + Configure GDB to run on the specified HOST. If you omit this, + GDB will guess; it's quite accurate. There is no convenient way to generate a list of all available hosts. -`HOST ...' - Same as `--host=HOST'. If you omit this, GDB will guess; it's - quite accurate. - `--target=TARGET' - Configure GDB for cross-debugging programs running on the specified - TARGET. Without this option, GDB is configured to debug programs - that run on the same machine (HOST) as GDB itself. + Configure GDB for cross-debugging programs running on the + specified TARGET. One way in which GDB support cross-debugging + is through the 'target remote' and 'target extended-remote' + commands for remote debugging. See the 'Remote debugging' + section below. + + If this option is not given then the default is the value of + HOST, see `--host' above. + + When TARGET matches HOST, GDB will be configured with support for + native debugging of programs running on the same machine as GDB. + + When TARGET and HOST are different GDB will only include support + for cross-debugging programs running on TARGET. There is no convenient way to generate a list of all available targets. @@ -400,9 +407,13 @@ more obscure GDB `configure' options are not listed here. `--enable-targets=TARGET,TARGET,...' `--enable-targets=all` Configure GDB for cross-debugging programs running on the - specified list of targets. The special value `all' configures + specified list of targets in addition to the target specified + with `--target' (see above). The special value `all' configures GDB for debugging programs running on any target it supports. + There is no convenient way to generate a list of all available + targets. + `--with-gdb-datadir=PATH' Set the GDB-specific data directory. GDB will look here for certain supporting files or scripts. This defaults to the `gdb' @@ -617,6 +628,15 @@ other GNU tools recursively. Remote debugging ================= + Remote debugging is when GDB runs on one maching type (see `--host' +above), while debugging applications running on a possibly different +machine using the 'target remote' or 'target extended-remote' +commands. The `--target' and `--enable-targets' configure options +control which targets GDB can debug. Remote debugging is one way in +which GDB can support cross-debugging, GDB runs on a machine of type +HOST (see `--host' configure option) but can remote debug a machine of +type TARGET (see `--target' and `--enable-targets' configure options). + The files m68k-stub.c, i386-stub.c, and sparc-stub.c are examples of remote stubs to be used with remote.c. They are designed to run standalone on an m68k, i386, or SPARC cpu and communicate properly