how to use gdb to debug downloadable kernel module(DKM)? - VxWorks

This is a discussion on how to use gdb to debug downloadable kernel module(DKM)? - VxWorks ; Hi, I would like to know how to use VxWorks 6.2's gdb to debug a DKM. I tried the following wrong method on the Host shell: -> gdb (gdb) file abc.o The error message was Error:{0} failed ... S_loadRtpLib_NOT_EXECUTABLE What ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: how to use gdb to debug downloadable kernel module(DKM)?

  1. how to use gdb to debug downloadable kernel module(DKM)?

    Hi,
    I would like to know how to use VxWorks 6.2's gdb to debug a DKM. I tried
    the following wrong method on the Host shell:
    -> gdb
    (gdb) file abc.o

    The error message was
    Error:{0} failed ... S_loadRtpLib_NOT_EXECUTABLE

    What is the right method?

    p.s. Kindly cc reply to kkokhoon@dso.org.sg

    Thanks, Vincent



  2. Re: how to use gdb to debug downloadable kernel module(DKM)?

    Hello Vincent,

    I might be wrong but I believe the host shell's gdb interpreter is
    meant to debug real-time processes (RTP) only. In the example you gave
    the file is an object module, not a VxWorks executable file (.vxe).

    Hope this helps,

    --
    PAD

  3. Re: how to use gdb to debug downloadable kernel module(DKM)?

    On Mar 14, 11:05 pm, PAD wrote:
    > Hello Vincent,
    >
    > I might be wrong but I believe thehostshell'sgdb interpreter is
    > meant to debug real-time processes (RTP) only. In the example you gave
    > the file is an object module, not a VxWorks executable file (.vxe).
    >
    > Hope this helps,
    >
    > --
    > PAD


    Hi Vincent,
    Hi PAD,

    the hostShell's gdb interpreter can be used to debug either RTP or
    DKM.

    Indeed, file command must be used to load RTP file (.vxe).
    And to debug DKM, used the following process :
    (gdb) attach kernel
    (gdb) load foo.out
    (gdb) break main
    (gdb) C sp main
    Where main is your DKM's entry point.

    And enjoy yourself !

    Cheers,
    Seb.

  4. Re: how to use gdb to debug downloadable kernel module(DKM)?

    Hi Seb,
    After running the task using "C sp main", I tried to list the source using:
    (gdb) list

    However, the following error message was shown:
    No symbol table is loaded. Use the "file" command.
    Do not forget to set the tgtpathmapping variable.


    What should I do?

    Thanks, Vincent

    "Seb" wrote in message
    news:f117787b-435b-438d-89b3-c34f375e324b@m3g2000hsc.googlegroups.com...
    > On Mar 14, 11:05 pm, PAD wrote:
    >> Hello Vincent,
    >>
    >> I might be wrong but I believe thehostshell'sgdb interpreter is
    >> meant to debug real-time processes (RTP) only. In the example you gave
    >> the file is an object module, not a VxWorks executable file (.vxe).
    >>
    >> Hope this helps,
    >>
    >> --
    >> PAD

    >
    > Hi Vincent,
    > Hi PAD,
    >
    > the hostShell's gdb interpreter can be used to debug either RTP or
    > DKM.
    >
    > Indeed, file command must be used to load RTP file (.vxe).
    > And to debug DKM, used the following process :
    > (gdb) attach kernel
    > (gdb) load foo.out
    > (gdb) break main
    > (gdb) C sp main
    > Where main is your DKM's entry point.
    >
    > And enjoy yourself !
    >
    > Cheers,
    > Seb.




  5. Re: how to use gdb to debug downloadable kernel module(DKM)?

    Hi Vincent,
    there is a bug in hostShell in fact ;-(
    So, to avoid it, re-select the current debugging thread with 'thread
    X' command where X is the thread number.
    Note that the thread number is printed when breakpoint is hitting,
    here 4 : [Switching to Thread 4 (LWP 1)]
    Below a debug example.

    Seb.

    (gdb) attach kernel
    (gdb) load /folk/seb/DKM/calendar/SIMLINUXdiab/calendar/Debug/
    calendar.out
    Reading symbols from /folk/seb/DKM/calendar/SIMLINUXdiab/calendar/
    Debug/calendar.out...done
    (gdb) break main
    Breakpoint 1 at 0x616FC0B9: file cal.c, line 160.
    (gdb) C sp main
    task spawned: id = 0x616fb1c8, name = s2u0
    value = 1634709960 = 0x616fb1c8
    (gdb) [Switching to Thread 4 (LWP 1)]

    Breakpoint 1, main (argc=0, argv=0x00000000) at cal.c:160
    160 __progname = argv[0];

    (gdb) thread 4
    [Switching to thread 4]
    4 0x616FC0B9 main (argc=0, argv=0x00000000) at /folk/seb/DKM/calendar/
    cal.c:160
    (gdb) list
    159
    160 __progname = argv[0];
    161
    162 yflag = 0;
    163 while ((ch = getopt(argc, argv, "jy")) != EOF)
    164 switch(ch) {


+ Reply to Thread