Impossible to set debug break point in private methods of objects
Migrated from http://lampsvn.epfl.ch/trac/scala/ticket/3271
Reporter RuedigerK
It is impossible to set debug break points in private methods of objects. In the following example, I can set a break point in the method debuggingPossible, but Eclipse won't let me set one in debuggingImpossible.
I'm using the Scala Eclipse Plugin in version 2.8.0.r21325-b20100404033944 on Eclipse version 3.5.2 on a Windows 7 64bit system. Eclipse is running with a 32 bit JRE version 1.6.0_19.
Reporter RuedigerK
It is impossible to set debug break points in private methods of objects. In the following example, I can set a break point in the method debuggingPossible, but Eclipse won't let me set one in debuggingImpossible.
I'm using the Scala Eclipse Plugin in version 2.8.0.r21325-b20100404033944 on Eclipse version 3.5.2 on a Windows 7 64bit system. Eclipse is running with a 32 bit JRE version 1.6.0_19.
package test
object DebugTest {
private def debuggingImpossible {
"..."
}
def debuggingPossible {
"..."
}
}
Leave a comment
Updating tickets (#3255, #3262, #3271, #3277, #3279, #3287, #3313, #3317, #3318, #3320, #3329, #1000000, #1000002, #1000004, #1000005, #1000007, #1000011, #1000013, #1000018, #1000019, #1000020, #1000022, #1000023, #1000024, #1000025, #1000026, #1000028, #1000031, #1000033, #1000034, #1000037, #1000039, #1000040, #1000041, #1000057, #1000058, #1000060, #1000061, #1000063, #1000064, #1000065, #1000067, #1000070, #1000073, #1000076, #1000080, #1000082, #1000083, #1000084, #1000085, #1000087, #1000088, #1000089, #1000090, #1000092, #1000093, #1000094, #1000095, #1000097, #1000102, #1000104, #1000106, #1000108, #1000110, #1000111, #1000116, #1000124, #1000126, #1000127, #1000129, #1000132, #1000133, #1000136, #1000139, #1000143, #1000144, #1000145, #1000148, #1000149, #1000152, #1000154, #1000155, #1000157, #1000158, #1000159, #1000161, #1000169, #1000170, #1000172, #1000174, #1000176, #1000178, #1000179, #1000183, #1000185, #1000188, #1000189, #1000192, #1000196, #1000198)
on 2011-09-23 21:06 *
By polly.c.chang
I found that even though I am unable to set a breakpoint inside a private function, the debugger is still able to debug inside the function. So I played around with this and found a decent workaround:
1. Remove "private" from the function definition.
2. Set the breakpoint on the line that you want.
3. Immediately add the "private" keyword back.
The breakpoint is saved in the private function at that point, and the debugger will stop there just like with public functions.
1. Remove "private" from the function definition.
2. Set the breakpoint on the line that you want.
3. Immediately add the "private" keyword back.
The breakpoint is saved in the private function at that point, and the debugger will stop there just like with public functions.
A simpler workaround is to use the 'Toggle Line Breakpoint' action from the 'Run' menu in the main menu bar. It forces a line breakpoint at the current position.
The default 'Toggle Breakpoint' tries to set the most relevant breakpoint for the position, and in this case it wrongly decides that a Class Load breakpoint is what the user expects.
The default 'Toggle Breakpoint' tries to set the most relevant breakpoint for the position, and in this case it wrongly decides that a Class Load breakpoint is what the user expects.
on 2011-09-26 17:28 *
By polly.c.chang
You're right. "Toggle Line Breakpoint" works and is more convenient. Thanks!
(In revision:85baa51c52a83f4bf8219444dd53f397e3850cc7) Fixed #3271. Modified how elements at a position are searched for, so the best anwser possible is returned.
Branch:issue/no-line-breakpoint-in-object-private-method-3271
The methods in the object were hidden by the generated companion class. Reworked the way we find what element is a specific position in the code, so the most meaning full element is returned.
Branch:issue/no-line-breakpoint-in-object-private-method-3271
The methods in the object were hidden by the generated companion class. Reworked the way we find what element is a specific position in the code, so the most meaning full element is returned.
(In revision:85baa51c52a83f4bf8219444dd53f397e3850cc7) Fixed #3271. Modified how elements at a position are searched for, so the best anwser possible is returned.
Branch: issue/implicit-highlighting-1000628
Branch: issue/implicit-highlighting-1000628