Assembly code support in source insight - linux

Has anybody tried browsing assembly language file (filename.s) in source insight?
I just added whole Linux kernel project into source insight but it does not support any of the assembly files.

When you create the project in Sourceinsight, it adds all the types of files (like *.c, *.h, *.cpp, etc) it knows. It also adds assembly files but only '.asm' and '.inc' files. To include all *.s files as assembly file in the project, You need to tell Sourceinsight to treat '.s' files as assembly files.
This can be by Document Options->Document Type -> select the x86 ASM Source File and then add on the in file filter box inside * s along with *.asm and *.inc. Once you are done with this, now you re-add all the files from root directory of the project (Project->add and remove files) and you will get the *.s files in Sourceinsight.

In The File field -> Load file -> Browse [give path]-> File Type [make it as all]
Then you will find your ".s" file open it ,
You can use it like normal files

in settings tab you should find it out.
There is an option to add support for all file types.

Method to unconditionally include all Files present in the directory (Folder) :
CREATE A NEW DOCUMENT TYPE :
Go to Options ==> Document Options ==> Document Type. Press 'Add Type' button. Create some new type called MY_Unconditional.
Set 'File Filter' for this type as, *, *.*. (* wild card indicates all the files. *.* indicates all the files all type of extension.)
Close the dialog box.
ADD ALL FILES TO PROJECT :
Go to Project ==> Add and Remove Project Files
Choose your directory
Uncheck the box, 'Show only known document types'. Now, it will show all the files in the directory.
Now, press 'Add All' button. press 'Add Tree' button also if required.

Related

Sublime: Quickly check where file is used?

I often find myself needing to check where a file is used in my node project (which other file imports it). What I'm doing now is right clicking on the editor showing my file, copying the file path, then doing a grep on my whole project using the filename. In this manner I'm able to 'walk up' the dependency tree.
However, I'm wondering if it'd be possible to make a shortcut for this sort of thing. Does anybody know if that's viable?
Include your node project root directory to a sublime project with Project / Add Folder To Project...
Right-click on the project directory in the sidebar, then select "Find in Folder..." from the context menu.
Enable Regular expression
Find: import.*filename
click on Find
filename must be replaced with the actual name. The search pattern can be further refined to match module names from 'filenames', for example. You will end up with a search buffer that lets you jump to each file for that a match has been found.
Maybe Find In Files , Activate with ctrl + shift + F

Ignore R.java files in Find results

When I do a Find in Path (Ctrl+Shift+F), I often get results under "Usages in Generated Code" in R.java files. When I'm searching my code, I want to do just that: search my code. Not files generated by my code.
Is it possible to get the find dialog to not show any R.java files in the results? The only results I want are those under "Found Occurrences"
Thank you!
Android Studio (like its progenitor IntelliJ) allows you to define a custom scope to help you exclude intermediates files when searching.
Here are the steps I use to set this up:
Bring up Find in Path dialog (Ctrl+Shift+F on my machine).
In the Scope area, select the Custom radio button. Then tap the "..." button on the right side of the dropdown. This brings up the Scopes dialog.
Click the "+" button on the left side of the Scopes dialog, which will bring up the Add New Scope dialog. Name it "ExcludeIntermediates".
In the Pattern field, paste in the following pattern and click OK:
!file:*intermediates*/&&!file:*generated*/
This pattern excludes R.java files and other intermediates such as layout files in exploded-aar and AndroidManifest.xml copies in filtered_manifests folders.
This pattern excludes R.java files and other intermediates such as layout files in exploded-aar and AndroidManifest.xml copies in filtered_manifests folders.
ignores R.java files
ignores all *.java files generated by Android Annotations (i.e. *_.java files)
includes strings.xml, dimens.xml, styles.xml, attrs.xml, colors.xml files
includes all xml files in layout/* path
!file:*intermediates*/&&!file:*generated*/&&file:*java&&!file:R.java&&!file:*_.java||file:*strings.xml||file:*dimes.xml||file:*styles.xml||file:*attrs.xml||file:*colors.xml||file:*layout/*xml&&!file:*build/*xml
Combined from:
https://stackoverflow.com/a/32238593/1815624
&
https://stackoverflow.com/a/32680493/1815624
To search multiple modules but ignore R.java, you could use the following mask IF you don't have any other single character file names in your project:
☑ File mask(s): ??*.*
i.e. Limit results to filenames with at least 2 characters + any extension.
If you're using Android Studio, a simple way of achieving this is to set the Scope to be Directory (rather than Whole Project) and set this directory to be your src folder - since R.java appears under build/generated it won't appear in results there.
I use "custom scopes" in Android Studio to ignore R.java files. Others had described how to create/save a "shared custom scope" which can later be uploaded to a git repository. I'm just gonna share my custom scope string which:
ignores R.java files
ignores all *.java files generated by Android Annotations (i.e. *_.java files)
includes strings.xml, dimens.xml, styles.xml, attrs.xml, colors.xml files
includes all xml files in layout/* path
file:*java&&!file:R.java&&!file:*_.java||file:*strings.xml||file:*dimes.xml||file:*styles.xml||file:*attrs.xml||file:*colors.xml||file:*layout/*xml&&!file:*build/*xml
You could just avoid all the generated files from your project, as Mike Evans suggest in this tweet
You just need add a scope excluding the pattern mentioned:

Total Commander How to feed list listbox with selected files

Just like Search result can feed the listbox (which opens new temporary tab),
is there a way to:
simply select files from one directory and feed the listbox?
select files from multiple directories and feed the same listbox?
Just to rename listbox's temporary tab and you could have favorite list of items over which you could perform more actions. This would increase productivity tremendously!
Regarding #1:
After you select the files activate:
Menu > Show > Only Selected Files
Regarding #2:
It's probably not what you were after, but you can use DiskDir / DiskDir Extended to add files (using a packer functionality, so you create an 'archive' file with extension .lst which contains a hierarchical list of the added files. You can then change source folder and then add more files. Later you just click on the .lst file and it looks no different then your normal file / folder list. Unfortunatelly you cannot rename the files, but you can launch them, with an extra confirmation.
UPDATE
Similar functionalitybut with 'source' renaming functionality limited to one file only (?): Virtual Panel, (File System Plugin, accessible through the Network Neighborhood 'drive'). It can launch files without a confirmation window. Rename 'source/target' file when you use it's own subbar (located here: %%COMMANDER_PATH%%\Plugins\WFX\VirtualPanel\EN\VirtualPanel.bar, make sure that you also have installed the AskParam addon and have paths in the VirtualPanel.bar right (both to AskParam.exe and VPBatch.exe). 'Regular' rename will change the file name only in the virtual panel.
URL: Virtual Panel Plugin

Coredata: opening an xcdatamodeld file

I have a single xcdatamodeld file and would merely like to open this particular file with xcode. However, when I double click the file, it doesn't really show me anything or allow editing. The only way to do this is to run MyApp.xcodeproj and only then can I modify this file. Isn't there any way to edit the coredata file using only the xcdatamodel file? Thanks!
The xcdatamodeld file is not actually a file - it's a directory containing other model files.
Right click the file, choose Show Package Contents and you will get access to the files inside the directory. You can then double-click those files. When I do so I get just the Xcode model editor without the full Xcode project window.

Visual C++ Include File not found

I have a project, and I added all the source files to it. I then clicked build, and it said:
fatal error C1083: Cannot open include file: 'common.h': No such file or directory
1> crc64_tablegen.c
This is rather annoying, because common.h is in my project! It's right there! I think it might be in a different directory though. Is the the reason? Should I move everything to a root directory, then add that instead? Thanx!
Where files are in the project structure makes no difference to the compiler when it is attempting to open include files. If they are in a different directory, you will need to path them appropriately.
That is, if you have this directory structure:
project/include/common.h
project/src/main.cpp
And you have this in your project:
Project
|-> common.h
|-> main.cpp
Your main file will need to do this:
#include "../include/common.h"
And not this:
#include "common.h"
You may, alternatively, define project/include as an Additional Include Directory in your project settings. This will allow you do use the second include form shown above.
Compiler doesn't know anything about project and files included in it. If .h file is in another directory, you need to add this directory to the list. For example, open Project - Properties - C++ - General - Additional Include Directories, and add $(ProjectDir)Include or something like this.
In VC++, the location of files within the project is virtual and has no link whatsoever to the actual filepaths. You may have to be more specific with #include and/or move the source files into the project directory to be found.
Try and add the path in the project settings under Additional Include Directories.
Here are the full set of steps:
Drop down the Tools menu, and select Options
In the box on the left is a list of option categories. Select "Projects and Solutions" and then the sub-category "VC++ Directories"
In the upper right hand corner is a drop-down box that selects a particular set of default directories, including "Executable files", "Include files", "Reference files", "Library files", and "Source files". Generally, you only want to add to the "Include files" or "Library files" lists. Select "Include files"
In the middle of the right hand side of the window is a list of directories. Add the include path by pressing the "New Line" button above the window, or by pressing "Ctrl-Insert". A blank entry appears for you to either type the path or navigate by clicking the "..." button. Generally the final path you want will end with a folder called "include". Enter the path now.
You're done, click OK
If you have added a .h file to an existing project and are getting the error message C1083: cannot open include file. Make sure you have it added properly to the program.
If you have #include it might not work.
Try entering #include "course.h" instead.
I have been working this problem with my project for several hours and have just now realized this error. You can also add the directory in the project properties to have it work, but when you send it to someone else to view it, they might receive the same error.
I just had the same problem in Visual Studio 2017, and found what was causing it. There is a difference between the following two includes:
#include "common.h" // Quoted form
#include <common.h> // Angle-bracket form
First include can uses the file that contains the #include to find the included header file.
Second include ignores the file that contains the #include, so if you don't have the directory of header file in Additional Include Directories it will not be found, ALTHOUGH the IntelliSense will happily jump to the header file (Ctrl+Shift+G) as if it was included like in the first case.
So, either change the #include or add the directory to Additional Include Directories.
More info at Microsoft Docs.

Resources