質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
GDB

GDBはGNUソフトウェアシステムのための標準的なデバッガーです。

Q&A

解決済

1回答

3363閲覧

gdbで"The program is not being run."と出力される

Prometheus

総合スコア10

GDB

GDBはGNUソフトウェアシステムのための標準的なデバッガーです。

0グッド

0クリップ

投稿2020/05/23 10:16

前提・実現したいこと

gdbでブレークポイントをセットした後、その地点までプログラムを実行しようとすると、”The program is not being run.”と出力されてしまいます。
どうすればこのエラーを回避出来るでしょうか?

発生している問題・エラーメッセージ

Terminal

1[kai@localhost Downloads]$ gdb rev200 2GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 3Copyright (C) 2018 Free Software Foundation, Inc. 4License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 5This is free software: you are free to change and redistribute it. 6There is NO WARRANTY, to the extent permitted by law. 7Type "show copying" and "show warranty" for details. 8This GDB was configured as "x86_64-redhat-linux-gnu". 9Type "show configuration" for configuration details. 10For bug reporting instructions, please see: 11<http://www.gnu.org/software/gdb/bugs/>. 12Find the GDB manual and other documentation resources online at: 13 <http://www.gnu.org/software/gdb/documentation/>. 14 15For help, type "help". 16Type "apropos word" to search for commands related to "word"... 17Reading symbols from rev200...(no debugging symbols found)...done. 18(gdb) disas main 19Dump of assembler code for function main: 20 0x080483ed <+0>: push %ebp 21 0x080483ee <+1>: mov %esp,%ebp 22 0x080483f0 <+3>: push %edi 23 0x080483f1 <+4>: push %ebx 24 0x080483f2 <+5>: add $0xffffff80,%esp 25 0x080483f5 <+8>: movl $0x7a,-0x78(%ebp) 26 0x080483fc <+15>: movl $0x69,-0x74(%ebp) 27 0x08048403 <+22>: movl $0x78,-0x70(%ebp) 28 0x0804840a <+29>: movl $0x6e,-0x6c(%ebp) 29 0x08048411 <+36>: movl $0x62,-0x68(%ebp) 30 0x08048418 <+43>: movl $0x6f,-0x64(%ebp) 31 0x0804841f <+50>: movl $0x7c,-0x60(%ebp) 32 0x08048426 <+57>: movl $0x6b,-0x5c(%ebp) 33 0x0804842d <+64>: movl $0x77,-0x58(%ebp) 34 0x08048434 <+71>: movl $0x78,-0x54(%ebp) 35 0x0804843b <+78>: movl $0x74,-0x50(%ebp) 36 0x08048442 <+85>: movl $0x38,-0x4c(%ebp) 37 0x08048449 <+92>: movl $0x38,-0x48(%ebp) 38 0x08048450 <+99>: movl $0x64,-0x44(%ebp) 39 0x08048457 <+106>: movl $0x19,-0x7c(%ebp) 40 0x0804845e <+113>: lea -0x40(%ebp),%ebx 41 0x08048461 <+116>: mov $0x0,%eax 42--Type <RET> for more, q to quit, c to continue without paging--c 43 0x08048466 <+121>: mov $0xe,%edx 44 0x0804846b <+126>: mov %ebx,%edi 45 0x0804846d <+128>: mov %edx,%ecx 46 0x0804846f <+130>: rep stos %eax,%es:(%edi) 47 0x08048471 <+132>: movl $0x0,-0x80(%ebp) 48 0x08048478 <+139>: jmp 0x8048491 <main+164> 49 0x0804847a <+141>: mov -0x80(%ebp),%eax 50 0x0804847d <+144>: mov -0x78(%ebp,%eax,4),%eax 51 0x08048481 <+148>: xor -0x7c(%ebp),%eax 52 0x08048484 <+151>: mov %eax,%edx 53 0x08048486 <+153>: mov -0x80(%ebp),%eax 54 0x08048489 <+156>: mov %edx,-0x40(%ebp,%eax,4) 55 0x0804848d <+160>: addl $0x1,-0x80(%ebp) 56 0x08048491 <+164>: cmpl $0xd,-0x80(%ebp) 57 0x08048495 <+168>: jle 0x804847a <main+141> 58 0x08048497 <+170>: mov $0x0,%eax 59 0x0804849c <+175>: sub $0xffffff80,%esp 60 0x0804849f <+178>: pop %ebx 61 0x080484a0 <+179>: pop %edi 62 0x080484a1 <+180>: pop %ebp 63 0x080484a2 <+181>: ret 64End of assembler dump. 65(gdb) b * 0x0804845e 66Breakpoint 1 at 0x804845e 67(gdb) c 68The program is not being run. 69

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

run(短縮形r)を実行してください。
runしていないため、continue(短縮形c)できません。

Man page of gdb


(gdb) run

Starting program: /tmp/rev200
/bin/bash: /tmp/rev200: No such file or directory
During startup program exited with code 127.

This GDB was configured as "x86_64-redhat-linux-gnu"とあることから、64bit環境で試されているようですが、32bitバイナリを32bitの共有ライブラリの入っていない64bit環境で動かそうとしていませんか?
$ file rev200
とするとELF 32-bitと表示されませんか?
もしそうなら
$ ldd rev200
で表示される32bit版の共有ライブラリは入っていますか?

投稿2020/05/23 10:28

編集2020/05/24 09:31
SHOMI

総合スコア4079

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Prometheus

2020/05/23 11:06

解答ありがとうございます。 runコマンドを実行したところ、以下のように出力され、プログラムが実行出来ませんでした。 これはどのようなエラーなのでしょうか? [kai@localhost Downloads]$ gdb rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) set disassembly-flavor intel (gdb) run Starting program: /home/kai/Downloads/rev200 /bin/bash: /home/kai/Downloads/rev200: No such file or directory During startup program exited with code 127.
SHOMI

2020/05/23 11:18

Downloadsというディレクトリ名からすると、おそらくダウンロードした実行ファイルのようですが実行可能になっていますか? 実行可能になっていないなら chmod +x rev200 を行ってください
Prometheus

2020/05/24 05:08

実行権限を変更しましたが、出力は変わりませんでした。 [kai@localhost Downloads]$ ls -l rev200 -rwxrwxrwx. 1 kai kai 7297 May 19 17:56 rev200 [kai@localhost Downloads]$ gdb rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) run Starting program: /home/kai/Downloads/rev200 /bin/bash: /home/kai/Downloads/rev200: No such file or directory During startup program exited with code 127.
SHOMI

2020/05/24 07:15 編集

1. $ gdb -nx rev200 2. $ env SHELL=/bin/sh $ gdb rev200 3. $ env SHELL=/bin/sh $ gdb -nx rev200 のどれかで動きませんか?
Prometheus

2020/05/24 07:35

いずれでも出力は変わりませんでした。 1. [kai@localhost Downloads]$ gdb -nx rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) run Starting program: /home/kai/Downloads/rev200 /bin/bash: /home/kai/Downloads/rev200: No such file or directory During startup program exited with code 127. 2. [kai@localhost Downloads]$ env SHELL=/bin/sh LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45: XDG_MENU_PREFIX=gnome- LANG=en_US.UTF-8 GDM_LANG=en_US.UTF-8 HISTCONTROL=ignoredups DISPLAY=:0 HOSTNAME=localhost.localdomain COLORTERM=truecolor USERNAME=kai XDG_VTNR=2 XDG_SESSION_ID=2 USER=kai DESKTOP_SESSION=gnome WAYLAND_DISPLAY=wayland-0 GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/32c1bc63_97b4_4f11_a754_c42e4c67a896 PWD=/home/kai/Downloads HOME=/home/kai XDG_SESSION_TYPE=wayland XDG_DATA_DIRS=/home/kai/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/ XDG_SESSION_DESKTOP=gnome GJS_DEBUG_OUTPUT=stderr MAIL=/var/spool/mail/kai VTE_VERSION=5202 TERM=xterm-256color SHELL=/bin/sh QT_IM_MODULE=ibus XMODIFIERS=@im=ibus XDG_CURRENT_DESKTOP=GNOME GNOME_TERMINAL_SERVICE=:1.78 XDG_SEAT=seat0 SHLVL=2 GDMSESSION=gnome GNOME_DESKTOP_SESSION_ID=this-is-deprecated LOGNAME=kai DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus XDG_RUNTIME_DIR=/run/user/1001 PATH=/home/kai/.local/bin:/home/kai/bin:/home/kai/.local/bin:/home/kai/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin HISTSIZE=1000 GJS_DEBUG_TOPICS=JS ERROR;JS LOG SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/5130,unix/unix:/tmp/.ICE-unix/5130 LESSOPEN=||/usr/bin/lesspipe.sh %s OLDPWD=/home/kai _=/usr/bin/env [kai@localhost Downloads]$ gdb rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) run Starting program: /home/kai/Downloads/rev200 /bin/bash: /home/kai/Downloads/rev200: No such file or directory During startup program exited with code 127. 3. [kai@localhost Downloads]$ env SHELL=/bin/sh LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45: XDG_MENU_PREFIX=gnome- LANG=en_US.UTF-8 GDM_LANG=en_US.UTF-8 HISTCONTROL=ignoredups DISPLAY=:0 HOSTNAME=localhost.localdomain COLORTERM=truecolor USERNAME=kai XDG_VTNR=2 XDG_SESSION_ID=2 USER=kai DESKTOP_SESSION=gnome WAYLAND_DISPLAY=wayland-0 GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/32c1bc63_97b4_4f11_a754_c42e4c67a896 PWD=/home/kai/Downloads HOME=/home/kai XDG_SESSION_TYPE=wayland XDG_DATA_DIRS=/home/kai/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/ XDG_SESSION_DESKTOP=gnome GJS_DEBUG_OUTPUT=stderr MAIL=/var/spool/mail/kai VTE_VERSION=5202 TERM=xterm-256color SHELL=/bin/sh QT_IM_MODULE=ibus XMODIFIERS=@im=ibus XDG_CURRENT_DESKTOP=GNOME GNOME_TERMINAL_SERVICE=:1.78 XDG_SEAT=seat0 SHLVL=2 GDMSESSION=gnome GNOME_DESKTOP_SESSION_ID=this-is-deprecated LOGNAME=kai DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus XDG_RUNTIME_DIR=/run/user/1001 PATH=/home/kai/.local/bin:/home/kai/bin:/home/kai/.local/bin:/home/kai/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin HISTSIZE=1000 GJS_DEBUG_TOPICS=JS ERROR;JS LOG SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/5130,unix/unix:/tmp/.ICE-unix/5130 LESSOPEN=||/usr/bin/lesspipe.sh %s OLDPWD=/home/kai _=/usr/bin/env [kai@localhost Downloads]$ gdb -nx rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) run Starting program: /home/kai/Downloads/rev200 /bin/bash: /home/kai/Downloads/rev200: No such file or directory During startup program exited with code 127.
SHOMI

2020/05/24 08:05

/bin/shにしたはずなのに/bin/bashで実行しようとしてますね… rev200を/tmpにおいて同様にしても駄目でしょうか?
Prometheus

2020/05/24 09:02

rev200をtmpディレクトリに移動して、行いましたが、上手くいきませんでした。 1. [kai@localhost tmp]$ gdb -nx rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) run Starting program: /tmp/rev200 /bin/bash: /tmp/rev200: No such file or directory During startup program exited with code 127. 2. [kai@localhost tmp]$ env SHELL=/bin/sh LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45: XDG_MENU_PREFIX=gnome- LANG=en_US.UTF-8 GDM_LANG=en_US.UTF-8 HISTCONTROL=ignoredups DISPLAY=:0 HOSTNAME=localhost.localdomain COLORTERM=truecolor USERNAME=kai XDG_VTNR=2 SSH_AUTH_SOCK=/run/user/1001/keyring/ssh XDG_SESSION_ID=2 USER=kai DESKTOP_SESSION=gnome WAYLAND_DISPLAY=wayland-0 GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/bf7fae48_d9f1_42d5_9d4a_fce6591ae943 PWD=/tmp HOME=/home/kai XDG_SESSION_TYPE=wayland XDG_DATA_DIRS=/home/kai/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/ XDG_SESSION_DESKTOP=gnome GJS_DEBUG_OUTPUT=stderr MAIL=/var/spool/mail/kai VTE_VERSION=5202 TERM=xterm-256color SHELL=/bin/sh QT_IM_MODULE=ibus XMODIFIERS=@im=ibus XDG_CURRENT_DESKTOP=GNOME GNOME_TERMINAL_SERVICE=:1.82 XDG_SEAT=seat0 SHLVL=2 GDMSESSION=gnome GNOME_DESKTOP_SESSION_ID=this-is-deprecated LOGNAME=kai DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus XDG_RUNTIME_DIR=/run/user/1001 PATH=/home/kai/.local/bin:/home/kai/bin:/home/kai/.local/bin:/home/kai/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin HISTSIZE=1000 GJS_DEBUG_TOPICS=JS ERROR;JS LOG SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/5161,unix/unix:/tmp/.ICE-unix/5161 LESSOPEN=||/usr/bin/lesspipe.sh %s OLDPWD=/ _=/usr/bin/env [kai@localhost tmp]$ gdb rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) run Starting program: /tmp/rev200 /bin/bash: /tmp/rev200: No such file or directory During startup program exited with code 127. 3. [kai@localhost tmp]$ env SHELL=/bin/sh LS_COLORS=rs=0:di=38;5;33:ln=38;5;51:mh=00:pi=40;38;5;11:so=38;5;13:do=38;5;5:bd=48;5;232;38;5;11:cd=48;5;232;38;5;3:or=48;5;232;38;5;9:mi=01;05;37;41:su=48;5;196;38;5;15:sg=48;5;11;38;5;16:ca=48;5;196;38;5;226:tw=48;5;10;38;5;16:ow=48;5;10;38;5;21:st=48;5;21;38;5;15:ex=38;5;40:*.tar=38;5;9:*.tgz=38;5;9:*.arc=38;5;9:*.arj=38;5;9:*.taz=38;5;9:*.lha=38;5;9:*.lz4=38;5;9:*.lzh=38;5;9:*.lzma=38;5;9:*.tlz=38;5;9:*.txz=38;5;9:*.tzo=38;5;9:*.t7z=38;5;9:*.zip=38;5;9:*.z=38;5;9:*.dz=38;5;9:*.gz=38;5;9:*.lrz=38;5;9:*.lz=38;5;9:*.lzo=38;5;9:*.xz=38;5;9:*.zst=38;5;9:*.tzst=38;5;9:*.bz2=38;5;9:*.bz=38;5;9:*.tbz=38;5;9:*.tbz2=38;5;9:*.tz=38;5;9:*.deb=38;5;9:*.rpm=38;5;9:*.jar=38;5;9:*.war=38;5;9:*.ear=38;5;9:*.sar=38;5;9:*.rar=38;5;9:*.alz=38;5;9:*.ace=38;5;9:*.zoo=38;5;9:*.cpio=38;5;9:*.7z=38;5;9:*.rz=38;5;9:*.cab=38;5;9:*.wim=38;5;9:*.swm=38;5;9:*.dwm=38;5;9:*.esd=38;5;9:*.jpg=38;5;13:*.jpeg=38;5;13:*.mjpg=38;5;13:*.mjpeg=38;5;13:*.gif=38;5;13:*.bmp=38;5;13:*.pbm=38;5;13:*.pgm=38;5;13:*.ppm=38;5;13:*.tga=38;5;13:*.xbm=38;5;13:*.xpm=38;5;13:*.tif=38;5;13:*.tiff=38;5;13:*.png=38;5;13:*.svg=38;5;13:*.svgz=38;5;13:*.mng=38;5;13:*.pcx=38;5;13:*.mov=38;5;13:*.mpg=38;5;13:*.mpeg=38;5;13:*.m2v=38;5;13:*.mkv=38;5;13:*.webm=38;5;13:*.ogm=38;5;13:*.mp4=38;5;13:*.m4v=38;5;13:*.mp4v=38;5;13:*.vob=38;5;13:*.qt=38;5;13:*.nuv=38;5;13:*.wmv=38;5;13:*.asf=38;5;13:*.rm=38;5;13:*.rmvb=38;5;13:*.flc=38;5;13:*.avi=38;5;13:*.fli=38;5;13:*.flv=38;5;13:*.gl=38;5;13:*.dl=38;5;13:*.xcf=38;5;13:*.xwd=38;5;13:*.yuv=38;5;13:*.cgm=38;5;13:*.emf=38;5;13:*.ogv=38;5;13:*.ogx=38;5;13:*.aac=38;5;45:*.au=38;5;45:*.flac=38;5;45:*.m4a=38;5;45:*.mid=38;5;45:*.midi=38;5;45:*.mka=38;5;45:*.mp3=38;5;45:*.mpc=38;5;45:*.ogg=38;5;45:*.ra=38;5;45:*.wav=38;5;45:*.oga=38;5;45:*.opus=38;5;45:*.spx=38;5;45:*.xspf=38;5;45: XDG_MENU_PREFIX=gnome- LANG=en_US.UTF-8 GDM_LANG=en_US.UTF-8 HISTCONTROL=ignoredups DISPLAY=:0 HOSTNAME=localhost.localdomain COLORTERM=truecolor USERNAME=kai XDG_VTNR=2 SSH_AUTH_SOCK=/run/user/1001/keyring/ssh XDG_SESSION_ID=2 USER=kai DESKTOP_SESSION=gnome WAYLAND_DISPLAY=wayland-0 GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/bf7fae48_d9f1_42d5_9d4a_fce6591ae943 PWD=/tmp HOME=/home/kai XDG_SESSION_TYPE=wayland XDG_DATA_DIRS=/home/kai/.local/share/flatpak/exports/share/:/var/lib/flatpak/exports/share/:/usr/local/share/:/usr/share/ XDG_SESSION_DESKTOP=gnome GJS_DEBUG_OUTPUT=stderr MAIL=/var/spool/mail/kai VTE_VERSION=5202 TERM=xterm-256color SHELL=/bin/sh QT_IM_MODULE=ibus XMODIFIERS=@im=ibus XDG_CURRENT_DESKTOP=GNOME GNOME_TERMINAL_SERVICE=:1.82 XDG_SEAT=seat0 SHLVL=2 GDMSESSION=gnome GNOME_DESKTOP_SESSION_ID=this-is-deprecated LOGNAME=kai DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus XDG_RUNTIME_DIR=/run/user/1001 PATH=/home/kai/.local/bin:/home/kai/bin:/home/kai/.local/bin:/home/kai/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin HISTSIZE=1000 GJS_DEBUG_TOPICS=JS ERROR;JS LOG SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/5161,unix/unix:/tmp/.ICE-unix/5161 LESSOPEN=||/usr/bin/lesspipe.sh %s OLDPWD=/ _=/usr/bin/env [kai@localhost tmp]$ gdb -nx rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) run Starting program: /tmp/rev200 /bin/bash: /tmp/rev200: No such file or directory During startup program exited with code 127.
SHOMI

2020/05/24 09:23 編集

gdbからではなく、rev200単独では動きますか? 32bitバイナリを32bitの共有ライブラリの入っていない64bit環境で動かそうとしているとか? $ file rev200 とするとELF 32-bitと表示されませんか? もしそうなら $ ldd rev200 で表示される32bit版の共有ライブラリは入っていますか?
SHOMI

2020/05/24 09:32

"The program is not being run."は解決しているので質問を分けたほうがよい気もしますが…
Prometheus

2020/05/24 10:48

32bit用の共有ライブラリをインストールしたところ、以下のように出力が変わりました。 (gdb) run Starting program: /home/kai/Downloads/rev200 Missing separate debuginfos, use: yum debuginfo-install glibc32-2.28-42.1.el8.x86_64 ご指摘の通り、質問内容自体は解決しているため、別の質問として投稿しようと思います。もし宜しければそちらへの解答もお願いします。 ありがとうございました。
SHOMI

2020/05/24 10:56

$ debuginfo-install glibc32-2.28-42.1.el8.x86_64 を実行しても駄目ですか?
Prometheus

2020/05/24 11:07

[root@localhost Downloads]# debuginfo-install glibc32-2.28-42.1.el8.x86_64 CentOS-8 - AppStream 5.4 kB/s | 4.3 kB 00:00 CentOS-8 - Base 6.8 kB/s | 3.9 kB 00:00 CentOS-8 - Extras 2.8 kB/s | 1.5 kB 00:00 Could not find debuginfo for package: glibc32-2.28-42.1.el8.x86_64 Could not find debuginfo for package: glibc32-2.28-42.1.el8.x86_64 No debuginfo packages available to install Dependencies resolved. Nothing to do. Complete! と出力され、gdbでrunコマンドを入力しても、結果は変わりませんでした。
SHOMI

2020/05/24 11:11 編集

Could not find debuginfo for package: glibc32-2.28-42.1.el8.x86_64 見つからないといっていますね
SHOMI

2020/05/24 11:14

ってglibcじゃなくそれ用のdebuginfoが見つからないのか。上記は無視してください。
SHOMI

2020/05/24 11:22 編集

$ yum debuginfo-install glibc32-2.28-42.1.el8.x86_64 はどうでしょう
Prometheus

2020/05/24 11:23

[root@localhost kai]# debuginfo-install glibc Last metadata expiration check: 0:16:39 ago on Sun 24 May 2020 08:05:56 PM JST. Could not find debuginfo for package: glibc-2.28-72.el8_1.1.x86_64 Could not find debuginfo for package: glibc-2.28-72.el8_1.1.i686 Could not find debuginfo for package: glibc-2.28-72.el8.x86_64 No debuginfo packages available to install Dependencies resolved. Nothing to do. Complete! と出力されました。
SHOMI

2020/05/24 11:26

$ yum debuginfo-install glibc32-2.28-42.1.el8.x86_64 はどうですか
Prometheus

2020/05/24 11:28

[root@localhost kai]# yum debuginfo-install glibc32-2.28-42.1.el8.x86_64 Last metadata expiration check: 0:21:59 ago on Sun 24 May 2020 08:05:56 PM JST. Could not find debuginfo for package: glibc32-2.28-42.1.el8.x86_64 Could not find debuginfo for package: glibc32-2.28-42.1.el8.x86_64 No debuginfo packages available to install Dependencies resolved. Nothing to do. Complete! と出力されます。
Prometheus

2020/05/24 11:38

viコマンドで、/etc/yum.repos.d/CentOS-Debuginfo.repoをenabled=1に編集したところ、以下のように出力されました。 Installed: glibc-debuginfo-2.28-72.el8_1.1.x86_64 glibc-debuginfo-common-2.28-72.el8_1.1.x86_64 Complete!
Prometheus

2020/05/24 11:48

[root@localhost Downloads]# yum install glibc32-2.28-42.1.el8.x86_64 Last metadata expiration check: 0:12:49 ago on Sun 24 May 2020 08:33:30 PM JST. Package glibc32-2.28-42.1.el8.x86_64 is already installed. Dependencies resolved. Nothing to do. Complete! glibc32-2.28-42.1.el8.x86_64は既にインストールされているようなのですが...
SHOMI

2020/05/24 12:05 編集

Installed: glibc-debuginfo-2.28-72.el8_1.1.x86_64 バージョンが違うのが気になりますが… yum debuginfo-install glibc32-2.28-42.1.el8.x86_64 で出たのですか? 再度gdbを試すとどうなります?
Prometheus

2020/05/24 12:48 編集

(gdb) run Starting program: /home/kai/Downloads/rev200 Missing separate debuginfos, use: yum debuginfo-install glibc32-2.28-42.1.el8.x86_64 [Inferior 1 (process 13225) exited normally] と出力されます。 一つ前の出力結果で、 "Package glibc32-2.28-42.1.el8.x86_64 is already installed." となっていたので、インストールされたものが反映されていないということなのでしょうか?
SHOMI

2020/05/24 13:49

glibc32-2.28-42.1は入っているが、それに対応するdebuginfoがないと言っています
SHOMI

2020/05/24 15:02

>Inferior 1 (process 13225) exited normally rev200の実行はされていますね。 Cランタイムの中まで追わないならそのままでも問題はないでしょう。
Prometheus

2020/05/25 11:12 編集

runコマンド、continueコマンドを実行したところ、rev200は動いているようでした。debuginfoに関しては、もう少し調べてみようと思います。長い間、お付き合い頂き本当にありがとうございました。 [kai@localhost Downloads]$ gdb rev200 GNU gdb (GDB) Red Hat Enterprise Linux 8.2-6.el8 Copyright (C) 2018 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-redhat-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 rev200...(no debugging symbols found)...done. (gdb) disas main Dump of assembler code for function main: 0x080483ed <+0>: push %ebp 0x080483ee <+1>: mov %esp,%ebp 0x080483f0 <+3>: push %edi 0x080483f1 <+4>: push %ebx 0x080483f2 <+5>: add $0xffffff80,%esp 0x080483f5 <+8>: movl $0x7a,-0x78(%ebp) 0x080483fc <+15>: movl $0x69,-0x74(%ebp) 0x08048403 <+22>: movl $0x78,-0x70(%ebp) 0x0804840a <+29>: movl $0x6e,-0x6c(%ebp) 0x08048411 <+36>: movl $0x62,-0x68(%ebp) 0x08048418 <+43>: movl $0x6f,-0x64(%ebp) 0x0804841f <+50>: movl $0x7c,-0x60(%ebp) 0x08048426 <+57>: movl $0x6b,-0x5c(%ebp) 0x0804842d <+64>: movl $0x77,-0x58(%ebp) 0x08048434 <+71>: movl $0x78,-0x54(%ebp) 0x0804843b <+78>: movl $0x74,-0x50(%ebp) 0x08048442 <+85>: movl $0x38,-0x4c(%ebp) 0x08048449 <+92>: movl $0x38,-0x48(%ebp) 0x08048450 <+99>: movl $0x64,-0x44(%ebp) 0x08048457 <+106>: movl $0x19,-0x7c(%ebp) 0x0804845e <+113>: lea -0x40(%ebp),%ebx 0x08048461 <+116>: mov $0x0,%eax --Type <RET> for more, q to quit, c to continue without paging-- 0x08048466 <+121>: mov $0xe,%edx 0x0804846b <+126>: mov %ebx,%edi 0x0804846d <+128>: mov %edx,%ecx 0x0804846f <+130>: rep stos %eax,%es:(%edi) 0x08048471 <+132>: movl $0x0,-0x80(%ebp) 0x08048478 <+139>: jmp 0x8048491 <main+164> 0x0804847a <+141>: mov -0x80(%ebp),%eax 0x0804847d <+144>: mov -0x78(%ebp,%eax,4),%eax 0x08048481 <+148>: xor -0x7c(%ebp),%eax 0x08048484 <+151>: mov %eax,%edx 0x08048486 <+153>: mov -0x80(%ebp),%eax 0x08048489 <+156>: mov %edx,-0x40(%ebp,%eax,4) 0x0804848d <+160>: addl $0x1,-0x80(%ebp) 0x08048491 <+164>: cmpl $0xd,-0x80(%ebp) 0x08048495 <+168>: jle 0x804847a <main+141> 0x08048497 <+170>: mov $0x0,%eax 0x0804849c <+175>: sub $0xffffff80,%esp 0x0804849f <+178>: pop %ebx 0x080484a0 <+179>: pop %edi 0x080484a1 <+180>: pop %ebp 0x080484a2 <+181>: ret End of assembler dump. (gdb) b * 0x0804845e Breakpoint 1 at 0x804845e (gdb) run Starting program: /home/kai/Downloads/rev200 Missing separate debuginfos, use: yum debuginfo-install glibc32-2.28-42.1.el8.x86_64 Breakpoint 1, 0x0804845e in main () (gdb) c Continuing. [Inferior 1 (process 12867) exited normally]
Prometheus

2020/06/06 13:40 編集

後日、Ubuntu16.04(32bit)をインストールして、gdbで実行したところ、問題なく動作しました。 やはり、32bit環境で実行しなければならなかったようです。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問