This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: kgdb support for gdb
On Mon, Oct 04, 2004 at 10:05:24PM +0530, Amit S. Kale wrote:
> I don't suppress any frames. I insert a fake frame so that the fake frame can
> do the job of reporting correct registers to the previous frame. IT works
> more or less like inline functions. At present inline functions don't insert
> fake frames, but I believe it's being worked on.
FYI, I have inline frames mostly working. They are sort of "fake"
frames... but I haven't taken a look at your code, so I'm not sure
whether what you did is comparable.
> Let me state the problem I am trying to solve. You may be able to provide a
> better solution to that.
>
> schedule() function has a call to macro switch_to. The switch_to macro is an
> architecture specific macro. It has hand written assembly code that does a
> part of the context switching job. This code manipulates eip and esp in a
> non-standard way. Present gdb can't produce backtraces correctly if the frame
> 0 is inside switch_to. That's obvious since gdb doesn't have dwarf
> information for those instructions.
>
> A few things have been tried to help gdb with this problem. This one is worth
> mentioning: We report the esp as it would be when switch_to is complete.
> Since gdb doesn't look into switch_to code, it starts interpretations where
> switch_to ends. So this works ok for most part. It doesn't solve the problem
> of all registers, though. The switch_to code has been written intelligently
> (read over-engineered) to save only those registers which would be expected
> by gcc to be correct when schedule() function returns. So this task becomes
> unmanageable and error-prone.
Can you explain why this can't be done with additional DWARF annotation?
--
Daniel Jacobowitz