[lldb-dev] --top-level doesn't work in lldb for Objective-C or Swift :(

2016-10-04 Thread Rex Fenley via lldb-dev
Hey lldb team!

I'm trying to use `expr --top-level` from lldb in Xcode but it throws
errors like the following:

(lldb) expression --top-level -- NSString *str = @"This is a string";
Error [IRForTarget]: Couldn't replace an Objective-C constant string with a
dynamic string
error: cannot import unsupported AST node ObjCStringLiteral
error: The expression could not be prepared to run in the target


It seems like top-level only supports raw C code and not Objective-C. Is
there an option we can set to support this? Is there somewhere in lldb's
source code that could help point us to fixing this?

Thank you, you guys rule!

-- 

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


Re: [lldb-dev] --top-level doesn't work in lldb for Objective-C or Swift :(

2016-10-05 Thread Rex Fenley via lldb-dev
Jim,

That doesn't seem to work for us. We're using lldb packaged with Xcode 8
fyi.

(lldb) expr --top-level -- NSString *string = [NSString
stringWithUTF8String: "This is a string"];


; Function Attrs: nounwind

define internal void @_GLOBAL__sub_I__null_() #0 section
"__TEXT,__StaticInit,regular,pure_instructions" {

  call void @__cxx_global_var_init()

  ret void

}

On Tue, Oct 4, 2016 at 4:09 PM, Jim Ingham  wrote:

> This isn't an issue with ObjC support in general, but rather shows that
> ObjC string constants are odd beasts.  You can work around this pretty
> easily by making dynamic strings:
>
> (lldb) expr --top-level -- NSString *string = [NSString
> stringWithUTF8String: "This is a string"];
> (lldb) expr string
> (__NSCFString *) $0 = 0x0001002001b0 @"This is a string"
>
> Please file a bug about the problem with ObjC constant strings.
>
> Jim
>
>
> > On Oct 4, 2016, at 3:57 PM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >
> > Hey lldb team!
> >
> > I'm trying to use `expr --top-level` from lldb in Xcode but it throws
> errors like the following:
> >
> > (lldb) expression --top-level -- NSString *str = @"This is a string";
> > Error [IRForTarget]: Couldn't replace an Objective-C constant string
> with a dynamic string
> > error: cannot import unsupported AST node ObjCStringLiteral
> > error: The expression could not be prepared to run in the target
> >
> > It seems like top-level only supports raw C code and not Objective-C. Is
> there an option we can set to support this? Is there somewhere in lldb's
> source code that could help point us to fixing this?
> >
> > Thank you, you guys rule!
> >
> > --
> > 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
>
>


-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] --top-level doesn't work in lldb for Objective-C or Swift :(

2016-10-05 Thread Rex Fenley via lldb-dev
Maybe I have that incorrectly, this does seem to work when using lldb from
Xcode's console. This doesn't work when typing `lldb` into the terminal and
using it from there. I assumed the two were the same.

On a separate note, --top-level doesn't seem to work for swift (from Xcode
console lldb). We need it to work with swift for the scripts we'll be
writing.

*(lldb) expr -l swift --top-level -- let i = 10*

*expr -l swift --top-level -- let a = i*

error: :3:9: error: use of unresolved identifier 'i'

let a = i

On Wed, Oct 5, 2016 at 10:06 AM, Rex Fenley  wrote:

> Jim,
>
> That doesn't seem to work for us. We're using lldb packaged with Xcode 8
> fyi.
>
> (lldb) expr --top-level -- NSString *string = [NSString
> stringWithUTF8String: "This is a string"];
>
>
> ; Function Attrs: nounwind
>
> define internal void @_GLOBAL__sub_I__null_() #0 section
> "__TEXT,__StaticInit,regular,pure_instructions" {
>
>   call void @__cxx_global_var_init()
>
>   ret void
>
> }
>
> On Tue, Oct 4, 2016 at 4:09 PM, Jim Ingham  wrote:
>
>> This isn't an issue with ObjC support in general, but rather shows that
>> ObjC string constants are odd beasts.  You can work around this pretty
>> easily by making dynamic strings:
>>
>> (lldb) expr --top-level -- NSString *string = [NSString
>> stringWithUTF8String: "This is a string"];
>> (lldb) expr string
>> (__NSCFString *) $0 = 0x0001002001b0 @"This is a string"
>>
>> Please file a bug about the problem with ObjC constant strings.
>>
>> Jim
>>
>>
>> > On Oct 4, 2016, at 3:57 PM, Rex Fenley via lldb-dev <
>> lldb-dev@lists.llvm.org> wrote:
>> >
>> > Hey lldb team!
>> >
>> > I'm trying to use `expr --top-level` from lldb in Xcode but it throws
>> errors like the following:
>> >
>> > (lldb) expression --top-level -- NSString *str = @"This is a string";
>> > Error [IRForTarget]: Couldn't replace an Objective-C constant string
>> with a dynamic string
>> > error: cannot import unsupported AST node ObjCStringLiteral
>> > error: The expression could not be prepared to run in the target
>> >
>> > It seems like top-level only supports raw C code and not Objective-C.
>> Is there an option we can set to support this? Is there somewhere in lldb's
>> source code that could help point us to fixing this?
>> >
>> > Thank you, you guys rule!
>> >
>> > --
>> > 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
>>
>>
>
>
> --
>
> Rex Fenley  |  IOS DEVELOPER
>
> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |
>  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
> <https://www.facebook.com/remindhq>
>



-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] --top-level doesn't work in lldb for Objective-C or Swift :(

2016-10-05 Thread Rex Fenley via lldb-dev
Sure, I'll file a bug :)

Can we get --top-level to work with Swift too?

On Wed, Oct 5, 2016 at 11:03 AM, Jim Ingham  wrote:

>
> > On Oct 5, 2016, at 10:06 AM, Rex Fenley  wrote:
> >
> > Jim,
> >
> > That doesn't seem to work for us. We're using lldb packaged with Xcode 8
> fyi.
> > (lldb) expr --top-level -- NSString *string = [NSString
> stringWithUTF8String: "This is a string"];
> >
> >
> >
> > ; Function Attrs: nounwind
> >
> > define internal void @_GLOBAL__sub_I__null_() #0 section
> "__TEXT,__StaticInit,regular,pure_instructions" {
> >
> >   call void @__cxx_global_var_init()
> >
> >   ret void
> >
> > }
> >
> >
>
> Yes, I see that printout too, but it doesn't make the expression not
> work.  With 8.0 I see:
>
> (lldb) expr --top-level -- NSString *string = [NSString
> stringWithUTF8String: "This is a string"];
>
> ; Function Attrs: nounwind
> define internal void @_GLOBAL__sub_I__null_() #0 section
> "__TEXT,__StaticInit,regular,pure_instructions" {
>   call void @__cxx_global_var_init()
>   ret void
> }
>
> (lldb) po string
> This is a string
>
> So the expression definitely worked.
>
> Can you file a bug about the spammy printing?  Looks like somebody left a
> printf in code somewhere.
>
> Jim
>
> > On Tue, Oct 4, 2016 at 4:09 PM, Jim Ingham  wrote:
> > This isn't an issue with ObjC support in general, but rather shows that
> ObjC string constants are odd beasts.  You can work around this pretty
> easily by making dynamic strings:
> >
> > (lldb) expr --top-level -- NSString *string = [NSString
> stringWithUTF8String: "This is a string"];
> > (lldb) expr string
> > (__NSCFString *) $0 = 0x0001002001b0 @"This is a string"
> >
> > Please file a bug about the problem with ObjC constant strings.
> >
> > Jim
> >
> >
> > > On Oct 4, 2016, at 3:57 PM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> > >
> > > Hey lldb team!
> > >
> > > I'm trying to use `expr --top-level` from lldb in Xcode but it throws
> errors like the following:
> > >
> > > (lldb) expression --top-level -- NSString *str = @"This is a string";
> > > Error [IRForTarget]: Couldn't replace an Objective-C constant string
> with a dynamic string
> > > error: cannot import unsupported AST node ObjCStringLiteral
> > > error: The expression could not be prepared to run in the target
> > >
> > > It seems like top-level only supports raw C code and not Objective-C.
> Is there an option we can set to support this? Is there somewhere in lldb's
> source code that could help point us to fixing this?
> > >
> > > Thank you, you guys rule!
> > >
> > > --
> > > 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
> >
> >
> >
> >
> > --
> > Rex Fenley  |  IOS DEVELOPER
> >
> >
> > Remind.com |  BLOG  |  FOLLOW US  |  LIKE US
>
>


-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


Re: [lldb-dev] --top-level doesn't work in lldb for Objective-C or Swift :(

2016-10-05 Thread Rex Fenley via lldb-dev
Hey Kate! Thanks for all this info, it's really helpful :)

We'd like to have more complex expressions being used from the debugger.
Some of this would be code written in separate files. It will be difficult
or at least very tedious to have all our code use "$", is there a way to
void using "$"? Is there an option we could add to lldb to avoid using "$"
and still have variables and data-structures globally accessible? I notice
that within "repl" "$" it's not necessary to use any "$" variables, is
there a way to elevate the logic "repl" uses into expr?

On Wed, Oct 5, 2016 at 11:29 AM, Kate Stone  wrote:

> On Oct 5, 2016, at 10:14 AM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
>
> Maybe I have that incorrectly, this does seem to work when using lldb from
> Xcode's console. This doesn't work when typing `lldb` into the terminal and
> using it from there. I assumed the two were the same.
>
>
> The same underlying debugger is used in both cases.  There can be subtle
> reasons for differences in behavior in the different contexts, but I don’t
> see how they’d apply here.  Let’s get to a specific scenario and ensure
> that we can resolve that for you.
>
> On a separate note, --top-level doesn't seem to work for swift (from Xcode
> console lldb). We need it to work with swift for the scripts we'll be
> writing.
>
> *(lldb) expr -l swift --top-level -- let i = 10*
>
> *expr -l swift --top-level -- let a = i*
>
> error: :3:9: error: use of unresolved identifier 'i'
>
> The --top-level option isn’t meaningful for Swift, so it’s completely
> ignored.  The less ambiguous nature of the language allows us to
> automatically determine what are top-level constructs and what’s intended
> to be evaluated in scope.  We introduced --top-level for Objective-C / C++
> primarily to enable declaring functions and anything else that literally
> *cannot* be written in a local scope.
>
> In your particular example the reason you can’t refer to “i” is completely
> unrelated.  Conceptually, every expression you evaluate is wrapped in its
> own scope.  So your two subsequent expressions act like this construct :
>
> do {
> let i = 10
> }
> do {
> let a = i
> }
>
>
> As you can see, “i” is defined in this expression scope and then goes out
> of scope immediately after execution.  This is useful when you want to
> write a multi-line expression that introduces declarations for immediate
> use without having them cluttering up your namespace afterwards.  The
> convention used by LLDB for any declaration that you intend to use in later
> expressions is to prefix the name with a dollar sign.  So you can do the
> following:
>
> (lldb) expr -l swift -- let $i = 10
> (lldb) expr -l swift -- let $a = i
>
>
> … and both “$a” and “$i" will be available in subsequent expressions.
>
> Kate Stone k8st...@apple.com
>  Xcode Low Level Tools
>
> On Wed, Oct 5, 2016 at 10:06 AM, Rex Fenley  wrote:
>
>> Jim,
>>
>> That doesn't seem to work for us. We're using lldb packaged with Xcode 8
>> fyi.
>>
>> (lldb) expr --top-level -- NSString *string = [NSString
>> stringWithUTF8String: "This is a string"];
>>
>>
>> ; Function Attrs: nounwind
>>
>> define internal void @_GLOBAL__sub_I__null_() #0 section
>> "__TEXT,__StaticInit,regular,pure_instructions" {
>>
>>   call void @__cxx_global_var_init()
>>
>>   ret void
>>
>> }
>>
>> On Tue, Oct 4, 2016 at 4:09 PM, Jim Ingham  wrote:
>>
>>> This isn't an issue with ObjC support in general, but rather shows that
>>> ObjC string constants are odd beasts.  You can work around this pretty
>>> easily by making dynamic strings:
>>>
>>> (lldb) expr --top-level -- NSString *string = [NSString
>>> stringWithUTF8String: "This is a string"];
>>> (lldb) expr string
>>> (__NSCFString *) $0 = 0x0001002001b0 @"This is a string"
>>>
>>> Please file a bug about the problem with ObjC constant strings.
>>>
>>> Jim
>>>
>>>
>>> > On Oct 4, 2016, at 3:57 PM, Rex Fenley via lldb-dev <
>>> lldb-dev@lists.llvm.org> wrote:
>>> >
>>> > Hey lldb team!
>>> >
>>> > I'm trying to use `expr --top-level` from lldb in Xcode but it throws
>>> errors like the following:
>>> >
>>> > (lldb) expression --top-level -- NSString *str = @"This is a string";
>>> > Error [IRForTarget

Re: [lldb-dev] --top-level doesn't work in lldb for Objective-C or Swift :(

2016-10-05 Thread Rex Fenley via lldb-dev
That's totally fine for our use case.

On Wed, Oct 5, 2016 at 11:57 AM, Jim Ingham  wrote:

> You would have to be really careful about using "debugger variables" whose
> name is not decorated with a "$".  After all, this is introducing a global
> variable, which will be shadowed by local variables, ivars, file statics
> for the current frame's CU, etc.  So using the code you've added at various
> stop points in the debugging session will be fragile.  That's the primary
> reason that we don't encourage defining debugger variables in the common
> identifier namespace of your program.
>
> Jim
>
>
>
> > On Oct 5, 2016, at 11:41 AM, Rex Fenley  wrote:
> >
> > Hey Kate! Thanks for all this info, it's really helpful :)
> >
> > We'd like to have more complex expressions being used from the debugger.
> Some of this would be code written in separate files. It will be difficult
> or at least very tedious to have all our code use "$", is there a way to
> void using "$"? Is there an option we could add to lldb to avoid using "$"
> and still have variables and data-structures globally accessible? I notice
> that within "repl" "$" it's not necessary to use any "$" variables, is
> there a way to elevate the logic "repl" uses into expr?
> >
> > On Wed, Oct 5, 2016 at 11:29 AM, Kate Stone  wrote:
> >> On Oct 5, 2016, at 10:14 AM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >>
> >> Maybe I have that incorrectly, this does seem to work when using lldb
> from Xcode's console. This doesn't work when typing `lldb` into the
> terminal and using it from there. I assumed the two were the same.
> >
> > The same underlying debugger is used in both cases.  There can be subtle
> reasons for differences in behavior in the different contexts, but I don’t
> see how they’d apply here.  Let’s get to a specific scenario and ensure
> that we can resolve that for you.
> >
> >> On a separate note, --top-level doesn't seem to work for swift (from
> Xcode console lldb). We need it to work with swift for the scripts we'll be
> writing.
> >> (lldb) expr -l swift --top-level -- let i = 10
> >>
> >> expr -l swift --top-level -- let a = i
> >>
> >> error: :3:9: error: use of unresolved identifier 'i'
> >>
> > The --top-level option isn’t meaningful for Swift, so it’s completely
> ignored.  The less ambiguous nature of the language allows us to
> automatically determine what are top-level constructs and what’s intended
> to be evaluated in scope.  We introduced --top-level for Objective-C / C++
> primarily to enable declaring functions and anything else that literally
> cannot be written in a local scope.
> >
> > In your particular example the reason you can’t refer to “i” is
> completely unrelated.  Conceptually, every expression you evaluate is
> wrapped in its own scope.  So your two subsequent expressions act like this
> construct :
> >
> > do {
> > let i = 10
> > }
> > do {
> > let a = i
> > }
> >
> > As you can see, “i” is defined in this expression scope and then goes
> out of scope immediately after execution.  This is useful when you want to
> write a multi-line expression that introduces declarations for immediate
> use without having them cluttering up your namespace afterwards.  The
> convention used by LLDB for any declaration that you intend to use in later
> expressions is to prefix the name with a dollar sign.  So you can do the
> following:
> >
> > (lldb) expr -l swift -- let $i = 10
> > (lldb) expr -l swift -- let $a = i
> >
> > … and both “$a” and “$i" will be available in subsequent expressions.
> >
> > Kate Stone k8st...@apple.com
> >  Xcode Low Level Tools
> >
> >> On Wed, Oct 5, 2016 at 10:06 AM, Rex Fenley  wrote:
> >> Jim,
> >>
> >> That doesn't seem to work for us. We're using lldb packaged with Xcode
> 8 fyi.
> >> (lldb) expr --top-level -- NSString *string = [NSString
> stringWithUTF8String: "This is a string"];
> >>
> >>
> >>
> >> ; Function Attrs: nounwind
> >>
> >> define internal void @_GLOBAL__sub_I__null_() #0 section
> "__TEXT,__StaticInit,regular,pure_instructions" {
> >>
> >>   call void @__cxx_global_var_init()
> >>
> >>   ret void
> >>
> >> }
> >>
> >>
> >> On Tue, Oct 4, 2016 at 4:09 PM, Jim Ingham  wrote:
> 

Re: [lldb-dev] --top-level doesn't work in lldb for Objective-C or Swift :(

2016-10-05 Thread Rex Fenley via lldb-dev
Hey!

I tried building the LLDB target from within Xcode in order to gain
understanding of how this system works at the source level. However, I get
the following error during compilation:

subprocess.CalledProcessError: Command '['python',
'/Users/Rex/Documents/projects/swift-lldb/llvm/tools/swift/utils/build-script',
'--preset=LLDB_Swift_ReleaseAssert',
'swift_install_destdir=/Users/Rex/Documents/projects/swift-lldb/llvm-build/ReleaseAssert/swift-macosx-x86_64']'
returned non-zero exit status 1

And much further up I see

warning: A compatible version of re2c (>= 0.11.3) was not found; changes to
src/*.in.cc will not affect your build.

and

error: unknown setting: cmark-cmake-options

How may I fix this/these issues to build and run lldb from Xcode?

On Wed, Oct 5, 2016 at 12:05 PM, Rex Fenley  wrote:

> That's totally fine for our use case.
>
> On Wed, Oct 5, 2016 at 11:57 AM, Jim Ingham  wrote:
>
>> You would have to be really careful about using "debugger variables"
>> whose name is not decorated with a "$".  After all, this is introducing a
>> global variable, which will be shadowed by local variables, ivars, file
>> statics for the current frame's CU, etc.  So using the code you've added at
>> various stop points in the debugging session will be fragile.  That's the
>> primary reason that we don't encourage defining debugger variables in the
>> common identifier namespace of your program.
>>
>> Jim
>>
>>
>>
>> > On Oct 5, 2016, at 11:41 AM, Rex Fenley  wrote:
>> >
>> > Hey Kate! Thanks for all this info, it's really helpful :)
>> >
>> > We'd like to have more complex expressions being used from the
>> debugger. Some of this would be code written in separate files. It will be
>> difficult or at least very tedious to have all our code use "$", is there a
>> way to void using "$"? Is there an option we could add to lldb to avoid
>> using "$" and still have variables and data-structures globally accessible?
>> I notice that within "repl" "$" it's not necessary to use any "$"
>> variables, is there a way to elevate the logic "repl" uses into expr?
>> >
>> > On Wed, Oct 5, 2016 at 11:29 AM, Kate Stone  wrote:
>> >> On Oct 5, 2016, at 10:14 AM, Rex Fenley via lldb-dev <
>> lldb-dev@lists.llvm.org> wrote:
>> >>
>> >> Maybe I have that incorrectly, this does seem to work when using lldb
>> from Xcode's console. This doesn't work when typing `lldb` into the
>> terminal and using it from there. I assumed the two were the same.
>> >
>> > The same underlying debugger is used in both cases.  There can be
>> subtle reasons for differences in behavior in the different contexts, but I
>> don’t see how they’d apply here.  Let’s get to a specific scenario and
>> ensure that we can resolve that for you.
>> >
>> >> On a separate note, --top-level doesn't seem to work for swift (from
>> Xcode console lldb). We need it to work with swift for the scripts we'll be
>> writing.
>> >> (lldb) expr -l swift --top-level -- let i = 10
>> >>
>> >> expr -l swift --top-level -- let a = i
>> >>
>> >> error: :3:9: error: use of unresolved identifier 'i'
>> >>
>> > The --top-level option isn’t meaningful for Swift, so it’s completely
>> ignored.  The less ambiguous nature of the language allows us to
>> automatically determine what are top-level constructs and what’s intended
>> to be evaluated in scope.  We introduced --top-level for Objective-C / C++
>> primarily to enable declaring functions and anything else that literally
>> cannot be written in a local scope.
>> >
>> > In your particular example the reason you can’t refer to “i” is
>> completely unrelated.  Conceptually, every expression you evaluate is
>> wrapped in its own scope.  So your two subsequent expressions act like this
>> construct :
>> >
>> > do {
>> > let i = 10
>> > }
>> > do {
>> > let a = i
>> > }
>> >
>> > As you can see, “i” is defined in this expression scope and then goes
>> out of scope immediately after execution.  This is useful when you want to
>> write a multi-line expression that introduces declarations for immediate
>> use without having them cluttering up your namespace afterwards.  The
>> convention used by LLDB for any declaration that you intend to use in later
>> expr

[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


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

2016-10-07 Thread Rex Fenley via lldb-dev
Hi Kate,

I'm trying to connect to the running instance of lldb in Xcode to send
commands to it from a different process :)

On Fri, Oct 7, 2016 at 10:27 AM, Kate Stone  wrote:

> The RPC mechanism used in Xcode 8 is not a part of the open source LLDB
> project and should be treated as an implementation detail of Xcode.  What
> are you trying to accomplish?
>
> Kate Stone k8st...@apple.com
>  Xcode Low Level Tools
>
> On Oct 6, 2016, at 6:11 PM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
>
> 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 <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |
>  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
> <https://www.facebook.com/remindhq>
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
>


-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


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

2016-10-07 Thread Rex Fenley via lldb-dev
I'm trying to build a separate debugging tool that can be used in unison
with Xcode it will provide buttons that are shortcuts to lldb scripts we
write.

On Fri, Oct 7, 2016 at 10:45 AM, Enrico Granata  wrote:

> I am gonna echo Kate's question, but delve one level deeper
>
> Why do you want to send commands to LLDB from a different process?
>
> We have a bunch of different extension points in LLDB, so it's possible
> that what you're trying to do is actually already possible
>
> On Oct 7, 2016, at 10:41 AM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
>
> Hi Kate,
>
> I'm trying to connect to the running instance of lldb in Xcode to send
> commands to it from a different process :)
>
> On Fri, Oct 7, 2016 at 10:27 AM, Kate Stone  wrote:
>
>> The RPC mechanism used in Xcode 8 is not a part of the open source LLDB
>> project and should be treated as an implementation detail of Xcode.  What
>> are you trying to accomplish?
>>
>> Kate Stone k8st...@apple.com
>>  Xcode Low Level Tools
>>
>> On Oct 6, 2016, at 6:11 PM, Rex Fenley via lldb-dev <
>> lldb-dev@lists.llvm.org> wrote:
>>
>> 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 <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
>>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
>> <https://www.facebook.com/remindhq>
>> ___
>> lldb-dev mailing list
>> lldb-dev@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>>
>>
>
>
> --
> Rex Fenley  |  IOS DEVELOPER
>
> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |
>  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
> <https://www.facebook.com/remindhq>
> ___
> lldb-dev mailing list
> lldb-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>
>
>
> Thanks,
> *- Enrico*
> 📩 egranata@.com ☎️ 27683
>
>


-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


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

2016-10-07 Thread Rex Fenley via lldb-dev
We expect to have a rich user experience as this tool progresses, using
Python to generate UI will limit our development process. It would be much
simpler if we could communicate with Xcode's lldb directly from our
application.

On Fri, Oct 7, 2016 at 11:33 AM, Enrico Granata  wrote:

> I can see a couple of avenues for your use case:
>
> - you can write custom LLDB commands (obligatory reference:
> http://lldb.llvm.org/python-reference.html) and have your users type
> these via the console instead of by clicking buttons
> - you could write a Python script that pops up extra UI and have your
> buttons run as part of LLDB that way. I have admittedly never tried to do
> this, and it might require some tinkering, but in theory I believe it
> should be possible
>
> Personally, I'd rather much have console commands I can type instead of a
> magic separate UI that might even be hidden underneath other windows or
> hiding useful information unless I drag it out of the way, but then it's
> annoying to reach for when I need it, ..., but that's me...
>
> On Oct 7, 2016, at 11:27 AM, Rex Fenley  wrote:
>
> I'm trying to build a separate debugging tool that can be used in unison
> with Xcode it will provide buttons that are shortcuts to lldb scripts we
> write.
>
> On Fri, Oct 7, 2016 at 10:45 AM, Enrico Granata  w
> rote:
>
>> I am gonna echo Kate's question, but delve one level deeper
>>
>> Why do you want to send commands to LLDB from a different process?
>>
>> We have a bunch of different extension points in LLDB, so it's possible
>> that what you're trying to do is actually already possible
>>
>> On Oct 7, 2016, at 10:41 AM, Rex Fenley via lldb-dev <
>> lldb-dev@lists.llvm.org> wrote:
>>
>> Hi Kate,
>>
>> I'm trying to connect to the running instance of lldb in Xcode to send
>> commands to it from a different process :)
>>
>> On Fri, Oct 7, 2016 at 10:27 AM, Kate Stone  wrote:
>>
>>> The RPC mechanism used in Xcode 8 is not a part of the open source LLDB
>>> project and should be treated as an implementation detail of Xcode.  What
>>> are you trying to accomplish?
>>>
>>> Kate Stone k8st...@apple.com
>>>  Xcode Low Level Tools
>>>
>>> On Oct 6, 2016, at 6:11 PM, Rex Fenley via lldb-dev <
>>> lldb-dev@lists.llvm.org> wrote:
>>>
>>> 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 <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
>>>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
>>> <https://www.facebook.com/remindhq>
>>> ___
>>> lldb-dev mailing list
>>> lldb-dev@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>>
>>>
>>>
>>
>>
>> --
>> Rex Fenley  |  IOS DEVELOPER
>>
>> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
>>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
>> <https://www.facebook.com/remindhq>
>> ___
>> lldb-dev mailing list
>> lldb-dev@lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>
>>
>>
>> Thanks,
>> *- Enrico*
>> 📩 egranata@.com ☎️ 27683
>>
>>
>
>
> --
> Rex Fenley  |  IOS DEVELOPER
>
> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |
>  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
> <https://www.facebook.com/remindhq>
>
>
>
> Thanks,
> *- Enrico*
> 📩 egranata@.com ☎️ 27683
>
>


-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


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

2016-10-07 Thread Rex Fenley via lldb-dev
https://media4.giphy.com/media/l2Je27KfKp8x71qAo/200.gif

On Fri, Oct 7, 2016 at 12:01 PM, Enrico Granata  wrote:

> It is my understanding that this is not possible in the current
> architecture
>
> On Oct 7, 2016, at 11:55 AM, Rex Fenley  wrote:
>
> We expect to have a rich user experience as this tool progresses, using
> Python to generate UI will limit our development process. It would be much
> simpler if we could communicate with Xcode's lldb directly from our
> application.
>
> On Fri, Oct 7, 2016 at 11:33 AM, Enrico Granata  w
> rote:
>
>> I can see a couple of avenues for your use case:
>>
>> - you can write custom LLDB commands (obligatory reference:
>> http://lldb.llvm.org/python-reference.html) and have your users type
>> these via the console instead of by clicking buttons
>> - you could write a Python script that pops up extra UI and have your
>> buttons run as part of LLDB that way. I have admittedly never tried to do
>> this, and it might require some tinkering, but in theory I believe it
>> should be possible
>>
>> Personally, I'd rather much have console commands I can type instead of a
>> magic separate UI that might even be hidden underneath other windows or
>> hiding useful information unless I drag it out of the way, but then it's
>> annoying to reach for when I need it, ..., but that's me...
>>
>> On Oct 7, 2016, at 11:27 AM, Rex Fenley  wrote:
>>
>> I'm trying to build a separate debugging tool that can be used in unison
>> with Xcode it will provide buttons that are shortcuts to lldb scripts we
>> write.
>>
>> On Fri, Oct 7, 2016 at 10:45 AM, Enrico Granata  w
>> rote:
>>
>>> I am gonna echo Kate's question, but delve one level deeper
>>>
>>> Why do you want to send commands to LLDB from a different process?
>>>
>>> We have a bunch of different extension points in LLDB, so it's possible
>>> that what you're trying to do is actually already possible
>>>
>>> On Oct 7, 2016, at 10:41 AM, Rex Fenley via lldb-dev <
>>> lldb-dev@lists.llvm.org> wrote:
>>>
>>> Hi Kate,
>>>
>>> I'm trying to connect to the running instance of lldb in Xcode to send
>>> commands to it from a different process :)
>>>
>>> On Fri, Oct 7, 2016 at 10:27 AM, Kate Stone  wrote:
>>>
>>>> The RPC mechanism used in Xcode 8 is not a part of the open source LLDB
>>>> project and should be treated as an implementation detail of Xcode.  What
>>>> are you trying to accomplish?
>>>>
>>>> Kate Stone k8st...@apple.com
>>>>  Xcode Low Level Tools
>>>>
>>>> On Oct 6, 2016, at 6:11 PM, Rex Fenley via lldb-dev <
>>>> lldb-dev@lists.llvm.org> wrote:
>>>>
>>>> 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 <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
>>>>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
>>>> <https://www.facebook.com/remindhq>
>>>> ___
>>>> lldb-dev mailing list
>>>> lldb-dev@lists.llvm.org
>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Rex Fenley  |  IOS DEVELOPER
>>>
>>> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
>>>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
>>> <https://www.facebook.com/remindhq>
>>> ___
>>> lldb-dev mailing list
>>> lldb-dev@lists.llvm.org
>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev
>>>
>>>
>>>
>>> Thanks,
>>> *- Enrico*
>>> 📩 egranata@.com ☎️ 27683
>>>
>>>
>>
>>
>> --
>> Rex Fenley  |  IOS DEVELOPER
>>
>> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
>>  |  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
>> <https://www.facebook.com/remindhq>
>>
>>
>>
>> Thanks,
>> *- Enrico*
>> 📩 egranata@.com ☎️ 27683
>>
>>
>
>
> --
> Rex Fenley  |  IOS DEVELOPER
>
> Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>  |
>  FOLLOW US <https://twitter.com/remindhq>  |  LIKE US
> <https://www.facebook.com/remindhq>
>
>
>
> Thanks,
> *- Enrico*
> 📩 egranata@.com ☎️ 27683
>
>


-- 

Rex Fenley  |  IOS DEVELOPER

Remind.com <https://www.remind.com/> |  BLOG <http://blog.remind.com/>
 |  FOLLOW
US <https://twitter.com/remindhq>  |  LIKE US
<https://www.facebook.com/remindhq>
___
lldb-dev mailing list
lldb-dev@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev


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

2016-10-07 Thread Rex Fenley via lldb-dev
Ok, thanks for all the info, it's really helpful. We may instead pursue
running lldb from the toolchain downloaded from the swift website within
our process for the time being and skip having it work in unison with
Xcode. We've been having trouble setting that up too however but it's
already being discussed in a different email thread :)

On Fri, Oct 7, 2016 at 12:29 PM, Jim Ingham  wrote:

> Enrico is right.  At present, each connection to the lldb-rpc-server gets
> its own SBDebugger, so you wouldn't be able to talk to the debugger that
> Xcode is using for its process.
>
> Even if that was changed, then you'd run into other problems, for
> instance, at present only one Listener can wait for process events from the
> debugger, so you would not be able to control execution or coordinate with
> Xcode's running of the process.  But this is probably just the tip of the
> iceberg of things that would go wrong if you try to do this.
>
> If you have lots of resources to devote to hacking on lldb itself, I'm
> sure you could make this work, but this is a very tricky part of lldb, so
> the engineering work would be non-trivial to say the least.  I don't know
> your circumstances, but I doubt it would end up being worthwhile for you.
>
> Enrico's suggestion of making Python commands to do the job is probably
> the best way to go.
>
> Note, it used to be tricky to get a plain command tool (lldb-rpc-server)
> to connect to the Window Server and put up UI.  I haven't tried that since
> I worked on Tcl/Tk way back in the day, so it may be easier now.  But you
> should probably also experiment with that to make sure that's possible
> before you go too far down this route.
>
> Jim
>
>
> > On Oct 7, 2016, at 12:05 PM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >
> > https://media4.giphy.com/media/l2Je27KfKp8x71qAo/200.gif
> >
> > On Fri, Oct 7, 2016 at 12:01 PM, Enrico Granata 
> wrote:
> > It is my understanding that this is not possible in the current
> architecture
> >
> >> On Oct 7, 2016, at 11:55 AM, Rex Fenley  wrote:
> >>
> >> We expect to have a rich user experience as this tool progresses, using
> Python to generate UI will limit our development process. It would be much
> simpler if we could communicate with Xcode's lldb directly from our
> application.
> >>
> >> On Fri, Oct 7, 2016 at 11:33 AM, Enrico Granata 
> wrote:
> >> I can see a couple of avenues for your use case:
> >>
> >> - you can write custom LLDB commands (obligatory reference:
> http://lldb.llvm.org/python-reference.html) and have your users type
> these via the console instead of by clicking buttons
> >> - you could write a Python script that pops up extra UI and have your
> buttons run as part of LLDB that way. I have admittedly never tried to do
> this, and it might require some tinkering, but in theory I believe it
> should be possible
> >>
> >> Personally, I'd rather much have console commands I can type instead of
> a magic separate UI that might even be hidden underneath other windows or
> hiding useful information unless I drag it out of the way, but then it's
> annoying to reach for when I need it, ..., but that's me...
> >>
> >>> On Oct 7, 2016, at 11:27 AM, Rex Fenley  wrote:
> >>>
> >>> I'm trying to build a separate debugging tool that can be used in
> unison with Xcode it will provide buttons that are shortcuts to lldb
> scripts we write.
> >>>
> >>> On Fri, Oct 7, 2016 at 10:45 AM, Enrico Granata 
> wrote:
> >>> I am gonna echo Kate's question, but delve one level deeper
> >>>
> >>> Why do you want to send commands to LLDB from a different process?
> >>>
> >>> We have a bunch of different extension points in LLDB, so it's
> possible that what you're trying to do is actually already possible
> >>>
> >>>> On Oct 7, 2016, at 10:41 AM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >>>>
> >>>> Hi Kate,
> >>>>
> >>>> I'm trying to connect to the running instance of lldb in Xcode to
> send commands to it from a different process :)
> >>>>
> >>>> On Fri, Oct 7, 2016 at 10:27 AM, Kate Stone 
> wrote:
> >>>> The RPC mechanism used in Xcode 8 is not a part of the open source
> LLDB project and should be treated as an implementation detail of Xcode.
> What are you trying to accomplish?
> >>>>
> >>>> Kate Stone k8st...

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

2016-10-07 Thread Rex Fenley via lldb-dev
That actually seems really doable! Thanks for the info, we'll give that a
shot!

On Fri, Oct 7, 2016 at 1:40 PM, Sean Callanan  wrote:

> Once you have Python commands, could you make them into a simple RPC
> service and set up a new socket connection to your program from the LLDB
> side, all implemented in Python?
>
> Sean
>
> > On Oct 7, 2016, at 12:29 PM, Jim Ingham via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >
> > Enrico is right.  At present, each connection to the lldb-rpc-server
> gets its own SBDebugger, so you wouldn't be able to talk to the debugger
> that Xcode is using for its process.
> >
> > Even if that was changed, then you'd run into other problems, for
> instance, at present only one Listener can wait for process events from the
> debugger, so you would not be able to control execution or coordinate with
> Xcode's running of the process.  But this is probably just the tip of the
> iceberg of things that would go wrong if you try to do this.
> >
> > If you have lots of resources to devote to hacking on lldb itself, I'm
> sure you could make this work, but this is a very tricky part of lldb, so
> the engineering work would be non-trivial to say the least.  I don't know
> your circumstances, but I doubt it would end up being worthwhile for you.
> >
> > Enrico's suggestion of making Python commands to do the job is probably
> the best way to go.
> >
> > Note, it used to be tricky to get a plain command tool (lldb-rpc-server)
> to connect to the Window Server and put up UI.  I haven't tried that since
> I worked on Tcl/Tk way back in the day, so it may be easier now.  But you
> should probably also experiment with that to make sure that's possible
> before you go too far down this route.
> >
> > Jim
> >
> >
> >> On Oct 7, 2016, at 12:05 PM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >>
> >> https://media4.giphy.com/media/l2Je27KfKp8x71qAo/200.gif
> >>
> >> On Fri, Oct 7, 2016 at 12:01 PM, Enrico Granata 
> wrote:
> >> It is my understanding that this is not possible in the current
> architecture
> >>
> >>> On Oct 7, 2016, at 11:55 AM, Rex Fenley  wrote:
> >>>
> >>> We expect to have a rich user experience as this tool progresses,
> using Python to generate UI will limit our development process. It would be
> much simpler if we could communicate with Xcode's lldb directly from our
> application.
> >>>
> >>> On Fri, Oct 7, 2016 at 11:33 AM, Enrico Granata 
> wrote:
> >>> I can see a couple of avenues for your use case:
> >>>
> >>> - you can write custom LLDB commands (obligatory reference:
> http://lldb.llvm.org/python-reference.html) and have your users type
> these via the console instead of by clicking buttons
> >>> - you could write a Python script that pops up extra UI and have your
> buttons run as part of LLDB that way. I have admittedly never tried to do
> this, and it might require some tinkering, but in theory I believe it
> should be possible
> >>>
> >>> Personally, I'd rather much have console commands I can type instead
> of a magic separate UI that might even be hidden underneath other windows
> or hiding useful information unless I drag it out of the way, but then it's
> annoying to reach for when I need it, ..., but that's me...
> >>>
> >>>> On Oct 7, 2016, at 11:27 AM, Rex Fenley  wrote:
> >>>>
> >>>> I'm trying to build a separate debugging tool that can be used in
> unison with Xcode it will provide buttons that are shortcuts to lldb
> scripts we write.
> >>>>
> >>>> On Fri, Oct 7, 2016 at 10:45 AM, Enrico Granata 
> wrote:
> >>>> I am gonna echo Kate's question, but delve one level deeper
> >>>>
> >>>> Why do you want to send commands to LLDB from a different process?
> >>>>
> >>>> We have a bunch of different extension points in LLDB, so it's
> possible that what you're trying to do is actually already possible
> >>>>
> >>>>> On Oct 7, 2016, at 10:41 AM, Rex Fenley via lldb-dev <
> lldb-dev@lists.llvm.org> wrote:
> >>>>>
> >>>>> Hi Kate,
> >>>>>
> >>>>> I'm trying to connect to the running instance of lldb in Xcode to
> send commands to it from a different process :)
> >>>>>
> >>>>> On Fri, Oct 7, 2016 at 10:27 AM, Kate Stone 
> wrote:
&g