Skip to contentSkip to conversation

domu_debug support removed on march 25th from traps.c in -unstable

DISCUSSION Kip Macy 2 participants 6 messages Apr 13, 2005

lore
Share & tools
lore
author
#1 lore raw

softirq change was Re: domu_debug support removed on march 25th from traps.c in -unstable

The comments are pretty self-explanatory - but it looks like the trace flag is no longer getting cleared on trap. Continue after single-stepping no longer works. Any thoughts on why?

-Kip

Quoted 4 lines · Kip Macy

Why?

-Kip

#2 lore raw

Re: softirq change was Re: domu_debug support removed on march 25th from traps.c in -unstable

The code belonged in debugger.h so I moved it there.

-- Keir

Quoted 13 lines · Kip Macy

The comments are pretty self-explanatory - but it looks like the trace flag is no longer getting cleared on trap. Continue after single-stepping no longer works. Any thoughts on why?

-Kip

Quoted 4 lines · Kip Macy

Why?

-Kip

author
#3 lore raw

Re: softirq change was Re: domu_debug support removed on march 25th from traps.c in -unstable

No idea why the trace trap flag isn't getting cleared? I can work at around it at the application level but that is aesthetically displeasing.

-Kip

Quoted 22 lines · Keir Fraser

The code belonged in debugger.h so I moved it there.

-- Keir

Quoted 13 lines · Kip Macy

The comments are pretty self-explanatory - but it looks like the trace flag is no longer getting cleared on trap. Continue after single-stepping no longer works. Any thoughts on why?

-Kip

Quoted 4 lines · Kip Macy

Why?

-Kip

#4 lore raw

Re: softirq change was Re: domu_debug support removed on march 25th from traps.c in -unstable

Quoted 3 lines · Kip Macy

No idea why the trace trap flag isn't getting cleared? I can work at around it at the application level but that is aesthetically displeasing.

You mean that the TF bit is not cleared by the domu_debug code when it should be? The correct place to fix this is in include/asm-x86/debugger.h in debugger_trap_entry().

In general (not using domu_debug) it is not Xen's job to clear TF. We clear it when we 'bounce' the exception into the guest OS, but the saved application stack frame will include EFLAGS with the TF bit still set. This matches real hardware.

-- Keir

author
#5 lore raw

Re: softirq change was Re: domu_debug support removed on march 25th from traps.c in -unstable

Quoted 3 lines

You mean that the TF bit is not cleared by the domu_debug code when it should be? The correct place to fix this is in include/asm-x86/debugger.h in debugger_trap_entry().

Yes. Continuing after single-stepping no longer works.

Quoted 4 lines

In general (not using domu_debug) it is not Xen's job to clear TF. We clear it when we 'bounce' the exception into the guest OS, but the saved application stack frame will include EFLAGS with the TF bit still set. This matches real hardware.

No it isn't Xen's job to clear it under normal circumstances as that would break PTRACE_SINGLESTEP in user-space. However, it was what the PDB code was doing and it seemed easy enough to clear it there to emulate PTRACE_SINGLESTEP for the kernel.

I honestly don't care where it happens, it is easy enough to clear the TF from xc_ptrace.c. I just happened to be *extremely* tired last night and was dealing with other issues, so I was frustrated when that didn't work. I'll just incorporate my fix to xc_ptrace.c in with the FreeBSD fixes for -unstable.

-Kip