gpt4 book ai didi

c - 如何调试以 C 语言开发的作为 Wi-Fi 接入点运行的进程?

转载 作者:太空狗 更新时间:2023-10-29 12:29:54 24 4
gpt4 key购买 nike

我有两个用 C 语言开发的进程。第一个在 Linux 机器上作为 WiFi 接入点运行,第二个在以太网网络中的另一台 Linux 机器上作为 Controller 运行。后者可以向 AP 发送配置命令。我的问题是在运行这两个进程时以及当我从 Controller 向 AP 发送命令时,如何调试 AP 进程?

最佳答案

GNU 调试器(远程服务器)
GDB 是一种源代码级调试器,支持 C 和其他编程语言,能够在任何特定行中断程序、显示变量值并确定错误发生的位置。

要在所有当前支持的 Ubuntu 版本(即 your operating system)中安装 GNU 调试器和 GNU 调试器(远程服务器),请打开终端并键入:

sudo apt install gdb gdbserver  

用法

  1. gdbserver is launched on the target system, with the arguments:

    • Either a device name (to use a serial line) or a TCP hostname and portnumber, and
    • The path and filename of the executable to be debugged
      It then waits passively for the host gdb to communicate with it.
  2. gdb is run on the host (controller), with the arguments:

    • The path and filename of the executable (and any sources) on the host, and
    • A device name (for a serial line) or the IP address and port number needed for connection to the target system.

来源: Wikipedia

关于c - 如何调试以 C 语言开发的作为 Wi-Fi 接入点运行的进程?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30618104/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com