mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
Merge branch 'main' into 263-add-debug-meta-information-between-seer-and-gdbserver
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
helloworld
|
||||
triangle
|
||||
@@ -0,0 +1,13 @@
|
||||
.PHONY: all
|
||||
all: helloworld triangle
|
||||
|
||||
helloworld: helloworld.cpp
|
||||
g++ -g -o helloworld helloworld.cpp -lncurses
|
||||
|
||||
triangle: triangle.cpp
|
||||
g++ -g -o triangle triangle.cpp -lncurses
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f helloworld triangle
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
#include <ncurses.h>
|
||||
|
||||
int main() {
|
||||
|
||||
initscr(); /* Start curses mode */
|
||||
printw("Hello World !!!"); /* Print Hello World */
|
||||
refresh(); /* Print it on to the real screen */
|
||||
getch(); /* Wait for user input */
|
||||
endwin(); /* End curses mode */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
/* triangle.c */
|
||||
#include <curses.h>
|
||||
#include <stdlib.h>
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
#define ITERMAX 10000
|
||||
|
||||
int main(void) {
|
||||
|
||||
long iter;
|
||||
int yi, xi;
|
||||
int y[3], x[3];
|
||||
int index;
|
||||
int maxlines, maxcols;
|
||||
|
||||
/* initialize curses */
|
||||
|
||||
initscr();
|
||||
cbreak();
|
||||
noecho();
|
||||
|
||||
clear();
|
||||
|
||||
/* initialize triangle */
|
||||
|
||||
maxlines = LINES - 1;
|
||||
maxcols = COLS - 1;
|
||||
|
||||
y[0] = 0;
|
||||
x[0] = 0;
|
||||
|
||||
y[1] = maxlines;
|
||||
x[1] = maxcols / 2;
|
||||
|
||||
y[2] = 0;
|
||||
x[2] = maxcols;
|
||||
|
||||
mvaddch(y[0], x[0], '0');
|
||||
mvaddch(y[1], x[1], '1');
|
||||
mvaddch(y[2], x[2], '2');
|
||||
|
||||
/* initialize yi,xi with random values */
|
||||
|
||||
yi = std::rand() % maxlines;
|
||||
xi = std::rand() % maxcols;
|
||||
|
||||
mvaddch(yi, xi, '.');
|
||||
|
||||
/* iterate the triangle */
|
||||
|
||||
for (iter = 0; iter < ITERMAX; iter++) {
|
||||
index = std::rand() % 3;
|
||||
|
||||
yi = (yi + y[index]) / 2;
|
||||
xi = (xi + x[index]) / 2;
|
||||
|
||||
mvaddch(yi, xi, '*');
|
||||
refresh();
|
||||
}
|
||||
|
||||
/* done */
|
||||
|
||||
mvaddstr(maxlines, 0, "Press any key to quit");
|
||||
|
||||
refresh();
|
||||
|
||||
getch();
|
||||
endwin();
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
@@ -6,9 +6,9 @@ In one window, launch the program using gdbserver.
|
||||
|
||||
$ gdbserver :1234 hellogdbserver
|
||||
|
||||
In another window, lauch Seer.
|
||||
In another terminal, start Seer with the project file.
|
||||
|
||||
$ seergdb --project project.seer
|
||||
$ /usr/local/bin/seergdb -xxx -s --project project.seer
|
||||
|
||||
The project file has the info that Seer needs.
|
||||
|
||||
@@ -17,9 +17,11 @@ The project file has the info that Seer needs.
|
||||
- gdbserver port
|
||||
|
||||
|
||||
To exit propery, enter this command in Seer's gdb input field.
|
||||
When exiting Seer, make sure to enter this command into the
|
||||
gdb command field. Otherwise, the gdbserver process will hang
|
||||
and you will need to 'kill -9' the gdbserver process.
|
||||
|
||||
monitor exit
|
||||
(gdb) monitor exit
|
||||
|
||||
It tells the gdbserver to shutdown. If you don't, the gdbsver
|
||||
process will need to be kill with "kill -9".
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
{
|
||||
"seerproject": {
|
||||
"connectmode": {
|
||||
"gdbserver": ":1234"
|
||||
"gdbserver": ":1234",
|
||||
"targettype": "extended-remote"
|
||||
},
|
||||
"executable": "/nas/erniep/Development/seer/tests/hellogdbserver/hellogdbserver",
|
||||
"postgdbcommands": [
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
helloucurses
|
||||
@@ -0,0 +1,10 @@
|
||||
.PHONY: all
|
||||
all: helloucurses
|
||||
|
||||
helloucurses: helloucurses.c
|
||||
gcc-13 -g -o helloucurses helloucurses.c -I/usr/local/uCurses -L /usr/local/lib64 -lm -luCurses
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f helloucurses helloucurses.o
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
break -source /nas/erniep/Development/seer/tests/helloucurses/helloucurses.c -line 23
|
||||
break -source /nas/erniep/Development/seer/tests/helloucurses/helloucurses.c -line 14
|
||||
break -function c_emit -line 107
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "uCurses.h"
|
||||
#include "uC_terminfo.h"
|
||||
#include "uC_attribs.h"
|
||||
|
||||
int main (int argc, char* argv[]) {
|
||||
|
||||
// not defining any windows, just used to position cursor
|
||||
// on the screen
|
||||
uCurses_init();
|
||||
uC_clear();
|
||||
uC_cup(5,5);
|
||||
uC_terminfo_flush();
|
||||
|
||||
write(1, "Hello", 5);
|
||||
|
||||
uC_console_reset_attrs();
|
||||
uC_cup(10, 0);
|
||||
|
||||
uCurses_deInit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user