summaryrefslogtreecommitdiff
path: root/tb/top
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-12-12 12:48:38 -0600
committerAlejandro Soto <alejandro@34project.org>2022-12-16 16:29:10 -0600
commitbb38130bb8e2b8ec17cb6347173af435c5ceef18 (patch)
tree36584332d684a35d3ce512d529e3ba68c8c896fa /tb/top
parentc67d424c6d130f810c251576fd55389d1385edb5 (diff)
Implement gdbstub monitor
Diffstat (limited to 'tb/top')
-rw-r--r--tb/top/conspiracion.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp
index bdda56c..5e16505 100644
--- a/tb/top/conspiracion.cpp
+++ b/tb/top/conspiracion.cpp
@@ -8,6 +8,8 @@
#include <string>
#include <vector>
+#include <unistd.h>
+
#include <verilated.h>
#include <verilated_vcd_c.h>
@@ -268,10 +270,15 @@ int main(int argc, char **argv)
}
FILE *ctrl = stdout;
- if(*control_fd != -1 && (ctrl = fdopen(*control_fd, "r+")) == nullptr)
+ if(*control_fd != -1)
{
- std::perror("fdopen()");
- return EXIT_FAILURE;
+ if((ctrl = fdopen(*control_fd, "r+")) == nullptr)
+ {
+ std::perror("fdopen()");
+ return EXIT_FAILURE;
+ }
+
+ dup2(*control_fd, STDERR_FILENO);
}
Vconspiracion top;