qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] user: Restore debug usage message for '-d ?' in user mode emulation
@ 2011-07-18 10:44 Peter Maydell
  2011-07-25  8:43 ` Peter Maydell
  2011-07-30  5:52 ` andrzej zaborowski
  0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2011-07-18 10:44 UTC (permalink / raw)
  To: qemu-devel; +Cc: Blue Swirl, Riku Voipio, patches

The code which prints the debug usage message on '-d ?' for *-user
has to come before the check for "not enough arguments", so that
"qemu-foo -d ?" prints the list of possible debug log items rather than
the generic usage message. (This was inadvertently broken in commit
c235d73.)

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
NB that I've tested the linux-user part of this fix but don't have access to
bsd/darwin to test those files; however the change is identical for all three
files so it should be OK...

 bsd-user/main.c    |    8 +++++---
 darwin-user/main.c |    8 +++++---
 linux-user/main.c  |   11 ++++++-----
 3 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/bsd-user/main.c b/bsd-user/main.c
index 6018a41..a63b877 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -856,9 +856,6 @@ int main(int argc, char **argv)
             usage();
         }
     }
-    if (optind >= argc)
-        usage();
-    filename = argv[optind];
 
     /* init debug */
     cpu_set_log_filename(log_file);
@@ -877,6 +874,11 @@ int main(int argc, char **argv)
         cpu_set_log(mask);
     }
 
+    if (optind >= argc) {
+        usage();
+    }
+    filename = argv[optind];
+
     /* Zero out regs */
     memset(regs, 0, sizeof(struct target_pt_regs));
 
diff --git a/darwin-user/main.c b/darwin-user/main.c
index 35196a1..72307ad 100644
--- a/darwin-user/main.c
+++ b/darwin-user/main.c
@@ -809,9 +809,6 @@ int main(int argc, char **argv)
             usage();
         }
     }
-    if (optind >= argc)
-        usage();
-    filename = argv[optind];
 
     /* init debug */
     cpu_set_log_filename(log_file);
@@ -830,6 +827,11 @@ int main(int argc, char **argv)
         cpu_set_log(mask);
     }
 
+    if (optind >= argc) {
+        usage();
+    }
+    filename = argv[optind];
+
     /* Zero out regs */
     memset(regs, 0, sizeof(struct target_pt_regs));
 
diff --git a/linux-user/main.c b/linux-user/main.c
index 289054b..8976b60 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -3019,11 +3019,6 @@ int main(int argc, char **argv, char **envp)
             usage();
         }
     }
-    if (optind >= argc)
-        usage();
-    filename = argv[optind];
-    exec_path = argv[optind];
-
     /* init debug */
     cpu_set_log_filename(log_file);
     if (log_mask) {
@@ -3041,6 +3036,12 @@ int main(int argc, char **argv, char **envp)
         cpu_set_log(mask);
     }
 
+    if (optind >= argc) {
+        usage();
+    }
+    filename = argv[optind];
+    exec_path = argv[optind];
+
     /* Zero out regs */
     memset(regs, 0, sizeof(struct target_pt_regs));
 
-- 
1.7.1

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

* Re: [Qemu-devel] [PATCH] user: Restore debug usage message for '-d ?' in user mode emulation
  2011-07-18 10:44 [Qemu-devel] [PATCH] user: Restore debug usage message for '-d ?' in user mode emulation Peter Maydell
@ 2011-07-25  8:43 ` Peter Maydell
  2011-07-27  9:38   ` Peter Maydell
  2011-07-30  5:52 ` andrzej zaborowski
  1 sibling, 1 reply; 4+ messages in thread
From: Peter Maydell @ 2011-07-25  8:43 UTC (permalink / raw)
  To: qemu-devel; +Cc: Blue Swirl, Riku Voipio, patches

Ping? Since this is a regression in our command line handling
I think it should also go into 0.15...

thanks
-- PMM


On 18 July 2011 11:44, Peter Maydell <peter.maydell@linaro.org> wrote:
> The code which prints the debug usage message on '-d ?' for *-user
> has to come before the check for "not enough arguments", so that
> "qemu-foo -d ?" prints the list of possible debug log items rather than
> the generic usage message. (This was inadvertently broken in commit
> c235d73.)
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> NB that I've tested the linux-user part of this fix but don't have access to
> bsd/darwin to test those files; however the change is identical for all three
> files so it should be OK...
>
>  bsd-user/main.c    |    8 +++++---
>  darwin-user/main.c |    8 +++++---
>  linux-user/main.c  |   11 ++++++-----
>  3 files changed, 16 insertions(+), 11 deletions(-)
>
> diff --git a/bsd-user/main.c b/bsd-user/main.c
> index 6018a41..a63b877 100644
> --- a/bsd-user/main.c
> +++ b/bsd-user/main.c
> @@ -856,9 +856,6 @@ int main(int argc, char **argv)
>             usage();
>         }
>     }
> -    if (optind >= argc)
> -        usage();
> -    filename = argv[optind];
>
>     /* init debug */
>     cpu_set_log_filename(log_file);
> @@ -877,6 +874,11 @@ int main(int argc, char **argv)
>         cpu_set_log(mask);
>     }
>
> +    if (optind >= argc) {
> +        usage();
> +    }
> +    filename = argv[optind];
> +
>     /* Zero out regs */
>     memset(regs, 0, sizeof(struct target_pt_regs));
>
> diff --git a/darwin-user/main.c b/darwin-user/main.c
> index 35196a1..72307ad 100644
> --- a/darwin-user/main.c
> +++ b/darwin-user/main.c
> @@ -809,9 +809,6 @@ int main(int argc, char **argv)
>             usage();
>         }
>     }
> -    if (optind >= argc)
> -        usage();
> -    filename = argv[optind];
>
>     /* init debug */
>     cpu_set_log_filename(log_file);
> @@ -830,6 +827,11 @@ int main(int argc, char **argv)
>         cpu_set_log(mask);
>     }
>
> +    if (optind >= argc) {
> +        usage();
> +    }
> +    filename = argv[optind];
> +
>     /* Zero out regs */
>     memset(regs, 0, sizeof(struct target_pt_regs));
>
> diff --git a/linux-user/main.c b/linux-user/main.c
> index 289054b..8976b60 100644
> --- a/linux-user/main.c
> +++ b/linux-user/main.c
> @@ -3019,11 +3019,6 @@ int main(int argc, char **argv, char **envp)
>             usage();
>         }
>     }
> -    if (optind >= argc)
> -        usage();
> -    filename = argv[optind];
> -    exec_path = argv[optind];
> -
>     /* init debug */
>     cpu_set_log_filename(log_file);
>     if (log_mask) {
> @@ -3041,6 +3036,12 @@ int main(int argc, char **argv, char **envp)
>         cpu_set_log(mask);
>     }
>
> +    if (optind >= argc) {
> +        usage();
> +    }
> +    filename = argv[optind];
> +    exec_path = argv[optind];
> +
>     /* Zero out regs */
>     memset(regs, 0, sizeof(struct target_pt_regs));
>
> --
> 1.7.1

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

* Re: [Qemu-devel] [PATCH] user: Restore debug usage message for '-d ?' in user mode emulation
  2011-07-25  8:43 ` Peter Maydell
@ 2011-07-27  9:38   ` Peter Maydell
  0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2011-07-27  9:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Blue Swirl, Riku Voipio, Justin M. Forbes, patches

Oops, I forgot to cc Justin when I said "should also go into 0.15"...

-- PMM

On 25 July 2011 09:43, Peter Maydell <peter.maydell@linaro.org> wrote:
> Ping? Since this is a regression in our command line handling
> I think it should also go into 0.15...
>
> thanks
> -- PMM
>
>
> On 18 July 2011 11:44, Peter Maydell <peter.maydell@linaro.org> wrote:
>> The code which prints the debug usage message on '-d ?' for *-user
>> has to come before the check for "not enough arguments", so that
>> "qemu-foo -d ?" prints the list of possible debug log items rather than
>> the generic usage message. (This was inadvertently broken in commit
>> c235d73.)
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>> NB that I've tested the linux-user part of this fix but don't have access to
>> bsd/darwin to test those files; however the change is identical for all three
>> files so it should be OK...
>>
>>  bsd-user/main.c    |    8 +++++---
>>  darwin-user/main.c |    8 +++++---
>>  linux-user/main.c  |   11 ++++++-----
>>  3 files changed, 16 insertions(+), 11 deletions(-)
>>
>> diff --git a/bsd-user/main.c b/bsd-user/main.c
>> index 6018a41..a63b877 100644
>> --- a/bsd-user/main.c
>> +++ b/bsd-user/main.c
>> @@ -856,9 +856,6 @@ int main(int argc, char **argv)
>>             usage();
>>         }
>>     }
>> -    if (optind >= argc)
>> -        usage();
>> -    filename = argv[optind];
>>
>>     /* init debug */
>>     cpu_set_log_filename(log_file);
>> @@ -877,6 +874,11 @@ int main(int argc, char **argv)
>>         cpu_set_log(mask);
>>     }
>>
>> +    if (optind >= argc) {
>> +        usage();
>> +    }
>> +    filename = argv[optind];
>> +
>>     /* Zero out regs */
>>     memset(regs, 0, sizeof(struct target_pt_regs));
>>
>> diff --git a/darwin-user/main.c b/darwin-user/main.c
>> index 35196a1..72307ad 100644
>> --- a/darwin-user/main.c
>> +++ b/darwin-user/main.c
>> @@ -809,9 +809,6 @@ int main(int argc, char **argv)
>>             usage();
>>         }
>>     }
>> -    if (optind >= argc)
>> -        usage();
>> -    filename = argv[optind];
>>
>>     /* init debug */
>>     cpu_set_log_filename(log_file);
>> @@ -830,6 +827,11 @@ int main(int argc, char **argv)
>>         cpu_set_log(mask);
>>     }
>>
>> +    if (optind >= argc) {
>> +        usage();
>> +    }
>> +    filename = argv[optind];
>> +
>>     /* Zero out regs */
>>     memset(regs, 0, sizeof(struct target_pt_regs));
>>
>> diff --git a/linux-user/main.c b/linux-user/main.c
>> index 289054b..8976b60 100644
>> --- a/linux-user/main.c
>> +++ b/linux-user/main.c
>> @@ -3019,11 +3019,6 @@ int main(int argc, char **argv, char **envp)
>>             usage();
>>         }
>>     }
>> -    if (optind >= argc)
>> -        usage();
>> -    filename = argv[optind];
>> -    exec_path = argv[optind];
>> -
>>     /* init debug */
>>     cpu_set_log_filename(log_file);
>>     if (log_mask) {
>> @@ -3041,6 +3036,12 @@ int main(int argc, char **argv, char **envp)
>>         cpu_set_log(mask);
>>     }
>>
>> +    if (optind >= argc) {
>> +        usage();
>> +    }
>> +    filename = argv[optind];
>> +    exec_path = argv[optind];
>> +
>>     /* Zero out regs */
>>     memset(regs, 0, sizeof(struct target_pt_regs));
>>
>> --
>> 1.7.1

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

* Re: [Qemu-devel] [PATCH] user: Restore debug usage message for '-d ?' in user mode emulation
  2011-07-18 10:44 [Qemu-devel] [PATCH] user: Restore debug usage message for '-d ?' in user mode emulation Peter Maydell
  2011-07-25  8:43 ` Peter Maydell
@ 2011-07-30  5:52 ` andrzej zaborowski
  1 sibling, 0 replies; 4+ messages in thread
From: andrzej zaborowski @ 2011-07-30  5:52 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Blue Swirl, Riku Voipio, qemu-devel, patches

On 18 July 2011 12:44, Peter Maydell <peter.maydell@linaro.org> wrote:
> The code which prints the debug usage message on '-d ?' for *-user
> has to come before the check for "not enough arguments", so that
> "qemu-foo -d ?" prints the list of possible debug log items rather than
> the generic usage message. (This was inadvertently broken in commit
> c235d73.)

I pushed this patch, thanks.

Cheers

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

end of thread, other threads:[~2011-07-30  5:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-18 10:44 [Qemu-devel] [PATCH] user: Restore debug usage message for '-d ?' in user mode emulation Peter Maydell
2011-07-25  8:43 ` Peter Maydell
2011-07-27  9:38   ` Peter Maydell
2011-07-30  5:52 ` andrzej zaborowski

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