Skip to content

Commit

Permalink
GP-4843 - PDB MSDIA proc of namespace and bit-fields - change initial
Browse files Browse the repository at this point in the history
name test
  • Loading branch information
ghizard committed Aug 13, 2024
1 parent 7d666ea commit f17f949
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -16,6 +16,7 @@
package ghidra.app.util.bin.format.pdb;

import java.util.List;

import org.apache.commons.lang3.StringUtils;

import ghidra.app.util.SymbolPathParser;
Expand All @@ -28,7 +29,7 @@
/**
* <code>PdbMember</code> convey PDB member information used for datatype
* reconstruction. The <i>memberDataTypeName</i> is expected to include
* namespace prefixes when relevant. When representing bitfields the
* namespace prefixes when relevant. When representing bitfields the
* <i>memberName</i> is used to convey bit-size and bit-offset information
* (e.g., fieldname:SSSS:XXXX where SSSS corresponds to the bit-size
* and XXXX corresponds to an bit-offset). If bit-offset information is
Expand Down Expand Up @@ -81,8 +82,8 @@ public String toString() {
}

private static String getMemberName(String name, PdbKind kind) {
if (name == null) {
return null;
if (StringUtils.isBlank(name)) {
return name;
}
if (kind == PdbKind.MEMBER) {
// Strip bitfield data if present (see parseBitField method)
Expand All @@ -92,9 +93,6 @@ private static String getMemberName(String name, PdbKind kind) {
}
}
// name may contain namespace prefix for non-Member class members
if (StringUtils.isEmpty(name)) {
return name;
}
List<String> names = SymbolPathParser.parse(name);
return names.get(names.size() - 1);
}
Expand Down

0 comments on commit f17f949

Please sign in to comment.