[GDB] Can I get some sample program using debugging stub?

Todd Whitesel toddpw@windriver.com
Sun Oct 24 22:10:00 GMT 1999


> According to GDB manual, they said , "Insert set_debug_traps, breakpoint
> near the top of your program". But It's not concrete to me.

Pick a function like 'main' or 'myApp' or whatever you call your functions
that begin the program; and set a breakpoint there:

(gdb) break main

> I compiled GDB for "--target=sparc-wrs-vxworks" as target and solraris2 as

If you are using a public version of GDB, then this requires an older vxworks
target that supports 'RDB'. Newer targets (those shipped with Tornado 2.0) do
not support RDB any more.

I am working to get something appropriate for T2.0 into the public GDB but it
is slow going as I missed my best window of opportunity last winter by getting
really sick at just the wrong time.

> When tried to debug the application compiled under solaris2, it failed to
> read the file format. I guess the gdb which is made for cross debugging for
> another architecture can't work for the application of host that GDB works.
> Am I right?

That is generally true. If you build a program with gcc for a --target, then
you will also need a gdb for the same --target in order to debug it. If you
want to debug programs compiled by the solaris2 compiler, you should use a gdb
for --target=sparc-sun-solaris2.5.1 (or whatever version of solaris you have).

-- 
Todd Whitesel
toddpw @ wrs.com


More information about the Gdb mailing list