Skip to content

Instantly share code, notes, and snippets.

@mrlnc
Created November 4, 2021 10:11
Show Gist options
  • Save mrlnc/50bac8003deddac65ef935b41b974e63 to your computer and use it in GitHub Desktop.
Save mrlnc/50bac8003deddac65ef935b41b974e63 to your computer and use it in GitHub Desktop.
srsRAN Debug vscode
  • srsRAN requires to run with sudo for accessing USRP software radios.
  • vscode runs as unprivileged user.
  • attaching a debugger (running unprivileged) to srsRAN (privileged) won't work.

See here: microsoft/vscode-remote-release#2053 (comment)

Create a file /usr/share/polkit-1/actions/com.ubuntu.pkexec.gdb.policy and add:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>

  <action id="com.ubuntu.pkexec.gdb-settings">
    <icon_name>gdb-settings</icon_name>
    <defaults>
      <allow_any>yes</allow_any>
      <allow_inactive>yes</allow_inactive>
      <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/gdb</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
  </action>

</policyconfig>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment