Skip to contentSkip to conversation

A different KGDB stub

PATCH In review Tom Rini 4 participants 10 messages Feb 17, 2004 – Feb 19, 2004

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

cover A different KGDB stub

Hi Andrew. The following is my next attempt at a different KGDB stub for your tree (and then hopefully into kernel.org). This is against 2.6.3-rc4 + bk-netdev-rc3 (from your tree), and nothing else. This has been tested on PPC32 (KGDB=y/n) and i386 (KGDB=y and allmodconfig) and not at all on x86_64 (no time to build a toolchain yet). Since the last time, I've done the following:
- SysRq-G is always part of SYSRQ && KGDB.
- choice for I/O (8250 serial, kgdboe and PPC 'simple' serial, for now).
- On x86_64 / PPC32, we don't bother with CHK_DEBUGGER, but instead always use the arch provided debugger hooks.

Thre are 6 different patches:
core.patch: All of the non-arch specific bits, that aren't drivers. 8250.patch: The i/o driver for KGDB, via a standard PC uart. kgdboe.patch: The i/o driver for KGDB, via netpoll. i386.patch: The i386-specific code, tested.
ppc32.patch: The ppc32-specific code, tested. x86_64.patch: The x86_64-specific bits, untested.

One last note. For some reason, kgdboe isn't working for me right now. But it doesn't look like it's something specific to the kgdboe driver (Dropping in the -mm one and changing names to match still shows it, and the serial driver is solid) so I'm not sure if it's anything other than my bad luck today. So if nothing else, if someone else could give this a shot and let me know if it works for them...

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#1 lore raw
Quoted 3 lines · Tom Rini

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

#2 lore raw

Hi!

Quoted 4 lines
Quoted 2 lines

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

It is based on Amit's version, so I think answer is "yes". I certainly like this one.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#3 lore raw
Quoted 9 lines · Pavel Machek

Hi!

Quoted 4 lines
Quoted 2 lines

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

It is based on Amit's version, so I think answer is "yes". I certainly like this one.

I don't agree. I did a few more cleanups after Andi expressed concerns over globals kgdb_memerr and debugger_memerr_expected.

I liked Pavel's approach. Let's first get a minimal kgdb stub into mainline kernel. Even this much is going to involve some effort. We can merge other features later.

Let's create a cvs tree at kgdb.sourceforge.net for kgdb components to be pushed int mainline kernel. This split is to keep current kgdb unaffected. People who are already using it won't be affected.

May I suggest we breakup this task into following tasklets. I have expanded item 1 because Pavel has something that's already close. The rest of the items can be discussed in detail later. These need not be done in this order except for first 2 whose sequence is fixed.

1. A minimal kgdb stub
core.patch:
kgdbstub.c full.
No changes to module.c
No changes for CONFIG_KGDB_THREAD
No changes to calling convention of do_IRQ (Needs to be done) CONFIG_KGDB_CONSOLE removed
i386.patch
No changes for CONFIG_KGDB_THREAD
No manipulation of kernel stack before entry into do_IRQ
No non-source level CFI directives.
2. Minimal x86_64.patch
3. Patch to sync ppc kgdb with arch independent stub
4. Patch to sync other architecture kgdbs with arch independent stub on help from maintainers of those architectures.
5. KGDB_CONSOLE patch
This is a must for embedded boards that have only one serial port
6. gdb automatic module loading
7. CONFIG_KGDB_THREAD patch
This may or may not be a separate config option. This patch will include
x86_64 support required to enable threads.
8. i386 thread support
9. Ethernet interface based on netconsole
10. ... Any other features

Signature · 3 lines
Amit Kale
EmSysSoft (http://www.emsyssoft.com)
KGDB: Linux Kernel Source Level Debugger (http://kgdb.sourceforge.net)
#4 lore raw
Quoted 2 lines · Amit S. Kale

9. Ethernet interface based on netconsole

This will be simplified when the netpoll infrastructure is merged up. Hopefully that will happen very soon.

#5 lore raw
In reply to Amit S. Kale

Hi!

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

It is based on Amit's version, so I think answer is "yes". I certainly like this one.

I don't agree. I did a few more cleanups after Andi expressed concerns over globals kgdb_memerr and debugger_memerr_expected.

Quoted 7 lines

I liked Pavel's approach. Let's first get a minimal kgdb stub into mainline kernel. Even this much is going to involve some effort. We can merge other features later.

Let's create a cvs tree at kgdb.sourceforge.net for kgdb components to be pushed int mainline kernel. This split is to keep current kgdb unaffected. People who are already using it won't be affected.

I do not think we want separate CVS tree.

What about simply splitting core.patch into core-lite.patch and core.patch, maybe do the same with i386 patch, and be done with that? [We do not have enough people for a fork, I think].

Hopefully soon after that *-lite is merged, so it disappears, and stuff is easy once again.
Pavel

Signature · 2 lines
Horseback riding is like software...
...vgf orggre jura vgf serr.
#6 lore raw
Quoted 21 lines · Pavel Machek

Hi!

Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

It is based on Amit's version, so I think answer is "yes". I certainly like this one.

I don't agree. I did a few more cleanups after Andi expressed concerns over globals kgdb_memerr and debugger_memerr_expected.

Quoted 7 lines

I liked Pavel's approach. Let's first get a minimal kgdb stub into mainline kernel. Even this much is going to involve some effort. We can merge other features later.

Let's create a cvs tree at kgdb.sourceforge.net for kgdb components to be pushed int mainline kernel. This split is to keep current kgdb unaffected. People who are already using it won't be affected.

Quoted 5 lines

I do not think we want separate CVS tree.

What about simply splitting core.patch into core-lite.patch and core.patch, maybe do the same with i386 patch, and be done with that? [We do not have enough people for a fork, I think].

Agreed. Let's create core-lite.patch and i386-lite.patch
It makes it somewhat difficult to maintain them, but should be easier than maintaining a separate CVS tree.

Quoted 3 lines

Hopefully soon after that *-lite is merged, so it disappears, and stuff is easy once again.

Yes.

Signature · 3 lines
Amit Kale
EmSysSoft (http://www.emsyssoft.com)
KGDB: Linux Kernel Source Level Debugger (http://kgdb.sourceforge.net)
#7 lore raw

Hi!

Quoted 21 lines
Quoted 21 lines
Quoted 11 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

It is based on Amit's version, so I think answer is "yes". I certainly like this one.

I don't agree. I did a few more cleanups after Andi expressed concerns over globals kgdb_memerr and debugger_memerr_expected.

Quoted 7 lines

I liked Pavel's approach. Let's first get a minimal kgdb stub into mainline kernel. Even this much is going to involve some effort. We can merge other features later.

Let's create a cvs tree at kgdb.sourceforge.net for kgdb components to be pushed int mainline kernel. This split is to keep current kgdb unaffected. People who are already using it won't be affected.

I do not think we want separate CVS tree.

Quoted 7 lines
Quoted 3 lines

What about simply splitting core.patch into core-lite.patch and core.patch, maybe do the same with i386 patch, and be done with that? [We do not have enough people for a fork, I think].

Agreed. Let's create core-lite.patch and i386-lite.patch
It makes it somewhat difficult to maintain them, but should be easier than maintaining a separate CVS tree.

There's tool called quilt that is pretty good at exactly this. (It is small enough to do by hand, but ...)

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
author
#8 lore raw
In reply to Amit S. Kale
Quoted 27 lines · Amit S. Kale
Quoted 9 lines · Pavel Machek

Hi!

Quoted 4 lines
Quoted 2 lines

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

It is based on Amit's version, so I think answer is "yes". I certainly like this one.

I don't agree. I did a few more cleanups after Andi expressed concerns over globals kgdb_memerr and debugger_memerr_expected.

I liked Pavel's approach. Let's first get a minimal kgdb stub into mainline kernel. Even this much is going to involve some effort. We can merge other features later.

Let's create a cvs tree at kgdb.sourceforge.net for kgdb components to be pushed int mainline kernel. This split is to keep current kgdb unaffected. People who are already using it won't be affected.

May I suggest we breakup this task into following tasklets. I have expanded item 1 because Pavel has something that's already close. The rest of the items can be discussed in detail later. These need not be done in this order except for first 2 whose sequence is fixed.

Quoted 11 lines

1. A minimal kgdb stub
core.patch:
kgdbstub.c full.
No changes to module.c
No changes for CONFIG_KGDB_THREAD
No changes to calling convention of do_IRQ (Needs to be done) CONFIG_KGDB_CONSOLE removed
i386.patch
No changes for CONFIG_KGDB_THREAD
No manipulation of kernel stack before entry into do_IRQ No non-source level CFI directives.

My question is now, is there anything in CVS other than patches? There's still a whole host of cleanups that need to be done to your version that I've got around here.

Quoted 11 lines

4. Patch to sync other architecture kgdbs with arch independent stub on help from maintainers of those architectures.
5. KGDB_CONSOLE patch
This is a must for embedded boards that have only one serial port
6. gdb automatic module loading
7. CONFIG_KGDB_THREAD patch
This may or may not be a separate config option. This patch will include
x86_64 support required to enable threads.
8. i386 thread support
9. Ethernet interface based on netconsole
10. ... Any other features

Personally, I'd swap 6 and 9.

Signature · 2 lines
Tom Rini
http://gate.crashing.org/~trini/
#9 lore raw
Quoted 40 lines · Tom Rini
Quoted 27 lines · Amit S. Kale
Quoted 9 lines · Pavel Machek

Hi!

Quoted 4 lines
Quoted 2 lines

The following is my next attempt at a different KGDB stub for your tree

Is this the patch which everyone agrees on?

It is based on Amit's version, so I think answer is "yes". I certainly like this one.

I don't agree. I did a few more cleanups after Andi expressed concerns over globals kgdb_memerr and debugger_memerr_expected.

I liked Pavel's approach. Let's first get a minimal kgdb stub into mainline kernel. Even this much is going to involve some effort. We can merge other features later.

Let's create a cvs tree at kgdb.sourceforge.net for kgdb components to be pushed int mainline kernel. This split is to keep current kgdb unaffected. People who are already using it won't be affected.

May I suggest we breakup this task into following tasklets. I have expanded item 1 because Pavel has something that's already close. The rest of the items can be discussed in detail later. These need not be done in this order except for first 2 whose sequence is fixed.

Quoted 11 lines

1. A minimal kgdb stub
core.patch:
kgdbstub.c full.
No changes to module.c
No changes for CONFIG_KGDB_THREAD
No changes to calling convention of do_IRQ (Needs to be done) CONFIG_KGDB_CONSOLE removed
i386.patch
No changes for CONFIG_KGDB_THREAD
No manipulation of kernel stack before entry into do_IRQ No non-source level CFI directives.

Quoted 1 line

My question is now, is there anything in CVS other than patches?

No.
The CVS tree contains patches only.
What I have described above are features of two patches: core.patch and i386.patch.

Quoted 2 lines

There's still a whole host of cleanups that need to be done to your version that I've got around here.

You are welcome to bring them into the cvs tree.
Thanks.
-Amit

Quoted 14 lines
Quoted 12 lines

4. Patch to sync other architecture kgdbs with arch independent stub on help from maintainers of those architectures.
5. KGDB_CONSOLE patch
This is a must for embedded boards that have only one serial port
6. gdb automatic module loading
7. CONFIG_KGDB_THREAD patch
This may or may not be a separate config option. This patch will
include x86_64 support required to enable threads.
8. i386 thread support
9. Ethernet interface based on netconsole
10. ... Any other features

Personally, I'd swap 6 and 9.