Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Kernel debugging
@ 2013-12-19 18:51 Nikos Balkanas
  2013-12-20 19:41 ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Nikos Balkanas @ 2013-12-19 18:51 UTC (permalink / raw)
  To: gdb

Hi,

I am developing a module for the Linux kernel. For that i have setup
the exact environment in Virtual Box and have loaded the (guest)
kernel with -g and removed the -frame-pointers. I will run gdb from
host and try to debug kernel on guest system.

What is the best approach for this scenario? GDBserver or gdbstubs?.
Gdb server is good only for userspace debugging. Will gdbstubs work?
Are they included in the recent gdb sources, or are the ones to use
since 2003 from sourceforge? I am also looking for instructions on how
to implement them. Any hints?

TIA,
Nikos


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel debugging
  2013-12-19 18:51 Kernel debugging Nikos Balkanas
@ 2013-12-20 19:41 ` Mike Frysinger
  2013-12-21  5:46   ` Nikos Balkanas
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Frysinger @ 2013-12-20 19:41 UTC (permalink / raw)
  To: gdb; +Cc: Nikos Balkanas

[-- Attachment #1: Type: Text/Plain, Size: 742 bytes --]

On Thursday 19 December 2013 13:51:36 Nikos Balkanas wrote:
> I am developing a module for the Linux kernel. For that i have setup
> the exact environment in Virtual Box and have loaded the (guest)
> kernel with -g and removed the -frame-pointers. I will run gdb from
> host and try to debug kernel on guest system.
> 
> What is the best approach for this scenario? GDBserver or gdbstubs?.
> Gdb server is good only for userspace debugging. Will gdbstubs work?
> Are they included in the recent gdb sources, or are the ones to use
> since 2003 from sourceforge? I am also looking for instructions on how
> to implement them. Any hints?

the kernel has a built in gdb stub.  look for "kgdb" in the 
documentation/kconfig.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel debugging
  2013-12-20 19:41 ` Mike Frysinger
@ 2013-12-21  5:46   ` Nikos Balkanas
  2013-12-21  9:28     ` Mike Frysinger
  0 siblings, 1 reply; 4+ messages in thread
From: Nikos Balkanas @ 2013-12-21  5:46 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb

Ty mike,

I am aware of kdgb, but it doesn't have gdb's abilities. Besides I
know extensibly gdb, and I can never find the Sysreq key on my
keyboard :-(. I will try it next time, but for now I solved my problem
by reading the kernel source code. I have noticed the remote_vis.c in
gdb sources. Does this mean I can use gdb remotely to a virtual host?
How can i do it? Furthermore have gdbstubs incorporated into gdb
sources, or is it another abandoned project (since 2003 :-()?

Nikos

On Fri, Dec 20, 2013 at 9:41 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Thursday 19 December 2013 13:51:36 Nikos Balkanas wrote:
>> I am developing a module for the Linux kernel. For that i have setup
>> the exact environment in Virtual Box and have loaded the (guest)
>> kernel with -g and removed the -frame-pointers. I will run gdb from
>> host and try to debug kernel on guest system.
>>
>> What is the best approach for this scenario? GDBserver or gdbstubs?.
>> Gdb server is good only for userspace debugging. Will gdbstubs work?
>> Are they included in the recent gdb sources, or are the ones to use
>> since 2003 from sourceforge? I am also looking for instructions on how
>> to implement them. Any hints?
>
> the kernel has a built in gdb stub.  look for "kgdb" in the
> documentation/kconfig.
> -mike


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Kernel debugging
  2013-12-21  5:46   ` Nikos Balkanas
@ 2013-12-21  9:28     ` Mike Frysinger
  0 siblings, 0 replies; 4+ messages in thread
From: Mike Frysinger @ 2013-12-21  9:28 UTC (permalink / raw)
  To: Nikos Balkanas; +Cc: gdb

[-- Attachment #1: Type: Text/Plain, Size: 971 bytes --]

On Saturday 21 December 2013 00:46:25 Nikos Balkanas wrote:
> Ty mike,

please don't top post in your replies

> I am aware of kdgb, but it doesn't have gdb's abilities. Besides I
> know extensibly gdb, and I can never find the Sysreq key on my
> keyboard :-(. I will try it next time, but for now I solved my problem
> by reading the kernel source code. I have noticed the remote_vis.c in
> gdb sources. Does this mean I can use gdb remotely to a virtual host?
> How can i do it? Furthermore have gdbstubs incorporated into gdb
> sources, or is it another abandoned project (since 2003 :-()?

are you confusing kdb and kgdb ?  kgdb is just a remote gdb stub.  you still 
need gdb running somewhere else to connect to it to do debugging.  which means 
you have full access to gdb's abilities.

note that QEMU also has a gdb stub in it.  so you could use one of its system 
binaries to boot a linux kernel and then connect your gdb client to it.
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-12-21  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-19 18:51 Kernel debugging Nikos Balkanas
2013-12-20 19:41 ` Mike Frysinger
2013-12-21  5:46   ` Nikos Balkanas
2013-12-21  9:28     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox