[lldb-dev] Asserts in StringRef::front

2016-10-06 Thread Jim Ingham via lldb-dev
I fixed a bug in CommandObject::Execute that cause test-suite crashes when 
running with an Assert build of llvm (r283479.)

The test was doing:

break modify -c ''

which is the way you unset a condition on a breakpoint.

So the StringRef for that option value was empty, and it appears that you 
aren't supposed to call "front" on an empty StringRef.  But empty option values 
are used in a bunch of places in lldb.

Zachary, you might want to go scrub through the Args changes (and anywhere else 
you might be parsing an empty StringRef) to make sure there aren't other errors 
of this sort.

And if you aren't running your prep testsuite runs with an Assert build of 
llvm, it's probably a good idea to do so.

Jim

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] Asserts in StringRef::front

2016-10-06 Thread Zachary Turner via lldb-dev
Thanks for the heads up.  I do run with asserts, so I'm not sure why I
didn't see this particular failure.  In any case i'll go back and look
through my changes for any other occurrences of this.

Most of the time args were being checked before being used.  Like the code
would go:

const char *arg = args.GetArgumentAtIndex(i);
if (!arg || arg[0] == '\0')
  continue;

// Use it.

I shouldn't have messed up any of those because I converted them all to

if (arg.empty())
  continue;

So hopefully the one you found is the only one.

On Thu, Oct 6, 2016 at 12:16 PM Jim Ingham  wrote:

> I fixed a bug in CommandObject::Execute that cause test-suite crashes when
> running with an Assert build of llvm (r283479.)
>
> The test was doing:
>
> break modify -c ''
>
> which is the way you unset a condition on a breakpoint.
>
> So the StringRef for that option value was empty, and it appears that you
> aren't supposed to call "front" on an empty StringRef.  But empty option
> values are used in a bunch of places in lldb.
>
> Zachary, you might want to go scrub through the Args changes (and anywhere
> else you might be parsing an empty StringRef) to make sure there aren't
> other errors of this sort.
>
> And if you aren't running your prep testsuite runs with an Assert build of
> llvm, it's probably a good idea to do so.
>
> Jim
>
>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] fate of TimeValue

2016-10-06 Thread Pavel Labath via lldb-dev
Hello all,

in line with the "deinventing the wheel" movement, I'd like to remove the
TimeValue class from LLDB. I've done some research on a flight this week,
and as far as I can tell all functionality can be easily replaced with
appropriate usage of std::chrono::duration and time_point.

The only parts that are missing are the ability to convert to/from legacy C
types (struct timevalue, struct timespec), which can be replaced by utility
functions.

Also, I've found one use case particularly cumbersome to write in the c++
way: writing out a duration as a fractional number of units (e.g.
milliseconds). So, I'd propose adding the following utility function as
well (unless someone knows a cleaner way to write this):

template
double float_duration(DurIn dur) {
  return std::chrono::duration_cast>(dur).count();
}

Then, you can write float_duration(dur) to get the duration
as a fractional number of milliseconds (used in printing time deltas in a
human readable fashion).

Any thoughts or objections?

pl
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] fate of TimeValue

2016-10-06 Thread Zachary Turner via lldb-dev
I'd love to move over to chrono. For Utility functions such as those you
propose probably we should consider whether they should go into llvm. Does
llvm currently use anything from chrono or have any chrono support
functions yet?
On Thu, Oct 6, 2016 at 5:39 PM Pavel Labath via lldb-dev <
lldb-dev@lists.llvm.org> wrote:

> Hello all,
>
> in line with the "deinventing the wheel" movement, I'd like to remove the
> TimeValue class from LLDB. I've done some research on a flight this week,
> and as far as I can tell all functionality can be easily replaced with
> appropriate usage of std::chrono::duration and time_point.
>
> The only parts that are missing are the ability to convert to/from legacy
> C types (struct timevalue, struct timespec), which can be replaced by
> utility functions.
>
> Also, I've found one use case particularly cumbersome to write in the c++
> way: writing out a duration as a fractional number of units (e.g.
> milliseconds). So, I'd propose adding the following utility function as
> well (unless someone knows a cleaner way to write this):
>
> template
> double float_duration(DurIn dur) {
>   return std::chrono::duration_cast DurOut::period>>(dur).count();
> }
>
> Then, you can write float_duration(dur) to get the duration
> as a fractional number of milliseconds (used in printing time deltas in a
> human readable fashion).
>
> Any thoughts or objections?
>
> pl
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] fate of TimeValue

2016-10-06 Thread Pavel Labath via lldb-dev
I see one usage of of chrono in the Fuzzer, and that's about it.

On 6 October 2016 at 17:46, Zachary Turner  wrote:

> I'd love to move over to chrono. For Utility functions such as those you
> propose probably we should consider whether they should go into llvm. Does
> llvm currently use anything from chrono or have any chrono support
> functions yet?
> On Thu, Oct 6, 2016 at 5:39 PM Pavel Labath via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
>
>> Hello all,
>>
>> in line with the "deinventing the wheel" movement, I'd like to remove the
>> TimeValue class from LLDB. I've done some research on a flight this week,
>> and as far as I can tell all functionality can be easily replaced with
>> appropriate usage of std::chrono::duration and time_point.
>>
>> The only parts that are missing are the ability to convert to/from legacy
>> C types (struct timevalue, struct timespec), which can be replaced by
>> utility functions.
>>
>> Also, I've found one use case particularly cumbersome to write in the c++
>> way: writing out a duration as a fractional number of units (e.g.
>> milliseconds). So, I'd propose adding the following utility function as
>> well (unless someone knows a cleaner way to write this):
>>
>> template
>> double float_duration(DurIn dur) {
>>   return std::chrono::duration_cast> DurOut::period>>(dur).count();
>> }
>>
>> Then, you can write float_duration(dur) to get the
>> duration as a fractional number of milliseconds (used in printing time
>> deltas in a human readable fashion).
>>
>> Any thoughts or objections?
>>
>> pl
>> ___
>> lldb-dev mailing list
>> lldb-dev@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] Connecting to lldb-rpc-server

2016-10-06 Thread Rex Fenley via lldb-dev
Hi! I'm trying to connect to Xcode's lldb rpc server but I'm having trouble.

This doesn't seem to work to list the hosts.

rpcinfo -p lldb-rpc-server

Can't contact rpcbind on lldb-rpc-server

rpcinfo: RPC: Unknown host

Am I doing this correctly?

-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com  |  BLOG 
 |  FOLLOW
US   |  LIKE US

___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


[lldb-dev] [Bug 30492] On Linux, lldb lit tests fail

2016-10-06 Thread via lldb-dev
https://llvm.org/bugs/show_bug.cgi?id=30492

Hal Finkel  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from Hal Finkel  ---
(In reply to comment #3)
> (In reply to comment #2)
> > LGTM as well!
> > 
> > Hal, if you'd like to commit it please go ahead.
> 
> Thanks; will do.

lit/Expr/TestCallStopAndContinue.test was fixed in r283082. The lit/lit.cfg
debugserver fix committed in r283520.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev