Trace vs Debug in .NET BCL

The main difference is the one you indicate: Debug is not included in release, while Trace is. The intended difference, as I understand it, is that development teams might use Debug to emit rich, descriptive messages that might prove too detailed (or revealing) for the consumer(s) of a product, while Trace is intended to emit … Read more

Using Instrumentation to record unhandled exception

I think you should use ASM to manipulate bytecode directly. Here is algoritms: Visit all try/catch blocks (see visitTryCatchBlock) and save all handler labels Visit instructions until one of the handler labels met. After handler label insert logging code GETSTATIC java/lang/System out LDC “exception X occured” INVOKEVIRTUAL java/io/PrintStream println (java/lang/String)V And ensure that your javaagent … Read more

How can I deliver parameters to a test function, that launched using adb shell am Instrumentation command

you can pass a data uri, mime type and even “extras” to the am command. am [start|instrument] am start [-a <action>] [-d ] [-t <mime_type>] [-c <category> [-c <category>] …] [-e <extra_key> <extra_value> [-e <extra_key> <extra_value> …] [-n <component>] [-D] [<uri>] am instrument [-e <arg_name> <arg_value>] [-p <prof_file>] [-w] <component> You could pass them as … Read more

Does java have any mechanism for a VM to trace method calls on itself, without using javaagent, etc?

There is no such API provided by the JVM— even for agents started with -javaagent. The JVM TI is a native interface provided for native agents started with the -agent option or for debuggers. Java agents might use the Instrumentation API which provides the lowlevel feature of class instrumentation but no direct profiling capability. There … Read more