Skip to content
Open
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
251 changes: 154 additions & 97 deletions gdbui_server/main.py

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions gdbui_server/output/bad_program.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
this is not valid c++
2 changes: 2 additions & 0 deletions gdbui_server/output/test_program.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include <iostream>
int main() { std::cout << 'Hello, World!'; return 0; }
Binary file added gdbui_server/output/test_program.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions gdbui_server/output/test_program2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#include <iostream>
int main() { std::cout << "Hello, Universe!"; return 0; }
Binary file added gdbui_server/output/test_program2.exe
Binary file not shown.
1 change: 1 addition & 0 deletions webapp/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=http://127.0.0.1:10000
1 change: 1 addition & 0 deletions webapp/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_API_BASE_URL=https://your-gdbui-server.com
8 changes: 5 additions & 3 deletions webapp/src/App.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from "react";
import { Route, Routes } from "react-router-dom";
import { Route, Routes, Navigate } from "react-router-dom";
import Debug from "./pages/Debug/Debug";
import Threads from "./components/GdbComponents/Threads/Threads";
import LocalVariable from "./components/GdbComponents/LocalVariable/LocalVariable";
Expand Down Expand Up @@ -30,14 +30,16 @@ const App = () => {
/>

<Routes>
<Route path="debug" element={<Debug />}>
<Route path="/debug" element={<Debug />}>
<Route path="threads" element={<Threads />} />
<Route path="localVariable" element={<LocalVariable />} />
<Route path="context" element={<Context />} />
<Route path="memoryMap" element={<MemoryMap />} />
<Route path="breakPoints" element={<BreakPoints />} />
</Route>
{/* You can add more routes here */}
<Route path="/login" element={<Navigate to="/debug" replace />} />
<Route path="/" element={<Navigate to="/debug" replace />} />
<Route path="*" element={<Navigate to="/debug" replace />} />
</Routes>
<Footer />
</div>
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Breakpoint/Breakpoint.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import "./Breakpoint.css";

import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css";
import axios from "axios";
import api from '../../services/api';

const Breakpoint = () => {
const [breakLine, setBreakLine] = useState("");
Expand All @@ -18,7 +18,7 @@ const Breakpoint = () => {
return;
}
try {
const data = await axios.post("http://127.0.0.1:10000/set_breakpoint", {
const data = await api.post("/set_breakpoint", {
location: breakLine,
name: "program",
});
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Functions/Functions.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect } from "react";
import { DataState } from "./../../context/DataContext";
import "./Functions.css";
import axios from "axios";
import api from '../../services/api';

const data = [
"sub.KERNEL32.dll_DeleteCritical_231",
Expand All @@ -22,7 +22,7 @@ const Functions = () => {
const fetchFunctionsData = async () => {
try {
console.log("click from functions");
const data = await axios.post("http://127.0.0.1:10000/get_locals", {
const data = await api.post("/get_locals", {
name: "program",
});
console.log(data.data.result);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { useEffect, useState } from "react";
import { DataState } from "./../../../context/DataContext";
import "./BreakPoints.css";
import axios from "axios";
import api from '../../../services/api';

const data = [
{
Expand All @@ -26,7 +26,7 @@ const BreakPoints = () => {
const { refresh, setInfoBreakpointData, infoBreakpointData } = DataState();

const fetchInfoBreakpoints = async () => {
const data = await axios.post("http://127.0.0.1:10000/info_breakpoints", {
const data = await api.post("/info_breakpoints", {
name: "program",
});
console.log(data.data["result"]);
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/GdbComponents/MemoryMap/MemoryMap.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect } from "react";
import { DataState } from "./../../../context/DataContext";

import "./MemoryMap.css";
import axios from "axios";
import api from '../../../services/api';

const data = [
"0x7fffffffe270: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00",
Expand All @@ -19,7 +19,7 @@ const MemoryMap = () => {

const fetchMemoryMap = async () => {
console.log("Click form memory map");
const data = await axios.post("http://127.0.0.1:10000/memory_map", {
const data = await api.post("/memory_map", {
name: "program",
});
console.log(data.data.result);
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Stack/Stack.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React, { useEffect } from "react";
import { DataState } from "./../../context/DataContext";
import "./Stack.css";
import axios from "axios";
import api from '../../services/api';

const Stack = () => {
const { refresh, stack, setStack } = DataState();

const fetStackData = async () => {
try {
console.log("click from stack");
const data = await axios.post("http://127.0.0.1:10000/stack_trace", {
const data = await api.post("/stack_trace", {
name: "program",
});
console.log(data.data.result);
Expand Down
4 changes: 2 additions & 2 deletions webapp/src/components/Terminal/TerminalComp.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useState, useEffect, useRef } from "react";
import { ReactTerminal } from "react-terminal";
import axios from "axios";
import api from '../../services/api';
import "./Terminal.css";
import { DataState } from "../../context/DataContext";

Expand All @@ -13,7 +13,7 @@ const TerminalComp = () => {
const fullCommand = [command, ...args].join(" ");
console.log("Full Command:", fullCommand);
try {
const { data } = await axios.post("http://127.0.0.1:10000/gdb_command", {
const { data } = await api.post("/gdb_command", {
command: fullCommand,
name: "program",
});
Expand Down
17 changes: 17 additions & 0 deletions webapp/src/services/api.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import axios from 'axios';

const sessionId = (() => {
let id = sessionStorage.getItem('gdbui-session-id');
if (!id) {
id = crypto.randomUUID();
sessionStorage.setItem('gdbui-session-id', id);
}
return id;
})();

const api = axios.create({
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://127.0.0.1:10000',
headers: { 'X-Session-ID': sessionId },
});

export default api;