Content-Length: 301707 | pFad | http://github.com/cyrus-and/gdb-dashboard/pull/306/commits/023329226345714b90f52b1e842aee3c7ade8498

A1 rewrite memory module to use GDB's "x" output by nwlyoc · Pull Request #306 · cyrus-and/gdb-dashboard · GitHub
Skip to content

rewrite memory module to use GDB's "x" output #306

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
improve address formatting for instructions and strings
  • Loading branch information
nwlyoc committed Dec 18, 2023
commit 023329226345714b90f52b1e842aee3c7ade8498
19 changes: 11 additions & 8 deletions .gdbinit
Original file line number Diff line number Diff line change
Expand Up @@ -1891,8 +1891,14 @@ class Memory(Dashboard.Module):
self.object_size)
else:
elem = str(memory[rel])
# save strlen because ANSI escape sequences are added later
elem_cont = [elem, len(elem)]
if self.object_base == 'i' or self.object_base == 's':
# instructions and strings need no padding, but address
# should be separated for formatting
addr_sep = elem.index(':')
elem_cont = [elem[addr_sep+1:], ansi(elem[:addr_sep+1], R.style_low)]
else:
# save strlen to calculate padding because ANSI is added later
elem_cont = [elem, len(elem)]
# differences against the latest have the highest priority
if self.latest and memory[rel] != self.latest[rel]:
elem_cont[0] = ansi(elem_cont[0], R.style_selected_1)
Expand All @@ -1915,12 +1921,9 @@ class Memory(Dashboard.Module):
for elem_cont in elems:
# instructions and strings are left aligned and on a single line
if self.object_base == 'i' or self.object_base == 's':
# address is included in element, format differently
addr_sep = elem_cont[0].index(':')
line += '{}{}{}'.format(' ' * separation,
ansi(elem_cont[0][:addr_sep+1], R.style_low),
elem_cont[0][addr_sep+1:])
#line = '{}'.format(ansi(address_str, R.style_low))
elem_cont[1],
elem_cont[0])
else:
line += '{}{}{}'.format(' ' * separation,
' ' * (elem_length - elem_cont[1]),
Expand Down Expand Up @@ -1959,7 +1962,7 @@ class Memory(Dashboard.Module):
for i in range(0, len(memory), per_line_current):
pad = per_line_current - len(memory[i:i + per_line_current])
raw = self.format_compute_changes(memory, i, per_line_current, False)
# TODO instruction and string format don't have fixed size, so
# instruction and string format don't have fixed size, so
# address can't be calculated
if self.object_base == 'i' or self.object_base == 's':
line = ''
Expand Down








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/cyrus-and/gdb-dashboard/pull/306/commits/023329226345714b90f52b1e842aee3c7ade8498

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy