Commit f9898d97 authored by Michael Cook's avatar Michael Cook

gdb.txt: Refine

Based on issues discovered by Zaid
parent b10cc9eb
-------------------------------------------------------------------------------
Build.
Make sure you've built with debug info:
cd ~/openairinterface5g # or wherever
......@@ -6,6 +9,9 @@ Make sure you've built with debug info:
./build_oai --UE --eNB --verbose-compile --run-with-gdb RelWithDebInfo
make -C ran_build/build -j4 lte-softmodem lte-uesoftmodem
-------------------------------------------------------------------------------
Verify.
Verify the build was done correctly:
$ ./gdb-helper
......@@ -46,9 +52,32 @@ the build as above.
(gdb) b main
Using Vscode
-------------------------------------------------------------------------------
Password-less sudo.
Vscode launches lte-softmodem via sudo. Make sure sudo does not prompt you
for a password:
sudo -n id
If that command fails, do the following:
echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee -a /etc/sudoers
Then verify:
sudo -n id
-------------------------------------------------------------------------------
Vscode.
Launch Vscode:
cd ~/openairinterface5g # or wherever
code . targets/RT/USER/lte-softmodem.c .vscode/launch.json
See launch.json for details about how lte-softmodem is launched.
See launch.json for details about how vscode launches lte-softmodem for debugging.
For example, in lte-softmodem.c, scroll to main() and click the line number to
the left of main to add a breakpoint. then do Run => Start debugging (F5) to
run lte-softmodem in the debugger
......@@ -3,4 +3,4 @@
cd "$(dirname "$0")/.." || exit
source oaienv
cd cmake_targets || exit
exec sudo -E gdb "$@"
exec sudo -nE gdb "$@"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment