* Question re symbols, symtabs and blocks
@ 2024-08-28 10:08 Jan Vrany via Gdb
2024-08-29 14:41 ` Simon Marchi via Gdb
0 siblings, 1 reply; 3+ messages in thread
From: Jan Vrany via Gdb @ 2024-08-28 10:08 UTC (permalink / raw)
To: GDB mailing list
Hi,
in GDB, are there any constraints for blocks belonging to
to particular symtab? Like: must each blocks' start and end address
be within its superblocks' start and end address?
Also, must blocks of different symtabs be always disjunct
(meaning, their start-end ranges must not overlap)?
Here by "must" I mean "the code expects that and if
it does not hold, behavior is undefined".
Thanks! Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question re symbols, symtabs and blocks
2024-08-28 10:08 Question re symbols, symtabs and blocks Jan Vrany via Gdb
@ 2024-08-29 14:41 ` Simon Marchi via Gdb
2024-09-03 12:38 ` Jan Vrany via Gdb
0 siblings, 1 reply; 3+ messages in thread
From: Simon Marchi via Gdb @ 2024-08-29 14:41 UTC (permalink / raw)
To: Jan Vrany, GDB mailing list
On 2024-08-28 06:08, Jan Vrany via Gdb wrote:
> Hi,
>
> in GDB, are there any constraints for blocks belonging to
> to particular symtab? Like: must each blocks' start and end address
> be within its superblocks' start and end address?
This is how my mental model works, that children blocks must be entirely
within their parents (even considering that blocks may be
non-contiguous), but I don't have proof of that. It's just what would
make sense to me.
> Also, must blocks of different symtabs be always disjunct
> (meaning, their start-end ranges must not overlap)?
What kind of symtab are you talking about? "struct symtab" or "struct
compunit_symtab"? I don't think that blocks care about "struct symtab".
However, blocks are part of a blockvector, and each compunit_symtab has
its own blockvector. So my intuition is that blocks belonging to
different compunit_symtabs should be disjoint, as compilation unit
address ranges are typically disjoints. But then I don't know if there
are weird cases, for instance I don't know how LTO affects this, if
compilation units start sharing some code.
Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Question re symbols, symtabs and blocks
2024-08-29 14:41 ` Simon Marchi via Gdb
@ 2024-09-03 12:38 ` Jan Vrany via Gdb
0 siblings, 0 replies; 3+ messages in thread
From: Jan Vrany via Gdb @ 2024-09-03 12:38 UTC (permalink / raw)
To: GDB mailing list; +Cc: Simon Marchi
On Thu, 2024-08-29 at 10:41 -0400, Simon Marchi wrote:
>
> On 2024-08-28 06:08, Jan Vrany via Gdb wrote:
>
> > Hi,
> >
> > in GDB, are there any constraints for blocks belonging to
> > to particular symtab? Like: must each blocks' start and end address
> > be within its superblocks' start and end address?
>
>
> This is how my mental model works, that children blocks must be
entirely
> within their parents (even considering that blocks may be
> non-contiguous), but I don't have proof of that. It's just what
would
> make sense to me.
Thanks, it makes sense.
>
> > Also, must blocks of different symtabs be always disjunct
> > (meaning, their start-end ranges must not overlap)?
>
>
> What kind of symtab are you talking about? "struct symtab" or "struct
> compunit_symtab"? I don't think that blocks care about "struct
symtab".
Sorry. I meant compunit_symtab.
> However, blocks are part of a blockvector, and each compunit_symtab
has
> its own blockvector. So my intuition is that blocks belonging to
> different compunit_symtabs should be disjoint, as compilation unit
> address ranges are typically disjoints.
> But then I don't know if there
> are weird cases,
Yeah, I have somewhat weird use case where I have an
executable that contains a static buffer which
is at runtime filled with with JIT-compiled code.
In order to debug that jitted code, I create
compunit_symtab, block, symtab, linetable and
all that and for example "b jitted_function" but
"disass jitted_function" disassembles the whole
buffer. But looking at code more closely, it seems
"disass" uses different way to figure out what range
to disassemble.
Anyways, I'll try to rework the code to add blocks for
jitted code to the existing compunit_symtab rather than
creating new one.
Thanks!
Jan
> for instance I don't know how LTO affects this, if
> compilation units start sharing some code.
>
> Simon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-03 12:39 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-28 10:08 Question re symbols, symtabs and blocks Jan Vrany via Gdb
2024-08-29 14:41 ` Simon Marchi via Gdb
2024-09-03 12:38 ` Jan Vrany via Gdb
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox