Skip to content

Commit

Permalink
Bug 581644 - Allow stack frames as pseudo-objects for HPROF snapshots
Browse files Browse the repository at this point in the history
Fix up parsing of ExportHPROF files for
ALL_METHODS_AS_CLASSES

Change-Id: I858a061f5535f1eae160ff5e409d07f15aa521d2
  • Loading branch information
ajohnson1 committed Mar 29, 2023
1 parent 17d1ca1 commit 025949e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -7805,6 +7805,23 @@ else if (next instanceof JavaClass)
al2.add(f);
}

// Add declared methods as pseudo-fields
if (getExtraInfo2)
{
int mindex = 1;
for (Iterator<?> i = j2.getDeclaredMethods(); i.hasNext();)
{
Object next = i.next();
if (isCorruptData(next, listener, Messages.DTFJIndexBuilder_CorruptDataReadingDeclaredMethods, j2))
continue;
JavaMethod jm = (JavaMethod) next;
long address = getMethodAddress(jm, listener);
ObjectReference val = new ObjectReference(null, address);
Field f = new Field("<method[" + (mindex++) + "]>", IObject.Type.OBJECT, val); //$NON-NLS-1$ //$NON-NLS-2$
al2.add(f);
}
}

// Add the MAT descriptions of the fields
Field[] statics = al2.toArray(new Field[al2.size()]);
FieldDescriptor[] fld = al.toArray(new FieldDescriptor[al.size()]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,6 @@ public void exportHPROF(boolean compress, boolean chunked, boolean redact, long
// Currently can't export PHD
assumeThat(snapshot.getSnapshotInfo().getProperty("$heapFormat"), not(equalTo((Serializable)"DTFJ-PHD")));
// Currently can't export methods as classes properly
assumeThat(hasMethods, not(equalTo(Methods.ALL_METHODS)));
if (redact)
assumeThat(hasMethods,equalTo(Methods.NONE));
// HPROF parser can't handle adding links from classloader to classes for javacore
Expand Down

0 comments on commit 025949e

Please sign in to comment.