This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: walking the stack


Anthony Green wrote:

>On Mon, 2002-04-15 at 01:37, Bryce McKinlay wrote:
>
>>Interesting. I was thinking of something similar for stack trace 
>>printing, as an alternative to the dlsym/addr2line/demangling stuff we 
>>do now. That would allow us to get a trace even from a stripped binary 
>>by utilizing the reflection data.
>>
>
>I don't think what I'm doing will give you enough resolution.  I just
>put jrtbegin and jrtend around crtbegin and crtend to determine the
>extent of the text section for the main executable and every shared
>library it loads.
>

Right. For stack tracing the idea was to use the (sorted, perhaps, if 
they arn't already) method pointer values in the reflection data to 
determine what method a given PC value belongs to.

It seems to me that this technique would be more flexible and portable 
than using jrtbegin/jrtend. Once you have the class that a PC value 
belongs to you can just call getProtectionDomain() on it.

Of course, for native code, there is really no way to enforce java 
security since any .so you load might have hacks in it which bypass the 
security checks and do anything they want to the runtime. Thus 
implementing security is really only useful for applications which 
depends on having it to run. And, of course, for bytecode.

regards

Bryce.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]