Skip to contentSkip to conversation

gdb support for kgdb [Re: Help for kgdb]

DISCUSSION Amit S. Kale 1 participant 1 message Oct 19, 2004 3 messages not in the archive

lore
Share & tools
lore
#3 lore raw
In reply to a message not in the archive

Hi All,

GDB gurus have suggested number of changes. I have checked in the major change today which is to remove the target "i386-lk". Instead I have added an osabi "Linux-kernel". I am pasting a part of the checked in README file here for your quick reference.

I can see a good info threads listing with the context frames as pointed out by me in earlier emails.
-Amit

--------
2. Building gdb
Compile the gdb with a configure followed by a make.

3. Using gdb
Supply vmlinux to gdb on command line and specify osabi to be "Linux-kernel" _before_ "target remote" command.

Example:

[amitkale@pythagoras gdb-build]$ gdb/gdb ~/build/2.6.9-rc2-i386/vmlinux GNU gdb 6.2.50_2004-10-15-cvs
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) set osabi Linux-kernel
(gdb) tar re /dev/ttyS0
Remote debugging using /dev/ttyS0
breakpoint () at /home/amitkale/work/linux-2.6.9-rc2/kernel/kgdb.c:1285
1285 atomic_set(&kgdb_setting_breakpoint, 0);
warning: no shared library support for this OS / ABI
(gdb) bt
#0 breakpoint () at /home/amitkale/work/linux-2.6.9-rc2/kernel/kgdb.c:1285
--------------

Quoted 32 lines · Tom Rini
Quoted 21 lines · Amit S. Kale
Quoted 20 lines · Tom Rini
Quoted 3 lines · George Anzinger

IMHO, any and ALL documentation of that sort should be in the Documentation branch of the kernel tree once the patch is applied. Likewise a

It's a good thing we've been doing that, then. :) Right now we've got a mini-HOWTO and code documentation done in DocBook.

Quoted 2 lines

recommended .gdbinit file, which would do the required set up. Mine also

What required setup? 'target remote /dev/ttyS0' (or udp:ip:port) and go.

Having said that, I wouldn't mind some sample GDB macros. Patches to the DocBook file are welcome. ... and once it is in the kernel, it's just another part of 'make *docs' of course.

[snip]

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

As to the gdb changes, the key issue in my mind is acceptance by the gdb folks.

Yes. Amit, any news on this front (such as you've submitted it or will in a few days) ?

I have checked in some gdb code today. I'll need to do a few more changes. I'll submit it to gdb folks by end of next week.

So, what's the status of this? Thanks.