Merge remote-tracking branch 'origin/Ghidra_11.4'

This commit is contained in:
Ryan Kurtz 2025-05-28 14:59:46 -04:00
commit 5e17903c66
6 changed files with 139 additions and 75 deletions

View file

@ -55,9 +55,13 @@
checked out "disappear" from the Ghidra Project Window, as they are unavailable. Private checked out "disappear" from the Ghidra Project Window, as they are unavailable. Private
files remain intact and are not affected by the server connection.</P> files remain intact and are not affected by the server connection.</P>
<P><IMG alt="" src="help/shared/tip.png" border="0">You are authenticated only once per <BLOCKQUOTE>
Ghidra session; so if you open other project repositories managed by the same Ghidra Server, <P>
you will be prompted only once for a password, as required.&nbsp;</P> <IMG SRC="help/shared/tip.png" />
You are authenticated only once per
Ghidra session; so if you open other project repositories managed by the same Ghidra Server,
you will be prompted only once for a password, as required.&nbsp;</P>
</BLOCKQUOTE>
<H3><A name="Troubleshooting"></A>Troubleshooting a Failed Connection</H3> <H3><A name="Troubleshooting"></A>Troubleshooting a Failed Connection</H3>
@ -133,17 +137,25 @@
has not been added to version control (note the plain icon and no version information). It has not been added to version control (note the plain icon and no version information). It
is considered to be a "private" file. Private files are never visible to other users.</P> is considered to be a "private" file. Private files are never visible to other users.</P>
<P><IMG alt="" src="help/shared/note.png" border="0"> A normal checkout is indicated by a <BLOCKQUOTE>
checkmark with a green background<IMG alt="" src="images/check.png" border="0">, while an <P>
exclusive checkout is indicated by checkmark with a blue background<IMG alt="" src= <IMG SRC="help/shared/tip.png" />
"images/checkex.png" border="0">. A checkmark with a red background<IMG alt="" src= A normal checkout is indicated by a
"images/checkNotLatest.gif" border="0"> indicates that a newer version has been checked-in checkmark with a green background<IMG alt="" src="images/check.png" border="0">, while an
by another user.</P> exclusive checkout is indicated by checkmark with a blue background<IMG alt="" src=
"images/checkex.png" border="0">. A checkmark with a red background<IMG alt="" src=
"images/checkNotLatest.gif" border="0"> indicates that a newer version has been checked-in
by another user.</P>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>
<IMG SRC="help/shared/note.png" />
A tool tip on the file (let the mouse pointer hover over it) shows the date
the file was checked out, and the date that is was last modified. An asterisk will appear
on the file icon to indicate that changes have been made but not checked in.</P>
</BLOCKQUOTE>
<P align="left">A tool tip on the file (let the mouse pointer hover over it) shows the date
the file was checked out, and the date that is was last modified. An asterisk will appear
on the file icon to indicate that changes have been made but not checked in.<BR>
</P>
</BLOCKQUOTE> </BLOCKQUOTE>
<H3>Check Out<A name="CheckOut"></A> <IMG alt="" src="images/vcCheckOut.png" border= <H3>Check Out<A name="CheckOut"></A> <IMG alt="" src="images/vcCheckOut.png" border=
@ -171,8 +183,12 @@
out. While the exclusive lock exists, no other user can check out the file.<BR> out. While the exclusive lock exists, no other user can check out the file.<BR>
</P> </P>
<P><IMG alt="" src="help/shared/note.png" border="0"> The exclusive lock is implied for a <BLOCKQUOTE>
non-shared project repository.</P> <P>
<IMG SRC="help/shared/note.png" />
The exclusive lock is implied for a non-shared project repository.</P>
</BLOCKQUOTE>
</BLOCKQUOTE> </BLOCKQUOTE>
<H3>Check In<A name="CheckIn"></A> <IMG alt="" src="images/vcCheckIn.png" border= <H3>Check In<A name="CheckIn"></A> <IMG alt="" src="images/vcCheckIn.png" border=
@ -185,11 +201,15 @@
either click on the check in icon <IMG alt="" src="images/vcCheckIn.png" border="0"> on the either click on the check in icon <IMG alt="" src="images/vcCheckIn.png" border="0"> on the
tool bar, or right mouse click and select the <B>Check In...</B> option.&nbsp;</P> tool bar, or right mouse click and select the <B>Check In...</B> option.&nbsp;</P>
<P><IMG alt="" src="help/shared/tip.png" border="0">The <IMG alt="" src= <P>A dialog is displayed so that you can enter comments that describe your changes.</P>
"images/vcCheckIn.png" border="0"> icon is also available from the tool where you have the
file opened.&nbsp;</P> <BLOCKQUOTE>
<P>
<IMG SRC="help/shared/tip.png" />
The <IMG alt="" src="images/vcCheckIn.png" border="0"> toolbar action icon is also
available from within the tool where you have the file opened.</P>
</BLOCKQUOTE>
<P>A dialog is displayed so that you can enter comments that describe your changes.</P>
</BLOCKQUOTE> </BLOCKQUOTE>
<P align="center"><IMG alt="" src="images/CheckInFile.png" border="0"></P> <P align="center"><IMG alt="" src="images/CheckInFile.png" border="0"></P>
@ -240,10 +260,26 @@
<P align="left">If the checkbox on the dialog is selected, then a private file is created <P align="left">If the checkbox on the dialog is selected, then a private file is created
with a ".keep" extension on the filename. The checkbox is selected by default.&nbsp;</P> with a ".keep" extension on the filename. The checkbox is selected by default.&nbsp;</P>
<P align="left"><IMG alt="" src="help/shared/note.png" border="0">If you have the file <BLOCKQUOTE>
open in the Code Browser when you attempt to undo the check out, you will get an error <P>
dialog indicating that the file is in use. You must close the file first, then undo check <IMG SRC="help/shared/note.yellow.png" />
out.</P> If you have the file
open in the Code Browser when you attempt to undo the check out, you will get an error
dialog indicating that the file is in use. You must close the file first, then undo check
out.</P>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>
<IMG SRC="help/shared/note.png" />
When a file is checked-out a copy of the file and
its folder path is created within the private project data store. When an undo checkout
is performed that file and any empty parent folders are removed from the private data
store. This is done to ensure any folder name changes or removals within a shared project
repository are properly reflected while connected and avoid showing old/stale folders.
</P>
</BLOCKQUOTE>
</BLOCKQUOTE> </BLOCKQUOTE>
<H3>Update<A name="Update"></A> <IMG alt="" src="images/vcMerge.png" border="0">&nbsp;</H3> <H3>Update<A name="Update"></A> <IMG alt="" src="images/vcMerge.png" border="0">&nbsp;</H3>
@ -276,12 +312,19 @@
option is only enabled when the latest version number on the server is <B>greater</B> than option is only enabled when the latest version number on the server is <B>greater</B> than
the version that you checked out.&nbsp;&nbsp;</P> the version that you checked out.&nbsp;&nbsp;</P>
<P><IMG alt="" src="help/shared/tip.png" border="0">&nbsp; The <IMG alt="" src= <BLOCKQUOTE>
"images/vcMerge.png" border="0"> icon is also available from the tool where you have the <P>
file opened.</P> <IMG SRC="help/shared/tip.png" />
The <IMG alt="" src="images/vcMerge.png" border="0"> icon is also available from the
tool where you have the file opened.</P>
</BLOCKQUOTE>
<BLOCKQUOTE>
<P>
<IMG SRC="help/shared/note.png" />
The update action is not applicable in a non-shared project repository.</P>
</BLOCKQUOTE>
<P><IMG alt="" src="help/shared/note.png" border="0"> The update action is not applicable
in a non-shared project repository.</P>
</BLOCKQUOTE> </BLOCKQUOTE>
<H3>&nbsp;</H3> <H3>&nbsp;</H3>
@ -343,23 +386,27 @@
version 10 of SharedProgram.exe.&nbsp; You can make changes to the file, but you must save version 10 of SharedProgram.exe.&nbsp; You can make changes to the file, but you must save
it to a new name.</P> it to a new name.</P>
<P><IMG alt="" src="help/shared/tip.png" border="0">&nbsp; Other ways to open a specific <BLOCKQUOTE>
version in a tool are:</P> <P>
<IMG SRC="help/shared/tip.png" />
Other ways to open a specific version in a tool are:</P>
<UL> <UL>
<LI>Drag a version from the <I>Version History</I> dialog to a running tool, the running <LI>Drag a version from the <I>Version History</I> dialog to a running tool, the running
tool's icon, or to a tool icon in the tool chest.</LI> tool's icon, or to a tool icon in the tool chest.</LI>
<LI>If you have a <A href= <LI>If you have a <A href=
"help/topics/Tool/Ghidra_Tool_Administration.htm#Set_Tool_Associations">default tool</A> "help/topics/Tool/Ghidra_Tool_Administration.htm#Set_Tool_Associations">default tool</A>
specified, double click on the version that you want to open.</LI> specified, double click on the version that you want to open.</LI>
<LI>Choose the <B>File</B><IMG alt="" src="help/shared/arrow.gif" border=
"0"><B>Open...</B> option; the <A href=
"help/topics/ProgramManagerPlugin/Opening_Program_Files.htm#VersionHistory">Open Program
dialog</A> is displayed; from this dialog you can select a version to
open.&nbsp;&nbsp;</LI>
</UL>
</BLOCKQUOTE>
<LI>Choose the <B>File</B><IMG alt="" src="help/shared/arrow.gif" border=
"0"><B>Open...</B> option; the <A href=
"help/topics/ProgramManagerPlugin/Opening_Program_Files.htm#VersionHistory">Open Program
dialog</A> is displayed; from this dialog you can select a version to
open.&nbsp;&nbsp;</LI>
</UL>
</BLOCKQUOTE> </BLOCKQUOTE>
<H3>Delete</H3> <H3>Delete</H3>

View file

@ -19,6 +19,7 @@ import java.io.*;
import db.buffers.BufferFile; import db.buffers.BufferFile;
import db.buffers.ManagedBufferFile; import db.buffers.ManagedBufferFile;
import ghidra.framework.store.local.UnknownFolderItem;
import ghidra.util.InvalidNameException; import ghidra.util.InvalidNameException;
import ghidra.util.exception.*; import ghidra.util.exception.*;
import ghidra.util.task.TaskMonitor; import ghidra.util.task.TaskMonitor;
@ -77,7 +78,9 @@ public interface FileSystem {
/** /**
* Returns a list of the folder items contained in the given folder. * Returns a list of the folder items contained in the given folder.
* @param folderPath the path of the folder. * @param folderPath the path of the folder.
* @return a list of folder items. * @return a list of folder items. Null items may exist if index contained item name
* while storage was not found. An {@link UnknownFolderItem} may be returned if unsupported
* item storage encountered.
* @throws IOException * @throws IOException
*/ */
public FolderItem[] getItems(String folderPath) throws IOException; public FolderItem[] getItems(String folderPath) throws IOException;

View file

@ -167,6 +167,23 @@ public class IndexedLocalFileSystem extends LocalFileSystem {
indexJournal = new IndexJournal(); indexJournal = new IndexJournal();
} }
@Override
public LocalFolderItem[] getItems(String folderPath) throws IOException {
String[] itemNames = getItemNames(folderPath, false);
LocalFolderItem[] folderItems = new LocalFolderItem[itemNames.length];
for (int i = 0; i < itemNames.length; i++) {
LocalFolderItem item = getItem(folderPath, itemNames[i]);
if (item == null && !readOnly) {
// remove item from index where item storage is missing
Msg.warn(this, "Removing missing folder item from filesystem index: " +
LocalFileSystem.getPath(folderPath, itemNames[i]));
itemDeleted(folderPath, itemNames[i]);
}
folderItems[i] = item;
}
return folderItems;
}
@Override @Override
public synchronized void dispose() { public synchronized void dispose() {
if (rootFolder == null) { if (rootFolder == null) {
@ -1286,9 +1303,9 @@ public class IndexedLocalFileSystem extends LocalFileSystem {
/** /**
* Construct a previously allocated item and add it to the parent's * Construct a previously allocated item and add it to the parent's
* item map. The FileID will be read from the Property file. * item map. The FileID will be read from the Property file.
* @param parent * @param parent parent folder
* @param name * @param name item name
* @param storageName * @param storageName storage name
*/ */
Item(Folder parent, String name, String storageName) { Item(Folder parent, String name, String storageName) {
this.storageName = storageName; this.storageName = storageName;
@ -1298,9 +1315,9 @@ public class IndexedLocalFileSystem extends LocalFileSystem {
/** /**
* Set this items parent, name and storage name and add the modified item * Set this items parent, name and storage name and add the modified item
* to the specified parent's item map * to the specified parent's item map
* @param parent * @param newParent new parent folder
* @param name * @param newName new item name
* @param fileId unique file ID from property file content * @param newFileId unique file ID from property file content
*/ */
void set(Folder newParent, String newName, String newFileId) { void set(Folder newParent, String newName, String newFileId) {
if (parent != null && itemStorage != null) { if (parent != null && itemStorage != null) {

View file

@ -18,16 +18,15 @@ package ghidra.framework.store.local;
import java.io.*; import java.io.*;
import java.util.HashMap; import java.util.HashMap;
import ghidra.framework.store.FolderItem;
import ghidra.util.Msg; import ghidra.util.Msg;
import ghidra.util.PropertyFile; import ghidra.util.PropertyFile;
import ghidra.util.exception.NotFoundException; import ghidra.util.exception.NotFoundException;
/** /**
* <code>IndexedLocalFileSystem</code> implements a case-sensitive indexed filesystem * <code>IndexedV1LocalFileSystem</code> implements a case-sensitive indexed filesystem
* which uses a shallow storage hierarchy with no restriction on file name or path * which uses a shallow storage hierarchy with no restriction on file name or path
* length. This filesystem is identified by the existence of an index file (~index.dat) * length. This filesystem is identified by the existence of an index file (~index.dat)
* and recovery journal (~index.jrn). * and recovery journal (~index.jrn). File system also maintains a file-ID mapping.
*/ */
public class IndexedV1LocalFileSystem extends IndexedLocalFileSystem { public class IndexedV1LocalFileSystem extends IndexedLocalFileSystem {

View file

@ -267,6 +267,10 @@ class GhidraFolderData {
if (parent.visited) { if (parent.visited) {
parent.folderList.remove(oldName); parent.folderList.remove(oldName);
parent.folderList.add(newName); parent.folderList.add(newName);
// Must force refresh to ensure that all folder items are properly updted with new parent path
refresh(true, true, projectData.getProjectDisposalMonitor());
listener.domainFolderRenamed(newFolder, oldName); listener.domainFolderRenamed(newFolder, oldName);
} }
@ -632,9 +636,8 @@ class GhidraFolderData {
++badItemCount; ++badItemCount;
continue; continue;
} }
Msg.error(this, Msg.error(this, "Unsupported folder item encountered (" + unk.getFileType() +
"Unsupported folder item encountered (" + unk.getFileType() + "): " + "): " + getPathname(item.getName()));
getPathname(item.getName()));
++unknownItemCount; ++unknownItemCount;
} }
map.put(itemName, item); map.put(itemName, item);
@ -648,9 +651,8 @@ class GhidraFolderData {
"Project folder contains " + nullNameCount + " null items: " + getPathname()); "Project folder contains " + nullNameCount + " null items: " + getPathname());
} }
if (badItemCount != 0) { if (badItemCount != 0) {
Msg.error(this, Msg.error(this, "Project folder contains " + unknownItemCount + " unsupported items: " +
"Project folder contains " + unknownItemCount + " unsupported items: " + getPathname());
getPathname());
} }
return map; return map;
} }
@ -746,7 +748,7 @@ class GhidraFolderData {
* a "folder changed" notification. * a "folder changed" notification.
* @param recursive if true a recursive refresh will be done (force must also be true). * @param recursive if true a recursive refresh will be done (force must also be true).
* Sub-folders will only be refreshed if they have been visited. * Sub-folders will only be refreshed if they have been visited.
* @param force if true will refresh will be forced regardless * @param force if true, refresh will be forced regardless
* of visited state, if false refresh is lazy and will not be * of visited state, if false refresh is lazy and will not be
* performed if a previous refresh set the visited state. * performed if a previous refresh set the visited state.
* @param monitor recursion task monitor - break from recursion if cancelled * @param monitor recursion task monitor - break from recursion if cancelled

View file

@ -2933,15 +2933,11 @@ abstract public class DataTypeManagerDB implements DataTypeManager {
if (allowsDefaultBuiltInSettings() && if (allowsDefaultBuiltInSettings() &&
builtInDt.getSettingsDefinitions().length != 0) { builtInDt.getSettingsDefinitions().length != 0) {
// Alter built-in datatype instance to use new DB-backed default settings which
// facilitates user adjustments to the original default settings.
DataTypeSettingsDB settings = DataTypeSettingsDB settings =
new DataTypeSettingsDB(this, builtInDt, dataTypeID); new DataTypeSettingsDB(this, builtInDt, dataTypeID);
if (builtInDt instanceof TypeDef) { settings.setDefaultSettings(builtInDt.getDefaultSettings());
// Copy default immutable builtin typedef settings
Settings typedefSettings = builtInDt.getDefaultSettings();
for (String n : typedefSettings.getNames()) {
settings.setValue(n, typedefSettings.getValue(n));
}
}
settings.setAllowedSettingPredicate(n -> isBuiltInSettingAllowed(builtInDt, n)); settings.setAllowedSettingPredicate(n -> isBuiltInSettingAllowed(builtInDt, n));
builtInDt.setDefaultSettings(settings); builtInDt.setDefaultSettings(settings);
} }