Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
小 白蛋
Intellij Community
Commits
b4367046
Commit
b4367046
authored
6 years ago
by
Vitaliy.Bibaev
Browse files
Options
Download
Email Patches
Plain Diff
[memory-agent] Remove a separate action to display referrers objects using the memory agent
parent
b4e19b3f
Branches unavailable
Tags unavailable
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
+8
-1
...gger/impl/src/com/intellij/debugger/engine/JavaValue.java
java/debugger/impl/src/com/intellij/debugger/memory/action/ShowGarbageCollectorRootsAction.java
+0
-54
...bugger/memory/action/ShowGarbageCollectorRootsAction.java
java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgent.java
+5
-0
...l/src/com/intellij/debugger/memory/agent/MemoryAgent.java
resources/src/idea/JavaActions.xml
+0
-7
resources/src/idea/JavaActions.xml
with
13 additions
and
62 deletions
+13
-62
java/debugger/impl/src/com/intellij/debugger/engine/JavaValue.java
+
8
-
1
View file @
b4367046
...
...
@@ -13,6 +13,8 @@ import com.intellij.debugger.engine.events.DebuggerCommandImpl;
import
com.intellij.debugger.engine.events.SuspendContextCommandImpl
;
import
com.intellij.debugger.impl.DebuggerContextImpl
;
import
com.intellij.debugger.impl.DebuggerUtilsEx
;
import
com.intellij.debugger.memory.agent.MemoryAgent
;
import
com.intellij.debugger.memory.agent.MemoryAgentReferringObjectsProvider
;
import
com.intellij.debugger.ui.impl.DebuggerTreeRenderer
;
import
com.intellij.debugger.ui.impl.watch.*
;
import
com.intellij.debugger.ui.tree.*
;
...
...
@@ -512,7 +514,12 @@ public class JavaValue extends XNamedValue implements NodeDescriptorProvider, XV
return
new
XReferrersProvider
()
{
@Override
public
XValue
getReferringObjectsValue
()
{
return
new
JavaReferringObjectsValue
(
JavaValue
.
this
,
ReferringObjectsProvider
.
BASIC_JDI
,
null
);
MemoryAgent
memoryAgent
=
getEvaluationContext
().
getDebugProcess
().
getMemoryAgent
();
ReferringObjectsProvider
provider
=
ReferringObjectsProvider
.
BASIC_JDI
;
if
(
memoryAgent
!=
null
&&
memoryAgent
.
canFindGcRoots
())
{
provider
=
new
MemoryAgentReferringObjectsProvider
(
memoryAgent
,
MemoryAgent
.
DEFAULT_GC_ROOTS_OBJECTS_LIMIT
);
}
return
new
JavaReferringObjectsValue
(
JavaValue
.
this
,
provider
,
null
);
}
};
}
...
...
This diff is collapsed.
Click to expand it.
java/debugger/impl/src/com/intellij/debugger/memory/action/ShowGarbageCollectorRootsAction.java
deleted
100644 → 0
+
0
-
54
View file @
b4e19b3f
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package
com.intellij.debugger.memory.action
;
import
com.intellij.debugger.actions.JavaReferringObjectsValue
;
import
com.intellij.debugger.engine.JavaValue
;
import
com.intellij.debugger.engine.ReferringObjectsProvider
;
import
com.intellij.debugger.engine.evaluation.EvaluateException
;
import
com.intellij.debugger.memory.agent.MemoryAgent
;
import
com.intellij.debugger.memory.agent.MemoryAgentReferringObjectsProvider
;
import
com.intellij.notification.NotificationType
;
import
com.intellij.openapi.application.ApplicationManager
;
import
com.intellij.openapi.util.text.StringUtil
;
import
com.intellij.xdebugger.XDebugSession
;
import
com.intellij.xdebugger.impl.XDebuggerManagerImpl
;
import
com.intellij.xdebugger.impl.ui.tree.XDebuggerTree
;
import
com.intellij.xdebugger.impl.ui.tree.XInspectDialog
;
import
com.intellij.xdebugger.impl.ui.tree.nodes.XValueNodeImpl
;
import
com.sun.jdi.ObjectReference
;
import
org.jetbrains.annotations.NotNull
;
public
class
ShowGarbageCollectorRootsAction
extends
MemoryAgentActionBase
{
private
static
final
int
DEFAULT_OBJECTS_LIMIT
=
3
;
@Override
protected
void
perform
(
@NotNull
MemoryAgent
memoryAgent
,
@NotNull
ObjectReference
reference
,
@NotNull
XValueNodeImpl
node
)
throws
EvaluateException
{
ReferringObjectsProvider
roots
=
memoryAgent
.
canFindGcRoots
()
?
new
MemoryAgentReferringObjectsProvider
(
memoryAgent
,
DEFAULT_OBJECTS_LIMIT
)
:
null
;
if
(
roots
==
null
)
{
XDebuggerManagerImpl
.
NOTIFICATION_GROUP
.
createNotification
(
"This feature is unavailable"
,
NotificationType
.
INFORMATION
);
return
;
}
ApplicationManager
.
getApplication
().
invokeLater
(
()
->
{
XDebuggerTree
tree
=
node
.
getTree
();
JavaValue
javaValue
=
(
JavaValue
)
node
.
getValueContainer
();
XDebugSession
session
=
javaValue
.
getEvaluationContext
().
getDebugProcess
().
getSession
().
getXDebugSession
();
JavaReferringObjectsValue
value
=
new
JavaReferringObjectsValue
(
javaValue
,
roots
,
null
);
XInspectDialog
dialog
=
new
XInspectDialog
(
tree
.
getProject
(),
tree
.
getEditorsProvider
(),
tree
.
getSourcePosition
(),
StringUtil
.
notNullize
(
node
.
getName
()),
value
,
tree
.
getValueMarkers
(),
session
,
false
);
dialog
.
setTitle
(
"Paths to GC Roots"
);
dialog
.
show
();
}
);
}
@Override
protected
boolean
isEnabled
(
@NotNull
MemoryAgent
agent
)
{
return
agent
.
canFindGcRoots
();
}
}
This diff is collapsed.
Click to expand it.
java/debugger/impl/src/com/intellij/debugger/memory/agent/MemoryAgent.java
+
5
-
0
View file @
b4367046
...
...
@@ -8,6 +8,11 @@ import org.jetbrains.annotations.NotNull;
import
java.util.List
;
public
interface
MemoryAgent
{
/**
* Maximal number of objects that will be retrieved by {@code findGcRoots} call
*/
int
DEFAULT_GC_ROOTS_OBJECTS_LIMIT
=
1000
;
boolean
isLoaded
();
boolean
canEvaluateObjectSize
();
...
...
This diff is collapsed.
Click to expand it.
resources/src/idea/JavaActions.xml
+
0
-
7
View file @
b4367046
...
...
@@ -588,13 +588,6 @@
relative-to-action=
"MemoryView.ShowInstancesFromDebuggerTree"
/>
</action>
<action
class=
"com.intellij.debugger.memory.action.ShowGarbageCollectorRootsAction"
id=
"Memory.ShowGarbageCollectorRoots"
text=
"Find Garbage Collector Roots"
>
<add-to-group
group-id=
"XDebugger.ValueGroup"
anchor=
"after"
relative-to-action=
"Memory.CalculateRetainedSize"
/>
</action>
<action
class=
"com.intellij.debugger.memory.action.tracking.JumpToAllocationSourceAction"
id=
"MemoryView.ShowAllocationStackTrace"
text=
"Jump To Allocation Position"
>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help