osdir.com
mailing list archive F.A.Q. -since 2001!



Subject: gcj/gdb problem -- can't find source file -
msg#00101

List: gcc.help

Mail Archive Navigation:
by Date: Prev Next Date Index by Thread: Prev Next Thread Index



I am trying to use gdb with gcj. I have read the faq and the help file
available (http://gcc.gnu.org/java/gdb.html) and tried to search the
mailing list but haven't succeeded.

gdb appears not to find the source file so that the user can't follow
in the source file where execution is happening or examine local
variables.

The session below illustrates the problem (I also tried compiling the
Java source with gcj directly).

I am using the following versions
gcj (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
GNU gdb Red Hat Linux (5.2.1-4)

(and used slightly older versions on a RH7 machine to get the same)

Any help gratefully appreciated,

Thanks

Scott




[ug]$ javac -g Lab2a1.java
[ug]$ gcj -g -o Lab2a1 --main=Lab2a1 Lab2a1.class
[ug]$ gdb Lab2a1
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
(gdb) break main
Breakpoint 1 at 0x8048b04: file /tmp/ccO9DjzS.i, line 10.
(gdb) run
Starting program: /home/students/coms200f/labs/lab2/Lab2a1
[New Thread 8192 (LWP 28072)]
[Switching to Thread 8192 (LWP 28072)]

Breakpoint 1, main (argc=1, argv=0xbffffc34) at /tmp/ccO9DjzS.i:10
10 /tmp/ccO9DjzS.i: No such file or directory.
in /tmp/ccO9DjzS.i
(gdb) print a
No symbol "a" in current context.
(gdb) next



Thread at a glance:

Previous Message by Date:

problems compiling GCJ 3.2.3 on PC Cygwin; error with prims.cc

I am having problems compiling GCJ for PC Cygwin. The prims.cc file is the culprit. I see a lot of comments in various mailing lists and forums, concerning the prims.cc file, but none have lead me a solution. I am including the configure flags used and the resulting make listing below, which leads up to the problem in question. Thanks in advance for any/all assistance. -John Vrab Platform specifics are as follows: Compaq DeskPro, 1GHz, 256MB RAM, WIndows 2000 SP3.

Next Message by Date:

hash_map error: passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers

Have you ever seen this error?, it means that I pass a pointer to a constant object out of it's protected context. Yes I cast it down to a normal pointer indeed. The pointer is actually casted to an integer. I'm keeping a hash of memory adresses with the adresses of kopies of the objects these adresses refer too. So I do not alter this const pointer. Here is the code: //hash function object for the Mem_hash class int_adr {public: const size_t operator()(const Port* const a) { int i; /*haha, fooled ya*/ here is the fooling part that actually works on other compilers const Port * const s= a;//(Port *)a; i=(int)s; return i; } }; //hash of memory adresses typedef std::hash_map< const Port *, Port *, int_adr , equal_to <const Port * > > Mem_hash; all these const identifiers are required by hash_map, the non-standard gnu stl-extension. I don't wnat to change code that works with other compilers I need some compiler option or something to disable the error. error mess: gcc -g -c -I/sw/pkg/gcc-2.95.2/include/g++-3 -I./loki main.cpp stl_hashtable.h: In method `size_t hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::_M_bkt_num_key(const lambda_calculus::Port *const &, unsigned int) const': stl_hashtable.h:536: instantiated from `hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::_M_bkt_num(const pair<const lambda_calculus::Port *const,lambda_calculus::Port *> &, unsigned int) const' stl_hashtable.h:930: instantiated from `hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::resize(unsigned int)' stl_hashtable.h:744: instantiated from `hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::find_or_insert(const pair<const lambda_calculus::Port *const,lambda_calculus::Port *> &)' stl_hash_map.h:181: instantiated from here stl_hashtable.h:531: passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers make: *** [main.o] Error 1 if you do got an idea please respond to buggy@xxxxxxxxx or to the list thanks ali

Previous Message by Thread:

problems compiling GCJ 3.2.3 on PC Cygwin; error with prims.cc

I am having problems compiling GCJ for PC Cygwin. The prims.cc file is the culprit. I see a lot of comments in various mailing lists and forums, concerning the prims.cc file, but none have lead me a solution. I am including the configure flags used and the resulting make listing below, which leads up to the problem in question. Thanks in advance for any/all assistance. -John Vrab Platform specifics are as follows: Compaq DeskPro, 1GHz, 256MB RAM, WIndows 2000 SP3.

Next Message by Thread:

hash_map error: passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers

Have you ever seen this error?, it means that I pass a pointer to a constant object out of it's protected context. Yes I cast it down to a normal pointer indeed. The pointer is actually casted to an integer. I'm keeping a hash of memory adresses with the adresses of kopies of the objects these adresses refer too. So I do not alter this const pointer. Here is the code: //hash function object for the Mem_hash class int_adr {public: const size_t operator()(const Port* const a) { int i; /*haha, fooled ya*/ here is the fooling part that actually works on other compilers const Port * const s= a;//(Port *)a; i=(int)s; return i; } }; //hash of memory adresses typedef std::hash_map< const Port *, Port *, int_adr , equal_to <const Port * > > Mem_hash; all these const identifiers are required by hash_map, the non-standard gnu stl-extension. I don't wnat to change code that works with other compilers I need some compiler option or something to disable the error. error mess: gcc -g -c -I/sw/pkg/gcc-2.95.2/include/g++-3 -I./loki main.cpp stl_hashtable.h: In method `size_t hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::_M_bkt_num_key(const lambda_calculus::Port *const &, unsigned int) const': stl_hashtable.h:536: instantiated from `hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::_M_bkt_num(const pair<const lambda_calculus::Port *const,lambda_calculus::Port *> &, unsigned int) const' stl_hashtable.h:930: instantiated from `hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::resize(unsigned int)' stl_hashtable.h:744: instantiated from `hashtable<pair<const lambda_calculus::Port *const,lambda_calculus::Port *>,const lambda_calculus::Port *,lambda_calculus::int_adr,_Select1st<pair<const lambda_calculus::Port *const,lambda_calculus::Port *> >,equal_to<const lambda_calculus::Port *>,allocator<lambda_calculus::Port *> >::find_or_insert(const pair<const lambda_calculus::Port *const,lambda_calculus::Port *> &)' stl_hash_map.h:181: instantiated from here stl_hashtable.h:531: passing `const lambda_calculus::int_adr' as `this' argument of `const size_t lambda_calculus::int_adr::operator ()(const lambda_calculus::Port *)' discards qualifiers make: *** [main.o] Error 1 if you do got an idea please respond to buggy@xxxxxxxxx or to the list thanks ali
blog comments powered by Disqus

Home | News | Sitemap | FAQ | advertise | OSDir is an Inevitable website. GBiz is too!