On Tue, 2006-06-13 at 10:19 -0400, Steve Millman wrote:

[NOTE: I'm working on the mail problem with sourceforge]

How about adding:

        set debug remote 10

to your .gdbinit file to better see what gdb is doing 
with the kgdb stub.

Often it's useful to have the stub trace what it's
sending to gdb also.

George's kgdb patch had a #define:

                REMOTE_DEBUG

which set remote_debug. This allowed the stub to log
what it was sending to gdb in putpacket().

You may want to add debug code to the SourceForge kgdb
stub. One place would be in put_packet(), just like 
George's patch for sending:

putpacket(char *buffer)
{
    unsigned char checksum;
    int count;
    char ch;

    /*  $<packet info>#<checksum>. */

    if (!kgdboe) {
        do {
            if (remote_debug)
                printk("T:%s\n", buffer);               <-----
            putDebugChar('$');
            checksum = 0;
            count = 0;


I've used DEBUG macro's that I added kernel.h and calls at the
entry and exit's of kgdb, kgdboe, and e1000 drivers.

The macro's switch out if not in an interrupt so that the console
output is logged.
----------------------------------------------------------------
#if DEBUG_PRINT
#define KERN_LEVEL KERN_ALERT
/*
 * DEBUG amd DEBUG_ENABLED defined
 * in individual files.
 */
#define  DEBUG_ENTRY(fmt,arg...)                \
    if (DEBUG_ENABLED) {                                    \
        printk(KERN_LEVEL "%s(", __func__);                 \
printk(fmt,##arg);                                  \
        printk(") {\n");                                \
        if ( !in_interrupt() ) {                \
           schedule_timeout(HZ/10); /* 1 sec */         \
        }                               \
    }

#define  DEBUG_PRINTF(fmt,arg...)               \
    if (DEBUG_ENABLED) {                                    \
        printk(KERN_LEVEL "%s:", __func__);                 \
        printk(fmt,##arg);                              \
        if ( !in_interrupt() )  {                           \
              schedule_timeout(HZ/10); /* 1 sec */          \
    }                           \
    }

#define DEBUG_RETURN(fmt, args...)                          \
    if (DEBUG_ENABLED) {                                    \
        printk(KERN_LEVEL "%s(): return(", __func__);       \
        printk(fmt, ##args);                                \
        printk("); }\n");                                   \
        if ( !in_interrupt() )  {                           \
        schedule_timeout(HZ/10); /* 1 sec */            \
    }                                                   \
    }

#define DEBUG_ERROR_EXIT(fmt, args...)                      \
    if (DEBUG_ENABLED) {                                    \
        printk(KERN_LEVEL "%s(): ", __func__);              \
        printk(fmt, ##args);                                \
        printk("; return; }\n");                            \
        if ( !in_interrupt() ) {                            \
        schedule_timeout(HZ/10); /* 1 sec */            \
    }                           \
#define DEBUG_EXIT()                                        \
    if (DEBUG_ENABLED) {                                    \
        printk(KERN_LEVEL "%s(): return; }\n", __func__);   \
    if ( !in_interrupt() ) {                            \
        schedule_timeout(HZ/10); /* 1 sec */            \
    }                           \
    }

#else
#define DEBUG_ENTRY(fmt,arg...)
#define DEBUG_PRINTF(fmt,arg...)
#define DEBUG_RETURN(fmt,arg...)
#define DEBUG_EXIT()
#define DEBUG_ERROR_EXIT(fmt,arg...)
#endif /* DEBUG_PRINT */
------------------------------------------------------------------------------------

I don't see any good reason why we shouldn't provide debug support in
the patch to facilitate installing the kgdb stub. It's been part of kgdb
stubs as far back as the old SunOS 4.1.4 patch I used back in 1995.

I'm using the 2.6.13 kgdb patch, so my viewpoint is likely a bit out of
date. I don't see my changes in bitkeeper with the calls to
DEBUG_ENTRY(); let me know if it's worth digging up.

I briefly looked thru the linux-2.6.15.5-kgdb-2.4 patchs and didn't see
any thing for enabling REMOTE_DEBUG; not even the README.

-piet



> 
> Hi Milind, 
> Thanks in advance for taking the time to look at this. 
> Here are the files that you requested: 
> 
> For the gdb log I just pasted the output of gdb.  I have the entire
> remote machine's compiled source image under the
> directory /usr/src/debugee2/linux-2.6.15KGDB-ETH directory on the
> machine running gdb and start gbd with the command:
>  ./gdbmod-2.4 /usr/src/debugee2/linux-2.6.15KGDB-ETH/vmlinux 
> Please tell me if you need any other information or files. 
> 
> Thanks,
> SteveM
> 
> 
> Milind Dumbare <[EMAIL PROTECTED]> wrote on 06/13/2006 02:44:24
> AM:
> 
> > Hi Steve,
> >    Please send Kernel .config file, gdb log and dmesg ouput of kgdb
> > machine (IMB Intellistation Z Pro in your case). Those files will be
> > helpful to track the problem.
> > 
> > thanks
> > 
> > On Mon, 2006-06-12 at 11:34 -0400, Steve Millman wrote:
> > > 
> > > Hi, 
> > > I am trying to set up kgdb over ethernet debugging of the 2.6.15
> > > kernel.  The machine being debugged is a IBM Intellistation Z Pro.
> > >  When I try to connect to it from my remote machine through gdb,
> it
> > > gives several "Ignoring packet error, continuing messages" and a
> > > "malformed response to offset query, timeout" message.  I cannot
> > > connect to it either when I put kgdbwait in the grub.conf file or
> not.
> > > Attached is my grub.conf file.   
> > > Any idea what I am doing wrong? 
> > > 
> > > Thanks,
> > > SteveM
> > > _______________________________________________
> > > Kgdb-bugreport mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport
> > -- 
> > ...Milind
> > KGDB-PRO
> > http://www.linsyssoft.com/Kgdbpro.html
> > 
> _______________________________________________
> Kgdb-bugreport mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport
-- 
---
[EMAIL PROTECTED]



_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to