From: Tom de Vries <tdevries@suse.de>
To: Tom Tromey <tom@tromey.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2 6/7] [gdb/tui] Handle section holes when forward disassembling
Date: Mon, 21 Sep 2026 23:29:53 +0200 [thread overview]
Message-ID: <255d0dd3-6b7e-4bfc-800a-2aedfecbdcab@suse.de> (raw)
In-Reply-To: <87ld97y6na.fsf@tromey.com>
On 9/11/26 8:39 PM, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
>
> Tom> + struct obj_section *next;
> Tom> + struct obj_section *section
> Tom> + = find_pc_section (pc, nullptr, &next);
> Tom> + if (section == nullptr
> Tom> + && next != nullptr
> Tom> + && ((bfd_section_flags (next->the_bfd_section) & SEC_ALLOC)
>
> I'm not sure this is the best test. SEC_ALLOC can be set for data
> sections as well; e.g. from 'objdump -h' on gdb:
>
> 13 .rodata 00dc0acc 0000000001064d80 0000000001064d80 00c64d80 2**7
> CONTENTS, ALLOC, LOAD, READONLY, DATA
>
> Probably you want SEC_CODE or maybe SEC_ALLOC|SEC_CODE, though I don't
> know if you can ever have code that isn't also 'alloc' (like, what would
> be the point).
>
That was my approach in v1, but it got comments [1], so I'm leaving that
for now.
> Then there's the issue that presumably you want to find the next code
> section -- but if code and data are interleaved, find_pc_section won't
> necessarily return this.
I've come up with a new approach ( v3:
https://sourceware.org/pipermail/gdb-patches/2026-September/230515.html
): build an addrmap mirroring what find_pc_section does.
The v3 introduces a function disassemble_skip_sections. If we indeed
decide that we don't want to disassemble data sections, then it should
be easy to address that in there, having effect for all disassembling
(CLI forward, TUI forward/backward).
Thanks,
- Tom
[1] https://sourceware.org/pipermail/gdb-patches/2026-September/230069.html
next prev parent reply other threads:[~2026-09-21 21:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 9:48 [PATCH v2 0/7] [gdb/tui] Some section hole handling fixes Tom de Vries
2026-09-09 9:48 ` [PATCH v2 1/7] [gdb/tui] Improve tui_disassemble comment Tom de Vries
2026-09-09 9:48 ` [PATCH v2 2/7] [gdb/tui] Fix underflow in tui_find_backward_disassembly_start_address Tom de Vries
2026-09-11 18:12 ` Tom Tromey
2026-09-11 18:14 ` Tom Tromey
2026-09-09 9:48 ` [PATCH v2 3/7] [gdb/tui] Improve section handling " Tom de Vries
2026-09-11 18:26 ` Tom Tromey
2026-09-14 7:31 ` Tom de Vries
2026-09-19 16:01 ` Tom de Vries
2026-09-09 9:48 ` [PATCH v2 4/7] [gdb] replace bsearch with std::lower_bound in find_pc_section Tom de Vries
2026-09-11 18:19 ` Tom Tromey
2026-09-14 7:34 ` Tom de Vries
2026-09-09 9:48 ` [PATCH v2 5/7] [gdb] Add prev/next params to find_pc_section Tom de Vries
2026-09-11 18:40 ` Tom Tromey
2026-09-09 9:48 ` [PATCH v2 6/7] [gdb/tui] Handle section holes when forward disassembling Tom de Vries
2026-09-11 18:39 ` Tom Tromey
2026-09-21 21:29 ` Tom de Vries [this message]
2026-09-23 15:51 ` Tom Tromey
2026-09-09 9:48 ` [PATCH v2 7/7] [gdb/tui] Handle section holes when backward disassembling Tom de Vries
2026-09-11 18:48 ` Tom Tromey
2026-09-19 21:45 ` Tom de Vries
2026-09-11 18:52 ` [PATCH v2 0/7] [gdb/tui] Some section hole handling fixes Tom Tromey
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=255d0dd3-6b7e-4bfc-800a-2aedfecbdcab@suse.de \
--to=tdevries@suse.de \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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