[Top][All Lists]

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

[libunwind] Basic use of dynamic features?

From: Tommy Hoffner
Subject: [libunwind] Basic use of dynamic features?
Date: Thu, 02 Dec 2004 17:30:42 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040421

I'm trying to use libunwind together with dynamically generated code.

My main concern has been to have the following call-chain on the stack: c++-code -> dynamically generated code -> c++-code, where the last one does a throw that get caught on the other side of the dynamically generated code.

I made a small test that seems to work fine for UNW_LOCAL_ONLY. Due to debugging problems I've decided to add my own stackdump function (in my application source) that I could call from inside a debugger that lacks support for this libunwind. Generalizing my test (e.g. removing UNW_LOCAL_ONLY and having a stackunwinder present in the code) forced me to link against libunwind-ia64, which in turn made my initial test fail (it only registers dynamically created unwind-info and uses throw and catch). As I understood it UNW_LOCAL_ONLY limits the functionality to a pure subset of what you get otherwise. I also thought that using the same functionality in and would give me the same results as long as I'm only using the "local" functionality. Have I missinterpreted something basic here?

And yes, I can live with UNW_LOCAL_ONLY for my basic functionality but looking at writing my own stackdump function seems to force me to use remote features. If I want to write my own stackdump function that I could call from the commandline in a debugger. I therefor need to get some kind of reference to the stack I want to dump. Calling a function from the command line in the debugger makes the calling function to be placed on another callstack than the application I want to debug. I'm not shure on exactly how it is implemented but functions like this can access the applicatons data so I assume the correlation between them (called function and the application I'm debugging) could be viewed as two threads (same data, different stacks). Do I need remote functionality to be able to access another threads callstack (whitout it doing things like unw_local_init itself)?
Any tips on how to do it?

I'm still using libunwind 0.97, but will hopefully move to 0.98.2 any day now,


Tommy Hoffner
Senior Software Designer
Compiler Technology

Ericsson AB
Development Unit Core Network Development
Tel:    +46 13 23 57 12
Fax:    +46 13 23 57 99

This communication is confidential and intended solely for the
addressee(s). Any unauthorized review, use, disclosure or distribution is
prohibited. If you believe this message has been sent to you in error,
please notify the sender by replying to this transmission and delete the
message without disclosing it. Thank you.

E-mail including attachments is susceptible to data corruption,
interruption, unauthorized amendment, tampering and viruses, and we only
send and receive e-mails on the basis that we are not liable for any such
corruption, interception, amendment, tampering or viruses or any
consequences thereof.

reply via email to

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