* Is bitstring support still useful?
@ 2009-07-17 14:33 Daniel Jacobowitz
2009-07-17 14:41 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2009-07-17 14:33 UTC (permalink / raw)
To: gdb, Pierre Muller
GDB contains both type (TYPE_CODE_BITSTRING) and expression
(OP_BITSTRING) support for bitstrings. This is in the way for some
bitfield changes I'd like to make, and before I spend time fixing it,
I'd like to know if it's still useful.
OP_BITSTRING is currently dead code. It's handled in a number of
places, but never generated.
TYPE_CODE_BITSTRING can be generated two ways: from OP_BITSTRING (so,
dead) or from the stabs reader. It's not generated from any other
symbol reader, including DWARF. Does this mean it's dead or that
there's something the DWARF reader should do?
For now, I'm going to remove support in my local tree.
Pierre, I've copied you because the most recent non-mechanical patch
related to bitstrings was yours, a long while ago:
2002-05-02 Pierre Muller <muller@ics.u-strasbg.fr>
* p-typeprint.c (pascal_type_print_base): Add support
for TYPE_CODE_STRING and TYPE_CODE_BITSTRING.
(I'm not sure you'll receive my mail directly, though - something
about the IPv6 addresses used by u-strasbg.fr causes my mail server a
lot of grief.)
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: Is bitstring support still useful?
2009-07-17 14:33 Is bitstring support still useful? Daniel Jacobowitz
@ 2009-07-17 14:41 ` Daniel Jacobowitz
2009-07-17 15:01 ` Jonas Maebe
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2009-07-17 14:41 UTC (permalink / raw)
To: gdb, Pierre Muller
On Fri, Jul 17, 2009 at 10:33:15AM -0400, Daniel Jacobowitz wrote:
> For now, I'm going to remove support in my local tree.
I'd better not... I just realized that I have a potential use for
this, in displaying packed bit arrays found in some device peripheral
registers.
I'd still like to know whether the existing support is used by any
language, though. If not, we can clean it up aggressively and remove
the stabs reader support for bitstrings. I suspect that it is mostly
copied and pasted from the removed Chill support.
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is bitstring support still useful?
2009-07-17 14:41 ` Daniel Jacobowitz
@ 2009-07-17 15:01 ` Jonas Maebe
2009-07-18 4:09 ` Daniel Jacobowitz
0 siblings, 1 reply; 5+ messages in thread
From: Jonas Maebe @ 2009-07-17 15:01 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb, Pierre Muller
On 17 Jul 2009, at 16:41, Daniel Jacobowitz wrote:
> I'd still like to know whether the existing support is used by any
> language, though. If not, we can clean it up aggressively and remove
> the stabs reader support for bitstrings. I suspect that it is mostly
> copied and pasted from the removed Chill support.
The Free Pascal Compiler uses it for bitpacked arrays (arrays whose
element sizes are not multiples of 8 bits), because there does not
appear to be any other way to represent them in stabs. I've also tried
@P, but that seemed to be ignored by gdb (and there is no reason why
it would mean bitpacked rather than e.g. bytepacked).
Bitpacked arrays are not used very much though, so if you can suggest
another way to generate Stabs debug information for them, that's fine
too (i.e., backwards compatibility is not that important in our case).
Jonas
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is bitstring support still useful?
2009-07-17 15:01 ` Jonas Maebe
@ 2009-07-18 4:09 ` Daniel Jacobowitz
2009-07-18 15:17 ` Jonas Maebe
0 siblings, 1 reply; 5+ messages in thread
From: Daniel Jacobowitz @ 2009-07-18 4:09 UTC (permalink / raw)
To: Jonas Maebe; +Cc: gdb, Pierre Muller
On Fri, Jul 17, 2009 at 05:00:54PM +0200, Jonas Maebe wrote:
> The Free Pascal Compiler uses it for bitpacked arrays (arrays whose
> element sizes are not multiples of 8 bits), because there does not
> appear to be any other way to represent them in stabs. I've also
> tried @P, but that seemed to be ignored by gdb (and there is no
> reason why it would mean bitpacked rather than e.g. bytepacked).
>
> Bitpacked arrays are not used very much though, so if you can suggest
> another way to generate Stabs debug information for them, that's fine
> too (i.e., backwards compatibility is not that important in our
> case).
Does this compiler support DWARF, and if so, how do you represent them
there?
--
Daniel Jacobowitz
CodeSourcery
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Is bitstring support still useful?
2009-07-18 4:09 ` Daniel Jacobowitz
@ 2009-07-18 15:17 ` Jonas Maebe
0 siblings, 0 replies; 5+ messages in thread
From: Jonas Maebe @ 2009-07-18 15:17 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb, Pierre Muller
On 18 Jul 2009, at 06:09, Daniel Jacobowitz wrote:
> Does this compiler support DWARF,
Yes.
> and if so, how do you represent them
> there?
type
ta = bitpacked array[1..10] of 0..2;
becomes:
0x0000007d: TAG_array_type [5] *
AT_name( "TA" )
AT_byte_size( 0x00000003 )
AT_bit_stride( 0x00000002 )
AT_type( {0x00000094} ( subrange BYTE ) )
0x00000087: TAG_subrange_type [6]
AT_lower_bound( 0x00000001 )
AT_upper_bound( 0x0000000a )
AT_type( {0x000000a0} ( SHORTINT ) )
0x0000008e: NULL
gdb does not handle this yet though (DW_AT_bit_stride is unsupported
in dwarf2read.c). Printing a variable of this type therefore prints it
as if it were an array of 10 bytes. But at least the concept is
representable in DWARF-3, and it just needs fixes in the DWARF reader
(and possibly in the Pascal printer).
Jonas
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-07-18 15:17 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-17 14:33 Is bitstring support still useful? Daniel Jacobowitz
2009-07-17 14:41 ` Daniel Jacobowitz
2009-07-17 15:01 ` Jonas Maebe
2009-07-18 4:09 ` Daniel Jacobowitz
2009-07-18 15:17 ` Jonas Maebe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox