如何在不重新启动的情况下修改gdbserver --multi的环境变量和工作目录? [英] How to modify the environment variables and working directory of gdbserver --multi without restarting it?

查看:229
本文介绍了如何在不重新启动的情况下修改gdbserver --multi的环境变量和工作目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行一个程序从 environ 本地打印环境时:

   

我可以使用以下方式更改运行环境变量:

 运行
set environment asdf = qwer
运行

有没有办法用 gdbserver --multi



我正在运行它:

  gdbserver --multi:1234 ./myprintenv 

然后在本地:

  arm-linux-gnueabihf-gdb -ex'target extended-remote remotehost:1234'./myprintenv 

然后命令:

  set environment asdf = qwer 
run



没有任何效果。



我可以用以下方式更改变量:

  asdf = qwer gdbserver --multi:1234 ./myprintenv 

但这很烦人因为它需要 mon出口,去登上,重新运行,去主持人,重新跳舞。



工作目录也是如此,您可以更改在本地使用 cd >,但显然不在服务器上。



另一种方法是启动 gdbserver ,每次都没有 - multi ,就像Eclipse一样,但是它的缺点是很难请参阅标准输出:如何通过a到达STDIN / STDOUT gdbserver session

解决方案

这个功能在gdb中不存在。它正在开发,但: https://sourceware.org/ml/gdb -patches / 2017-08 / msg00000.html


When I run a program that prints the environment from environ locally with:

./gdb myprintenv

I can change environment variables across runs with:

run
set environment asdf=qwer
run

Is there any way to do that with gdbserver --multi?

I'm running it as:

gdbserver --multi :1234 ./myprintenv

and then locally:

arm-linux-gnueabihf-gdb -ex 'target extended-remote remotehost:1234' ./myprintenv

then the command:

set environment asdf=qwer
run

has no effect.

I can change the variables with:

asdf=qwer gdbserver --multi :1234 ./myprintenv

but that is annoying as it requires the mon exit, go to board, rerun, go to host, reconnect dance.

The same goes for working directory, which you can change with cd locally, but not on the server apparently.

One alternative would be to launch gdbserver with SSH every time without --multi, just like Eclipse does, but that has the downside that it is harder to see stdout: How can I reach STDIN/STDOUT through a gdbserver session

解决方案

This feature doesn't exist in gdb yet. It's being developed though: https://sourceware.org/ml/gdb-patches/2017-08/msg00000.html

这篇关于如何在不重新启动的情况下修改gdbserver --multi的环境变量和工作目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆