Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Nikolai Kosjar <nikolai.kosjar@qt.io>
To: Konstantin Tokarev <annulen@yandex.ru>,
	"Jason A. Donenfeld" <jason@zx2c4.com>,
	"qt-creator@qt-project.org" <qt-creator@qt-project.org>
Cc: WireGuard mailing list <wireguard@lists.zx2c4.com>
Subject: Re: [Qt-creator] Qt Creator for Linux Kernel Development
Date: Tue, 29 Nov 2016 09:56:00 +0100	[thread overview]
Message-ID: <07fd30ec-41fc-6dc4-fb12-14b591ef1b0c@qt.io> (raw)
In-Reply-To: <1566601479887120@web23m.yandex.ru>

On 11/23/2016 08:45 AM, Konstantin Tokarev wrote:
> 23.11.2016, 08:51, "Jason A. Donenfeld" <jason@zx2c4.com>:
>> Hello Eike & Qt Creator mailing list,
>>
>> I'm insane and decided to try using an IDE for Linux kernel
>> development. Much to my delight, it actually works well. (Everybody on
>> the mailing list to which this message is cross-posted just vomited a
>> little bit in their mouth and swallowed, but fear not: I'm a competent
>> VIM user too. It's just that sometimes clickity clicking around Qt
>> Creator is buttery nice. Here's a screenshot [2].)
>>
>> I'm working on a small kernel module [1], and for it I made a very
>> minimal .pro file to import its files into Qt Creator. I even hooked
>> the build/run commands up to my qemu testing rig. Seems to work pretty
>> well. Here's the .pro I use:
>>
>> CONFIG -= qt
>> INCLUDEPATH = /usr/src/linux/arch/x86/include
>> /usr/src/linux/arch/x86/include/generated/uapi /usr/src/linux/
>> arch/x86/include/generated /usr/src/linux/include
>> /usr/src/linux/arch/x86/include/uapi /usr/src/linux/arch/x
>> 86/include/generated/uapi /usr/src/linux/include/uapi
>> /usr/src/linux/include/generated/uapi
>> DEFINES = __KERNEL__ DEBUG MODULE
>> SOURCES = $$system(find -L . -type f -iname $$system_quote(*.c) -and
>> -not -path $$system_quote(./tests/*)) $
>> $system(find -L . -type f -iname $$system_quote(*.S) -and -not -path
>> $$system_quote(./tests/*))
>> HEADERS = $$system(find -L . -type f -iname $$system_quote(*.h) -and
>> -not -path $$system_quote(./tests/*))
>>
>> As you can see, it's a real hack.
>>
>> I also do development on the main Linux kernel tree, and similarly for
>> that, I have a .pro file that works well:
>>
>> CONFIG -= qt
>> INCLUDEPATH = $$system(find -L include/ -type d)
>> SOURCES = $$system(find -L . -type f -iname \'*.c\')
>> HEADERS = $$system(find -L . -type f -iname \'*.h\')
>> INCLUDEPATH = include/ arch/x86/include
>>
>> Download the linux sources, put that in the tree, and load it up in Qt
>> Creator. It works. Amazing!
>>
>> But don't get too excited. Unfortunately, there are two issues that
>> make things unbearable:
>>
>> (A) Qt Creator doesn't seem to parse the C correctly. Things like
>> designated initializers and a few other C features here and there just
>> don't get parsed correctly, and the IDE stops being useful. I suspect
>> this is because things are actually being parsed in C++ mode. Bummer.
>> Developers: any interest in improving C support in Qt Creator?
>>
>> (B) There is no way to tell Qt Creator that a particular header file
>> is included in every file -- that is, that gcc's "-include" is in use.
>> There is a way of messing with the "C++ Code Model" on a file-by-file
>> basis, for the duration of the time that the file is open, but no way
>> to automatically have it included in every file of the project. This
>> is a major hindrance. It means that every ifdef for every kconfig
>> option is a grayed out unclickable region, rendering most things
>> useless.
>
> BTW, I'm facing similar issue with QtWebKit: config.h is included into all
> source files, but never in headers, so all #if's in headers are disabled
> and code model does not function properly.

Could you provide a report for this with a minimal example?

Nikolai

  parent reply	other threads:[~2016-11-29  8:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23  5:51 Jason A. Donenfeld
2016-11-23  7:45 ` [Qt-creator] " Konstantin Tokarev
2016-11-28 18:03   ` Jason A. Donenfeld
2016-11-28 19:49     ` Marco Bubke
2016-11-29 19:21       ` Jason A. Donenfeld
2016-11-28 21:34     ` André Pönitz
2016-11-29  8:55     ` Nikolai Kosjar
2016-11-29 19:23       ` Jason A. Donenfeld
2016-11-30  8:41         ` Nikolai Kosjar
2016-11-30  8:43       ` Orgad Shaneh
2016-11-29  8:56   ` Nikolai Kosjar [this message]
2016-11-23  7:58 ` Orgad Shaneh
2016-11-23  9:21 ` Eike Ziller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=07fd30ec-41fc-6dc4-fb12-14b591ef1b0c@qt.io \
    --to=nikolai.kosjar@qt.io \
    --cc=annulen@yandex.ru \
    --cc=jason@zx2c4.com \
    --cc=qt-creator@qt-project.org \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).