This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libgcj/5669: gij not debuggable by gdb
- From: toddastock at yahoo dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: Tue, 12 Feb 2002 09:56:05 -0800
- Subject: libgcj/5669: gij not debuggable by gdb
>Number: 5669
>Category: libgcj
>Synopsis: gij not debuggable by gdb
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Feb 12 09:56:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:
>Release: 3.1 20020211 (experimental)
>Organization:
>Environment:
System: Linux escher 2.4.9-21 #1 Thu Jan 17 14:16:30 EST 2002 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --enable-threads=posix --prefix=/home/tstock/local --disable-shared --enable-languages=c++,java
>Description:
The code is not debuggable when running with gdb from redhat: 'GNU gdb Red Hat Linux (5.1-0.71)'.
>How-To-Repeat:
Start up a gdb session and step into compute_argument_types then step out. The memory location for type is scribbled on. Technically I thought and according to my C++ books that passing type as an argument to the function call required the function to use the C++ syntax of the unary '&'. I forget the term for this..
That is to say:
int main( ) {
int x;
test( x );
}
int test( &x ) {
x = 1;
}
However using the unary '&' doesn't work on an array of struct type.
>Fix:
It is not very elegent, but does work.
Index: libjava/verify.cc
===================================================================
RCS file: /cvsroot/gcc/gcc/libjava/verify.cc,v
retrieving revision 1.35
diff -r1.35 verify.cc
1946,1947c1946,1947
< void compute_argument_types (_Jv_Utf8Const *signature,
< type *types)
---
> type *compute_argument_types (_Jv_Utf8Const *signature,
> int arg_count)
1948a1949,1950
> if( arg_count == 0 ) return NULL;
> type *types=new type[arg_count];
1955a1958
> return types;
1997,1998c2000
< type arg_types[arg_count];
< compute_argument_types (current_method->self->signature, arg_types);
---
> type *arg_types = compute_argument_types( current_method->self->signature, arg_count );
2006a2009,2010
> delete []arg_types;
>
2750,2751c2754
< type arg_types[arg_count];
< compute_argument_types (method_signature, arg_types);
---
> type *arg_types = compute_argument_types( method_signature, arg_count );
2758a2762
> delete []arg_types;
>Release-Note:
>Audit-Trail:
>Unformatted: