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

john o goyo jog37@riddermarkfarm.ca
Wed Mar 20 22:33:34 GMT 2024


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



More information about the Gdb mailing list