mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
Merge remote-tracking branch 'origin/patch'
This commit is contained in:
commit
3b05eada12
3 changed files with 39 additions and 10 deletions
|
@ -72,8 +72,8 @@ public class SymbolPathParser {
|
||||||
int endIndex = i; // could be 0 if i == 0.
|
int endIndex = i; // could be 0 if i == 0.
|
||||||
if (endIndex > startIndex) {
|
if (endIndex > startIndex) {
|
||||||
list.add(name.substring(startIndex, endIndex));
|
list.add(name.substring(startIndex, endIndex));
|
||||||
i += 2;
|
startIndex = i + 2;
|
||||||
startIndex = i;
|
i++; // Only increment one, because the loop also has an increment.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,8 +100,8 @@ public class SymbolPathParser {
|
||||||
int endIndex = i; // could be 0 if i == 0.
|
int endIndex = i; // could be 0 if i == 0.
|
||||||
if (endIndex > startIndex) {
|
if (endIndex > startIndex) {
|
||||||
list.add(name.substring(startIndex, endIndex));
|
list.add(name.substring(startIndex, endIndex));
|
||||||
i += 2;
|
startIndex = i + 2;
|
||||||
startIndex = i;
|
i++; // Only increment one, because the loop also has an increment.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
*/
|
*/
|
||||||
package ghidra.app.util;
|
package ghidra.app.util;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.fail;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -68,10 +68,10 @@ public class SymbolPathParserTest extends AbstractGTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testNamespaceInFunctionArgument() {
|
public void testNamespaceInFunctionArgument() {
|
||||||
List<String> list = SymbolPathParser.parse( "Foo7::Bar5(class Foo1d::Bar1,int)");
|
List<String> list = SymbolPathParser.parse("Foo7::Bar5(class Foo1d::Bar1,int)");
|
||||||
List<String> expected = new ArrayList<>();
|
List<String> expected = new ArrayList<>();
|
||||||
expected.add("Foo7");
|
expected.add("Foo7");
|
||||||
expected.add("Bar5(class Foo1d::Bar1,int)");
|
expected.add("Bar5(class Foo1d::Bar1,int)");
|
||||||
assertListEqualOrdered(expected, list);
|
assertListEqualOrdered(expected, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,4 +118,32 @@ public class SymbolPathParserTest extends AbstractGTest {
|
||||||
assertListEqualOrdered(expected, list);
|
assertListEqualOrdered(expected, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSpecialCharAfterDelimiter1() {
|
||||||
|
String name = "A::B::C<wchar_t,A::B::D<wchar_t>,A::B::E<wchar_t> >::<unnamed-tag>";
|
||||||
|
List<String> list = SymbolPathParser.parse(name);
|
||||||
|
List<String> expected = new ArrayList<>();
|
||||||
|
expected.add("A");
|
||||||
|
expected.add("B");
|
||||||
|
expected.add("C<wchar_t,A::B::D<wchar_t>,A::B::E<wchar_t> >");
|
||||||
|
expected.add("<unnamed-tag>");
|
||||||
|
assertListEqualOrdered(expected, list);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testUnmatchedAngleBracketFallback1() {
|
||||||
|
// Contrived example to test naive parsing going into fallback mode due to unmatched
|
||||||
|
// angle brackets. The expected result here is not an accurate result that we would
|
||||||
|
// expect from a more sophisticated parser.
|
||||||
|
String name = "A::operator<=::B<C<int>::<unnamed-tag>>::E";
|
||||||
|
List<String> list = SymbolPathParser.parse(name);
|
||||||
|
List<String> expected = new ArrayList<>();
|
||||||
|
expected.add("A");
|
||||||
|
expected.add("operator<=");
|
||||||
|
expected.add("B<C<int>");
|
||||||
|
expected.add("<unnamed-tag>>");
|
||||||
|
expected.add("E");
|
||||||
|
assertListEqualOrdered(expected, list);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
<processor_spec>
|
<processor_spec>
|
||||||
<properties>
|
<properties>
|
||||||
<property key="assemblyRating:dsPIC30F:LE:24:default" value="POOR"/>
|
<property key="assemblyRating:dsPIC30F:LE:24:default" value="POOR"/>
|
||||||
<property key="assemblyMessage:dsPICdsPIC30F:LE:24:default" value="The language tested with a rating of POOR; however, the failures all deal with extraneous instructions. The assembler may offer you several options. At least one of them will be correct, but others may be erroneous."/>
|
<property key="assemblyMessage:dsPIC30F:LE:24:default"
|
||||||
|
value="The language tested with a rating of POOR; however, the failures all deal with extraneous instructions. The assembler may offer you several options. At least one of them will be correct, but others may be erroneous."/>
|
||||||
</properties>
|
</properties>
|
||||||
<programcounter register="PC"/>
|
<programcounter register="PC"/>
|
||||||
<data_space space="ram"/>
|
<data_space space="ram"/>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue