0

I was asked this question on a test and I'm not sure what the answer is and I'm having trouble finding it here and anywhere else online. So I hope someone on here can give me a quick answer and a quick explanation:

You debug a Java program using the following command:

jdb -attach 2121

Based on the scenario above, the command that is unavailable during your debugging session is:

a) print. b) threads. c) run. D) dump. e) cont.

I know attach is used with jdb to connect the debugger to a specific process and VM. But I don't know which process would be unavailable. I'm pretty sure you can use multiple threads within a VM, so that discounts b and c. and I don't know why you couldn't use print or cont -- that's a and e. and last would be dump, but I'm still not sure.

Anyone know. Thanks.

Alphonse23
  • 113
  • 2
  • 10

1 Answers1

2

The answer is: c) run. Since "This command is available only when jdb launches the debugged application (as opposed to attaching to an existing VM)". See jdb manual page for details.

dan
  • 13,132
  • 3
  • 38
  • 49
  • Aw yes, there's the answer: "run: After starting jdb, and setting any necessary breakpoints, you can use this command to start the execution the debugged application. This command is available only when jdb launches the debugged application (as opposed to attaching to an existing VM)." – Alphonse23 Nov 28 '12 at 18:20