From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 51F1C3858D37 for ; Sun, 1 Nov 2020 18:28:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 51F1C3858D37 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-467-PberS9ZxPmiEDEe4hrmEwA-1; Sun, 01 Nov 2020 13:28:25 -0500 X-MC-Unique: PberS9ZxPmiEDEe4hrmEwA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C7BA4185A0CE; Sun, 1 Nov 2020 18:28:24 +0000 (UTC) Received: from [10.36.115.38] (ovpn-115-38.ams2.redhat.com [10.36.115.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id 387495D9D2; Sun, 1 Nov 2020 18:28:23 +0000 (UTC) To: William Adair , gdb@sourceware.org References: From: Andrew Dinn Subject: Re: GDB Incorrectly Reads & Resolves Shared Library Symbols [MinGW-w64] Message-ID: Date: Sun, 1 Nov 2020 18:28:22 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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: Sun, 01 Nov 2020 18:28:29 -0000 On 31/10/2020 23:26, William Adair via Gdb wrote: > Can anyone recommend a way to start debugging GDB? I've found that when I > compile a 32-bit shared library that GDB is unable to correctly resolve the > symbols in the image and set breakpoints. Even when I reach a segfault and > print the backtrace, the symbols are incorrect or flat out missing. I > already verified that the image has .debug_* sections as would be required > for DWARF debugging, so I'm perplexed as to why GDB cannot correctly > resolve it and am looking for guidance. Well you can, of course, use your currently installed gdb to debug gdb. Build gdb from a downloaded src tree using make install PREFIX=/path/to/install/dir CFLAGS=-g CXXFLAGS=-g. Then run gdb --fullname /path/to/my/newly/built/gdb. When you type run you will enter a nested gdb that you can debug. Hint: before typing run type (gdb) set prompt (outer) That way you can distinguish prompts in the outer gdb from prompts in the inner gdb. n.b.b. make sure to type a space after (outer) or your typing will start right next to the closing bracket regards, After that all you need to do is familiarize wiht the gdb source! Andrew Dinn -----------