Unable to trace assembler in GDB 14.2 on Solaris 11.3/sparc
john o goyo
jog37@riddermarkfarm.ca
Sat Mar 16 14:50:29 GMT 2024
I am learning Sparc assembler (mostly through Paul's book and various
tutorials). I built GDB 14.2 on Solaris 11.3/sparc and can debug C code
with no problem.
Here is my test assembler code (hello.s):
/*
* 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
Compiled and linked via "gcc -g hello.s", the resulting a.out executes
as expected.
Here is what happens in GDB:
GNU gdb (GDB) 14.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "sparcv9-sun-solaris2.11".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from a.out...
(No debugging symbols found in a.out)
(gdb) b main
Function "main" not defined.
Make breakpoint pending on future shared library load? (y or [n])
This is contradiction to what both Paul's book and tutorials state. They
state that a breakpoint should be set at main.
Assistance requested, thank you.
Sincerely,
john
More information about the Gdb
mailing list