How knows the gdb debugger the assembly code in ROM without ROM elf file

HeikoAverbeck
Posts: 3
Joined: Mon Jun 29, 2020 11:43 am

How knows the gdb debugger the assembly code in ROM without ROM elf file

Postby HeikoAverbeck » Mon Jun 29, 2020 12:31 pm

I am debugging the ESP with the OpenOCD like described in the documentation. One part of my source code is a call to the function gpio_pad_select_gpio. As far as I know this function resides in the ROM. I have checked as well the esp32_rom.elf and there the function is inside. But for debugging with the gdb I did not publish this elf file for the gdb. I have just configured the elf file of my build. But during debugging I see all instructions of the function gpio_pad_select_gpio in the disassembly. Thus first I was wondering how gdb knows that. But then it come to my mind, that gdb does not need the elf file for doing that. Because it just reads the memory, the ROM in this case, and it knows the instruction set, so it can show the Disassembly. I guess my assumption is correct, right?

Furthermore, why is the source code of the ROM functions not published, because of company secrets?
And I can't even find the gpio_pad_select_gpio inside the API documentation.

Thanks in advance!

ESP_Sprite
Posts: 3621
Joined: Thu Nov 26, 2015 4:08 am

Re: How knows the gdb debugger the assembly code in ROM without ROM elf file

Postby ESP_Sprite » Mon Jun 29, 2020 12:52 pm

Yes, gdb reads the memory directly.

HeikoAverbeck
Posts: 3
Joined: Mon Jun 29, 2020 11:43 am

Re: How knows the gdb debugger the assembly code in ROM without ROM elf file

Postby HeikoAverbeck » Mon Jun 29, 2020 4:02 pm

Thanks for the fast reply. What's about the other questions? Any answers?
Thanks in advance.

ESP_Sprite
Posts: 3621
Joined: Thu Nov 26, 2015 4:08 am

Re: How knows the gdb debugger the assembly code in ROM without ROM elf file

Postby ESP_Sprite » Tue Jun 30, 2020 7:21 am

I think the ROM sources aren't published because we cannot publish large parts of it (the BT stack) and no one expressed enough interest in the remaining bits to make any effort to sort those out and put them up.

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot], jgustavoam and 26 guests