public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizf@cn.fujitsu.com>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	Michal Marek <mmarek@suse.cz>,
	linux-kbuild@vger.kernel.org, Tim Bird <tim.bird@am.sony.com>
Subject: [PATCH 2/6] kconfig: fix zconfdump()
Date: Wed, 14 Apr 2010 11:44:20 +0800	[thread overview]
Message-ID: <4BC53A14.1010806@cn.fujitsu.com> (raw)
In-Reply-To: <4BC539DD.5040003@cn.fujitsu.com>

zconfdump(), which is used for debugging, can't recognize P_SELECT,
P_RANGE and P_MENU (if associated with a symbol, aka "menuconfig"),
and output something like this:

config X86
  boolean
  default y
  unknown prop 6!
  unknown prop 6!
  unknown prop 6!
  ...

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
---
 scripts/kconfig/zconf.tab.c_shipped |   21 +++++++++++++++++----
 scripts/kconfig/zconf.y             |   21 +++++++++++++++++----
 2 files changed, 34 insertions(+), 8 deletions(-)

diff --git a/scripts/kconfig/zconf.tab.c_shipped b/scripts/kconfig/zconf.tab.c_shipped
index 6e9dcd5..54d5ba1 100644
--- a/scripts/kconfig/zconf.tab.c_shipped
+++ b/scripts/kconfig/zconf.tab.c_shipped
@@ -2336,9 +2336,9 @@ static void print_symbol(FILE *out, struct menu *menu)
 	struct property *prop;
 
 	if (sym_is_choice(sym))
-		fprintf(out, "choice\n");
+		fprintf(out, "\nchoice\n");
 	else
-		fprintf(out, "config %s\n", sym->name);
+		fprintf(out, "\nconfig %s\n", sym->name);
 	switch (sym->type) {
 	case S_BOOLEAN:
 		fputs("  boolean\n", out);
@@ -2384,6 +2384,21 @@ static void print_symbol(FILE *out, struct menu *menu)
 		case P_CHOICE:
 			fputs("  #choice value\n", out);
 			break;
+		case P_SELECT:
+			fputs( "  select ", out);
+			expr_fprint(prop->expr, out);
+			fputc('\n', out);
+			break;
+		case P_RANGE:
+			fputs( "  range ", out);
+			expr_fprint(prop->expr, out);
+			fputc('\n', out);
+			break;
+		case P_MENU:
+			fputs( "  menu ", out);
+			print_quoted_string(out, prop->text);
+			fputc('\n', out);
+			break;
 		default:
 			fprintf(out, "  unknown prop %d!\n", prop->type);
 			break;
@@ -2395,7 +2410,6 @@ static void print_symbol(FILE *out, struct menu *menu)
 			menu->help[len] = 0;
 		fprintf(out, "  help\n%s\n", menu->help);
 	}
-	fputc('\n', out);
 }
 
 void zconfdump(FILE *out)
@@ -2428,7 +2442,6 @@ void zconfdump(FILE *out)
 				expr_fprint(prop->visible.expr, out);
 				fputc('\n', out);
 			}
-			fputs("\n", out);
 		}
 
 		if (menu->list)
diff --git a/scripts/kconfig/zconf.y b/scripts/kconfig/zconf.y
index 8c43491..98dae9f 100644
--- a/scripts/kconfig/zconf.y
+++ b/scripts/kconfig/zconf.y
@@ -591,9 +591,9 @@ static void print_symbol(FILE *out, struct menu *menu)
 	struct property *prop;
 
 	if (sym_is_choice(sym))
-		fprintf(out, "choice\n");
+		fprintf(out, "\nchoice\n");
 	else
-		fprintf(out, "config %s\n", sym->name);
+		fprintf(out, "\nconfig %s\n", sym->name);
 	switch (sym->type) {
 	case S_BOOLEAN:
 		fputs("  boolean\n", out);
@@ -639,6 +639,21 @@ static void print_symbol(FILE *out, struct menu *menu)
 		case P_CHOICE:
 			fputs("  #choice value\n", out);
 			break;
+		case P_SELECT:
+			fputs( "  select ", out);
+			expr_fprint(prop->expr, out);
+			fputc('\n', out);
+			break;
+		case P_RANGE:
+			fputs( "  range ", out);
+			expr_fprint(prop->expr, out);
+			fputc('\n', out);
+			break;
+		case P_MENU:
+			fputs( "  menu ", out);
+			print_quoted_string(out, prop->text);
+			fputc('\n', out);
+			break;
 		default:
 			fprintf(out, "  unknown prop %d!\n", prop->type);
 			break;
@@ -650,7 +665,6 @@ static void print_symbol(FILE *out, struct menu *menu)
 			menu->help[len] = 0;
 		fprintf(out, "  help\n%s\n", menu->help);
 	}
-	fputc('\n', out);
 }
 
 void zconfdump(FILE *out)
@@ -683,7 +697,6 @@ void zconfdump(FILE *out)
 				expr_fprint(prop->visible.expr, out);
 				fputc('\n', out);
 			}
-			fputs("\n", out);
 		}
 
 		if (menu->list)
-- 
1.6.3


  parent reply	other threads:[~2010-04-14  3:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14  3:43 [PATCH 0/6] kconfig: add support to show hidden options which have prompts Li Zefan
2010-04-14  3:44 ` [PATCH 1/6] kconfig: some small fixes Li Zefan
2010-04-14  3:44 ` Li Zefan [this message]
2010-04-14  3:44 ` [PATCH 3/6] gconfig: remove dbg_print_ptype() and dbg_print_stype() Li Zefan
2010-04-14  3:44 ` [PATCH 4/6] gconfig: remove show_debug option Li Zefan
2010-04-14  3:46 ` [PATCH 5/6] menuconfig: add support to show hidden options which have prompts Li Zefan
2010-04-14 23:48   ` Randy Dunlap
2010-04-15  7:31     ` Li Zefan
2010-04-15  7:54       ` Michal Marek
2010-04-15  8:02         ` Li Zefan
2010-04-14  3:46 ` [PATCH 6/6] gconfig: add support to show hidden options that " Li Zefan
2010-04-14 23:48   ` Randy Dunlap
2010-04-15  7:43     ` Li Zefan
2010-04-14 13:57 ` [PATCH 0/6] kconfig: add support to show hidden options which " Michal Marek
2010-04-14 23:00 ` Randy Dunlap
2010-04-15  7:29   ` Li Zefan

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=4BC53A14.1010806@cn.fujitsu.com \
    --to=lizf@cn.fujitsu.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mmarek@suse.cz \
    --cc=randy.dunlap@oracle.com \
    --cc=tim.bird@am.sony.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