tikv 采用vscode 调试 debug 无法watch变量的问题

tikv代码可以debug run 起来 但是无法通过vscode watch到变量 请问是什么问题

1赞

参考下这个帖子

1赞

这个问题在 tikv GitHub issue #11963#5572 都有提及;

本质原因:

在 tikv readme 的 build issue 中有介绍,为了优化编译时间,仅仅包含的行号等信息,并非全部 debug 需要的信息。
image

解决效果:

要么编译时,debug = true ,要么 RUSTFLAGS=-Cdebuginfo=2 cargo build
Debug 效果如下:
image

1赞

您好,我这边在debug的时候出现如下错误,这个您遇到过吗

  1. 这是稳定浮现的吗?

我没遇到过,可以格式化下报错信息

每次都出现,下边是格式化的报错信息

[2022/02/21 09:09:04.808 +08:00] [INFO] [raft.rs:1164] ["became pre-candidate at term 5"] [term=5] [raft_id=61] [region_id=60]
[2022/02/21 09:09:04.808 +08:00] [INFO] [raft.rs:1138] ["became candidate at term 6"] [term=6] [raft_id=61] [region_id=60]
[2022/02/21 09:09:04.808 +08:00] [INFO] [raft.rs:1222] ["became leader at term 6"] [term=6] [raft_id=61] [region_id=60]
[2022/02/21 09:09:04.808 +08:00] [INFO] [peer.rs:4614] ["require updating max ts"] [initial_status=25769803836] [region_id=60]
[2022/02/21 09:09:04.808 +08:00] [INFO] [pd.rs:1451] ["succeed to update max timestamp"] [region_id=60]
[2022/02/21 09:09:04.809 +08:00] [INFO] [endpoint.rs:314] ["register observe region"] [region="id: 60 start_key: 7480000000000000FF3B00000000000000F8 end_key: 7480000000000000FF3D00000000000000F8 region_epoch { conf_ver: 1 version: 30 } peers { id: 61 store_id: 1 }"]
[2022/02/21 09:09:04.809 +08:00] [INFO] [endpoint.rs:233] ["Resolver initialized"] [pending_data_index=0] [snapshot_index=64] [observe_id=ObserveID(57)] [region=2]
[2022/02/21 09:09:04.809 +08:00] [INFO] [endpoint.rs:233] ["Resolver initialized"] [pending_data_index=0] [snapshot_index=6] [observe_id=ObserveID(58)] [region=60]
[2022/02/21 09:09:10.937 +08:00] [INFO] [client.rs:749] ["set cluster version to 5.4.0-alpha"]
[2022/02/21 09:17:38.254 +08:00] [FATAL] [lib.rs:466] ["called `Result::unwrap()` on an `Err` value: Sys(EINVAL)"] 
[backtrace="   
0: backtrace::backtrace::libunwind::trace\n             at /Users/zhaochen5/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/libunwind.rs:90:5\n      backtrace::backtrace::trace_unsynchronized\n             at /Users/zhaochen5/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs:66:5\n   
1: backtrace::backtrace::trace\n             at /Users/zhaochen5/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/backtrace/mod.rs:53:14\n   
2: backtrace::capture::Backtrace::create\n             at /Users/zhaochen5/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/capture.rs:176:9\n   
3: backtrace::capture::Backtrace::new\n             at /Users/zhaochen5/.cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.61/src/capture.rs:140:22\n   
4: tikv_util::set_panic_hook::{{closure}}\n             at /Users/zhaochen5/work/src/github.com/pingcap/tikv/components/tikv_util/src/lib.rs:465:18\n   
5: std::panicking::rust_panic_with_hook\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:702:17\n   
6: std::panicking::begin_panic_handler::{{closure}}\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:588:13\n   
7: std::sys_common::backtrace::__rust_end_short_backtrace\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/sys_common/backtrace.rs:138:18\n   
8: rust_begin_unwind\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:584:5\n   
9: core::panicking::panic_fmt\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/panicking.rs:143:14\n  
10: core::result::unwrap_failed\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/result.rs:1749:5\n  
11: core::result::Result<T,E>::unwrap\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/result.rs:1065:23\n  
12: <signal::trap::Trap as core::iter::traits::iterator::Iterator>::next\n             at /Users/zhaochen5/.cargo/registry/src/github.com-1ecc6299db9ec823/signal-0.6.0/src/trap.rs:114:29\n  
13: server::signal_handler::imp::wait_for_signal\n             at /Users/zhaochen5/work/src/github.com/pingcap/tikv/components/server/src/signal_handler.rs:16:20\n  
14: server::server::run_tikv\n             at /Users/zhaochen5/work/src/github.com/pingcap/tikv/components/server/src/server.rs:157:9\n  
15: tikv_server::main\n             at /Users/zhaochen5/work/src/github.com/pingcap/tikv/cmd/tikv-server/src/main.rs:190:5\n  
16: core::ops::function::FnOnce::call_once\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/ops/function.rs:227:5\n  
17: std::sys_common::backtrace::__rust_begin_short_backtrace\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/sys_common/backtrace.rs:122:18\n  
18: std::rt::lang_start::{{closure}}\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/rt.rs:145:18\n  
19: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/core/src/ops/function.rs:259:13\n      std::panicking::try::do_call\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:492:40\n      std::panicking::try\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:456:19\n      std::panic::catch_unwind\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panic.rs:137:14\n      std::rt::lang_start_internal::{{closure}}\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/rt.rs:128:48\n      std::panicking::try::do_call\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:492:40\n      std::panicking::try\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panicking.rs:456:19\n      std::panic::catch_unwind\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/panic.rs:137:14\n      std::rt::lang_start_internal\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/rt.rs:128:20\n  
20: std::rt::lang_start\n             at /rustc/1e12aef3fab243407f9d71ba9956cb2a1bf105d5/library/std/src/rt.rs:144:17\n  
21: <unknown>\n             at /Users/zhaochen5/work/src/github.com/pingcap/tikv/cmd/tikv-server/src/main.rs:191:2\n"] [location=/Users/zhaochen5/.cargo/registry/src/github.com-1ecc6299db9ec823/signal-0.6.0/src/trap.rs:114] [thread_name=main]

这个是不是得原厂的人来回复一下,感觉没看懂报的是啥意思

可以来这里聊一下,开发者论坛.https://internals.tidb.io/

1赞

开发者有专门的论坛?任何人都可以参与吗?

1赞


这个我提过,没人回答