mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Add new test program for pretty printing structures.
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
helloprettyprint
|
||||
*.o
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
.PHONY: all
|
||||
all: helloprettyprint
|
||||
|
||||
helloprettyprint: helloprettyprint.cpp
|
||||
g++ -g -o helloprettyprint helloprettyprint.cpp
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f helloprettyprint helloprettyprint.o
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
|
||||
Seer has a problem with enabling 'pretty printing' and structs have have \n characters.
|
||||
|
||||
https://github.com/epasveer/seer/issues/313
|
||||
|
||||
(gdb) set print pretty on
|
||||
|
||||
Without pretty print
|
||||
10^done,value="{B = 1, C = 0, D = \"asd\", E = std::vector<bool> of length 1, capacity 64 = {true}}"
|
||||
11^done,value="1"
|
||||
|
||||
With pretty print
|
||||
10^done,value="{\n B = 1,\n C = 0,\n D = \"asd\",\n E = std::vector<bool> of length 1, capacity 64 = {true}\n}"
|
||||
11^done,value="1"
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct A
|
||||
{
|
||||
int B;
|
||||
float C;
|
||||
std::string D;
|
||||
std::vector<bool> E;
|
||||
};
|
||||
|
||||
struct A f(int p)
|
||||
{
|
||||
A a;
|
||||
a.B = p;
|
||||
a.D = "asd";
|
||||
a.E.push_back(p > 0);
|
||||
return a;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
A a = f(1);
|
||||
std::cout << a.E[0] << std::endl;
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"seerproject": {
|
||||
"executable": "helloprettyprint",
|
||||
"postgdbcommands": [
|
||||
""
|
||||
],
|
||||
"pregdbcommands": [
|
||||
"# Comment the next line out to disable \"pretty printing\".",
|
||||
"set pretty printer on"
|
||||
],
|
||||
"startmode": {
|
||||
"arguments": "",
|
||||
"breakinfunction": false,
|
||||
"breakinfunctionname": "",
|
||||
"breakinmain": true,
|
||||
"breakpointsfile": "",
|
||||
"nobreak": false,
|
||||
"nonstopmode": false,
|
||||
"randomizestartaddress": false,
|
||||
"showassemblytab": false
|
||||
},
|
||||
"symbolfile": "",
|
||||
"workingdirectory": ""
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user