Skip to content

extra: Remove dbg module and rt support code #8175

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 0 additions & 80 deletions src/libextra/dbg.rs

This file was deleted.

1 change: 0 additions & 1 deletion src/libextra/extra.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ pub mod sha2;

pub mod url;
pub mod ebml;
pub mod dbg;
pub mod getopts;
pub mod json;
pub mod md4;
Expand Down
2 changes: 0 additions & 2 deletions src/libstd/unstable/lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ pub mod rustrt {

#[rust_stack]
pub fn rust_try_get_task() -> *rust_task;

pub fn rust_dbg_breakpoint();
}
}

Expand Down
92 changes: 0 additions & 92 deletions src/rt/rust_builtin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,93 +150,6 @@ debug_static_mut_check_four() {
assert(debug_static_mut == 4);
}

/* Debug builtins for std::dbg. */

static void
debug_tydesc_helper(type_desc *t)
{
rust_task *task = rust_get_current_task();
LOG(task, stdlib, " size %" PRIdPTR ", align %" PRIdPTR,
t->size, t->align);
}

extern "C" CDECL void
debug_tydesc(type_desc *t) {
rust_task *task = rust_get_current_task();
LOG(task, stdlib, "debug_tydesc");
debug_tydesc_helper(t);
}

extern "C" CDECL void
debug_opaque(type_desc *t, uint8_t *front) {
rust_task *task = rust_get_current_task();
LOG(task, stdlib, "debug_opaque");
debug_tydesc_helper(t);
// Account for alignment. `front` may not indeed be the
// front byte of the passed-in argument
if (((uintptr_t)front % t->align) != 0) {
front = (uint8_t *)align_to((uintptr_t)front, (size_t)t->align);
}
for (uintptr_t i = 0; i < t->size; ++front, ++i) {
LOG(task, stdlib, " byte %" PRIdPTR ": 0x%" PRIx8, i, *front);
}
}

extern "C" CDECL void
debug_box(type_desc *t, rust_opaque_box *box) {
rust_task *task = rust_get_current_task();
LOG(task, stdlib, "debug_box(0x%" PRIxPTR ")", box);
debug_tydesc_helper(t);
LOG(task, stdlib, " refcount %" PRIdPTR,
box->ref_count - 1); // -1 because we ref'ed for this call
uint8_t *data = (uint8_t *)box_body(box);
for (uintptr_t i = 0; i < t->size; ++i) {
LOG(task, stdlib, " byte %" PRIdPTR ": 0x%" PRIx8, i, data[i]);
}
}

struct rust_tag {
uintptr_t discriminant;
uint8_t variant[];
};

extern "C" CDECL void
debug_tag(type_desc *t, rust_tag *tag) {
rust_task *task = rust_get_current_task();

LOG(task, stdlib, "debug_tag");
debug_tydesc_helper(t);
LOG(task, stdlib, " discriminant %" PRIdPTR, tag->discriminant);

for (uintptr_t i = 0; i < t->size - sizeof(tag->discriminant); ++i)
LOG(task, stdlib, " byte %" PRIdPTR ": 0x%" PRIx8, i,
tag->variant[i]);
}

extern "C" CDECL void
debug_fn(type_desc *t, fn_env_pair *fn) {
rust_task *task = rust_get_current_task();
LOG(task, stdlib, "debug_fn");
debug_tydesc_helper(t);
LOG(task, stdlib, " fn at 0x%" PRIxPTR, fn->f);
LOG(task, stdlib, " env at 0x%" PRIxPTR, fn->env);
if (fn->env) {
LOG(task, stdlib, " refcount %" PRIdPTR, fn->env->ref_count);
}
}

extern "C" CDECL void *
debug_ptrcast(type_desc *from_ty,
type_desc *to_ty,
void *ptr) {
rust_task *task = rust_get_current_task();
LOG(task, stdlib, "debug_ptrcast from");
debug_tydesc_helper(from_ty);
LOG(task, stdlib, "to");
debug_tydesc_helper(to_ty);
return ptr;
}

extern "C" CDECL void *
debug_get_stk_seg() {
rust_task *task = rust_get_current_task();
Expand Down Expand Up @@ -583,11 +496,6 @@ rust_should_log_console() {
return (uintptr_t)should_log_console();
}

extern "C" CDECL void
rust_dbg_breakpoint() {
BREAKPOINT_AWESOME;
}

extern "C" CDECL rust_sched_id
rust_osmain_sched_id() {
rust_task *task = rust_get_current_task();
Expand Down
13 changes: 0 additions & 13 deletions src/rt/rust_debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,6 @@
#include <string>
#include <cstdlib>

#ifndef _WIN32

#include <signal.h>
#define BREAKPOINT_AWESOME \
do { \
signal(SIGTRAP, SIG_IGN); \
raise(SIGTRAP); \
} while (0)

#else
#define BREAKPOINT_AWESOME
#endif

struct rust_task;

namespace debug {
Expand Down
7 changes: 0 additions & 7 deletions src/rt/rustrt.def.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
debug_box
debug_fn
debug_opaque
debug_ptrcast
debug_tag
debug_tydesc
debug_get_stk_seg
debug_abi_1
debug_abi_2
Expand Down Expand Up @@ -178,7 +172,6 @@ rust_dbg_lock_wait
rust_dbg_lock_signal
rust_dbg_call
rust_dbg_do_nothing
rust_dbg_breakpoint
rust_osmain_sched_id
rust_task_inhibit_kill
rust_task_allow_kill
Expand Down