Repository navigation
Web mode: hex view of the last dump (#85) - #88
Conversation
Under the status registers: address, bytes and ASCII, 16 bytes a row, 512 bytes a page, 00 and FF dim; Prev, Next and Go to an address in hex. /dumps/<file> takes Range: bytes=A-B or A- and answers 206 with Content-Range, 416 past the end; several ranges give the whole file, as before. A dump of any size opens at once. Part of #85.
PR Summary by QodoAdd a paged hex view for web-mode dumps
AI Description
Diagram
High-Level Assessment
Files changed (8)
|
Code Review by Qodo
1.
|
Each load gets a number; an answer that comes after a newer request (fast paging, or a new dump while a part was coming) is dropped, so the bytes, the address and the buttons stay of the same page.
|
Fixed in 5ad972c: Old dump pages overwrite the current view. Each |
|
/review |
The Range of a dump request is looked for among the headers only, not in bytes that came after them; a second Range header makes it the whole file, as several ranges in one header do.
|
Fixed in 331b1af: Some full dump requests return a slice. |
|
/review |
…paces Go takes up to 12 hex digits and an address below the dump size: a huge number became 1e+20 in the Range, which the server took as no range and sent the whole dump. Past the end nothing is asked and the last address is told; a 416 (a dump that changed) goes back to page 0. The server skips tabs before the range and blanks after it.
|
All three findings are fixed in 2d6b30a:
All tests pass. native, |
|
/review |
|
Both new findings on 2d6b30a are minor edge cases of the view. They are not fixed in this PR and go into a small follow-up:
Neither can write to the chip or send the whole dump: every request is still a 512-byte range inside the known size. |
Part of #85: the classic hex view, web mode first.
fileof the state), 512 bytes a page. Each row has the address, 16 bytes with a gap after 8, and the ASCII. 00 and FF bytes are dim. There are Prev and Next buttons, and Go to an address in hex (0x1F000or1F000), aligned down to 16. Colours are the existing page tokens only: amber addresses, ink bytes, dim ASCII. The file-name plate keeps its case./dumps/<file>takesRange: bytes=A-Borbytes=A-. It answers206withContent-Range, or416withContent-Range: bytes */Nwhen A is past the end. A range past the end is cut at the end. Several ranges, a suffix range or another unit get the whole file, as before. Full responses now sendAccept-Ranges: bytes. The page reads only the 512 bytes it shows, so a 512 MB dump opens at once.Tests:
LIBUSB=1and musl x86_64/arm/mipsel/mips, all with 0 warnings.Range: bytes=0-511gave206,Content-Range: bytes 0-511/33554432;xxdof the dump (4E 86 82 4B 39 D0 C3 1A …), at 900 px and at 390 px (the table scrolls inside the panel).