Помещение некоторых строк в сценарии для выполнения их в gdb

Я хочу создать сценарий или на самом деле ярлык на перемещение в мире

#!/bin/bash
konsole -e firefox --debug
(gdb) handle SIGPIPE noprint nostop pass
(gdb) handle SIGSEGV noprint nostop pass
(gdb) run

это не работает. я надеюсь, что кто-то поможет мне. после решения я могу рассказать Вам историю. возможно, что я помогу большому количеству людей с этим.

до сих пор я могу сделать это:

создание сценария удара с

#!/bin/bash
konsole -e firefox --debug

маркировка его как исполняемый файл. дважды щелкните по концам с открытием в терминале, ожидающем меня, чтобы ввести выполненный и войти

создание ~/.gdbinit со следующим содержанием

handle SIGPIPE noprint nostop pass
handle SIGSEGV noprint nostop pass
3
задан 8 November 2015 в 04:38

2 ответа

Можно использовать Здесь Документы bash (<<) для передачи интерактивных команд gdb:

#!/bin/bash
firefox --debug  <<'EOF'
handle SIGPIPE noprint nostop pass
handle SIGSEGV noprint nostop pass
run
EOF 

Проверка Here Documents раздел man bash для получения большей идеи.

Пример:

$ cat scr.sh 
#!/bin/bash
firefox --debug <<'EOF'
help
quit
EOF

$ bash scr.sh 
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/firefox/firefox...(no debugging symbols found)...done.
(gdb) (gdb) (gdb) (gdb) (gdb) (gdb) (gdb) List of classes of commands:

aliases -- Aliases of other commands
breakpoints -- Making program stop at certain points
data -- Examining data
files -- Specifying and examining files
internals -- Maintenance commands
obscure -- Obscure features
running -- Running the program
stack -- Examining the stack
status -- Status inquiries
support -- Support facilities
tracepoints -- Tracing of program execution without stopping the program
user-defined -- User-defined commands

Type "help" followed by a class name for a list of commands in that class.
Type "help all" for the list of all commands.
Type "help" followed by command name for full documentation.
Type "apropos word" to search for commands related to "word".
Command name abbreviations are allowed if unambiguous.
(gdb) 

$  ##Back to prompt
3
ответ дан 1 December 2019 в 16:26

хорошо это работает. теперь я знаю, как создать новую строку здесь. это - сдвиг +, входят. только для режима редактирования. возможно, 4 пробелов работают.... всего 600 символов wtf?

this is the code:
#!/bin/bash
firefox --debug <<'EOF'
handle SIGPIPE noprint nostop pass
handle SIGSEGV noprint nostop pass
run
EOF

никакая потребность "консоли-e"...... затем просто не дважды щелкает по сценарию, затем gdbinit может быть удален

спасибо heemayl., Вы спасли жизнь многих, многие расстроенные пользователи Linux, кто катастрофический отказ Firefox, слишком чертовски высоки! я сожалею о добавлении текста выше, но консоль-e не необходима, который был моим отказ. мне теперь действительно любопытно, что означает EOF.

0
ответ дан 1 December 2019 в 16:26

Другие вопросы по тегам:

Похожие вопросы: