This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

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


>>>>> "Okehee" == Okehee Goh <ogoh@cise.ufl.edu> writes:
Okehee> 1. Can I get some sample application which is ready to debug
Okehee> on remote system with debugging stub? Any application on any
Okehee> target is o.k.
Okehee>
Okehee> According to GDB manual, they said , "Insert set_debug_traps,
Okehee> breakpoint near the top of your program". But It's not
Okehee> concrete to me.

When using (most of) the sample stubs distributed with GDB, you would
add:

        set_debug_traps();
        breakpoint();

Many of the programs in the GDB test suite add them right at the start
of main().  This may not be directly applicable to your situation, as
exception handling is target specific.

Okehee> 2.  I compiled GDB for "--target=sparc-wrs-vxworks" as target
Okehee> and solraris2 as host.  When tried to debug the application
Okehee> compiled under solaris2, it failed to read the file format.

First of all, you'll want to be using compiler, binutils, and debugger
built for the same target.

Secondly, RTOS's like vxWorks may be more difficult to adapt to using
the debug stubs.  The debug stubs assume they can take control of the
target, and the RTOS may have other requirements.  If the RTOS has its
own debug prtocol, like vxWorks' RDB or WDB, you may be better off
using it instead.

        --jtc

-- 
J.T. Conklin
RedBack Networks

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]