public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: john o goyo <jog37@riddermarkfarm.ca>
To: gdb@sourceware.org
Subject: Re: Unable to trace assembler in GDB 14.2 on Solaris 11.3/sparc [Solved]
Date: Wed, 20 Mar 2024 18:33:34 -0400	[thread overview]
Message-ID: <5d59faf0-07fc-be7c-47fe-9f6be9ddf05d@riddermarkfarm.ca> (raw)
In-Reply-To: <d38ff0e9-ab8f-6e3d-62df-d1231160e7c7@riddermarkfarm.ca>

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


  parent reply	other threads:[~2024-03-20 22:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-16 14:50 Unable to trace assembler in GDB 14.2 on Solaris 11.3/sparc john o goyo
     [not found] ` <8f334a7b-b0d8-4bee-b58a-d09526c6b0ab@redhat.com>
2024-03-18 15:12   ` john o goyo
2024-03-20 22:33 ` john o goyo [this message]
2024-03-21 16:29 ` Tom Tromey
2024-03-21 17:27   ` Unable to trace assembler in GDB 14.2 on Solaris 11.3/sparc [SOLVED] john o goyo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5d59faf0-07fc-be7c-47fe-9f6be9ddf05d@riddermarkfarm.ca \
    --to=jog37@riddermarkfarm.ca \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).