gdb.txt: Refine
Based on issues discovered by Zaid
This commit is contained in:
+31
-2
@@ -1,3 +1,6 @@
|
|||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Build.
|
||||||
|
|
||||||
Make sure you've built with debug info:
|
Make sure you've built with debug info:
|
||||||
|
|
||||||
cd ~/openairinterface5g # or wherever
|
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
|
./build_oai --UE --eNB --verbose-compile --run-with-gdb RelWithDebInfo
|
||||||
make -C ran_build/build -j4 lte-softmodem lte-uesoftmodem
|
make -C ran_build/build -j4 lte-softmodem lte-uesoftmodem
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Verify.
|
||||||
|
|
||||||
Verify the build was done correctly:
|
Verify the build was done correctly:
|
||||||
|
|
||||||
$ ./gdb-helper
|
$ ./gdb-helper
|
||||||
@@ -46,9 +52,32 @@ the build as above.
|
|||||||
|
|
||||||
(gdb) b main
|
(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
|
cd ~/openairinterface5g # or wherever
|
||||||
code . targets/RT/USER/lte-softmodem.c .vscode/launch.json
|
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
|
cd "$(dirname "$0")/.." || exit
|
||||||
source oaienv
|
source oaienv
|
||||||
cd cmake_targets || exit
|
cd cmake_targets || exit
|
||||||
exec sudo -E gdb "$@"
|
exec sudo -nE gdb "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user