trace

How do I trace methods calls in Java?

我是研究僧i 提交于 2019-12-18 02:45:07
问题 Consider the two simple Java classes below: First Example class Computer { Computer() { System.out.println("Constructor of Computer class."); } void On() { System.out.println("PC turning on..."); } void working() { System.out.println("PC working..."); } void Off() { System.out.println("PC shuting down..."); } public static void main(String[] args) { Computer my = new Computer(); Laptop your = new Laptop(); my.On(); my.working(); your.On(); your.working(); my.Off(); your.Off(); } } Second

VB6 Debugging - compiled

血红的双手。 提交于 2019-12-17 22:02:53
问题 My scenario is I'm supporting a VB6 app at the place I work and in the last few weeks it has started crashing more often than it ever used to. It uses both a local Access MDB database and a remote SQL Server DB for different types of storage. The good news is we are writing a replacement app, the band news I need to support this one in the meantime and the vendor is long gone from this world. What are some ways I could try and diagnose what is causing the crash? For example so far I've tried

Is there a way to get the stack trace of an exception in form of a String in Blackberry?

瘦欲@ 提交于 2019-12-17 20:13:57
问题 I want to log the stack trace of exceptions into a file. Is there a way that I can get the stack trace in form of a String , or somehow make ex.printStackTrace() print the trace into a stream or a file? I know that there is a way to do this in Java standard edition, but I want this in Blackberry. 回答1: BlackBerry only provides stack traces when you catch a Throwable. So you should be able to use printStackTrace and friends if you change the catch type. EDIT Sorry, I misread your question --

how to trace function call in C?

可紊 提交于 2019-12-17 10:32:32
问题 Without modifying the source code, how can i trace which functions are called and with what parameters, when some function(say func100 in the following example) is invoked. I would like the output to be as follows: enter func100(p1001=xxx,p1002=xxx) enter func110(p1101=xxx,p1102=xxx) exit func110(p1101=xxx,p1102=xxx) enter func120(p1201=xxx,p1202=xxx,p1203=xxx) enter func121(p1211=xxx) exit func121(p1211=xxx) exit func120(p1201=xxx,p1202=xxx,p1203=xxx) exit func100(p1001=xxx,p1002=xxx) is

Trace Python imports

烈酒焚心 提交于 2019-12-17 05:04:05
问题 My Python library just changed it's main module name from foo.bar to foobar . For backward compat, foo.bar still exists, but importing it raises a few warnings. Now, it seems some example program still imports from the old module, but not directly. I'd like to find the erroneous import statement. Is there any tool that allows me to trace imports and find the culprit without wading through all of the code? 回答1: Start the python interpreter with -v : $ python -v -m /usr/lib/python2.6/timeit.py

Trace Python imports

喜欢而已 提交于 2019-12-17 05:04:02
问题 My Python library just changed it's main module name from foo.bar to foobar . For backward compat, foo.bar still exists, but importing it raises a few warnings. Now, it seems some example program still imports from the old module, but not directly. I'd like to find the erroneous import statement. Is there any tool that allows me to trace imports and find the culprit without wading through all of the code? 回答1: Start the python interpreter with -v : $ python -v -m /usr/lib/python2.6/timeit.py

Is this usage of mlockall correct?

你说的曾经没有我的故事 提交于 2019-12-14 04:09:21
问题 The program below XORs 2 files to create an output file using one time pad encryption. I have attempted to use mlockall in order to avoid any traces of the keyfile being left on the hard drive when getting the keyfile from external memory sources. From the mlockall man page: mlock() and mlockall() respectively lock part or all of the calling process's virtual address space into RAM, preventing that memory from being paged to the swap area. How I do check if it is working and have I used

Disabling TRACE request method on Apache/2.0.52

我的梦境 提交于 2019-12-14 03:48:28
问题 By default, Apache 2.0.52 will respond to any HTTP TRACE request that it receives. This is a potential security problem because it can allow certain types of XSS attacks. For details, see http://www.apacheweek.com/issues/03-01-24#news I am trying to disable TRACE requests by following the instructions shown in the page linked to above. I added the following lines of code to my http.conf file, and restarted apache: RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRACE RewriteRule .* - [F]

btrace with JDK5

自闭症网瘾萝莉.ら 提交于 2019-12-14 03:46:34
问题 Can we use bTrace with JDK5 or lesser versions? If not, what is that things which is provided in JDK6 that makes bTrace work? My understanding is that btrace working on Java Byte Code Instrumentation which was there for JDK5 as well. is there some extra features of instrumentation which is being exploit by bTrace? 回答1: Please refer here: http://kenai.com/projects/btrace/forums/forum/topics/13112-running-BTrace-on-JRE Here is what have they answered: this scenario is not tested. In theory, it

How to trace COM objects exceptions?

南笙酒味 提交于 2019-12-13 20:15:31
问题 I have a DLL with some COM objects . Sometimes, this objects crashes and register an error event in the Windows Event Log with lots of hexadecimal informations. I have no clue why this crashes happens. So, How can I trace those COM objects exceptions? 回答1: The first step is to lookup the Fail code's hex value (E.G. E_FAIL 0x80004005). I've had really good luck with posting that value in Google to get a sense of what the error code means. Then, I just use trial and error to try to isolate the