Re: Is there a kgdb for Opteron for linux-2.6?

From: George Anzinger
Date: Wed Oct 29 2003 - 17:51:05 EST


Andi Kleen wrote:
On Wed, 29 Oct 2003 13:14:55 -0800
George Anzinger <george@xxxxxxxxxx> wrote:


Andi Kleen wrote:

On Tue, 28 Oct 2003 14:47:34 -0800
George Anzinger <george@xxxxxxxxxx> wrote:




I see that Andrew has not picked up my latest kgdb. In the latest version I have the dwarf2 stuff working in entry.S. Just ask, off list.


Do you use the .cfi* mnemonics in newer binutils? Without that it would get ugly.

I use asm mnemonics .uleb*, .sleb*, .byte and .long. For operands I use the defines in dwarf2.h (after fixing them to work with asm). These are, for the most part DW_CFA_* and other DW_* things. I put this together to build macros (CCP) so that I can code things like:


The latest binutils has new .cfi_* mnemonics in gas that make writing such a table
much cleaner and easier. My plan was to use that. It would require new binutils,
but make future mainteance much easier. When people don't have the new binutils
it can be defined away.

See http://www.logix.cz/~mic/devel/gas-cfi/

Looks like good stuff if you want to do a blow by blow. I decided against this in the register save and restore code as it is hardly ever needed. An asm function is another matter and this looks good for that.

An observation: Once you have the register save info in a CFI call frame, you can refer to it from anyplace you do the same save order. For example, in my code, the trap save and the system call save as well as the interrupt saves are all covered by the one cfi entry. This does not work if you want to do a blow by blow on the save and restore of the registers. Also, I don't see the entries to do expression evaluation (yet).



Which allows "bt" through entry.S code. I did not try to allow you to get the correct answer if you stop in the middle of the register save or restore code.


On x86-64 it is unfortunately more complicated because it has a separate interrupt
or exception stack. The backtracker has to read the old stack pointer from the frame. This can be expressed in dwarf2, but is a bit tricky.

Yes, the expression stuff...

--
George Anzinger george@xxxxxxxxxx
High-res-timers: http://sourceforge.net/projects/high-res-timers/
Preemption patch: http://www.kernel.org/pub/linux/kernel/people/rml

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/