English 中文(简体)
从指挥线第2部分发射 em
原标题:launching emacs-gdb from the command line part 2
  • 时间:2011-07-05 23:03:30
  •  标签:
  • emacs
  • gdb
  • zsh

I want to launch emacs with gdb running. I d like to have all of the command line arguments fed in at the same time. This post: Start emacs-gdb from command line?, already solves 95% of the problem, but I have an annoying nagging follow-on to the problem. I really need to be able to pass in arguments that have spaces, something ala

edbg path/to/myprog --firstarg "something with spaces" --secondarg 1

我在现场和洞.地进行了搜捕,我走了几小时,但我看不到这一点。

任何想法?

最佳回答

因此,根据我的理解,你确定了这一巴什功能:

edbg() { emacs --eval "(gdb "gdb --annotate=3 $*")";}

and it doesn t work because any spaces in the arguments get reparsed into new word boundaries. Well, this is a common enough problem in Bash scripts that there s a special variable $@ that expands the arguments to the function differently when it s inside a double-quoted string. This gets us half-way there. The rest is just putting the quotes back around them:

edbg() {
  arglist="";
  for a in "$@"; do
    if [[ $a == ${a/ /} ]]; then
      arglist="$arglist $a";
    else
      arglist="$arglist \"$a\"";
    fi
  done;
  emacs --eval "(gdb "gdb --annotate $arglist")"
}

值得注意的是,这张旗号是围绕含有纸面或新线的增量而引出的;贵方证券交易所可能各不相同。

问题回答

暂无回答




相关问题
tell gdb to disassemble "unknown" code

is it possible to configure gdb in order to debug assembly code when there are no debug symbols or no sources available ? I mean showing assembly instruction by assembly instruction when performing a ...

C++ Netbeans debugging issues

I installed netbeans6.7.1 ide for c/c++ also i have mingw/msys cygwin installed and i have given C:Msysin as environment variable path.It has gdb7 version.However wheni run dbugging thru netbeans ...

setting strings in gdb

c++: int main() { string a = "a"; ... ... } when i debug in gdb: (gdb) set var a = "ok" Invalid cast I run the program and pause at a break point after string a has been ...

How to debug programms written in fasm under linux using gdb?

I wrote simple "hello, world" in fasm, and its works, but how i can generate debug info for gdb and edb (Evan s Debugger)? Fasm compiler could only produce debugging symbols in its specific format - "...

How can I display Unicode strings while debugging on linux?

I have been working for some years now as C++ Developer using MS Visual Studio as working platform. Since I privately prefer to use linux, I recently took the chance to move my working environment to ...

Continue to debug after failed assertion on Linux?

When an assertion fails with Visual C++ on Windows, the debugger stops, displays the message, and then lets you continue (or, if no debugging session is running, offers to launch visual studio for you)...

热门标签