Skip to content

Commit

Permalink
Release 0.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
hajdam committed Dec 8, 2022
1 parent 23cb47b commit 11977f0
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 75 deletions.
2 changes: 1 addition & 1 deletion changes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
0.2.7
0.2.7 (2022-12-08)
- Added byte array support for some fields for Rider/CLion/GoLand (debug tree child nodes extraction)
- Minor layout fix (issue #45)
- Fixed settings save (issue #44)
Expand Down
12 changes: 6 additions & 6 deletions resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<idea-plugin version="2" url="https://bined.exbin.org/intellij-plugin">
<id>org.exbin.deltahex.intellij</id>
<name>BinEd - Binary/Hexadecimal Editor</name>
<version>0.2.7.snapshot</version>
<version>0.2.7</version>
<vendor email="[email protected]" url="https://exbin.org">ExBin Project</vendor>

<description><![CDATA[
Expand All @@ -24,7 +24,7 @@
<li>Show debug variables as binary data</li></ul>
<h1>License</h1>
<a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
<a href="https://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>
<h1>Links</h1>
Homepage: <a href="https://bined.exbin.org/intellij-plugin/">https://bined.exbin.org/intellij-plugin/</a><br/>
Expand All @@ -41,10 +41,10 @@ Sources: <a href="https://github.com/exbin/bined-intellij-plugin">https://github
]]>
</change-notes>

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
<idea-version since-build="211.1"/>

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
<!-- please see https://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
on how to target different products -->
<depends>com.intellij.modules.lang</depends>
<depends optional="true" config-file="debugger-ext.xml">com.intellij.modules.xdebugger</depends>
Expand Down Expand Up @@ -92,7 +92,7 @@ Sources: <a href="https://github.com/exbin/bined-intellij-plugin">https://github
<action id="BinEdEditor.OpenAsBinaryAction" class="org.exbin.bined.intellij.OpenAsBinaryAction"
text="Open As Binary" description="Opens file in binary/hexadecimal viewer/editor"
icon="/images/icon-idea.png"/>
<group>
<group id="BinEdEditor.ProjectView">
<reference id="BinEdEditor.OpenAsBinaryAction"/>
<add-to-group group-id="ProjectViewPopupMenu" relative-to-action="EditorDelete" anchor="after"/>
</group>
Expand All @@ -103,7 +103,7 @@ Sources: <a href="https://github.com/exbin/bined-intellij-plugin">https://github
<add-to-group group-id="FileOpenGroup" relative-to-action="OpenFile" anchor="after"/>
</action>

<group>
<group id="BinEdEditor.Editor">
<reference id="BinEdEditor.OpenAsBinaryAction"/>
<add-to-group group-id="EditorPopupMenu" relative-to-action="EditorDelete" anchor="after"/>
</group>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Application.name = BinEd
Application.title = BinEd Binary/Hexadecimal Editor
Application.release = 0.2.7
Application.mode = DEV
Application.version = 0.2.7 DEV
Application.product= BinEd Binary/Hexadecimal Editor 0.2.7 DEV
Application.mode =
Application.version = 0.2.7
Application.product= BinEd Binary/Hexadecimal Editor 0.2.7
Application.vendor = ExBin Project
Application.homepage = https://bined.exbin.org/intellij-plugin/
Application.vendorId = ExBin Project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void extensionListChanged() {
}

private void initExtensions() {
BINED_VIEW_DATA.extensions().filter(binaryViewData -> !initialized.contains(binaryViewData)).forEach(binaryViewData -> {
BINED_VIEW_DATA.getExtensionList().stream().filter(binaryViewData -> !initialized.contains(binaryViewData)).forEach(binaryViewData -> {
binaryViewData.passHandler(viewHandler);
initialized.add(binaryViewData);
});
Expand Down
127 changes: 63 additions & 64 deletions src/org/exbin/bined/intellij/debug/intellij/XValueNodeConvertor.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.jetbrains.php.debug.common.PhpNavigatableValue;
import com.jetbrains.php.lang.psi.resolve.types.PhpType;
import com.jetbrains.python.debugger.PyDebugValue;
import com.jetbrains.rider.debugger.DotNetNamedValue;
import com.sun.jdi.ArrayReference;
import com.sun.jdi.ArrayType;
import com.sun.jdi.ByteValue;
Expand Down Expand Up @@ -208,64 +207,6 @@ public List<DebugViewDataProvider> identifyAvailableProviders(@Nullable XValueNo
}
}

if (dotNetValueClassAvailable && container instanceof DotNetNamedValue) {
String typeName = myDataNode.getRawValue();
int arraySizePos = typeName.indexOf("[");
if (arraySizePos > 0) {
try {
String childType = typeName.substring(0, arraySizePos);
int arraySize = Integer.parseInt(typeName.substring(arraySizePos + 1, typeName.length() - 1));
childValueExtractor = XValueNodeConvertor::getDotNetValueText;
switch (childType) {
case "bool": {
childValueType = ChildNodesPageProvider.ValueType.BOOLEAN;
childValueSize = arraySize;
break;
}
case "byte": {
childValueType = ChildNodesPageProvider.ValueType.BYTE;
childValueSize = arraySize;
break;
}
case "short": {
childValueType = ChildNodesPageProvider.ValueType.SHORT;
childValueSize = arraySize;
break;
}
case "int": {
childValueType = ChildNodesPageProvider.ValueType.INTEGER;
childValueSize = arraySize;
break;
}
case "long": {
childValueType = ChildNodesPageProvider.ValueType.LONG;
childValueSize = arraySize;
break;
}
}
} catch (Exception ex) {
}
}

// DotNetNamedValue namedValue = (DotNetNamedValue) container;
// Project project = myDataNode.getTree().getProject();
// XDebuggerManager debuggerManager = XDebuggerManager.getInstance(project);
// XDebugSession debuggerSession = debuggerManager.getCurrentSession();
// XStackFrame debuggerStackFrame = debuggerSession.getCurrentStackFrame();
// ((DotNetExecutionStack) ((XDebugSessionImpl) debuggerSession).getCurrentExecutionStack()).getContext();
//
// ObjectProxy objectProxy = namedValue.getObjectProxy();
// DotNetValue value = new DotNetValue(namedValue.getFrame(), objectProxy, namedValue.getLifetime(), namedValue.getSessionId());
/// value.
// ObjectPropertiesProxy properties = objectProxy.getProperties();
// if (properties.isArray()) {
// switch (properties.getType()) {
//
// }
// }
// TODO Extract value somehow
}

if (pythonValueClassAvailable && container instanceof PyDebugValue) {
String dataType = ((PyDebugValue) container).getType();
if (dataType != null) {
Expand Down Expand Up @@ -452,6 +393,64 @@ public List<DebugViewDataProvider> identifyAvailableProviders(@Nullable XValueNo
}
}

if (dotNetValueClassAvailable && DOTNET_VALUE_CLASS.equals(valueCanonicalName)) {
String typeName = myDataNode.getRawValue();
int arraySizePos = typeName.indexOf("[");
if (arraySizePos > 0) {
try {
String childType = typeName.substring(0, arraySizePos);
int arraySize = Integer.parseInt(typeName.substring(arraySizePos + 1, typeName.length() - 1));
childValueExtractor = XValueNodeConvertor::getDotNetValueText;
switch (childType) {
case "bool": {
childValueType = ChildNodesPageProvider.ValueType.BOOLEAN;
childValueSize = arraySize;
break;
}
case "byte": {
childValueType = ChildNodesPageProvider.ValueType.BYTE;
childValueSize = arraySize;
break;
}
case "short": {
childValueType = ChildNodesPageProvider.ValueType.SHORT;
childValueSize = arraySize;
break;
}
case "int": {
childValueType = ChildNodesPageProvider.ValueType.INTEGER;
childValueSize = arraySize;
break;
}
case "long": {
childValueType = ChildNodesPageProvider.ValueType.LONG;
childValueSize = arraySize;
break;
}
}
} catch (Exception ex) {
}
}

// DotNetNamedValue namedValue = (DotNetNamedValue) container;
// Project project = myDataNode.getTree().getProject();
// XDebuggerManager debuggerManager = XDebuggerManager.getInstance(project);
// XDebugSession debuggerSession = debuggerManager.getCurrentSession();
// XStackFrame debuggerStackFrame = debuggerSession.getCurrentStackFrame();
// ((DotNetExecutionStack) ((XDebugSessionImpl) debuggerSession).getCurrentExecutionStack()).getContext();
//
// ObjectProxy objectProxy = namedValue.getObjectProxy();
// DotNetValue value = new DotNetValue(namedValue.getFrame(), objectProxy, namedValue.getLifetime(), namedValue.getSessionId());
/// value.
// ObjectPropertiesProxy properties = objectProxy.getProperties();
// if (properties.isArray()) {
// switch (properties.getType()) {
//
// }
// }
// TODO Extract value somehow
}

if (VARIABLE_VIEW_VALUE_CLASS.equals(valueCanonicalName)) {
org.jetbrains.debugger.values.Value value = ((VariableView) container).getValue();
String valueType = value.getValueString();
Expand Down Expand Up @@ -496,7 +495,7 @@ public List<DebugViewDataProvider> identifyAvailableProviders(@Nullable XValueNo
if (childValueType != null) {
// Debug tree child nodes extraction calls child tree nodes generation in GUI and tries to extract single values from it
BinaryData binaryData = new ChildNodesPageProvider(myDataNode, childValueType, childValueSize, childValueExtractor);
providers.add(new DefaultDebugViewDataProvider("Debug tree child nodes", binaryData));
providers.add(new DefaultDebugViewDataProvider("Tree child nodes (lazy)", binaryData));
}

providers.add(new DebugViewDataProvider() {
Expand Down Expand Up @@ -545,10 +544,6 @@ public static Optional<XValueNodeImpl> getDataNode(AnActionEvent event) {
return Optional.of(node);
}

if (dotNetValueClassAvailable && container instanceof DotNetNamedValue) {
return Optional.of(node);
}

if (cValueClassAvailable && container instanceof CidrValue) {
return Optional.of(node);
}
Expand All @@ -562,6 +557,10 @@ public static Optional<XValueNodeImpl> getDataNode(AnActionEvent event) {
return Optional.of(node);
}

if (dotNetValueClassAvailable && DOTNET_VALUE_CLASS.equals(valueCanonicalName)) {
return Optional.of(node);
}

if (VARIABLE_VIEW_VALUE_CLASS.equals(valueCanonicalName)) {
return Optional.of(node);
}
Expand Down

0 comments on commit 11977f0

Please sign in to comment.