Re: [lldb-dev] LLDB REFORMATTING IN PROGRESS

2016-09-08 Thread Ilia K via lldb-dev
Hi!

clang-formatting of my patch changed the style outside the patch (diff:
https://reviews.llvm.org/D24331?vs=70653&id=70654). Am I doing something
wrong?

On Wed, Sep 7, 2016 at 1:06 PM, Pavel Labath via lldb-dev <
[email protected]> wrote:

> Windows unit tests passing now. All clear.
>
> On 7 September 2016 at 09:54, Pavel Labath  wrote:
> > I am still seeing errors when building windows unittests. I'll have a
> > change for fixing that soon. Apart from that everything else looks
> > good on our side. I'll send an all clear once the unit tests get green
> > on windows.
> >
> > pl
> >
> > On 6 September 2016 at 23:26, Zachary Turner via lldb-dev
> >  wrote:
> >> I think Windows is good.
> >>
> >> On Tue, Sep 6, 2016 at 3:10 PM Zachary Turner 
> wrote:
> >>>
> >>> Everything compiles on Windows now but all the tests are failing with
> >>> ERROR.  I'm looking into this now.
> >>>
> >>> On Tue, Sep 6, 2016 at 2:26 PM Ed Maste via lldb-dev
> >>>  wrote:
> 
>  On 6 September 2016 at 17:17, Kate Stone via lldb-dev
>   wrote:
>  > The storm of commit messages might be a subtle clue, but here it is
>  > officially: the reformatting is complete and I’ve verified that no
>  > tests
>  > regressed locally in our macOS suite.  Please begin any validation
>  > process
>  > you’ve signed up for on another platform, and if changes are
> necessary
>  > go
>  > ahead and land them individually.
> 
>  FreeBSD currently fails to build due to header reordering in
>  source/Host/freebsd/Host.cpp which I'll sort out shortly.
> 
>  I'd like to request that we avoid any functional changes other than
>  those restoring builds to green, until we get the "all clear" from
>  everyone who's signed up to validate other platforms.
> 
>  -Ed
>  ___
>  lldb-dev mailing list
>  [email protected]
>  http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> >>
> >>
> >> ___
> >> lldb-dev mailing list
> >> [email protected]
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> >>
> ___
> lldb-dev mailing list
> [email protected]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>



-- 
- Ilia
___
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] LLDB REFORMATTING IN PROGRESS

2016-09-08 Thread Zachary Turner via lldb-dev
In order to clang-format only the diff, you should use the "git
clang-format" extension command. Search for git-clang-format (yes, that one
has an extra dash), and there should be instructions inside
On Thu, Sep 8, 2016 at 12:16 AM Ilia K  wrote:

> Hi!
>
> clang-formatting of my patch changed the style outside the patch (diff:
> https://reviews.llvm.org/D24331?vs=70653&id=70654). Am I doing something
> wrong?
>
> On Wed, Sep 7, 2016 at 1:06 PM, Pavel Labath via lldb-dev <
> [email protected]> wrote:
>
> Windows unit tests passing now. All clear.
>
> On 7 September 2016 at 09:54, Pavel Labath  wrote:
> > I am still seeing errors when building windows unittests. I'll have a
> > change for fixing that soon. Apart from that everything else looks
> > good on our side. I'll send an all clear once the unit tests get green
> > on windows.
> >
> > pl
> >
> > On 6 September 2016 at 23:26, Zachary Turner via lldb-dev
> >  wrote:
> >> I think Windows is good.
> >>
> >> On Tue, Sep 6, 2016 at 3:10 PM Zachary Turner 
> wrote:
> >>>
> >>> Everything compiles on Windows now but all the tests are failing with
> >>> ERROR.  I'm looking into this now.
> >>>
> >>> On Tue, Sep 6, 2016 at 2:26 PM Ed Maste via lldb-dev
> >>>  wrote:
> 
>  On 6 September 2016 at 17:17, Kate Stone via lldb-dev
>   wrote:
>  > The storm of commit messages might be a subtle clue, but here it is
>  > officially: the reformatting is complete and I’ve verified that no
>  > tests
>  > regressed locally in our macOS suite.  Please begin any validation
>  > process
>  > you’ve signed up for on another platform, and if changes are
> necessary
>  > go
>  > ahead and land them individually.
> 
>  FreeBSD currently fails to build due to header reordering in
>  source/Host/freebsd/Host.cpp which I'll sort out shortly.
> 
>  I'd like to request that we avoid any functional changes other than
>  those restoring builds to green, until we get the "all clear" from
>  everyone who's signed up to validate other platforms.
> 
>  -Ed
>  ___
>  lldb-dev mailing list
>  [email protected]
>  http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> >>
> >>
> >> ___
> >> lldb-dev mailing list
> >> [email protected]
> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
> >>
> ___
> lldb-dev mailing list
> [email protected]
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
>
>
> --
> - Ilia
>
___
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] LLDB REFORMATTING IN PROGRESS

2016-09-08 Thread Ilia K via lldb-dev
But what about SVN users? :)
Okay, I know format can be applied for modified fragments only. But why did
we leave some places unformatted? I thought "clang-format -i `find include
source tools -name '*.[cpp|h]'`" ends with empty diff.

On Thu, Sep 8, 2016 at 10:19 AM, Zachary Turner  wrote:

> In order to clang-format only the diff, you should use the "git
> clang-format" extension command. Search for git-clang-format (yes, that one
> has an extra dash), and there should be instructions inside
> On Thu, Sep 8, 2016 at 12:16 AM Ilia K  wrote:
>
>> Hi!
>>
>> clang-formatting of my patch changed the style outside the patch (diff:
>> https://reviews.llvm.org/D24331?vs=70653&id=70654). Am I doing something
>> wrong?
>>
>> On Wed, Sep 7, 2016 at 1:06 PM, Pavel Labath via lldb-dev <
>> [email protected]> wrote:
>>
>>> Windows unit tests passing now. All clear.
>>>
>>> On 7 September 2016 at 09:54, Pavel Labath  wrote:
>>> > I am still seeing errors when building windows unittests. I'll have a
>>> > change for fixing that soon. Apart from that everything else looks
>>> > good on our side. I'll send an all clear once the unit tests get green
>>> > on windows.
>>> >
>>> > pl
>>> >
>>> > On 6 September 2016 at 23:26, Zachary Turner via lldb-dev
>>> >  wrote:
>>> >> I think Windows is good.
>>> >>
>>> >> On Tue, Sep 6, 2016 at 3:10 PM Zachary Turner 
>>> wrote:
>>> >>>
>>> >>> Everything compiles on Windows now but all the tests are failing with
>>> >>> ERROR.  I'm looking into this now.
>>> >>>
>>> >>> On Tue, Sep 6, 2016 at 2:26 PM Ed Maste via lldb-dev
>>> >>>  wrote:
>>> 
>>>  On 6 September 2016 at 17:17, Kate Stone via lldb-dev
>>>   wrote:
>>>  > The storm of commit messages might be a subtle clue, but here it
>>> is
>>>  > officially: the reformatting is complete and I’ve verified that no
>>>  > tests
>>>  > regressed locally in our macOS suite.  Please begin any validation
>>>  > process
>>>  > you’ve signed up for on another platform, and if changes are
>>> necessary
>>>  > go
>>>  > ahead and land them individually.
>>> 
>>>  FreeBSD currently fails to build due to header reordering in
>>>  source/Host/freebsd/Host.cpp which I'll sort out shortly.
>>> 
>>>  I'd like to request that we avoid any functional changes other than
>>>  those restoring builds to green, until we get the "all clear" from
>>>  everyone who's signed up to validate other platforms.
>>> 
>>>  -Ed
>>>  ___
>>>  lldb-dev mailing list
>>>  [email protected]
>>>  http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>> >>
>>> >>
>>> >> ___
>>> >> lldb-dev mailing list
>>> >> [email protected]
>>> >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>> >>
>>> ___
>>> lldb-dev mailing list
>>> [email protected]
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>>
>>
>>
>>
>> --
>> - Ilia
>>
>


-- 
- Ilia
___
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] LLDB REFORMATTING IN PROGRESS

2016-09-08 Thread Pavel Labath via lldb-dev
The clang format webpage 
recommends the following (I haven't tried it, but it sounds like it
should work):
svn diff --diff-cmd=diff -x -U0 | clang-format-diff.py -i

I also expected that running clang-format on the current tree would be
a no-op, but actually I get a lot of changes, mostly to do with moving
comments around. I can only assume this is due to not using the exact
same version of the tool.

pl

On 8 September 2016 at 08:37, Ilia K  wrote:
> But what about SVN users? :)
> Okay, I know format can be applied for modified fragments only. But why did
> we leave some places unformatted? I thought "clang-format -i `find include
> source tools -name '*.[cpp|h]'`" ends with empty diff.
>
> On Thu, Sep 8, 2016 at 10:19 AM, Zachary Turner  wrote:
>>
>> In order to clang-format only the diff, you should use the "git
>> clang-format" extension command. Search for git-clang-format (yes, that one
>> has an extra dash), and there should be instructions inside
>> On Thu, Sep 8, 2016 at 12:16 AM Ilia K  wrote:
>>>
>>> Hi!
>>>
>>> clang-formatting of my patch changed the style outside the patch (diff:
>>> https://reviews.llvm.org/D24331?vs=70653&id=70654). Am I doing something
>>> wrong?
>>>
>>> On Wed, Sep 7, 2016 at 1:06 PM, Pavel Labath via lldb-dev
>>>  wrote:

 Windows unit tests passing now. All clear.

 On 7 September 2016 at 09:54, Pavel Labath  wrote:
 > I am still seeing errors when building windows unittests. I'll have a
 > change for fixing that soon. Apart from that everything else looks
 > good on our side. I'll send an all clear once the unit tests get green
 > on windows.
 >
 > pl
 >
 > On 6 September 2016 at 23:26, Zachary Turner via lldb-dev
 >  wrote:
 >> I think Windows is good.
 >>
 >> On Tue, Sep 6, 2016 at 3:10 PM Zachary Turner 
 >> wrote:
 >>>
 >>> Everything compiles on Windows now but all the tests are failing
 >>> with
 >>> ERROR.  I'm looking into this now.
 >>>
 >>> On Tue, Sep 6, 2016 at 2:26 PM Ed Maste via lldb-dev
 >>>  wrote:
 
  On 6 September 2016 at 17:17, Kate Stone via lldb-dev
   wrote:
  > The storm of commit messages might be a subtle clue, but here it
  > is
  > officially: the reformatting is complete and I’ve verified that
  > no
  > tests
  > regressed locally in our macOS suite.  Please begin any
  > validation
  > process
  > you’ve signed up for on another platform, and if changes are
  > necessary
  > go
  > ahead and land them individually.
 
  FreeBSD currently fails to build due to header reordering in
  source/Host/freebsd/Host.cpp which I'll sort out shortly.
 
  I'd like to request that we avoid any functional changes other than
  those restoring builds to green, until we get the "all clear" from
  everyone who's signed up to validate other platforms.
 
  -Ed
  ___
  lldb-dev mailing list
  [email protected]
  http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
 >>
 >>
 >> ___
 >> lldb-dev mailing list
 >> [email protected]
 >> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
 >>
 ___
 lldb-dev mailing list
 [email protected]
 http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>>
>>>
>>>
>>>
>>> --
>>> - Ilia
>
>
>
>
> --
> - Ilia
___
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] LLDB REFORMATTING IN PROGRESS

2016-09-08 Thread Tobias Grosser via lldb-dev
On Thu, Sep 8, 2016, at 11:14 AM, Pavel Labath via lldb-dev wrote:
> The clang format webpage 
> recommends the following (I haven't tried it, but it sounds like it
> should work):
> svn diff --diff-cmd=diff -x -U0 | clang-format-diff.py -i
> 
> I also expected that running clang-format on the current tree would be
> a no-op, but actually I get a lot of changes, mostly to do with moving
> comments around. I can only assume this is due to not using the exact
> same version of the tool.

Just to add some experiences from 'polly.llvm.org'. We always use the
latest version version of clang-format, because we also earlier observed
larger differences in formatting between different clang-format
versions. To simplify this format-checking we added a
'polly-check-format'  command to our build system. In recent releases
clang-format formatting only changed little, if at all.

Best,
Tobias
___
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] Syntax/documentation on continuing from a breakpoint in a one-line python script

2016-09-08 Thread Randy Smith via lldb-dev
I've been playing around with lldb and customization in python recently,
and the interface seems unclear and/or broken around continuing from a
breakpoint when using a one-line python script ("breakpoint command add -s
python -o ").  The documentation isn't clear about whether this
works with a one liner (It says both "Your Python code, however organized,
can optionally return a value.  If the returned value is False, that tells
LLDB not to stop at the breakpoint to which the code is associated." and
"Single line breakpoint commands will be interpreted 'as is' when the
breakpoint is hit.  Multiple lines of Python will be wrapped in a generated
function, and a call to the function will be attached to the breakpoint.")
and my experiments have suggested that it can't (neither an expression that
returns False nor an explicit "return " seem to work).

Is this expected to work?  Should the documentation be cleared up?

(In case anyone wants to help with the background problem I'm trying to
solve: I'm trying to write some generic logging code that can be attached
to a breakpoint, so that I can log variable values at particular locations
without repeatedly recompiling the program.  So I'm trying to have a
command that creates a breakpoint at a location that prints different
variables and then continues.  I couldn't find a way to have the python
code enter multiple lines of commands attached to a breakpoint (hence the
one-liner).  From the doc it looked like I could set a python callback to
be called when the breakpoint was hit and do everything in python, but I
couldn't find any documentation on how to use
SBBreakpoint::BreakpointHitCallback.
I can't just attach a python function directly to the breakpoint
(--python-function) because the function has to vary depending on what
variables you want to trace.

I've attached my python module to make this clear.  The "experiments" I
refer to above are whether the text on line 58 is

"return logging.log(frame, bp_loc, (" +

or

"logging.log(frame, bp_loc, (" +

).

Thanks much in advance ...

-- Randy
import argparse
import lldb
import shlex

def log(frame, bp_loc, variables):
result = ""
result += "Logging: "
result += bp_loc.GetAddress().GetFunction().GetName()
result += "("
result += bp_loc.GetAddress().GetLineEntry().GetFileSpec().GetFilename()
result += ":"
result += str(bp_loc.GetAddress().GetLineEntry().GetLine())
result += "): "
for v in variables:
result += '"%s"' % v
result += ":"
result += frame.EvaluateExpression(v).GetValue()
result += " "
result += "\n"
print result
return False

# TODO: Define a python function that takes the following args when aliased
# from the command line:
#	-f  
#	-l 
#	-v  # may be specified multiple times.
# 
# and sets a breakpoint that outputs:
# "Logging  (fnname:l#): : "
# and continues whenever that location is hit.
def log_line(debugger, command, result, internal_dict):
"Set a breakpoint for logging; prints information and continues."

args=shlex.split(command)

parser = argparse.ArgumentParser(
prog='',
description='Parse args to log_line function.')
parser.add_argument('-f', dest='filename', 
required=True, help="File containing line to log.")
parser.add_argument('-l', dest='lineno', type=int, required=True,
help="Line to log.")
parser.add_argument('-v', dest='variables', action='append',
help="Variable value to log.")

args_ns = parser.parse_args(args=args)

## TODO: Shift over to using python arguments instead of going through
## command line.  Requires understanding how callbacks are used in python. 

bp = debugger.GetSelectedTarget().BreakpointCreateByLocation(
args_ns.filename, args_ns.lineno)

debugger.HandleCommand(
"breakpoint set -f %s -l %d" % (args_ns.filename, args_ns.lineno))
debugger.HandleCommand("breakpoint command add -s python -o '" +
   "return logging.log(frame, bp_loc, (" +
   ",".join(['"%s"' % i for i in args_ns.variables]) +
   "))'")

lldb.debugger.HandleCommand('command script add -f logging.log_line trace')
___
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] Problem with watchpoints

2016-09-08 Thread Ted Woodward via lldb-dev
I recently discovered a problem with watchpoints talking to the Hexagon
simulator:

 

(lldb) w s e 0x1000

error: Watchpoint creation failed (addr=0x1000, size=4).

error: Target supports (0) hardware watchpoint slots.

 

 

It seems that lldb now sends a qWatchpointSupportInfo packet. But this
packet isn't defined in lldb-gdb-remote.txt.

 

Looking at the code, it expects to get back a pair "num:#". If it doesn't it
returns 0. The caller will report the above error if the number returned is
0. So if qWatchpointSupportInfo isn't supported, lldb can't set a
watchpoint.

 

 

What is the definition of the response to qWatchpointSupportInfo? Is the the
number of supported watchpoints, or the number of available watchpoints? If
it's supported, then CheckIfWatchpointsExhausted won't really check if the
watchpoints are exhausted. If it's available, then a return of 0 doesn't let
us aggregate watchpoints - a 4 byte watchpoint at 0x1000 and one at 0x1004
could be one going from 0x1000-0x1007.

 

 

Wouldn't it be better to try to set the watchpoint, then report a failure if
we get an error back from the remote server?

 

--

Qualcomm Innovation Center, Inc.

The Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a
Linux Foundation Collaborative Project

 

___
lldb-dev mailing list
[email protected]
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev