How is stack-trace constructed? (original) (raw)

Manas Thakur manasthakur17 at gmail.com
Wed Jun 17 12:33:23 UTC 2015


Thanks a lot Andrew; I understood the flow now.

Regards, Manas

On 17-Jun-2015, at 4:45 pm, Andrew Haley <aph at redhat.com> wrote:

Hi, On 06/17/2015 12:02 PM, Manas Thakur wrote:

I haven’t done that (will do for sure if you suggest). But I thought this information must be available somewhere with a data structure in “ciMethod”. Can you tell if I am leading to the right direction? No, those are compile-time structures. The information you seek is in the nmethod. It has PcDescs which map a physical PC to the corresponding source scope and bytecode index. Once you have that it's relatively easy. Put a breakpoint on javalangThrowable::fillinstacktrace here: if (nm->method()->isnative()) { method = nm->method(); bci = 0; } else { PcDesc* pd = nm->pcdescat(pc); decodeoffset = pd->scopedecodeoffset(); // if decodeoffset is not equal to 0, it will execute the // "compiled java method case" at the beginning of the loop. and you can watch it happen. Andrew.



More information about the hotspot-dev mailing list