linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kconfig: qconf: make debug links work again
@ 2020-06-28 12:21 Mauro Carvalho Chehab
  2020-06-28 12:25 ` Maxim Levitsky
  2020-06-28 14:41 ` Masahiro Yamada
  0 siblings, 2 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2020-06-28 12:21 UTC (permalink / raw)
  To: Linux Media Mailing List
  Cc: Mauro Carvalho Chehab, Masahiro Yamada, linux-kbuild,
	linux-kernel, Maxim Levitsky

The Qt5 conversion broke support for debug info links.

Restore the behaviour added by changeset
ab45d190fd4a ("kconfig: create links in info window").

Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 scripts/kconfig/qconf.cc | 35 ++++++++++++++++++++++++++++++++++-
 scripts/kconfig/qconf.h  |  1 +
 2 files changed, 35 insertions(+), 1 deletion(-)

diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
index 631e19659504..03cadf27a376 100644
--- a/scripts/kconfig/qconf.cc
+++ b/scripts/kconfig/qconf.cc
@@ -1012,7 +1012,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
 	: Parent(parent), sym(0), _menu(0)
 {
 	setObjectName(name);
-
+	setOpenLinks(false);
 
 	if (!objectName().isEmpty()) {
 		configSettings->beginGroup(objectName());
@@ -1224,6 +1224,36 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
 		*text += str2;
 }
 
+void ConfigInfoView::clicked(const QUrl &url)
+{
+	QByteArray str = url.toEncoded();
+	const std::size_t count = str.size();
+	char *hex = new char[count];
+	unsigned long p;
+
+	if (count < 1)
+		return;
+
+	memcpy(hex, str.constData(), count);
+	p = (int)strtol(hex + 1, NULL, 16);
+
+	if (!p)
+		return;
+
+	if (hex[0] == 's') {
+		struct symbol *s = (struct symbol *)p;
+
+		sym = s;
+		symbolInfo();
+	} else {
+		struct menu *m = (struct menu *)p;
+
+		_menu = m;
+		menuInfo();
+	}
+	emit showDebugChanged(true);
+}
+
 QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
 {
 	QMenu* popup = Parent::createStandardContextMenu(pos);
@@ -1497,6 +1527,9 @@ ConfigMainWindow::ConfigMainWindow(void)
 	helpMenu->addAction(showIntroAction);
 	helpMenu->addAction(showAboutAction);
 
+	connect (helpText, SIGNAL (anchorClicked (const QUrl &)),
+		 helpText, SLOT (clicked (const QUrl &)) );
+
 	connect(configList, SIGNAL(menuChanged(struct menu *)),
 		helpText, SLOT(setInfo(struct menu *)));
 	connect(configList, SIGNAL(menuSelected(struct menu *)),
diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
index d913a02967ae..a193137f2314 100644
--- a/scripts/kconfig/qconf.h
+++ b/scripts/kconfig/qconf.h
@@ -250,6 +250,7 @@ public slots:
 	void setInfo(struct menu *menu);
 	void saveSettings(void);
 	void setShowDebug(bool);
+	void clicked (const QUrl &url);
 
 signals:
 	void showDebugChanged(bool);
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] kconfig: qconf: make debug links work again
  2020-06-28 12:21 [PATCH] kconfig: qconf: make debug links work again Mauro Carvalho Chehab
@ 2020-06-28 12:25 ` Maxim Levitsky
  2020-06-28 14:41 ` Masahiro Yamada
  1 sibling, 0 replies; 5+ messages in thread
From: Maxim Levitsky @ 2020-06-28 12:25 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Linux Media Mailing List
  Cc: Masahiro Yamada, linux-kbuild, linux-kernel

On Sun, 2020-06-28 at 14:21 +0200, Mauro Carvalho Chehab wrote:
> The Qt5 conversion broke support for debug info links.
> 
> Restore the behaviour added by changeset
> ab45d190fd4a ("kconfig: create links in info window").
> 
> Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  scripts/kconfig/qconf.cc | 35 ++++++++++++++++++++++++++++++++++-
>  scripts/kconfig/qconf.h  |  1 +
>  2 files changed, 35 insertions(+), 1 deletion(-)
> 
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index 631e19659504..03cadf27a376 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -1012,7 +1012,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
>  	: Parent(parent), sym(0), _menu(0)
>  {
>  	setObjectName(name);
> -
> +	setOpenLinks(false);
>  
>  	if (!objectName().isEmpty()) {
>  		configSettings->beginGroup(objectName());
> @@ -1224,6 +1224,36 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
>  		*text += str2;
>  }
>  
> +void ConfigInfoView::clicked(const QUrl &url)
> +{
> +	QByteArray str = url.toEncoded();
> +	const std::size_t count = str.size();
> +	char *hex = new char[count];
> +	unsigned long p;
> +
> +	if (count < 1)
> +		return;
> +
> +	memcpy(hex, str.constData(), count);
> +	p = (int)strtol(hex + 1, NULL, 16);
> +
> +	if (!p)
> +		return;
> +
> +	if (hex[0] == 's') {
> +		struct symbol *s = (struct symbol *)p;
> +
> +		sym = s;
> +		symbolInfo();
> +	} else {
> +		struct menu *m = (struct menu *)p;
> +
> +		_menu = m;
> +		menuInfo();
> +	}
> +	emit showDebugChanged(true);
> +}
> +
>  QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
>  {
>  	QMenu* popup = Parent::createStandardContextMenu(pos);
> @@ -1497,6 +1527,9 @@ ConfigMainWindow::ConfigMainWindow(void)
>  	helpMenu->addAction(showIntroAction);
>  	helpMenu->addAction(showAboutAction);
>  
> +	connect (helpText, SIGNAL (anchorClicked (const QUrl &)),
> +		 helpText, SLOT (clicked (const QUrl &)) );
> +
>  	connect(configList, SIGNAL(menuChanged(struct menu *)),
>  		helpText, SLOT(setInfo(struct menu *)));
>  	connect(configList, SIGNAL(menuSelected(struct menu *)),
> diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
> index d913a02967ae..a193137f2314 100644
> --- a/scripts/kconfig/qconf.h
> +++ b/scripts/kconfig/qconf.h
> @@ -250,6 +250,7 @@ public slots:
>  	void setInfo(struct menu *menu);
>  	void saveSettings(void);
>  	void setShowDebug(bool);
> +	void clicked (const QUrl &url);
>  
>  signals:
>  	void showDebugChanged(bool);

Just tested it and it works well. Thank you very much!

Best regards,
	Maxim Levitsky


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kconfig: qconf: make debug links work again
  2020-06-28 12:21 [PATCH] kconfig: qconf: make debug links work again Mauro Carvalho Chehab
  2020-06-28 12:25 ` Maxim Levitsky
@ 2020-06-28 14:41 ` Masahiro Yamada
  2020-06-28 14:48   ` Maxim Levitsky
  1 sibling, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2020-06-28 14:41 UTC (permalink / raw)
  To: Mauro Carvalho Chehab
  Cc: Linux Media Mailing List, Linux Kbuild mailing list,
	Linux Kernel Mailing List, Maxim Levitsky

On Sun, Jun 28, 2020 at 9:21 PM Mauro Carvalho Chehab
<mchehab+huawei@kernel.org> wrote:
>
> The Qt5 conversion broke support for debug info links.
>
> Restore the behaviour added by changeset
> ab45d190fd4a ("kconfig: create links in info window").
>
> Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>


I tested this patch, but this caused
segmentation fault.


I enabled 'Show Debug Info',
and then clicked
dep: <symbol name>.

Then, xconfig crashed.

(without this patch, it did not cause
segfault at least)

Did you see this?











> ---
>  scripts/kconfig/qconf.cc | 35 ++++++++++++++++++++++++++++++++++-
>  scripts/kconfig/qconf.h  |  1 +
>  2 files changed, 35 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> index 631e19659504..03cadf27a376 100644
> --- a/scripts/kconfig/qconf.cc
> +++ b/scripts/kconfig/qconf.cc
> @@ -1012,7 +1012,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
>         : Parent(parent), sym(0), _menu(0)
>  {
>         setObjectName(name);
> -
> +       setOpenLinks(false);
>
>         if (!objectName().isEmpty()) {
>                 configSettings->beginGroup(objectName());
> @@ -1224,6 +1224,36 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
>                 *text += str2;
>  }
>
> +void ConfigInfoView::clicked(const QUrl &url)
> +{
> +       QByteArray str = url.toEncoded();
> +       const std::size_t count = str.size();
> +       char *hex = new char[count];
> +       unsigned long p;
> +
> +       if (count < 1)
> +               return;
> +
> +       memcpy(hex, str.constData(), count);
> +       p = (int)strtol(hex + 1, NULL, 16);
> +
> +       if (!p)
> +               return;
> +
> +       if (hex[0] == 's') {
> +               struct symbol *s = (struct symbol *)p;
> +
> +               sym = s;
> +               symbolInfo();
> +       } else {
> +               struct menu *m = (struct menu *)p;
> +
> +               _menu = m;
> +               menuInfo();
> +       }
> +       emit showDebugChanged(true);
> +}
> +
>  QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
>  {
>         QMenu* popup = Parent::createStandardContextMenu(pos);
> @@ -1497,6 +1527,9 @@ ConfigMainWindow::ConfigMainWindow(void)
>         helpMenu->addAction(showIntroAction);
>         helpMenu->addAction(showAboutAction);
>
> +       connect (helpText, SIGNAL (anchorClicked (const QUrl &)),
> +                helpText, SLOT (clicked (const QUrl &)) );
> +
>         connect(configList, SIGNAL(menuChanged(struct menu *)),
>                 helpText, SLOT(setInfo(struct menu *)));
>         connect(configList, SIGNAL(menuSelected(struct menu *)),
> diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
> index d913a02967ae..a193137f2314 100644
> --- a/scripts/kconfig/qconf.h
> +++ b/scripts/kconfig/qconf.h
> @@ -250,6 +250,7 @@ public slots:
>         void setInfo(struct menu *menu);
>         void saveSettings(void);
>         void setShowDebug(bool);
> +       void clicked (const QUrl &url);
>
>  signals:
>         void showDebugChanged(bool);
> --
> 2.26.2
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kconfig: qconf: make debug links work again
  2020-06-28 14:41 ` Masahiro Yamada
@ 2020-06-28 14:48   ` Maxim Levitsky
  2020-06-28 14:58     ` Masahiro Yamada
  0 siblings, 1 reply; 5+ messages in thread
From: Maxim Levitsky @ 2020-06-28 14:48 UTC (permalink / raw)
  To: Masahiro Yamada, Mauro Carvalho Chehab
  Cc: Linux Media Mailing List, Linux Kbuild mailing list,
	Linux Kernel Mailing List

On Sun, 2020-06-28 at 23:41 +0900, Masahiro Yamada wrote:
> On Sun, Jun 28, 2020 at 9:21 PM Mauro Carvalho Chehab
> <mchehab+huawei@kernel.org> wrote:
> > The Qt5 conversion broke support for debug info links.
> > 
> > Restore the behaviour added by changeset
> > ab45d190fd4a ("kconfig: create links in info window").
> > 
> > Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> 
> I tested this patch, but this caused
> segmentation fault.
> 
> 
> I enabled 'Show Debug Info',
> and then clicked
> dep: <symbol name>.
> 
> Then, xconfig crashed.
> 
> (without this patch, it did not cause
> segfault at least)
> 
> Did you see this?

Works for me - tested this again 
(I have both patches applied on top on mainline master branch).
Maybe you have Qt4?

One thing that I forgot to report is that when clicking on the symbol,
only config descripion updates and not config/menu windows.
It might even be always like that, I don't remember, but it would be nice if 
these were updated too.

Best regards,
	Maxim Levitsky

> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> > ---
> >  scripts/kconfig/qconf.cc | 35 ++++++++++++++++++++++++++++++++++-
> >  scripts/kconfig/qconf.h  |  1 +
> >  2 files changed, 35 insertions(+), 1 deletion(-)
> > 
> > diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> > index 631e19659504..03cadf27a376 100644
> > --- a/scripts/kconfig/qconf.cc
> > +++ b/scripts/kconfig/qconf.cc
> > @@ -1012,7 +1012,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
> >         : Parent(parent), sym(0), _menu(0)
> >  {
> >         setObjectName(name);
> > -
> > +       setOpenLinks(false);
> > 
> >         if (!objectName().isEmpty()) {
> >                 configSettings->beginGroup(objectName());
> > @@ -1224,6 +1224,36 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
> >                 *text += str2;
> >  }
> > 
> > +void ConfigInfoView::clicked(const QUrl &url)
> > +{
> > +       QByteArray str = url.toEncoded();
> > +       const std::size_t count = str.size();
> > +       char *hex = new char[count];
> > +       unsigned long p;
> > +
> > +       if (count < 1)
> > +               return;
> > +
> > +       memcpy(hex, str.constData(), count);
> > +       p = (int)strtol(hex + 1, NULL, 16);
> > +
> > +       if (!p)
> > +               return;
> > +
> > +       if (hex[0] == 's') {
> > +               struct symbol *s = (struct symbol *)p;
> > +
> > +               sym = s;
> > +               symbolInfo();
> > +       } else {
> > +               struct menu *m = (struct menu *)p;
> > +
> > +               _menu = m;
> > +               menuInfo();
> > +       }
> > +       emit showDebugChanged(true);
> > +}
> > +
> >  QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
> >  {
> >         QMenu* popup = Parent::createStandardContextMenu(pos);
> > @@ -1497,6 +1527,9 @@ ConfigMainWindow::ConfigMainWindow(void)
> >         helpMenu->addAction(showIntroAction);
> >         helpMenu->addAction(showAboutAction);
> > 
> > +       connect (helpText, SIGNAL (anchorClicked (const QUrl &)),
> > +                helpText, SLOT (clicked (const QUrl &)) );
> > +
> >         connect(configList, SIGNAL(menuChanged(struct menu *)),
> >                 helpText, SLOT(setInfo(struct menu *)));
> >         connect(configList, SIGNAL(menuSelected(struct menu *)),
> > diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
> > index d913a02967ae..a193137f2314 100644
> > --- a/scripts/kconfig/qconf.h
> > +++ b/scripts/kconfig/qconf.h
> > @@ -250,6 +250,7 @@ public slots:
> >         void setInfo(struct menu *menu);
> >         void saveSettings(void);
> >         void setShowDebug(bool);
> > +       void clicked (const QUrl &url);
> > 
> >  signals:
> >         void showDebugChanged(bool);
> > --
> > 2.26.2
> > 
> 
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] kconfig: qconf: make debug links work again
  2020-06-28 14:48   ` Maxim Levitsky
@ 2020-06-28 14:58     ` Masahiro Yamada
  0 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-06-28 14:58 UTC (permalink / raw)
  To: Maxim Levitsky
  Cc: Mauro Carvalho Chehab, Linux Media Mailing List,
	Linux Kbuild mailing list, Linux Kernel Mailing List

On Sun, Jun 28, 2020 at 11:48 PM Maxim Levitsky <mlevitsk@redhat.com> wrote:
>
> On Sun, 2020-06-28 at 23:41 +0900, Masahiro Yamada wrote:
> > On Sun, Jun 28, 2020 at 9:21 PM Mauro Carvalho Chehab
> > <mchehab+huawei@kernel.org> wrote:
> > > The Qt5 conversion broke support for debug info links.
> > >
> > > Restore the behaviour added by changeset
> > > ab45d190fd4a ("kconfig: create links in info window").
> > >
> > > Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
> > > Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> >
> > I tested this patch, but this caused
> > segmentation fault.
> >
> >
> > I enabled 'Show Debug Info',
> > and then clicked
> > dep: <symbol name>.
> >
> > Then, xconfig crashed.
> >
> > (without this patch, it did not cause
> > segfault at least)
> >
> > Did you see this?
>
> Works for me - tested this again
> (I have both patches applied on top on mainline master branch).
> Maybe you have Qt4?


I do not think so.

I checked scripts/kconfig/.qconf.cmd

qconf was linked with Qt5.


$ cat scripts/kconfig/.qconf.cmd
cmd_scripts/kconfig/qconf := g++   -o scripts/kconfig/qconf
scripts/kconfig/images.o scripts/kconfig/confdata.o
scripts/kconfig/expr.o scripts/kconfig/lexer.lex.o
scripts/kconfig/parser.tab.o scripts/kconfig/preprocess.o
scripts/kconfig/symbol.o scripts/kconfig/util.o
scripts/kconfig/qconf.o   -lQt5Widgets -lQt5Gui -lQt5Core


BTW, my machine runs ubuntu 20.04




>
> One thing that I forgot to report is that when clicking on the symbol,
> only config descripion updates and not config/menu windows.
> It might even be always like that, I don't remember, but it would be nice if
> these were updated too.
>
> Best regards,
>         Maxim Levitsky
>
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > > ---
> > >  scripts/kconfig/qconf.cc | 35 ++++++++++++++++++++++++++++++++++-
> > >  scripts/kconfig/qconf.h  |  1 +
> > >  2 files changed, 35 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/scripts/kconfig/qconf.cc b/scripts/kconfig/qconf.cc
> > > index 631e19659504..03cadf27a376 100644
> > > --- a/scripts/kconfig/qconf.cc
> > > +++ b/scripts/kconfig/qconf.cc
> > > @@ -1012,7 +1012,7 @@ ConfigInfoView::ConfigInfoView(QWidget* parent, const char *name)
> > >         : Parent(parent), sym(0), _menu(0)
> > >  {
> > >         setObjectName(name);
> > > -
> > > +       setOpenLinks(false);
> > >
> > >         if (!objectName().isEmpty()) {
> > >                 configSettings->beginGroup(objectName());
> > > @@ -1224,6 +1224,36 @@ void ConfigInfoView::expr_print_help(void *data, struct symbol *sym, const char
> > >                 *text += str2;
> > >  }
> > >
> > > +void ConfigInfoView::clicked(const QUrl &url)
> > > +{
> > > +       QByteArray str = url.toEncoded();
> > > +       const std::size_t count = str.size();
> > > +       char *hex = new char[count];
> > > +       unsigned long p;
> > > +
> > > +       if (count < 1)
> > > +               return;
> > > +
> > > +       memcpy(hex, str.constData(), count);
> > > +       p = (int)strtol(hex + 1, NULL, 16);
> > > +
> > > +       if (!p)
> > > +               return;
> > > +
> > > +       if (hex[0] == 's') {
> > > +               struct symbol *s = (struct symbol *)p;
> > > +
> > > +               sym = s;
> > > +               symbolInfo();
> > > +       } else {
> > > +               struct menu *m = (struct menu *)p;
> > > +
> > > +               _menu = m;
> > > +               menuInfo();
> > > +       }
> > > +       emit showDebugChanged(true);
> > > +}
> > > +
> > >  QMenu* ConfigInfoView::createStandardContextMenu(const QPoint & pos)
> > >  {
> > >         QMenu* popup = Parent::createStandardContextMenu(pos);
> > > @@ -1497,6 +1527,9 @@ ConfigMainWindow::ConfigMainWindow(void)
> > >         helpMenu->addAction(showIntroAction);
> > >         helpMenu->addAction(showAboutAction);
> > >
> > > +       connect (helpText, SIGNAL (anchorClicked (const QUrl &)),
> > > +                helpText, SLOT (clicked (const QUrl &)) );
> > > +
> > >         connect(configList, SIGNAL(menuChanged(struct menu *)),
> > >                 helpText, SLOT(setInfo(struct menu *)));
> > >         connect(configList, SIGNAL(menuSelected(struct menu *)),
> > > diff --git a/scripts/kconfig/qconf.h b/scripts/kconfig/qconf.h
> > > index d913a02967ae..a193137f2314 100644
> > > --- a/scripts/kconfig/qconf.h
> > > +++ b/scripts/kconfig/qconf.h
> > > @@ -250,6 +250,7 @@ public slots:
> > >         void setInfo(struct menu *menu);
> > >         void saveSettings(void);
> > >         void setShowDebug(bool);
> > > +       void clicked (const QUrl &url);
> > >
> > >  signals:
> > >         void showDebugChanged(bool);
> > > --
> > > 2.26.2
> > >
> >
> >
>
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-06-28 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-28 12:21 [PATCH] kconfig: qconf: make debug links work again Mauro Carvalho Chehab
2020-06-28 12:25 ` Maxim Levitsky
2020-06-28 14:41 ` Masahiro Yamada
2020-06-28 14:48   ` Maxim Levitsky
2020-06-28 14:58     ` Masahiro Yamada

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).