zoukankan      html  css  js  c++  java
  • 使用VS2015远程GDB调试

    官方介绍这个插件的博客:(https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/

       

    1.首先下载vs2015 with update3

    2.然后下载Visual C++ for Linux Development, "VC_Linux.exe"

    https://visualstudiogallery.msdn.microsoft.com/725025cf-7067-45c2-8d01-1e0fd359ae6e

    3.ubuntu主机上下载安装gdbserversudo apt-get install openssh-server g++ gdb gdbserveryumredhat系的,等同于ubuntuapt-get,一般自动开启了)

    4.,3步也可以使用网页https://pkgs.org/centos-6/centos-x86_64/gdb-gdbserver-7.2-90.el6.x86_64.rpm/download/

    下载二进制文件,下载地址:http://mirror.centos.org/centos/6/os/x86_64/Packages/gdb-gdbserver-7.2-90.el6.x86_64.rpm

    然后执行rpm i gdb-gdbserver-7.2-90.el6.x86_64.rpm,使用如下代码安装

    sudo apt-get install rpm (rpm是主流的软件安装管理方式,见鸟哥P685)

    rpm –i gdb-gdbserver-7.2-90.el6.x86_64.rpm

    5.vs2015

    新建->项目->empty project(linux)

    然后新建一个cpp文件(注意文件名为英文)

    6.工具->选项->cross platform->connection manager

    add

    填写centosip,用户名,密码

    7.在项目名上右键,调出属性窗口,在target machine上选择你的目标主机

    8.填写调试参数

    9.写个代码来试试,记得要注意x86x64的调试选项,我的就选x86

       

       

    10.直接在ubuntu中生成.out可执行文件。文件的位置可以在属性-配置中的Remote setting中看到。

       

    11.以上是我在虚拟机中生成的.out文件,用以上步骤在我腾讯云上的ubuntu14上运行时,出现错误。可以把.out文件上传到ubuntu服务器上执行,会出现permission denied,不能执行,使用chmod更改后,可执行。

       

    12.另外,我配了两个ubuntu主机,一个我的虚拟机,一个是我在腾讯云申请的学生一元主机。云主机在后,我发现使用云主机时会出现找不到源文件地址的错误,大概设置Source Directories地址为 /projects/ConsoleApplication1/ 就可以了。

       

       

    更多如何在Visual Studio上用C/C++linux程序,关注这个知乎话题 https://www.zhihu.com/question/26388094

  • 相关阅读:
    Linux DNS配置
    SqlCommandBuilder 为SqlDataAdapter 提供 update、insert、delete 命令(自己利用select命令自动从数据库元数据推断)
    Dev中GridView——事件
    select 动态赋值 layui重新渲染
    url-loader和file-loader的区别和使用
    Fetch API
    Fetch API
    FormData上传文件
    Buffer、ArrayBuffer互转
    if exists用法(判断对象的用法)
  • 原文地址:https://www.cnblogs.com/Yan47/p/5986301.html
Copyright © 2011-2022 走看看