2

I'm trying to run a memory error detector (like Valgrind's Memcheck or Drmemory) on the ADB software. However, I'm having trouble figuring it how to build/compile the source code. I'm using linux (ubuntu).

https://github.com/aosp-mirror/platform_system_core/tree/master/adb

Do I need a makefile? Or is there something wrong with my understanding on how to go about doing this? Maybe there's a way that I can use Memcheck/Dr. Memory on the actual program when it's run in Android Studio? I don't believe there are any instructions, or a makefile in the source code.

I've tried compiling the main.cpp file in the client folder with g++, but it says it doesn't have access to the sysdep.h file.

Compiled using: $ cd client $ g++ -std=c++11 main.cpp -o main

Error message: fatal error: sysdep.h: No such file or directory

bbqsasuke
  • 21
  • 1
  • 3

1 Answers1

3

Take a look at this documentation for the AOSP ADB tool: https://source.android.com/setup/build/adb#building_adb_build-adb

From my understanding you need to download the AOSP source code then run the following commands:

source ~/aosp/build/envsetup.sh
cd ~/aosp/system/core/adb
mm  # <- That's not a typo

This command should take a while (especially on the first run) but you should get a compiled adb executable in the ~/aosp/out folder somewhere (I can't verify on this computer as it doesn't have enough ram to complete a build...)

Also to show the help menu, type:

hmm
HyperionX
  • 1,332
  • 2
  • 17
  • 31