Re: Unable to trace assembler in GDB 14.2 on Solaris 11.3/sparc [Solved]

john o goyo <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.