TL;DR
- 8.0.29とそれ以降でソースビルドをしてる人だけだと思う
cmake
する時に -DMINIMAL_RELWITHDEBINFO=OFF
する
cmake
する時に -DMINIMAL_RELWITHDEBINFO=OFF
するgdbでmysqldにアタッチした時に色々見つからなくて困った。thdとか全然見えない。
$ gdb -p $(pidof mysqld)
(gdb) b PT_show_processlist::make_cmd
+b PT_show_processlist::make_cmd
Breakpoint 1 at 0x122eaec: file /home/yoku0825/mysql-8.0.35/sql/parse_tree_nodes.cc, line 2722.
(gdb) c
+c
Continuing.
[Switching to Thread 0x7fe5dc2e9700 (LWP 13041)]
Breakpoint 1, PT_show_processlist::make_cmd () at /home/yoku0825/mysql-8.0.35/sql/parse_tree_nodes.cc:2722
2722 lex->sql_command = m_sql_command;
(gdb) n
+n
2725 bool use_pfs = pfs_processlist_enabled;
(gdb) n
+n
2727 m_sql_cmd.set_use_pfs(use_pfs);
(gdb) p use_pfs
+p use_pfs
No symbol "use_pfs" in current context.
(gdb) n
+n
2728 if (use_pfs) {
(gdb) p use_pfs
+p use_pfs
No symbol "use_pfs" in current context.
(gdb) n
+n
2729 if (build_processlist_query(m_pos, thd, m_sql_cmd.verbose()))
(gdb) n
+n
2733 return &m_sql_cmd;
(gdb) p m_sql_cmd
+p m_sql_cmd
No symbol "m_sql_cmd" in current context.
(gdb) p thd->s m_sql_cmd
+p thd->m_sql_cmd
No symbol "thd" in current context.
おかしいなあと思ってたけど、何気なく cmake3 -LA | grep -i relwith
ってやったら MINIMAL_RELWITHDEBINFO
なんていかにも怪しいオプションがONになっているのを見つけた。
$ cmake3 -LA | grep -i relwith
..
CMAKE_ASM_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_BUILD_TYPE:STRING=RelWithDebInfo
CMAKE_CXX_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_C_FLAGS_RELWITHDEBINFO:STRING=-O2 -g -DNDEBUG
CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO:STRING=
CMAKE_STATIC_LINKER_FLAGS_RELWITHDEBINFO:STRING=
MINIMAL_RELWITHDEBINFO:BOOL=ON
OFFにしてコンパイルし直す。
$ cmake3 -DMINIMAL_RELWITHDEBINFO=OFF .
$ make
見えるようになった。
(gdb) b PT_show_processlist::make_cmd
+b PT_show_processlist::make_cmd
Breakpoint 1 at 0x122eaf9: file /home/yoku0825/mysql-8.0.35/sql/parse_tree_nodes.cc, line 2725.
(gdb) c
+c
Continuing.
[Switching to Thread 0x7fce486f6700 (LWP 29941)]
Breakpoint 1, PT_show_processlist::make_cmd (this=0x7fce0c00b000, thd=0x7fce0c010580) at /home/yoku0825/mysql-8.0.35/sql/parse_tree_nodes.cc:2725
2725 bool use_pfs = pfs_processlist_enabled;
(gdb) bt
+bt
#0 PT_show_processlist::make_cmd (this=0x7fce0c00b000, thd=0x7fce0c010580) at /home/yoku0825/mysql-8.0.35/sql/parse_tree_nodes.cc:2725
#1 0x0000000000d9c5a7 in LEX::make_sql_cmd (this=0x7fce0c013990, parse_tree=<optimized out>) at /home/yoku0825/mysql-8.0.35/sql/sql_lex.cc:4949
#2 0x0000000000d3618a in THD::sql_parser (this=this@entry=0x7fce0c010580) at /home/yoku0825/mysql-8.0.35/sql/sql_class.cc:3066
#3 0x0000000000dc50b5 in parse_sql (thd=thd@entry=0x7fce0c010580, parser_state=parser_state@entry=0x7fce486f4ae0, creation_ctx=creation_ctx@entry=0x0) at /home/yoku0825/mysql-8.0.35/sql/sql_parse.cc:7132
#4 0x0000000000dc9d5d in dispatch_sql_command(THD*, Parser_state*) () at /home/yoku0825/mysql-8.0.35/sql/sql_parse.cc:5265
#5 0x0000000000dcb39e in dispatch_command(THD*, COM_DATA const*, enum_server_command) () at /home/yoku0825/mysql-8.0.35/sql/sql_parse.cc:2054
#6 0x0000000000dcd727 in do_command (thd=thd@entry=0x7fce0c010580) at /home/yoku0825/mysql-8.0.35/sql/sql_parse.cc:1439
#7 0x0000000000f24500 in handle_connection (arg=arg@entry=0x73d11f0) at /home/yoku0825/mysql-8.0.35/sql/conn_handler/connection_handler_per_thread.cc:302
#8 0x00000000024f91b5 in pfs_spawn_thread (arg=0x74b0b10) at /home/yoku0825/mysql-8.0.35/storage/perfschema/pfs.cc:3042
#9 0x00007fce78163ea5 in start_thread () from /lib64/libpthread.so.0
#10 0x00007fce7677db0d in clone () from /lib64/libc.so.6
(gdb) p use_pfs
+p use_pfs
$1 = <optimized out>
(gdb) p thd
+p thd
$2 = (THD *) 0x7fce0c010580
0 件のコメント :
コメントを投稿