From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id aCEUCF1k+2XYdw8AWB0awg (envelope-from ) for ; Wed, 20 Mar 2024 18:34:05 -0400 Received: by simark.ca (Postfix, from userid 112) id 1E71F1E0C0; Wed, 20 Mar 2024 18:34:05 -0400 (EDT) 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 0AAF31E08C for ; Wed, 20 Mar 2024 18:34:03 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 72C243858287 for ; Wed, 20 Mar 2024 22:34:02 +0000 (GMT) Received: from vmail1.sentex.ca (vmail1.sentex.ca [64.7.153.19]) by sourceware.org (Postfix) with ESMTPS id E5BE33858C98 for ; Wed, 20 Mar 2024 22:33:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E5BE33858C98 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=riddermarkfarm.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=riddermarkfarm.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E5BE33858C98 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=64.7.153.19 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710974019; cv=none; b=VcWK/0WsCh4vtHsqiEDNhamx3ybllCTBfzue6RuNAMEbJ9ztRRzJ/GDTH1bCEOKLGseDzJlUKk9brPQ0OFgDQ1xJswZToF2D+KVE2cJ6Tl+Q7GRhM0Bjc3xUSttzHzsFkv1D2rTS+Sbml0q1G2AskenaUaHK+nkI+cM6OCvrr7U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710974019; c=relaxed/simple; bh=4lWm11CwhLjJq+h4qGFcjAZf8suAZOgZbZL9xs3/IG8=; h=Message-ID:Date:MIME-Version:From:Subject:To; b=mN4NOEJDdUooshpb3ztvVE3s7rYKDUJsmVHrcVY5nLJ8lYp/7g7lZ31AJ2pUoU1CyLcQsS0aN+JvHEn1EjclDUWMubHLTeQX047v8ufx0Y1oKHkdvgzqZBwIgFmvcRVKXgWKr8bOxOV01uow6MXmkqxND+eJC+p8sxqnnxcbTDw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: (Haraka outbound); Wed, 20 Mar 2024 18:33:35 -0400 Authentication-Results: vmail1.sentex.ca; auth=pass (plain) Received: from [10.0.1.25] (lan0.qip.iasl.com [206.210.100.144]) by vmail1.sentex.ca (Haraka/2.8.25) with ESMTPSA id B5ACC4D8-9A4D-454E-B597-EFE2028B7BF6.1 envelope-from (authenticated bits=0) (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256); Wed, 20 Mar 2024 18:33:35 -0400 Message-ID: <5d59faf0-07fc-be7c-47fe-9f6be9ddf05d@riddermarkfarm.ca> Date: Wed, 20 Mar 2024 18:33:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 From: john o goyo Subject: Re: Unable to trace assembler in GDB 14.2 on Solaris 11.3/sparc [Solved] To: gdb@sourceware.org References: Content-Language: en-CA In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Haraka-GeoIP: NA, CA, ON, Cobourg, 185km X-Spam-Status: No, score=-0.4 required=5.0 tests=BAYES_00, BODY_8BITS, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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@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: , Reply-To: jog37@riddermarkfarm.ca Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" The following works (thanks to https://stackoverflow.com/questions/44040235/using-gdb-to-find-exactly-where-the-error-occurs-sparc-assembly): 1. In gdb, "layout asm" runs TUI with the startup code on display. 2. Set breakpoint on _start. 3. Nexti until you reach the appropriate call, then issue stepi. 4. You are now at your code. Some odd things here.  When TUI starts up, your code is displayed with no labels, despite compiling with "-g".  The startup code has labels. For reference, here is the assembler. /*  *  Calling printf via assembler.  *  */         .section ".data" hello:  .asciz "Hello, World!\n"         .global main         .align 4 main:         save %sp,-96,%sp         set  hello,%o0         call printf         nop         mov  0,%i0         ret         restore