OpenBMC Source-Level Debugging
Bills, Jason M
jason.m.bills at linux.intel.com
Sat Jan 18 09:04:49 AEDT 2020
On 1/17/2020 1:54 PM, James Feist wrote:
> On 1/14/20 5:02 AM, John Chung wrote:
>> Hi All,
>>
>> I am doing a personal study on OpenBMC recently. And I am wondering
>> that how to do source-level debugging via gdb, especially in vscode
>> (Not sure it is possible or not).
>
> This is how I get gdb running, there may be (probably are) better ways:
>
> 1. Add IMAGE_INSTALL_append += "gdb" to the end of your local.conf to
> get gdb in the image.
> 2. devtool modify 'package' to modify package
> 3. scp
> build/workspace/sources/<package-name>/oe-workdir/packages-split/<package-name>-dbg/usr/bin/.debug/<application-name>
> onto image to get symbols.
> 4. gdb pacakge
> 5. symbol-file <file you just scpd>
>
> Not sure about vscode usage.
>
> -James
I had some minimal success getting remote GDB working. Here are the
notes that I kept:
1. Add 'IMAGE_INSTALL_append += " gdbserver"' to /local/local.conf
2. Build 'gdb-cross-arm' recipe without python
a. If libreadline.so.7 error, 'export LD_LIBRARY_PATH=<path to
libreadline.so.7>'
3. On Target, run 'gdbserver localhost:9999 <app to debug>'
4. On Host, run 'arm-openbmc-linux-gnueabi-gdb <app to debug with symbols>
a. Then run 'target remote <ip>:9999'
b. Then run 'continue' to start app on target
https://www.linux.com/news/remote-cross-target-debugging-gdb-and-gdbserver
https://stackoverflow.com/questions/21928876/gdb-can-not-load-source-file
I believe for step 2, I modified the PACKAGECONFIG to disable python.
Sorry that the notes are a little rough, and it's been a while since I
tried this, so ymmv.
-Jason
>
>>
>> If anyone has any experience or documentation, please kindly let me know.
>>
>> Very appreciated for the help.
>>
>> Thanks,
>> John
>>
>>
More information about the openbmc
mailing list