Recent

Author Topic: How to do android lamw debugging  (Read 11570 times)

gary

  • New Member
  • *
  • Posts: 37
How to do android lamw debugging
« on: December 31, 2024, 06:58:00 am »
This is how I installed it and it also works fine on the emulator
https://forum.lazarus.freepascal.org/index.php/topic,69691.0.html

But I set it up according to the following documentation, which I didn't understand too well
https://github.com/jmpessoa/lazandroidmodulewizard/blob/master/docs/LAMW_DebugApkFromIDE.txt

But I don't have the GNU remote debugger (gdbserver) LAMW here, but I can ADD
IDE options/debugger Select debugger type: 'GNU remote debugger (gdbserver) LAMW'

I set a breakpoint in the code, but nothing happens.

I set a breakpoint in the code, nothing happens, the program is still running normally in the emulator, and it doesn't stop at this place.


Is there something I'm missing, or is there something I'm not configuring correctly, can someone please tell me the details of the process, thanks!

Seenkao

  • Hero Member
  • *****
  • Posts: 718
    • New ZenGL.
Re: How to do android lamw debugging
« Reply #1 on: December 31, 2024, 07:36:23 am »
Как я понимаю, вам в параметрах проекта надо включить отладку.

Google translate:
As I understand it, you need to enable debugging in the project settings.
Quote
7) Project/Project Option/Compile options/Debugging:
       -> generate Dedug information,
       -> type automatic,
       -> Disp line numbers,
       -> use external gdb symb
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

gary

  • New Member
  • *
  • Posts: 37
Re: How to do android lamw debugging
« Reply #2 on: December 31, 2024, 04:41:54 pm »
I've seen this note inside the documentation, but I don't have these inside my debug settings

Seenkao

  • Hero Member
  • *****
  • Posts: 718
    • New ZenGL.
Re: How to do android lamw debugging
« Reply #3 on: December 31, 2024, 07:11:17 pm »
Как вы открыли эту вкладку? Она похожа на нужную и не похожа одновременно.

Google translate:
How did you open this tab? It looks like the one you need and it doesn't at the same time.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

gary

  • New Member
  • *
  • Posts: 37
Re: How to do android lamw debugging
« Reply #4 on: January 02, 2025, 11:53:56 am »
Как вы открыли эту вкладку? Она похожа на нужную и не похожа одновременно.

Google translate:
How did you open this tab? It looks like the one you need and it doesn't at the same time.

Click on the IDE toolbar and voila!

Seenkao

  • Hero Member
  • *****
  • Posts: 718
    • New ZenGL.
Re: How to do android lamw debugging
« Reply #5 on: January 02, 2025, 01:14:09 pm »
"Type of debug info" =
Quote
automatic
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

gary

  • New Member
  • *
  • Posts: 37
Re: How to do android lamw debugging
« Reply #6 on: January 03, 2025, 07:03:40 pm »
"Type of debug info" =
Quote
automatic

It still doesn't work, it still can't be debugged, is it ok for you to operate like this?


Seenkao

  • Hero Member
  • *****
  • Posts: 718
    • New ZenGL.
Re: How to do android lamw debugging
« Reply #7 on: January 03, 2025, 11:01:35 pm »
Я установил LAMW на своей системе Debian 12. И вот что я вижу:

Вы можете попробовать такие шаги:
Tools -> Options -> Debugger -> Debugger backend

закладка: "Add"

Debugger type and path

выбрать: "GNU remote debugger (gdbserver) LAMW"

далее: "Apply" и "Ok"

Проверьте работает ли. И будьте внимательны, я не вижу собранной библиотеки отладки для x86-64, потому возможно для 64-х битных приложений x86 отладка работать не будет. В этом случае делайте эмулятор для x86.

P.S. Не учёл: после выбора типа отладчика, нужно указать путь до gdb (он лежит в папке NDK). У меня примерно выглядит так:
".../ndk/25.1.8937393/prebuilt/linux-x86_64/bin/ndk-gdb"

P.P.S. В настройках проекта, в "Compiler Options"
"Target CPU family (-P)" - здесь для эмулятора или для вашего устройства вы должны выбрать нужную архитектуру! Например для 32-х битной x86 надо выбрать "i386".

------------------------------------------------------------------------------
Google translate:
I installed LAMW on my Debian 12 system. And this is what I see:

You can try these steps:
Tools -> Options -> Debugger -> Debugger backend

tab: "Add"

Debugger type and path

select: "GNU remote debugger (gdbserver) LAMW"

then: "Apply" and "Ok"

Check if it works. And be careful, I don’t see a built-in debugging library for x86-64, so it’s possible that debugging won’t work for 64-bit x86 applications. In this case, make an emulator for x86.

P.S. I didn't take into account: after selecting the debugger type, you need to specify the path to gdb (it is in the NDK folder). Mine looks something like this:
".../ndk/25.1.8937393/prebuilt/linux-x86_64/bin/ndk-gdb"

P.P.S. In the project settings, in "Compiler Options"
"Target CPU family (-P)" - here for the emulator or for your device you must select the desired architecture! For example, for 32-bit x86 you must select "i386".
« Last Edit: January 03, 2025, 11:56:09 pm by Seenkao »
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

gary

  • New Member
  • *
  • Posts: 37
Re: How to do android lamw debugging
« Reply #8 on: January 04, 2025, 05:25:19 am »
I did what was asked of me and it still doesn't work, don't know what I'm missing


gary

  • New Member
  • *
  • Posts: 37
Re: How to do android lamw debugging
« Reply #9 on: January 04, 2025, 06:01:46 am »

Seenkao

  • Hero Member
  • *****
  • Posts: 718
    • New ZenGL.
Re: How to do android lamw debugging
« Reply #10 on: January 04, 2025, 07:42:47 am »
Если вы запустили программу, то результат должен быть на эмуляторе или телефоне. Для работы приложения должна быть выбрана конечная архитектура телефона или эмулятора.

Так же APK-файл должен находится в папке проекта. Путь до него и его имя указан у вас в настройках проекта (но не факт что там же находится APK файл).
Попробуйте его найти там где указан вывод файла или в папке "obj". Но честно говоря, я не знаю куда сделан вывод APK, потому его вам придётся найти самому.

--------------------------------
Google translate:
If you run the program, the result should be on the emulator or phone. The final architecture of the phone or emulator must be selected for the application to work.

The APK file must also be in the project folder. The path to it and its name are specified in your project settings (but it is not a fact that the APK file is located there).
Try to find it where the file output is specified or in the "obj" folder. But honestly, I don't know where the APK output is made, so you will have to find it yourself.
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

gary

  • New Member
  • *
  • Posts: 37
Re: How to do android lamw debugging
« Reply #11 on: January 04, 2025, 02:32:07 pm »
I use an emulator and my APP can appear on the emulator and run fine. My emulator is x86_64 and the CPU architecture is correct.

I can compile and run it normally, but it just won't F9

Seenkao

  • Hero Member
  • *****
  • Posts: 718
    • New ZenGL.
Re: How to do android lamw debugging
« Reply #12 on: January 04, 2025, 05:29:50 pm »
Cпросите у jmpessoa. Он разрабатывал (разрабатывает) данный модуль, и у меня нет ни времени ни желания "ковыряться" с LAMW. С учётом того, что сборка LAMW-проектов под Android для Linux - сломана. И я не могу на многие вопросы вообще ответить, потому что не могу даже собрать проект.

А для запуска проекта, нажмите пункт "Run", там будет пункт "[LAMW] Build Android Apk and Run".

----------------------------------
Google translate:
Ask jmpessoa. He developed (is developing) this module, and I have neither the time nor the desire to "poke around" with LAMW. Considering that the assembly of LAMW projects for Android on Linux is broken. And I can't answer many questions at all, because I can't even build the project.

And to run the project, click "Run", there will be an item "[LAMW] Build Android Apk and Run".
Rus: Стремлюсь к созданию минимальных и достаточно быстрых приложений.

Eng: I strive to create applications that are minimal and reasonably fast.
Working on ZenGL

gary

  • New Member
  • *
  • Posts: 37
Re: How to do android lamw debugging
« Reply #13 on: January 05, 2025, 03:54:29 am »
Only jmpessoa has seen this post and may answer it, but I thank you for your help as well.

 

TinyPortal © 2005-2018