* Double ';' problem in stabs
@ 2001-12-28 1:44 debashis mahata
2002-01-03 20:22 ` Andrew Cagney
2002-01-04 11:45 ` Elena Zannoni
0 siblings, 2 replies; 3+ messages in thread
From: debashis mahata @ 2001-12-28 1:44 UTC (permalink / raw)
To: gdb
[-- Attachment #1: Type: text/plain, Size: 1756 bytes --]
Hi all,
This problem was observed while using Gdb on code that is
compiled with Sun C Compiler Forte 6 update 2.( cc - 5.3)
While going through the Gdb code, I have noticed one issue
in handling stabs for a structure / union, looks like some
assumptions has been made about the format, which is not
documented. The assumption made is - the structure or union
stabs should end with two consecutive semicolon i.e. ';;'.
One example (using Sun compiler) - For the structure
struct node{
int I;
char C;
};
the generated stab is - "node:T(0,21)=s8I:(0,3),0,32;C:(0,1),32,8;;"
where,
$cc -V
cc: WorkShop Compilers 5.0 98/12/15 C 5.0
You can see that the stab has two consecutive ';' at the
end. But the last ';' is not documented in Sun stab document.
Neither the Gdb stab document says that the last ';' should be
present. The code is in file stabsread.c (function:
read_struct_fields()), where Gdb searches for the last ';'.
The corresponding code is -
/* Read each data member type until we find the terminating ';' at the
end
of
the data member list, or break for some other reason such as
finding
the
start of the member function list. */
while (**pp != ';')
{
.....
Some compilers does not generates the last ';'. For the
above mentioned example and using the
$cc -V
cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15
compiler the generated stab is -
"node:T(0,21)=s8I:(0,3),0,32;C:(0,1),32,8;"
In this example the last ';'is missing.
Questions:
1. Is it anywhere documented that the last ';' (the second one) should
be present?
2. If not, is it a bug (the assumption that last ';' should
be persent) in Gdb, which requires a fix?
3. In case a fix is required what will be the long term strategy?
Thanks in advance,
debashis
[-- Attachment #2: InterScan_Disclaimer.txt --]
[-- Type: text/plain, Size: 855 bytes --]
-------------------------------------------------------------------------------------------------------------------------
Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
is intended for use only by the individual or entity to which it is
addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If you are not the intended
recipient or it appears that this mail has been forwarded to you without
proper authority, you are notified that any use or dissemination of this
information in any manner is strictly prohibited. In such cases, please
notify us immediately at mailto:mailadmin@wipro.com and delete this mail
from your records.
----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Double ';' problem in stabs
2001-12-28 1:44 Double ';' problem in stabs debashis mahata
@ 2002-01-03 20:22 ` Andrew Cagney
2002-01-04 11:45 ` Elena Zannoni
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cagney @ 2002-01-03 20:22 UTC (permalink / raw)
To: debashis mahata; +Cc: gdb, Elena Zannoni
> Questions:
> 1. Is it anywhere documented that the last ';' (the second one) should
> be present?
> 2. If not, is it a bug (the assumption that last ';' should
> be persent) in Gdb, which requires a fix?
> 3. In case a fix is required what will be the long term strategy?
I'd treat it as a GDB bug - even if someone could find a spec indicating
that Sun's compiler is producing bad STABS, GDB should still be handling
them. Could I suggest at least filing a bug report at
http://sources.redhat.com/gdb/bugs/
enjoy,
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Double ';' problem in stabs
2001-12-28 1:44 Double ';' problem in stabs debashis mahata
2002-01-03 20:22 ` Andrew Cagney
@ 2002-01-04 11:45 ` Elena Zannoni
1 sibling, 0 replies; 3+ messages in thread
From: Elena Zannoni @ 2002-01-04 11:45 UTC (permalink / raw)
To: debashis mahata; +Cc: gdb
Debashis,
I have committed the suggested fix.
http://sources.redhat.com/ml/gdb-patches/2002-01/msg00035.html
Thanks
Elena
debashis mahata writes:
> Hi all,
>
> This problem was observed while using Gdb on code that is
> compiled with Sun C Compiler Forte 6 update 2.( cc - 5.3)
>
> While going through the Gdb code, I have noticed one issue
> in handling stabs for a structure / union, looks like some
> assumptions has been made about the format, which is not
> documented. The assumption made is - the structure or union
> stabs should end with two consecutive semicolon i.e. ';;'.
>
> One example (using Sun compiler) - For the structure
> struct node{
> int I;
> char C;
> };
> the generated stab is - "node:T(0,21)=s8I:(0,3),0,32;C:(0,1),32,8;;"
> where,
> $cc -V
> cc: WorkShop Compilers 5.0 98/12/15 C 5.0
>
> You can see that the stab has two consecutive ';' at the
> end. But the last ';' is not documented in Sun stab document.
> Neither the Gdb stab document says that the last ';' should be
> present. The code is in file stabsread.c (function:
> read_struct_fields()), where Gdb searches for the last ';'.
> The corresponding code is -
>
> /* Read each data member type until we find the terminating ';' at the
> end
> of
> the data member list, or break for some other reason such as
> finding
> the
> start of the member function list. */
>
> while (**pp != ';')
> {
> .....
>
> Some compilers does not generates the last ';'. For the
> above mentioned example and using the
> $cc -V
> cc: Sun WorkShop 6 update 2 C 5.3 2001/05/15
>
> compiler the generated stab is -
> "node:T(0,21)=s8I:(0,3),0,32;C:(0,1),32,8;"
>
> In this example the last ';'is missing.
>
> Questions:
> 1. Is it anywhere documented that the last ';' (the second one) should
> be present?
> 2. If not, is it a bug (the assumption that last ';' should
> be persent) in Gdb, which requires a fix?
> 3. In case a fix is required what will be the long term strategy?
>
> Thanks in advance,
> debashis
> -------------------------------------------------------------------------------------------------------------------------
> Information transmitted by this E-MAIL is proprietary to Wipro and/or its Customers and
> is intended for use only by the individual or entity to which it is
> addressed, and may contain information that is privileged, confidential or
> exempt from disclosure under applicable law. If you are not the intended
> recipient or it appears that this mail has been forwarded to you without
> proper authority, you are notified that any use or dissemination of this
> information in any manner is strictly prohibited. In such cases, please
> notify us immediately at mailto:mailadmin@wipro.com and delete this mail
> from your records.
> ----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2002-01-04 19:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-12-28 1:44 Double ';' problem in stabs debashis mahata
2002-01-03 20:22 ` Andrew Cagney
2002-01-04 11:45 ` Elena Zannoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox