[lldb-dev] MI command for connecting remote target

Vadim Macagon via lldb-dev lldb-dev at lists.llvm.org
Thu Sep 22 22:15:28 PDT 2016


You need to specify the executable to debug before attempting to connect 
to the remote machine:

> lldb-mi --interpreter

-file-exec-and-symbols local/path/to/executable
-target-select remote host:port

Note that the file-exec-and-symbols command has some non-standard 
extensions in LLDB-MI that are documented in 
<https://github.com/llvm-mirror/lldb/blob/release_38/tools/lldb-mi/MIExtensions.txt>

On 23/09/2016 7:07 AM, Chunseok Lee via lldb-dev wrote:
> However, when I try the same thing with lldb-mi, I cannot connect to 
> remote target as follows:
>
> ------- host log --------
> twoflower at js1-desktop ~/local-hello> lldb-mi-3.8.1
> (gdb)
> -target-select remote 10.113.62.251:1234 <http://10.113.62.251:1234>
> ^error,msg="Command 'target-select'. Current SBTarget is invalid"
> (gdb)
>
> ------  remote log ------
> twoflower at twoflower ~/remote-hello> lldb-server-3.8 p --listen "*:1234"
>
> The remote side seems not to receive any msg at all.
> I am not sure that it is proper use for -target-select command.
>
> BR,
> Chunseok Lee



On 23/09/2016 7:07 AM, Chunseok Lee via lldb-dev wrote:
> Is there any MI command for connecting remote target ?
>
> Using platform and target command with lldb, It works fine as follows:
>
> -----host log----------
> twoflower at js1-desktop ~/local-hello> ls
> a.out*  hello.cpp
> twoflower at js1-desktop ~/local-hello> lldb-3.8.1
> (lldb) platform select remote-linux
>   Platform: remote-linux
>  Connected: no
> (lldb) platform connect connect://10.113.62.251:1234 
> <http://10.113.62.251:1234>
>   Platform: remote-linux
>     Triple: x86_64-*-linux-gnu
> OS Version: 3.19.0 (3.19.0-32-generic)
>     Kernel: #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015
>   Hostname: twoflower
>  Connected: yes
> WorkingDir: /home/twoflower/remote-hello
> (lldb) target create -r /home/twoflower/remote-hello/a.out a.out
> Current executable set to 'a.out' (x86_64).
> (lldb) b main
> Breakpoint 1: where = a.out`main, address = 0x000000000040052d
> (lldb) r
> Process 14524 launched: 
> '/home/twoflower/.lldb/module_cache/remote-linux/.cache/BB42308F-4677-5DC0-AFC2-097CDFE91A83-3612C4F8/a.out' 
> (x86_64)
> Process 14524 stopped
> * thread #1: tid = 14524, 0x000000000040052d a.out`main, name = 
> 'a.out', stop reason = breakpoint 1.1
>     frame #0: 0x000000000040052d a.out`main
> a.out`main:
> ->  0x40052d <+0>: pushq  %rbp
>     0x40052e <+1>: movq   %rsp, %rbp
>     0x400531 <+4>: movl   $0x4005d4, %edi           ; imm = 0x4005D4
>     0x400536 <+9>: movl   $0x0, %eax
> (lldb) c
> Process 14524 resuming
> Process 14524 exited with status = 0 (0x00000000)
> (lldb) q
> twoflower at js1-desktop ~/local-hello>
>
> ------remote log -------
> twoflower at twoflower ~/remote-hello> ls
> a.out*  hello.cpp
> twoflower at twoflower ~/remote-hello> lldb-server-3.8 p --listen "*:1234"
> Connection established.
> error: lost connection
> lldb-server exiting...
>
> --------------------------------------
>
> However, when I try the same thing with lldb-mi, I cannot connect to 
> remote target as follows:
>
> ------- host log --------
> twoflower at js1-desktop ~/local-hello> lldb-mi-3.8.1
> (gdb)
> -target-select remote 10.113.62.251:1234 <http://10.113.62.251:1234>
> ^error,msg="Command 'target-select'. Current SBTarget is invalid"
> (gdb)
>
> ------  remote log ------
> twoflower at twoflower ~/remote-hello> lldb-server-3.8 p --listen "*:1234"
>
> The remote side seems not to receive any msg at all.
> I am not sure that it is proper use for -target-select command.
>
> BR,
> Chunseok Lee
>
> -- 
> Where Do We come from? What Are We? Where Are We Going?
>
>
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list