MCPcopy Create free account
hub / github.com/SeaQL/FireDBG.for.Rust / main

Function main

debugger/src/main.rs:100–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

98
99#[tokio::main]
100async fn main() -> Result<()> {
101 env_logger::init();
102
103 check_rustc_version();
104
105 let Command {
106 workspace_root,
107 package_cfgs,
108 output,
109 package_name,
110 sub_command,
111 } = Command::from_args();
112
113 let workspace_root = workspace_root.trim_end_matches('/');
114 let producer = create_streamer(&output)
115 .await
116 .context("Fail to create streamer")?;
117
118 let mut files = vec![Default::default()];
119 let mut breakpoints = vec![Default::default()];
120 let mut id = 1;
121
122 let get_map_file = |src_file: &PathBuf| {
123 let src_rel_path = &src_file.to_str().expect("path to str")[(workspace_root.len() + 1)..];
124 format!("{workspace_root}/firedbg/{src_rel_path}.firedbg.map")
125 };
126
127 let mut set_file_breakpoint = |file: File| {
128 let File {
129 path,
130 functions,
131 crate_name,
132 modified,
133 } = file;
134 let path = if path.starts_with(workspace_root) {
135 // We want to strip the workspace root and the `/` at the starts
136 path[(workspace_root.len() + 1)..].to_string()
137 } else {
138 path
139 };
140 files.push(SourceFile {
141 id,
142 path,
143 crate_name,
144 modified,
145 });
146 for func in functions {
147 breakpoints.push(new_breakpoint(breakpoints.len() as u32, id, &func));
148 }
149 id += 1;
150 };
151
152 let get_arguments = |testcase: String| vec!["--exact".into(), testcase];
153
154 let (binary, src_dirs, arguments) = match sub_command {
155 SubCommand::Run {
156 binary_executable,
157 args,

Callers

nothing calls this directly

Calls 15

check_rustc_versionFunction · 0.85
create_streamerFunction · 0.85
new_breakpointFunction · 0.85
from_bson_fileFunction · 0.85
get_target_basenameFunction · 0.85
print_to_stdoutFunction · 0.85
to_strMethod · 0.80
to_stringMethod · 0.80
sizeMethod · 0.80
DebuggerClass · 0.70
runFunction · 0.70
lenMethod · 0.45

Tested by

no test coverage detected