[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libunwind] How does GDB's libunwind communicate with ours?

From: David Mosberger
Subject: Re: [libunwind] How does GDB's libunwind communicate with ours?
Date: Mon, 8 Dec 2003 09:34:33 -0800

>>>>> On 07 Dec 2003 21:06:39 +0100, Johan Walles <address@hidden> said:

  Johan> Now, I attach a GDB that speaks libunwind.  How does GDB's
  Johan> libunwind communicate with ours?  How does it get hold of the
  Johan> information I handed to our libunwind?

The communication is via ptrace().  That is, gdb (through libunwind)
will read the data-structure for the dynamic unwind info via ptrace().
This passive communication is by design, because it needs to work even
at times when it's not possible to run code in the target program
(e.g., because you're looking at a core dump or because the target
program may be corrupted).

You may wonder how gdb/libunwind knows how to locate the
data-structure.  This is architecture-specific but in the case of
ia64, there is a special entry in the unwind-table which encodes the
address of the list-head for the dynamic unwind-info list (the special
entry is constructed such that it will be ignored by unwinders that
don't know about dynamic unwind-info, i.e., it's 100%


reply via email to

[Prev in Thread] Current Thread [Next in Thread]