[Lldb-commits] Fwd: [PATCH] Python register definition script not being executed

Steve Pucci spucci at google.com
Tue Jan 7 18:55:38 PST 2014


Please commit the attached patch.  Thanks!

---------- Forwarded message ----------
From: Greg Clayton <gclayton at apple.com>
Date: Tue, Jan 7, 2014 at 4:37 PM
Subject: Re: [PATCH] Python register definition script not being executed
To: Steve Pucci <spucci at google.com>
Cc: Todd Fiala <tfiala at google.com>


Looks good.

On Jan 7, 2014, at 3:58 PM, Steve Pucci <spucci at google.com> wrote:

> Hi Greg,
>
> (Thanks for your previous mail.  Still working through it to get good
answers).
>
> The attached patch fixes a problem where our register definition script
was not being invoked.  I believe that as a result of this change
>
>
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20131202/010096.html
>
> , the call asking for the first register definition "succeeds" even
though the response from qRegisterInfo0 is $00#, and this success disturbs
the logic in the rest of the method, which was assuming failure from the
packet call (specifically, reg_num was now 1 rather than 0 when exiting the
for loop, which caused the reading of the Python script to be skipped).
>
> One thing I'm not sure of:  there is another dependency on "reg_num == 0"
later on in the same method, which is used in the call to
m_register_info.HardcodeARMRegisters(from_scratch).  It seems clear that
the intent is that reg_num be 0 here as well, though, which this patch will
also accomplish.
>
> Thanks,
>   Steve
>
> diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
> index 0cf3284..a9cf080 100644
> --- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
> +++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
> @@ -509,6 +509,10 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool
force)
>
>                  m_register_info.AddRegister(reg_info, reg_name,
alt_name, set_name);
>              }
> +            else
> +            {
> +                break;  // ensure exit before reg_num is incremented
> +            }
>          }
>          else
>          {
>
> <patch.txt>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140107/7a63534e/attachment.html>
-------------- next part --------------
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 0cf3284..a9cf080 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -509,6 +509,10 @@ ProcessGDBRemote::BuildDynamicRegisterInfo (bool force)
 
                 m_register_info.AddRegister(reg_info, reg_name, alt_name, set_name);
             }
+            else
+            {
+                break;  // ensure exit before reg_num is incremented
+            }
         }
         else
         {


More information about the lldb-commits mailing list