yocto - using gdb with externalsrc - gdb

We’re extending an existing Yocto project. We’d like to be able to selectively modify components of the project and build using the local modifications, then debug those modifications with gdb.
We’ve added these features to get gdb and the debug symbol packages into the image:
EXTRA_IMAGE_FEATURES = "debug-tweaks tools-debug"
IMAGE_FEATURES = "ssh-server-openssh dbg-pkgs"
We’ve added these variables to build from the local component code:
INHERIT += "externalsrc"
EXTERNALSRC_pn-[component] = “[local source code path]/[component]”
All seems well, as the build succeeds and the component in the image reflects local code changes. However, the component source code never makes it into the image, so it can’t be referenced in gdb.
Is there a secret to using dbg-pkgs and EXTERNALSRC together?

I believe this was due to a bug that was resolved in the 2.1 release, though I never pinpointed which commit actually resolved the issue. There's a bugzilla entry covering the issue - if you are still experiencing this with 2.1 please do let me know.

Related

Rider can't resolve symbol for UnityTest although the tests run (OSX, M1)

I recently started having this issue where although my tests run properly, Rider forgets the reference to the [UnityTest] attribute. It shows up as an error in Rider, but not in Unity. Although the namespace is already imported, after I do a quick action to fix the reference the errors disappear but only until the next save.
Mac OS: Ventura 13.0.1
Rider version: 2022.2.4
Unity version: 2021.3.15f1
I've attached a gif to show what exactly is happening:
Do you work with Assembly definitions?
In that case you will need to add it there as dependency.
I suspect Rider's quick action basically does this within the csproj files but with the next save Unity recompiles and overwrites the .csproj files according to the assembly definitions
-> should be looking like e.g.
I finally found the answer in this post. I'm not sure what exactly went wrong and got cached but the solution was to invalidate the cache by calling this action:
File | Invalidate Caches | Invalidate and Restart
Hope this will help others!

Qt creator could not parse stddef.h --> incorrect code completion and highlighting

I am developing a QT GUI for my application using QT Creator (4.11.0).
Recently, our IT updated my OS to Ubuntu 20.04 (from 18.04) - maybe the error is related to that.
I have not touched to project in some month but yesterday wanted to continue developing it.
However, within the IDE there are now thousands of errors highlighted at almost every line of my code. (with highlighted I mean that there is this red background and a red dot beside the line number)
On the very top, it says:
Warning: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
cstddef:50:10: fatal error: 'stddef.h' file not found
...
The errors that are listed in the IDE are very wired like:
type `QMainWindow`is not a direct or virtual base of `MainWindow` (my class is called `MainWindow`)
I'm pretty sure it is not related to my code:
the code compiles and works fine - it is really just the IDE that is highlighting errors at every line of my code.
I have the same code on a Windows Computer and there no errors are listed in the IDE.
even if I start a brand new QT Widget project the errors appear within the template code provided by the QT Creator.
Since the GCC version changed with the update of the OS, I thought maybe I have to define a new KIT but this also did not help.
Is there anything I can do to fix the issue?
Do I have to reinstall the QT Creator?
I know, pictures are not very well-liked but here I think it might help to understand what I mean with "IDE is highlighting errors":
1. First
~/.profile :
CPATH="/usr/include/clang/10/include:$CPATH"
C_INCLUDE_PATH="/usr/include/clang/10/include:$C_INCLUDE_PATH"
CPLUS_INCLUDE_PATH="/usr/include/clang/10/include:$CPLUS_INCLUDE_PATH"
export CPATH
export C_INCLUDE_PATH
export CPLUS_INCLUDE_PATH
maybe /usr/include/clang/10/include see in you file system.
2. Second
Logout / login.
3. Third
Specifying Build Settings (Projects -> Build -> in every config build) in Build Environment section: [unset] CPATH, C_INCLUDE_PATH and CPLUS_INCLUDE_PATH
or [edit] replace this variable with the necessary values
I fixed this issue by sudo apt install clang-8.
Source: https://bugs.launchpad.net/ubuntu/+source/qtcreator/+bug/1890434

Sitecore 6.6 Lucene.Net upgrade issue

I recently upgraded my Sitecore installation from 6.5 to 6.6. Part of this upgrade also upgrades the Lucene.Net library from 2.3.1.3 to 2.9.4.1, which introduces some breaking changes. The code base used a lot of custom code around the Lucene.Net search engine, which had to be removed for the installation to work. Now that I've done that, I'm trying to re-implement the search functions, but I can't get the simplest search to compile. For example, this code:
using (var sc = SearchManager.GetIndex("system").CreateSearchContext())
{
var query = new FullTextQuery("health");
SearchHits hits = sc.Search(query);
}
produces this error:
Error 104 The type 'Lucene.Net.Search.Query' is defined in an assembly
that is not referenced. You must add a reference to assembly
'Lucene.Net, Version=2.3.1.3, Culture=neutral,
PublicKeyToken=null'.
I've confirmed that I only have the 2.9.4.1 version of Lucene.Net referenced in my project. Why is this code looking for the 2.3.1.3 version?
#MarkCassidy nailed it - I did the upgrade on the server, but I was developing locally, so my local copy of the Sitecore.Kernal DLL was still at 6.5. Copying the 6.6 version down locally cleared up the compile error and let me know that my code example is obsolete, which is more along the lines of what I was expecting.

How to initialise a git repository with libgit2

On a Windows XP, 32-bit machine I've cloned the libgit2 repository using
git clone git://github.com/libgit2/libgit2.git trunk
Then I configured from trunk_build_debug for mingw using:
cmake ../trunk -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=-g
and build-ed it with
make
With this newly build library I'm trying to create a new repository. So I'm using
error_code = git_repository_init( &repo, path, 0 );
if ( error_code != 0 )
{
const git_error * error = giterr_last();
/* the text representation:
( error == NULL || error->message == NULL ?
"(no description)" :
error->message )
*/
}
On first attempt this fails with the error message:
Git error -1: The global file '.config/git/config' doesn't exist: The
system cannot find the file specified.
The .git directory is created and I can use git status to query it. Also, I have git installed in Program Files/git and it works just fine. The file that is mentioned does not exist in user directory, that is true. I'm not happy because I can't check the returned error code (the error may be "real").
So I've created an empty file in D:\Documents and Settings\User Name.config\git\config
The .git directory is again created but I get the same -1 error code. This time giterr_last() returns NULL.
Tracing the code in debugger seems to indicate that the library is not happy with my empty file.
However, I think this indicates that I'm doing something wrong. Is there an initialization method? Do I need to create the file and use the git_config_ functions to point the library to it?
BTW, is this the wrong place to ask this? Is there a dedicated forum where I should ask this question?
Thanks
Here is the back trace where the call fails: pastebin
It seems that the configure file inside .git directory can't be parsed (not shown in in trace is the 'config_parse()' that fails).
I've opened an issue in libgit2.
To create a new repository, one should rather rely on git_repository_init(). For more information, you can peek at the header and the tests.
git_repository_open() should rather be used when the repository already exists.
Is there a dedicated forum where I should ask this question?
It's ok to ask programming related question on StackOverflow. Beside this, some libgit2 developers hang out in the #libgit2 channel on irc.freenode.net. However, when you encounter bugs, it's recommended to submit them to the issue tracker.
Update
There had been some issues in the past with the way the configuration files are being probbed on Windows. Along with some attempts to fix them. See this issue for some background about this.
Beside the complexity of the probbing, some users may want to explictly provide alternate locations for their files. This pull request works this angle.
Considering what you discovered while debugging the libgit2, maybe now would be a good time to open a bug in the issue tracker. Beware that two issues may be at play: the probbing one and and the empty config issue.

Firebreath plugin on windows fails to load in chrome

I am busy converting by existing firebreath plugin here to use gpgme instead of making calls via the OS and the gpg binary.
I have managed to get the code to compile in windows using VS 2010 on a x32 system but after loading the plugin into chrome I can not access the npapi code at all. Even simple version calls fails.
When loading the plugin I get no visible errors but when using sawbuck log viewer for chrome I get the erorr messages below.
.\renderer\webplugin_delegate_proxy.cc 347 PluginMsg_Init returned false
..\plugins\npapi\webplugin_impl.cc 271 Couldn't initialize plug-in
I have tried to use my code with both firebreath 1.4 and 1.6 and neither versions work. After some simple debugging it seems that using any code provided by gpgme (whether its called or not) causes the plugin to break.
I came to this conclusion by doing the following.
Created a new project with firebreath (versions 1.4 and 1.6)
Add the gpgme.h headers to gmailGPGAPI.cpp and changed nothing else aside from adding the required reference paths to the project.
Build the project to create the dll (this generates the dll fine).
Replace the existing ddl in my project with the dll in step 2 and test it with the following piece of code
plugin = document.createElement('object'); plugin.id = 'plugin';
plugin.type = 'application/x-gmailtest';
document.body.appendChild(plugin);
console.log("my plugin returned: "+ plugin.valid);
console.log("my plugin returned: " + plugin.version);
This returns valid = true and the version returns what ever i set it to.
I then modified gmailGPGAPI.cpp to now return the gpg version by calling gpgme_check_version(NULL) in the version method. I used that method because its probably the simplest returning function that I could test with.
Build the plugin and copy dll to chrome extension as in step 3-4. The plugin builds fine again as expected.
Load the plugin and try to execute the code in step 4 at which point it now just returns undefined for any property or method i try to access on the plugin. No errors are printed to the console or anywhere else in chrome except for the error logged to sawbuck.
I have got no idea where to look or what to try since I cant seem to get an actionable error to work against. I have also reduced by test code to the point where its just a new project with a one line change to make it easier to find the problem.
I should note the code in the repo builds fine in linux/OSX and loads into chrome correctly so I know at some level my code does work.
Two possible paths:
You may have a DLL dependency that isn't available which keeps the plugin from loading; if you run regsvr32 on it in the state where it doesn't work on chrome, does it work?
Your plugin may be loading and then crashing. Start chrome with --plugin-startup-dialog and then when it pops up a dialog warning you that a plugin is about to be loaded attach to that process and see if the process crashes. At this point you can also set breakpoints to try to figure out how far it gets.
Double check your metadata in PluginConfig.cmake as well; sometimes unusual characters in some fields can cause issues like this.