Re: [lldb-dev] did anyone konw LLDB support lldb + openocd to run dotest.py in bare board like ARM or other non-x86 architecture?

2017-10-31 Thread Greg Clayton via lldb-dev
If you are launching your lldb-server and it is already debugging a program you 
don't use "process launch", you use "process attach" if you are connected to 
your platform. 

It isn't recommended to use "remote-gdb-server" platform directly. 
"remote-linux" uses "remote-gdb-server" underneath it, but it also overrides a 
bunch of other platform functions that you need in order to debug correctly. So 
use "remote-linux".



> On Oct 28, 2017, at 3:15 AM, Tatyana Krasnukha via lldb-dev 
>  wrote:
> 
> I guess 2 ways of remote debugging:
> “remote-linux” platform with process attach instead of process launch
> “remote-gdb-server” platform with process launch.
> As I understood, both of them use lldb-server.
>  
> To execute tests remotely you may run dotest.py with according options 
> (platform-name and platfrom-url).
>  
> As for openocd and other gdb servers, there is no way to use them for remote 
> testing. I haven’t found, at least.
>  
> Thanks,
> Tatyana
>  
> From: cuibixiong [mailto:cuibixi...@gmail.com] 
> Sent: Saturday, 28 October, 2017 12:40 PM
> To: Tatyana Krasnukha 
> Cc: lldb-dev@lists.llvm.org
> Subject: Re: [lldb-dev] did anyone konw LLDB support lldb + openocd to run 
> dotest.py in bare board like ARM or other non-x86 architecture?
>  
> Hi 
>  
>   You mean should use “platform select remote-linux” ? I use it 
> but also report error: unable to launch a GDB server on 'debian-armhf.""'
>  
>   in-addition, you said gdb-server is “GNU GDB server” or just 
> lldb-server services ?
>  
> Best Regards
> —cuibixiong
>  
> 发件人: Tatyana Krasnukha  >
> 日期: 2017年10月27日 星期五 21:53
> 至: cuibixiong mailto:cuibixi...@gmail.com>>
> 抄送: "lldb-dev@lists.llvm.org " 
> mailto:lldb-dev@lists.llvm.org>>
> 主题: RE: [lldb-dev] did anyone konw LLDB support lldb + openocd to run 
> dotest.py in bare board like ARM or other non-x86 architecture?
>  
> It seems that ‘process launch’ tries to launch gdb-server that is already 
> started manually, try to attach instead.
>  
> I also met ‘remote-gdb-server’ platform, maybe it fits your goal better? 
> Didn’t you try to do something like this?
> dotest.py --platform-name=remote-gdb-server 
> --platfrom-url=connect://hostname:port --arch=architecture ...
>  
> From: lldb-dev [mailto:lldb-dev-boun...@lists.llvm.org 
> ] On Behalf Of cui bixiong via 
> lldb-dev
> Sent: Friday, 27 October, 2017 9:41 AM
> To: Greg Clayton mailto:clayb...@gmail.com>>
> Cc: lldb-dev mailto:lldb-dev@lists.llvm.org>>
> Subject: Re: [lldb-dev] did anyone konw LLDB support lldb + openocd to run 
> dotest.py in bare board like ARM or other non-x86 architecture?
>  
> Hi :
>  
> I build a armhf qemu enviroment to test ARM lldb + lldb-server testsuite. 
>  source code base on LLVM + LLDB + LLD + CLANG formal release 5.0.0.
>  
> Target: lldb-server platform --listen *: --server
>  
> Host :  
>  
> (lldb) platform select remote-linux
> Platform: remote-linux
> Connected: no
> (lldb) platform connect connect://0.0.0.0: 
> 
> Platform: remote-linux
> Triple: arm-*-linux-gnueabihf
> OS Version: 3.2.0 (3.2.0-4-vexpress)
> Kernel: #1 SMP Debian 3.2.51-1
> Hostname: debian-armhf.""
> Connected: yes
> WorkingDir: /root
> (lldb) file ./hello.exe
> Current executable set to './hello.exe' (arm).
> (lldb) log enable gdb-remote packets
> (lldb) process launch
> history[1] tid=0x6192 <   1> send packet: +
> history[2] tid=0x6192 <  19> send packet: $QStartNoAckMode#b0
> history[3] tid=0x6192 <   1> read packet: +
> history[4] tid=0x6192 <   6> read packet: $OK#9a
> history[5] tid=0x6192 <   1> send packet: +
> history[6] tid=0x6192 <  13> send packet: $qHostInfo#9b
> history[7] tid=0x6192 < 297> read packet:  
> $triple:61726d2d2d6c696e75782d676e75656162696866;ptrsize:4;distribution_id:64656269616e;watchpoint_exceptions_received:before;endian:little;os_version:3.2.0;os_build:332e322e302d342d7665787072657373;os_kernel:233120534d502044656269616e20332e322e35312d31;hostname:64656269616e2d61726d68662e;#1a
> history[8] tid=0x6192 <  18> send packet: $qGetWorkingDir#91
> history[9] tid=0x6192 <  14> read packet: $2f726f6f74#a4
> history[10] tid=0x6192 <  19> send packet: $qQueryGDBServer#cb
> history[11] tid=0x6192 <   7> read packet: $E04#a9
> history[12] tid=0x6192 <  73> send packet: 
> $qModuleInfo:2e2f68656c6c6f2e657865;61726d2d2d6c696e75782d656162696866#b7
> history[13] tid=0x6192 <   7> read packet: $E03#a8
> history[14] tid=0x6192 <  69> send packet: 
> $qModuleInfo:6c6962632e736f2e36;61726d2d2

Re: [lldb-dev] did anyone konw LLDB support lldb + openocd to run dotest.py in bare board like ARM or other non-x86 architecture?

2017-10-31 Thread cuibixiong via lldb-dev
Hi 
I don’t launch lldb-server which already debugging a program, just use 
"lldb-server platform —listen *: —server” on Qemu armhf for Debian 6.0

Best Regards
—cuibixiong

发件人:  Greg Clayton 
日期:  2017年10月31日 星期二 23:15
至:  Tatyana Krasnukha 
抄送:  cuibixiong , "lldb-dev@lists.llvm.org" 

主题:  Re: [lldb-dev] did anyone konw LLDB support lldb + openocd to run 
dotest.py in bare board like ARM or other non-x86 architecture?

If you are launching your lldb-server and it is already debugging a program you 
don't use "process launch", you use "process attach" if you are connected to 
your platform. 

It isn't recommended to use "remote-gdb-server" platform directly. 
"remote-linux" uses "remote-gdb-server" underneath it, but it also overrides a 
bunch of other platform functions that you need in order to debug correctly. So 
use "remote-linux".



On Oct 28, 2017, at 3:15 AM, Tatyana Krasnukha via lldb-dev 
 wrote:

I guess 2 ways of remote debugging:
“remote-linux” platform with process attach instead of process launch
“remote-gdb-server” platform with process launch.
As I understood, both of them use lldb-server.
 
To execute tests remotely you may run dotest.py with according options 
(platform-name and platfrom-url).
 
As for openocd and other gdb servers, there is no way to use them for remote 
testing. I haven’t found, at least.
 
Thanks,
Tatyana
 
From: cuibixiong [mailto:cuibixi...@gmail.com] 
Sent: Saturday, 28 October, 2017 12:40 PM
To: Tatyana Krasnukha 
Cc: lldb-dev@lists.llvm.org
Subject: Re: [lldb-dev] did anyone konw LLDB support lldb + openocd to run 
dotest.py in bare board like ARM or other non-x86 architecture?
 
Hi 
 
  You mean should use “platform select remote-linux” ? I use it but 
also report error: unable to launch a GDB server on 'debian-armhf.""'
 
  in-addition, you said gdb-server is “GNU GDB server” or just 
lldb-server services ?
 
Best Regards
—cuibixiong
 
发件人: Tatyana Krasnukha 
日期: 2017年10月27日 星期五 21:53
至: cuibixiong 
抄送: "lldb-dev@lists.llvm.org" 
主题: RE: [lldb-dev] did anyone konw LLDB support lldb + openocd to run dotest.py 
in bare board like ARM or other non-x86 architecture?
 
It seems that ‘process launch’ tries to launch gdb-server that is already 
started manually, try to attach instead.
 
I also met ‘remote-gdb-server’ platform, maybe it fits your goal better? Didn’t 
you try to do something like this?
dotest.py --platform-name=remote-gdb-server 
--platfrom-url=connect://hostname:port --arch=architecture ...
 
From: lldb-dev [mailto:lldb-dev-boun...@lists.llvm.org] On Behalf Of cui 
bixiong via lldb-dev
Sent: Friday, 27 October, 2017 9:41 AM
To: Greg Clayton 
Cc: lldb-dev 
Subject: Re: [lldb-dev] did anyone konw LLDB support lldb + openocd to run 
dotest.py in bare board like ARM or other non-x86 architecture?
 
Hi :
 
I build a armhf qemu enviroment to test ARM lldb + lldb-server testsuite.  
source code base on LLVM + LLDB + LLD + CLANG formal release 5.0.0.
 
Target: lldb-server platform --listen *: --server
 
Host :  
 
(lldb) platform select remote-linux
Platform: remote-linux
Connected: no
(lldb) platform connect connect://0.0.0.0:
Platform: remote-linux
Triple: arm-*-linux-gnueabihf
OS Version: 3.2.0 (3.2.0-4-vexpress)
Kernel: #1 SMP Debian 3.2.51-1
Hostname: debian-armhf.""
Connected: yes
WorkingDir: /root
(lldb) file ./hello.exe
Current executable set to './hello.exe' (arm).
(lldb) log enable gdb-remote packets
(lldb) process launch
history[1] tid=0x6192 <   1> send packet: +
history[2] tid=0x6192 <  19> send packet: $QStartNoAckMode#b0
history[3] tid=0x6192 <   1> read packet: +
history[4] tid=0x6192 <   6> read packet: $OK#9a
history[5] tid=0x6192 <   1> send packet: +
history[6] tid=0x6192 <  13> send packet: $qHostInfo#9b
history[7] tid=0x6192 < 297> read packet:  
$triple:61726d2d2d6c696e75782d676e75656162696866;ptrsize:4;distribution_id:64656269616e;watchpoint_exceptions_received:before;endian:little;os_version:3.2.0;os_build:332e322e302d342d7665787072657373;os_kernel:233120534d502044656269616e20332e322e35312d31;hostname:64656269616e2d61726d68662e;#1a
history[8] tid=0x6192 <  18> send packet: $qGetWorkingDir#91
history[9] tid=0x6192 <  14> read packet: $2f726f6f74#a4
history[10] tid=0x6192 <  19> send packet: $qQueryGDBServer#cb
history[11] tid=0x6192 <   7> read packet: $E04#a9
history[12] tid=0x6192 <  73> send packet: 
$qModuleInfo:2e2f68656c6c6f2e657865;61726d2d2d6c696e75782d656162696866#b7
history[13] tid=0x6192 <   7> read packet: $E03#a8
history[14] tid=0x6192 <  69> send packet: 
$qModuleInfo:6c6962632e736f2e36;61726d2d2d6c696e75782d656162696866#7b
history[15] tid=0x6192 <   7> read packet: $E03#a8
<  36> send packet: $qLaunchGDBServer;host:mtkslt202;#b1
error: unable to launch a GDB server on 'debian-armhf.""'
 
 i show host and port is uncorrect, is it a bu