* [RFC] mdebugread.c: Fix IRIX segfault
@ 2003-03-18 20:57 Kevin Buettner
2003-03-19 19:52 ` Kevin Buettner
0 siblings, 1 reply; 2+ messages in thread
From: Kevin Buettner @ 2003-03-18 20:57 UTC (permalink / raw)
To: gdb-patches
I recently discovered that a simple "Hello, world" program would cause
gdb to segfault when compiled with the Irix compiler for the o32 ABI.
The change which cause this breakage in gdb is due to Joel's Jan 3
change to mdebugread.c.
It appears that the symbols in my o32 Irix binary don't use the
convention that Joel is relying upon to terminate the loop which
counts the fields. However, it does appear that simply looking for an
iss of 0 is sufficient to terminate the search. The documentation
that I've been able to locate about mdebug indicates that index 0 in
in the string tables will be the null string. I'm using David
Anderson's doc dated August 30, 1995.
Any comments on the following patch?
mdebugread.c is maintainerless, right? If not, I'll need approval from
the maintainer to check this in.
* mdebugread.c (parse_symbol): For stEnd, we're done counting
when iss is 0.
Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.43
diff -u -p -r1.43 mdebugread.c
--- mdebugread.c 25 Feb 2003 21:36:18 -0000 1.43
+++ mdebugread.c 18 Mar 2003 20:42:33 -0000
@@ -916,9 +916,13 @@ parse_symbol (SYMR *sh, union aux_ext *a
method whose name is identical to the class name
(in particular constructor method names are different
from the class name). There is therefore no risk that
- this check stops the count on the StEnd of a method. */
- if (strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss,
- name) == 0)
+ this check stops the count on the StEnd of a method.
+
+ Also, assume that we're really at the end when tsym.iss
+ is 0. (An iss of zero points at the null string.) */
+ if (tsym.iss == 0
+ || strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss,
+ name) == 0)
goto end_of_fields;
break;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [RFC] mdebugread.c: Fix IRIX segfault
2003-03-18 20:57 [RFC] mdebugread.c: Fix IRIX segfault Kevin Buettner
@ 2003-03-19 19:52 ` Kevin Buettner
0 siblings, 0 replies; 2+ messages in thread
From: Kevin Buettner @ 2003-03-19 19:52 UTC (permalink / raw)
To: gdb-patches
I made some small changes to the patch based on some feedback from Joel.
(Joel recommended that issNull be used instead of 0.) Joel also took a
look at the debug info which was problematic before. As I understand it,
my patch should not cause any new difficulties with that code.
I've just committed the patch below.
* mdebugread.c (parse_symbol): For stEnd, we're done counting
when iss is issNull.
Index: mdebugread.c
===================================================================
RCS file: /cvs/src/src/gdb/mdebugread.c,v
retrieving revision 1.43
diff -u -p -r1.43 mdebugread.c
--- mdebugread.c 25 Feb 2003 21:36:18 -0000 1.43
+++ mdebugread.c 19 Mar 2003 19:44:36 -0000
@@ -916,9 +916,13 @@ parse_symbol (SYMR *sh, union aux_ext *a
method whose name is identical to the class name
(in particular constructor method names are different
from the class name). There is therefore no risk that
- this check stops the count on the StEnd of a method. */
- if (strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss,
- name) == 0)
+ this check stops the count on the StEnd of a method.
+
+ Also, assume that we're really at the end when tsym.iss
+ is 0 (issNull). */
+ if (tsym.iss == issNull
+ || strcmp (debug_info->ss + cur_fdr->issBase + tsym.iss,
+ name) == 0)
goto end_of_fields;
break;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-03-19 19:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-18 20:57 [RFC] mdebugread.c: Fix IRIX segfault Kevin Buettner
2003-03-19 19:52 ` Kevin Buettner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox