Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Metzger, Markus T" <markus.t.metzger@intel.com>
To: Pedro Alves <palves@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: RE: "set record instruction-history" ?
Date: Wed, 27 Mar 2013 10:03:00 -0000	[thread overview]
Message-ID: <A78C989F6D9628469189715575E55B2307BA8B86@IRSMSX102.ger.corp.intel.com> (raw)
In-Reply-To: <5151E3BE.90603@redhat.com>

> -----Original Message-----
> From: gdb-patches-owner@sourceware.org [mailto:gdb-patches-owner@sourceware.org] On Behalf Of Pedro Alves
> Sent: Tuesday, March 26, 2013 7:07 PM
> To: Metzger, Markus T


> Thanks!  Taking into account the push back in making the
> set history size command signed, I've adjusted the patch
> to keep this command signed as well and checked it in.
> I tried the different numbers that should be affected manually
> and I believe it to be an equivalent patch from what you tested.
> Let me know, if something broke.

There is a single regression...

[...]

> +static int
> +command_size_to_target_size (unsigned int *command)
> +{
> +  gdb_assert (*command <= INT_MAX || *command == UINT_MAX);
> +
> +  if (record_call_history_size == UINT_MAX)

...here. We should have used *command in the comparison.

I also changed the parameter type to "unsigned int" since we're not
updating our argument.

    record: fix instruction-history-size regression
    
    (gdb) PASS: gdb.btrace/instruction_history.exp: set record instruction-history-size 0
    record instruction-history 0
    Bad range.
    (gdb) FAIL: gdb.btrace/instruction_history.exp: record instruction-history - unlimited
    
    2013-03-13  Markus Metzger  <markus.t.metzger@intel.com>
    
    	* record.c (command_size_to_target_size): Fix size comparison.
    	Change parameter type from pointer to integer to integer.
    	Update all users.
    
diff --git a/gdb/record.c b/gdb/record.c
index b64f3bc..2736a1e 100644
--- a/gdb/record.c
+++ b/gdb/record.c
@@ -442,18 +442,18 @@ get_insn_history_modifiers (char **arg)
    meaning unlimited.  The target interfaces works with signed int
    though, to indicate direction, so map "unlimited" to INT_MAX, which
    is about the same as unlimited in practice.  If the user does have
-   a log that huge, she can can fetch it in chunks across several
-   requests, but she'll likely have other problems first...  */
+   a log that huge, she can fetch it in chunks across several requests,
+   but she'll likely have other problems first...  */
 
 static int
-command_size_to_target_size (unsigned int *command)
+command_size_to_target_size (unsigned int size)
 {
-  gdb_assert (*command <= INT_MAX || *command == UINT_MAX);
+  gdb_assert (size <= INT_MAX || size == UINT_MAX);
 
-  if (record_call_history_size == UINT_MAX)
+  if (size == UINT_MAX)
     return INT_MAX;
   else
-    return *command;
+    return size;
 }
 
 /* The "record instruction-history" command.  */
@@ -467,7 +467,7 @@ cmd_record_insn_history (char *arg, int from_tty)
 
   flags = get_insn_history_modifiers (&arg);
 
-  size = command_size_to_target_size (&record_insn_history_size);
+  size = command_size_to_target_size (record_insn_history_size);
 
   if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
     target_insn_history (size, flags);
@@ -583,7 +583,7 @@ cmd_record_call_history (char *arg, int from_tty)
 
   flags = get_call_history_modifiers (&arg);
 
-  size = command_size_to_target_size (&record_call_history_size);
+  size = command_size_to_target_size (record_call_history_size);
 
   if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
     target_call_history (size, flags);


OK to commit?  Does this also go onto the 7.6 branch?

Thanks,
Markus.
Intel GmbH
Dornacher Strasse 1
85622 Feldkirchen/Muenchen, Deutschland
Sitz der Gesellschaft: Feldkirchen bei Muenchen
Geschaeftsfuehrer: Christian Lamprechter, Hannes Schwaderer, Douglas Lusk
Registergericht: Muenchen HRB 47456
Ust.-IdNr./VAT Registration No.: DE129385895
Citibank Frankfurt a.M. (BLZ 502 109 00) 600119052


  reply	other threads:[~2013-03-27  7:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-25 17:23 Pedro Alves
2013-03-25 17:25 ` Metzger, Markus T
2013-03-25 19:55   ` Pedro Alves
2013-03-26 16:21     ` Metzger, Markus T
2013-03-26 16:53       ` Pedro Alves
2013-03-26 16:58         ` Metzger, Markus T
2013-03-26 19:35           ` Pedro Alves
2013-03-27 10:03             ` Metzger, Markus T [this message]
2013-03-27 11:23               ` Pedro Alves

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=A78C989F6D9628469189715575E55B2307BA8B86@IRSMSX102.ger.corp.intel.com \
    --to=markus.t.metzger@intel.com \
    --cc=gdb-patches@sourceware.org \
    --cc=palves@redhat.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