From: Tom Tromey <tromey@adacore.com>
To: Simon Farre via Gdb-patches <gdb-patches@sourceware.org>
Cc: Simon Farre <simon.farre.cx@gmail.com>, tromey@adacore.com
Subject: Re: [PATCH v5] gdb/DAP Fix disassemble bug
Date: Fri, 28 Jul 2023 12:22:21 -0600 [thread overview]
Message-ID: <87pm4bhp5u.fsf@tromey.com> (raw)
In-Reply-To: <20230712184519.182460-1-simon.farre.cx@gmail.com> (Simon Farre via Gdb-patches's message of "Wed, 12 Jul 2023 20:45:19 +0200")
>>>>> "Simon" == Simon Farre via Gdb-patches <gdb-patches@sourceware.org> writes:
Thanks again for working on this.
I'm sorry it took so long for me to get back to it.
Simon> +# Disassemble "backwards"
Simon> +def _disasm_backwards(
This should be marked @in_gdb_thread.
Simon> + # We take an arbitrary jump backwards
Simon> + # Guessing that an instruction averages at 8 bytes
Simon> + start = end_pc - 4 * offset
I don't understand the relation between the comment and the code
here... I thought it was just a typo but later 8 is used, so I don't
know.
Simon> + tmp = []
Simon> + # fill remaining ins with "invalid values" as per DAP spec
Simon> + for i in range(0, offset - len(instructions)):
Simon> + tmp.append({"addr": 0, "asm": "unknown"})
I guess this could be:
tmp = [{"addr": 0, "asm": "unknown"}] * (offset - len(instructions))
Tom
prev parent reply other threads:[~2023-07-28 18:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-12 18:45 Simon Farre
2023-07-28 18:22 ` Tom Tromey [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pm4bhp5u.fsf@tromey.com \
--to=tromey@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.farre.cx@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).