9

I'm currently playing around with GDB and want to debug a native processor in Android, specifically /system/bin/lmkd.

But I'm having trouble on how to stop GDB once that processor is invoked.

This is what I've tried so far:

Android-side:

./gdbserver tcp:5039 /system/bin/lmkd

Client-side:

gdb

target remote localhost:5039

From here, I typed in info shared, so I could get the base address of the native processor, set the breakpoint, continue, invoke the processor, then it would stop.

But info shared only shows address for shared object files.

Any recommendation on how to set breakpoint on the processor that I don't know the address to?

ks1322
  • 33,961
  • 14
  • 109
  • 164
Carol Ward
  • 699
  • 4
  • 17
  • 1
    By "processor" do you mean "process"? A process is a running program; a processor is the thing that runs the program (i.e. CPU). – interfect Sep 28 '18 at 23:02

1 Answers1

0

You should be able to find where the executable itself is mapped in the process's address space with info proc mappings in gdb. If you know the relative offset where you need a breakpoint, you can probably add it to something in there to get the final virtual address to break at.

But it sounds like you might be barking up the wrong tree with respect to getting breakpoints in this process; can't you set breakpoints by symbol name? Can you rebuild the binary with debugging symbols?

interfect
  • 2,665
  • 1
  • 20
  • 35