jdb

Debugging ASM-generated bytecode with JDB (or similar)

半世苍凉 提交于 2020-12-01 11:54:28
问题 So I have some malfuctioning code to debug where SOMEthing throws an NPE and I'd like to step through some generated methods in order to try and find out why. Except stepping blindly is not really useful. Thread-4[1] list Source file not found: Foo.java Thread-4[1] locals Local variable information not available. Compile with -g to generate variable information The code was generated, so of course there is no .java file available for JDB. And since I don't compile it with javac, there's no

How to break into debugger within a jUnit test case?

一笑奈何 提交于 2020-02-04 03:08:51
问题 I'm debugging a unit test in a large java project. I need to run 'ant test ...' to launch the test suite. So it's difficult for me to launch it from the IDE. Is it possible to call some function like Debugger.Break() in C# to break into the debugger if it's attached to any debugger? 回答1: If I am understanding your question correctly, you can use java's remote debugging by setting these 2 jvm parameters: -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=1044 And for debugging

How to script the java debugger command-line tool (jdb)?

落花浮王杯 提交于 2020-01-11 04:06:06
问题 How can I drive the debugging session with some scripting language like ruby? Is there any easier options than using Expect or some similar module with a scripting language? 回答1: You may be able to use JRuby to drive your own debugger via the JPDA API. 回答2: Check out jdiscript; it's a thin scripting frontend for the JDI that can be used with Java, JRuby, or any other jvm language. 来源: https://stackoverflow.com/questions/630044/how-to-script-the-java-debugger-command-line-tool-jdb

Mac OS HSDB HotSpot Debugger can not attach to the process

女生的网名这么多〃 提交于 2020-01-06 05:15:29
问题 I want to use HSDB to debug my java code. I follow the steps blow: Debug my code in IntelliJ and stop at a breakpoint Start HSDB: java -cp ,:/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/lib/sa-jdi.jar sun.jvm.hotspot.HSDB use jps to get the pid attach to the pid, but error occurs. My java version: java version "1.8.0_161" Java(TM) SE Runtime Environment (build 1.8.0_161-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.161-b12, mixed mode) My os version: System Version:

Android with jdb confusion using waitForDebugger

南笙酒味 提交于 2019-12-29 07:15:12
问题 I'd like to debug my Android application on my device (Nexus One - not the emulator) using the command line. I'm confused at how to set a breakpoint using jdb in combination with android.os.Debug.waitForDebugger . Say I put the following code in my main activity onCreate : public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); android.os.Debug.waitForDebugger(); int j = 10; int r = j; } Using ddms I can see that my application is

Is it possible to set breakpoints at a specific bytecode instruction?

折月煮酒 提交于 2019-12-24 17:15:38
问题 I'm using jdb to remotely debug a Java application of which I don't have the source code. Furthermore, the application jars are obfuscated. I can set method breakpoints but, is it possible to set breakpoints at a specific bytecode instruction within a method? The idea I have is to use some disassembler like javap to identify the interesting instructions. Can jdb or other Java debugger do this? 回答1: You need line numbers to breakpoint on (something I assume has been removed). You can

Got badly stuck in integrating struts2 with hibernate

允我心安 提交于 2019-12-23 04:36:58
问题 i want to integrate Struts with Hibernate. I am new to these technologies. Infortunately i get badly stuck in these for last 4 days and my table is not able to get mapped. Please help. I am working on netbeans 7.1.2. i have created database on derby (Java DB). and i created few tables in it. In my Java EE simple project which simply need to fetch whole data from database and display on the JSP page. Here is My files : web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns

shmemBase_attach failed when connecting to Android device

社会主义新天地 提交于 2019-12-19 11:54:11
问题 I'm trying to hook up jdb on my computer to a process (any process really) on my Android device, but it doesn't work at all. So the commands I used are straight off the Google ADB Documentation. First I do adb forward tcp:3456 jdwp:pid Then after that I try to use jdb to try to hook up jdb -attach emulatorIP:3456 But I get the following error: java.io.IOException: shmemBase_attach failed: The system cannot find the file specified at com.sun.tools.jdi.SharedMemoryTransportService.attach0

shmemBase_attach failed when connecting to Android device

喜你入骨 提交于 2019-12-19 11:54:08
问题 I'm trying to hook up jdb on my computer to a process (any process really) on my Android device, but it doesn't work at all. So the commands I used are straight off the Google ADB Documentation. First I do adb forward tcp:3456 jdwp:pid Then after that I try to use jdb to try to hook up jdb -attach emulatorIP:3456 But I get the following error: java.io.IOException: shmemBase_attach failed: The system cannot find the file specified at com.sun.tools.jdi.SharedMemoryTransportService.attach0

JDB does not work on OS X 10.11

你。 提交于 2019-12-12 10:42:22
问题 My Java version is 1.8.0_6. The JDB on my laptop can be started with a .class file, say MyClass.class. But after I type run conmmand, JDB first gives me a prompt "run MyClass", then it is stuck for a while. After that, it throws out the following error information, VM start exception: VM initialization failed for: /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/bin/java -Xdebug -Xrunjdwp:transport=dt_socket,address=promote.cache-dns.local:58261,suspend=y DebugMe ERROR: