๊ธ€ ์ž‘์„ฑ์ž: ๋˜ฅํด๋ฒ .
๋ฐ˜์‘ํ˜•

Memory Dump ํŒŒ์ผ ๋‚จ๊ธฐ๊ธฐ


- Linux ํ™˜๊ฒฝ(Virtual Machine - CentOS7 ๊ธฐ์ค€)

 

1. gdb ์„ค์น˜(๋˜์–ด์žˆ๋‹ค๋ฉด ์ƒ๋žต)

yum install gdb

 

2. ๋Œ€์ƒ์ด ๋˜๋Š” ํ”„๋กœ์„ธ์Šค ์ถ”์ 

$ ps -ef | grep socket


root      7896 18386  0 Nov04 ?        00:01:47 /game/server/socketServer/20191104_175539/dev_socket/dev_socket -ServerType=Dev
root     29534 29485  0 16:34 pts/1    00:00:00 grep --color=auto socket

 

3. memory dump ๋‚จ๊ธฐ๊ธฐ

$ gcore 7896

warning: File "/usr/lib/golang/src/runtime/runtime-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "/usr/share/gdb/auto-load:/usr/lib/debug:/usr/bin/mono-gdb.py".
To enable execution of this file add
        add-auto-load-safe-path /usr/lib/golang/src/runtime/runtime-gdb.py
line to your configuration file "/root/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "/root/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"
[New LWP 12406]
[New LWP 7915]
[New LWP 7914]
[New LWP 7910]
[New LWP 7908]
[New LWP 7906]
[New LWP 7904]
[New LWP 7903]
[New LWP 7902]
[Thread debugging using libthread_db enabled]
runtime.futex () at /usr/lib/golang/src/runtime/sys_linux_amd64.s:536
536             MOVL    AX, ret+40(FP)
Saved corefile core.7896

 

4. ๊ฐœ๋ฐœํ™˜๊ฒฝ์œผ๋กœ memory dumpํŒŒ์ผ๊ณผ ์‹คํ–‰๋˜๊ณ  ์žˆ๋Š” ํ”„๋กœ์„ธ์Šค ๋นŒ๋“œ๋ฅผ ์ „์†ก

(ํŒŒ์ผ ์ „์†ก์—๋Š” ์—ฌ๋Ÿฌ ๋ฐฉ๋ฒ•์ด ์žˆ์ง€๋งŒ ์ด ๊ธ€์—์„  WinSCP๋ฅผ ์‚ฌ์šฉํ•˜์˜€์Œ)

 

- Windows ํ™˜๊ฒฝ

 

์ž‘์—…๊ด€๋ฆฌ์ž์—์„œ ์‹คํ–‰ ์ค‘์ธ ํ”„๋กœ์„ธ์Šค๋ฅผ ๋Œ€์ƒ์œผ๋กœ ๋งˆ์šฐ์Šค ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ → ๋คํ”„ ํŒŒ์ผ ๋งŒ๋“ค๊ธฐ ์„ ํƒ

 

 

GoLand๋กœ ๋ถ„์„


1. <Run> → <Open Core Dump...>

 

2. ๋นŒ๋“œ ํŒŒ์ผ๊ณผ ์ฝ”์–ด๋คํ”„ ํŒŒ์ผ ์ง€์ •

 

3. ๋ถ„์„

 

 

์ฐธ๊ณ 


https://blog.jetbrains.com/go/2019/03/13/debugging-in-goland-windows-minidumps/
https://blog.jetbrains.com/go/2019/03/04/debugging-with-goland-advanced-debugging-features/
๋ฐ˜์‘ํ˜•