Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I compiled one helloworld.c using ndk, pushed it to my android, and launched it using lldb remote, following lldb's offcial manual https://lldb.llvm.org/use/remote.html.

in adb

./lldb-server platform --listen "*:8888" --server

in host shell

lldb 
platform select remote-android
platform connect connect://localhost:8888
file helloworld
source list

I get output

   4    int main() {
   5      printf("Hello, world
");
   6      return 0;
   7    }

then I launch process in lldb

b main
r

But I get

Process xxxx stopped
* thread #1, name = 'helloworld', stop reason = breakpoint 1.1
    frame #0: 0x000000xxxx
error: memory read failed for 0x0000xxxx
Target 1: (helloworld) stopped.

and using bt I get similar output, both without source line symbol, although I indeed specify -g option to clang, and source list can display source content at first.

If I specify -m32 to tell clang generate an executable for 32-bit, and launch again, I can get correct result. But my lldb-server executable is 64-bit, since file lldb-server output:

lldb-server: ELF executable, 64-bit LSB arm64, static

Does anyone know why 64-bit ldb-server cannot run 64-bit helloworld executable?

And I found in vscode if using codelldb extension to launch 64-bit helloworld, I can get source symbol. What's the difference? Thanks

question from:https://stackoverflow.com/questions/65540889/lldb-remote-debugging-cannot-find-symbol-after-running-once

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
385 views
Welcome To Ask or Share your Answers For Others

1 Answer

Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...