Skip to content

Commit ed610cf

Browse files
SersemPecaalehander92
authored andcommitted
chore: Address miscellaneous changes
1 parent 78372d7 commit ed610cf

File tree

12 files changed

+3610
-3352
lines changed

12 files changed

+3610
-3352
lines changed

LICENSE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,4 +660,8 @@ if any, to sign a "copyright disclaimer" for the program, if necessary.
660660
For more information on this, and how to apply and follow the GNU AGPL, see
661661
<https://www.gnu.org/licenses/>.
662662

663+
Wasm-sysroot licensing
664+
665+
-------------------
666+
663667
The wasm-sysroot is copied from the tree-sitter repo: (https://github.com/tree-sitter/tree-sitter) : specifically https://github.com/tree-sitter/tree-sitter/tree/master/crates/language/wasm/include. The C headers there are a modified version of glibc headers, which are originally under LGPL license.

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ Key signatures:
2020

2121
> [!TIP]
2222
> You can place the downloaded app in a location of your choosing (e.g., the `Applications` folder on macOS or `~/.local/bin` on Linux).
23-
>
23+
>
2424
> When you launch CodeTracer for the first time, it will prompt you to complete the remaining installation steps, such as adding the command-line utilities to your PATH.
2525
26-
> [!CAUTION]
26+
> [!CAUTION]
2727
> Upon the first launch, macOS users will see the error message "CodeTracer is damaged and can't be opened". To resolve this problem, please execute the command `user $ xattr -c <path/to/CodeTracer.app>`.
2828
>
2929
> We expect this inconvenience will be remedied soon through our enrollment in the Apple Developer program which will ensure CodeTracer is properly signed and whitelisted by Apple.
3030
> See [this discussion](https://discussions.apple.com/thread/253714860?sortBy=rank) for more details.
3131
3232
> [!CAUTION]
3333
> Recording ruby on macOS requires you to install ruby through [homebrew](https://brew.sh), otherwise trying to record ruby programs will fail due to the built-in ruby binary on macOS being more than 7 years old.
34-
>
34+
>
3535
> Once homebrew is installed, simply install ruby with `user $ brew install ruby`.
3636
3737
# Introduction
@@ -228,3 +228,5 @@ Check out our [Contributors Guide](./CONTRIBUTING.md) for more details.
228228
## License
229229

230230
CodeTracer is distributed under the GNU Affero General Public License (AGPLv3).
231+
232+
The wasm-sysroot is copied from the tree-sitter repo: (https://github.com/tree-sitter/tree-sitter) : specifically https://github.com/tree-sitter/tree-sitter/tree/master/crates/language/wasm/include. The C headers there are a modified version of glibc headers, which are originally under LGPL license.

src/db-backend/src/dap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#[cfg(feature = "browser-transport")]
2+
use crate::dap_error::DapError;
3+
14
use crate::dap_types::{self, OutputEventBody, SetBreakpointsArguments, StoppedEventBody};
25
use crate::task::{self, CtUpdatedTableResponseBody};
36
use crate::transport::DapResult;

src/db-backend/src/dap_server.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ use crate::db::Db;
55
use crate::handler::Handler;
66
use crate::paths::CODETRACER_PATHS;
77
use crate::task::{
8-
gen_task_id, Action, CallSearchArg, CalltraceLoadArgs, CollapseCallsArgs, CtLoadLocalsArguments, FunctionLocation,
9-
LoadHistoryArg, LocalStepJump, Location, ProgramEvent, RunTracepointsArg, SourceCallJumpTarget, SourceLocation,
10-
StepArg, Task, TaskKind, TracepointId, UpdateTableArgs,
8+
gen_task_id, Action, CallSearchArg, CalltraceLoadArgs, CollapseCallsArgs, CtLoadFlowArguments,
9+
CtLoadLocalsArguments, FunctionLocation, LoadHistoryArg, LocalStepJump, Location, ProgramEvent, RunTracepointsArg,
10+
SourceCallJumpTarget, SourceLocation, StepArg, Task, TaskKind, TracepointId, UpdateTableArgs,
1111
};
1212

1313
use crate::trace_processor::{load_trace_data, load_trace_metadata, TraceProcessor};
@@ -195,7 +195,7 @@ fn handle_request<T: DapTransport>(
195195
"ct/tracepoint-toggle" => handler.tracepoint_toggle(req.clone(), req.load_args::<TracepointId>()?)?,
196196
"ct/tracepoint-delete" => handler.tracepoint_delete(req.clone(), req.load_args::<TracepointId>()?)?,
197197
"ct/trace-jump" => handler.trace_jump(req.clone(), req.load_args::<ProgramEvent>()?)?,
198-
"ct/load-flow" => handler.load_flow(req.clone(), req.load_args::<Location>()?)?,
198+
"ct/load-flow" => handler.load_flow(req.clone(), req.load_args::<CtLoadFlowArguments>()?)?,
199199
"ct/run-to-entry" => handler.run_to_entry(req.clone())?,
200200
"ct/run-tracepoints" => handler.run_tracepoints(req.clone(), req.load_args::<RunTracepointsArg>()?)?,
201201
"ct/setup-trace-session" => handler.setup_trace_session(req.clone(), req.load_args::<RunTracepointsArg>()?)?,

src/db-backend/src/main.rs

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -120,20 +120,35 @@ fn main() -> Result<(), Box<dyn Error>> {
120120
info!("logging from db-backend");
121121

122122
info!("pid {:?}", std::process::id());
123-
if cli.stdio {
124-
let _ = db_backend::dap_server::run_stdio();
125-
} else {
126-
let socket_path = if let Some(p) = cli.socket_path {
127-
p
128-
} else {
129-
let pid = std::process::id() as usize;
130-
db_backend::dap_server::socket_path_for(pid)
131-
};
132-
133-
info!("dap_server::run {:?}", socket_path);
134-
135-
let _ = db_backend::dap_server::run(&socket_path);
136-
};
123+
124+
match cli.cmd {
125+
Commands::DapServer { socket_path, stdio } => {
126+
if stdio {
127+
let _ = db_backend::dap_server::run_stdio();
128+
} else {
129+
let socket_path = if let Some(p) = socket_path {
130+
p
131+
} else {
132+
let pid = std::process::id() as usize;
133+
db_backend::dap_server::socket_path_for(pid)
134+
};
135+
136+
info!("dap_server::run {:?}", socket_path);
137+
138+
let _ = db_backend::dap_server::run(&socket_path);
139+
};
140+
}
141+
Commands::IndexDiff {
142+
structured_diff_path,
143+
trace_folder,
144+
multitrace_folder,
145+
} => {
146+
let raw = std::fs::read_to_string(structured_diff_path)?;
147+
info!("raw {raw:?}");
148+
let structured_diff = serde_json::from_str::<diff::Diff>(&raw)?;
149+
diff::index_diff(structured_diff, &trace_folder, &multitrace_folder)?;
150+
}
151+
}
137152

138153
Ok(())
139154
}

src/db-backend/tests/dap_backend_server.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ fn test_backend_dap_server() {
4141
let socket_path = dap_server::socket_path_for(std::process::id() as usize);
4242
let mut child = Command::new(bin).arg("dap-server").arg(&socket_path).spawn().unwrap();
4343

44-
wait_for_socket(&socket_path);
45-
4644
if let Some(dir) = socket_path.parent() {
4745
fs::create_dir_all(dir).unwrap_or_else(|err| panic!("failed to create socket directory {dir:?}: {err}"));
4846
}

src/db-backend/tree-sitter-trace/grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module.exports = grammar({
8484
))
8585
),
8686
logExpression: $ => seq(
87-
choice("log", "покажи"),
87+
choice("log", "покажи", "print"),
8888
"(",
8989
// based on https://stackoverflow.com/a/62803449/438099
9090
optional(seq($._expression, repeat(seq(",", $._expression)))),

src/db-backend/tree-sitter-trace/src/grammar.json

Lines changed: 7 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/db-backend/tree-sitter-trace/src/node-types.json

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)