On Nov 29, 2007 2:09 PM, Ramana Radhakrishnan <[EMAIL PROTECTED]> wrote:
> Hi Michael,
>
> I had a comment / query regarding Stage 2 where you talk about
> Function cloning for different targets.
>
> I understand that the mechanism is to have a hidden function pointer
> that actually gets initialized based on the cpuid.
>
> I don't know if it is worth the effort to have debug info also
> enhanced to be such that a breakpoint put on the function my_min
> actually sets the breakpoint on any of the clones since the logic
> would be similar to the same.  This sounds logically similar to the
> way that gdb currently handles breakpoints to multiple constructors.
>

If the user has written the clone (for manual dispatch), then the
debug info would point to his code version. If it were generated
automatically (stage 2), the information would pertain to the function
cloned multiple times.The disassembly on those breakpoints might be
different, of course.

> The other option ofcourse is to fake debug information for such to
> actually set a breakpoint on the value of the function pointer that
> you so set up. I am no DWARF expert but there might be other folks on
> the list who might have better ideas about how to implement this.
>

There is an idea to modify the dynamic linker to take advantage of the
detection; If in such case, setting a breakpoint would be easier. Then
we wouldn't require indirect calls either. The breakpoints can be set
in each of the clones, and they will be processed only after setting
up the pointer and their subsequent execution.

The idea is to make use of the debugging information as provided by
the inline-cloner.

> cheers
> Ramana

Karthik



-- 
Karthik
http://guilt.bafsoft.net

Reply via email to