Skip to content

Commit af140c2

Browse files
committed
add: styled list toggle
1 parent 98468ef commit af140c2

File tree

6 files changed

+76
-31
lines changed

6 files changed

+76
-31
lines changed

prova_test/es2/nucleo/debug/nuculeo.py

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -177,24 +177,23 @@ def process_dump(pid, proc, indent=0, verbosity=3):
177177
rip = readfis(stack)
178178
rip_s = "{}".format(gdb.Value(rip).cast(void_ptr_type)).split()
179179
proc_dmp['rip'] = "{:>18s} {}".format(rip_s[0], " ".join(rip_s[1:]))
180-
if (verbosity > 2):
181-
pila_dmp = {}
182-
pila_dmp['start'] = "{:016x} \u279e {:x}):\n".format(vstack, stack)
183-
pila_dmp['cs'] = dump_selector(readfis(stack + 8))
184-
pila_dmp['rflags'] = dump_flags(readfis(stack + 16))
185-
pila_dmp['rsp'] = "{:#18x}".format(readfis(stack + 24))
186-
pila_dmp['ss'] = dump_selector(readfis(stack + 32))
187-
proc_dmp['pila_dmp'] = pila_dmp
188-
189-
reg_dmp ={}
190-
for i, r in enumerate(registers):
191-
reg_dmp[r] = hex(toi(proc['contesto'][i]))
192-
proc_dmp['reg_dmp'] = reg_dmp
180+
pila_dmp = {}
181+
pila_dmp['start'] = "{:016x} \u279e {:x}):\n".format(vstack, stack)
182+
pila_dmp['cs'] = dump_selector(readfis(stack + 8))
183+
pila_dmp['rflags'] = dump_flags(readfis(stack + 16))
184+
pila_dmp['rsp'] = "{:#18x}".format(readfis(stack + 24))
185+
pila_dmp['ss'] = dump_selector(readfis(stack + 32))
186+
proc_dmp['pila_dmp'] = pila_dmp
187+
188+
reg_dmp ={}
189+
for i, r in enumerate(registers):
190+
reg_dmp[r] = hex(toi(proc['contesto'][i]))
191+
proc_dmp['reg_dmp'] = reg_dmp
193192

194-
cr3 = toi(proc['cr3'])
195-
proc_dmp['cr3'] = vm_paddr_to_str(cr3)
193+
cr3 = toi(proc['cr3'])
194+
proc_dmp['cr3'] = vm_paddr_to_str(cr3)
196195

197-
# proc_dmp['nex_ist'] = show_lines(gdb.find_pc_line(rip), indent)
196+
# proc_dmp['nex_ist'] = show_lines(gdb.find_pc_line(rip), indent)
198197
if len(toshow) > 0:
199198
campi_aggiuntivi = {}
200199
for f in toshow:

prova_test/es2/nucleo/myfile.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"command": "process_list", "process": []}
1+
{"command": "process_list", "process": [{"pid": 0, "livello": "sistema", "corpo": "sistema:dummy(0)", "rip": " 0x20019a <halt+1>", "pila_dmp": {"start": "000000ffffffffa8 \u279e 475fa8):\n", "cs": "[SEL_CODICE_SISTEMA]", "rflags": "[IF IOPL=sistema]", "rsp": " 0xffffffffd8", "ss": "[SEL_NULLO]"}, "reg_dmp": {"rax": "0x1", "rcx": "0x0", "rdx": "0x0", "rbx": "0x0", "rsp": "0xffffffffa8", "rbp": "0xfffffffff0", "rsi": "0x0", "rdi": "0x0", "r8": "0x0", "r9": "0x0", "r10": "0x0", "r11": "0x0", "r12": "0x0", "r13": "0x0", "r14": "0x0", "r15": "0x0"}, "cr3": "0x00471000", "campi_aggiuntivi": {"barrier_id": ["4294967295"]}}, {"pid": 3, "livello": "sistema", "corpo": "io:estern_kbd(0)", "rip": " 0x1000000062b <estern_kbd(int)>", "pila_dmp": {"start": "000000ffffffffd0 \u279e 484fd0):\n", "cs": "[SEL_CODICE_SISTEMA]", "rflags": "[IF IOPL=sistema]", "rsp": " 0xfffffffff8", "ss": "[SEL_NULLO]"}, "reg_dmp": {"rax": "0x0", "rcx": "0x0", "rdx": "0x0", "rbx": "0x0", "rsp": "0xffffffffd0", "rbp": "0x0", "rsi": "0x0", "rdi": "0x0", "r8": "0x0", "r9": "0x0", "r10": "0x0", "r11": "0x0", "r12": "0x0", "r13": "0x0", "r14": "0x0", "r15": "0x0"}, "cr3": "0x00480000", "campi_aggiuntivi": {"barrier_id": ["4294967295"]}}, {"pid": 4, "livello": "sistema", "corpo": "io:estern_hd(0)", "rip": " 0x10000000f3f <estern_hd(int)>", "pila_dmp": {"start": "000000ffffffffd0 \u279e 489fd0):\n", "cs": "[SEL_CODICE_SISTEMA]", "rflags": "[IF IOPL=sistema]", "rsp": " 0xfffffffff8", "ss": "[SEL_NULLO]"}, "reg_dmp": {"rax": "0x0", "rcx": "0x0", "rdx": "0x0", "rbx": "0x0", "rsp": "0xffffffffd0", "rbp": "0x0", "rsi": "0x0", "rdi": "0x0", "r8": "0x0", "r9": "0x0", "r10": "0x0", "r11": "0x0", "r12": "0x0", "r13": "0x0", "r14": "0x0", "r15": "0x0"}, "cr3": "0x00485000", "campi_aggiuntivi": {"barrier_id": ["4294967295"]}}, {"pid": 6, "livello": "utente", "corpo": "utente:main_body(0)", "rip": "0xffff800000001c1b <delay+2>", "pila_dmp": {"start": "000000ffffffffd8 \u279e 47afd8):\n", "cs": "[SEL_CODICE_UTENTE]", "rflags": "[IF PF IOPL=sistema]", "rsp": "0xffffffffffffffc8", "ss": "[SEL_DATI_UTENTE]"}, "reg_dmp": {"rax": "0x7", "rcx": "0x3", "rdx": "0xffff800000009010", "rbx": "0x0", "rsp": "0xffffffffd8", "rbp": "0xfffffffffffffff0", "rsi": "0x0", "rdi": "0x1", "r8": "0x0", "r9": "0x0", "r10": "0x0", "r11": "0x0", "r12": "0x0", "r13": "0x0", "r14": "0x0", "r15": "0x0"}, "cr3": "0x00476000", "campi_aggiuntivi": {"barrier_id": ["4294967295"]}}]}

vscode-cpptools/Extension/src/nucleoweb.ts

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,43 @@ export class NucleoInfo {
111111

112112
private formatProcessList(){
113113
let processListJson = JSON.parse(this.process_list);
114-
114+
console.log(processListJson);
115115
let source = `
116-
<div>
117-
<h3 id="palle">Processi in esecuzione:</h3>
116+
<div>
117+
<h3 id="process_title">Processi in esecuzione:</h3>
118118
{{#each process}}
119-
{{#each this}}
120-
<p>{{@key}}: {{this}}</p>
121-
{{/each}}
119+
<h3 class="p-title"id="p-title-{{@key}}">Processo: {{@key}}</h3>
120+
<ul class="p-dump" id="p-list-{{@key}}">
121+
<li class="p-item" id="p-item-{{pid}}">Pid: {{pid}}</li>
122+
<li class="p-item" id="p-item-{{livello}}">Livello: {{livello}}</li>
123+
<li class="p-item" id="p-item-{{corpo}}">Corpo: {{corpo}}</li>
124+
<li class="p-item" id="p-item-{{rip}}">Rip: {{rip}}</li>
125+
<li class="p-ca-dump-list toggle" >Campi Aggiuntivi:
126+
<ul id="p-ca-list-{{@key}}">
127+
{{#each campi_aggiuntivi}}
128+
<li class="p-dmp-item">{{@key}}: {{this}}</li>
129+
{{/each}}
130+
</ul>
131+
</li>
132+
<li class="p-dump-list toggle" >Pila Dump:
133+
<ul id="p-pd-list">
134+
{{#each pila_dmp}}
135+
<li class="p-dmp-item">{{@key}}: {{this}}</li>
136+
{{/each}}
137+
</ul>
138+
</li>
139+
<li class="p-dump-list toggle" >Registers Dump:
140+
<ul id="p-rd-list">
141+
{{#each reg_dmp}}
142+
<li class="p-dmp-item">{{@key}}: {{this}}</li>
143+
{{/each}}
144+
</ul>
145+
</li>
146+
</ul>
122147
{{/each}}
123-
</div>
148+
</div>
124149
`;
125-
150+
126151
let template = Handlebars.compile(source);
127152
return template(processListJson);
128153
}
@@ -142,8 +167,6 @@ export class NucleoInfo {
142167
const stylesResetUri = this._panel.webview.asWebviewUri(styleResetPath);
143168
const stylesMainUri = this._panel.webview.asWebviewUri(stylesPathMainPath);
144169

145-
console.log("uwu");
146-
console.log(scriptUri);
147170
let sourceDocument = `
148171
<!DOCTYPE html>
149172
<html lang="en">
Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
1+
// @ts-nocheck
12
// This script will be run within the webview itself
23
// It cannot access the main VS Code APIs directly.
34

45
(function () {
5-
document.addEventListener("DOMContentLoaded", function(){
6-
6+
document.addEventListener('DOMContentLoaded', (event) => {
7+
// Toggle Campi Aggiuntivi
8+
const pCaDumpLists = document.querySelectorAll('.toggle');
9+
pCaDumpLists.forEach((pCaDumpList) => {
10+
pCaDumpList.addEventListener('click', (event) => {
11+
event.target.classList.toggle('toggled');
12+
});
13+
});
714
});
15+
816
}());

vscode-cpptools/Extension/src/webview/reset.css

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
html {
22
box-sizing: border-box;
33
font-size: 13px;
4+
font-family: ;
45
}
56

67
*,
78
*:before,
89
*:after {
910
box-sizing: inherit;
11+
color: white;
1012
}
1113

1214
body,
@@ -24,6 +26,19 @@ ul {
2426
font-weight: normal;
2527
}
2628

29+
.toggle:not(.toggled) * {
30+
display: none;
31+
}
32+
33+
.toggle:hover {
34+
color: aqua;
35+
cursor: pointer;
36+
}
37+
38+
.toggle ** {
39+
color: white;
40+
}
41+
2742
img {
2843
max-width: 100%;
2944
height: auto;

vscode-cpptools/Extension/src/webview/vscode.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ body {
1010
padding: 0 var(--container-padding);
1111
color: var(--vscode-foreground);
1212
font-size: var(--vscode-font-size);
13-
font-weight: var(--vscode-font-weight);
14-
font-family: var(--vscode-font-family);
13+
font-weight: 200;
14+
font-family: "monospace";
1515
background-color: var(--vscode-editor-background);
1616
}
1717

0 commit comments

Comments
 (0)