Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157179 - Java code misidentified as c++ by gdb when compiled with -findirect-dispatch -shared -Wl,-Bsymbolic
Summary: Java code misidentified as c++ by gdb when compiled with -findirect-dispatch ...
Alias: None
Product: Fedora
Classification: Fedora
Component: gdb
Version: rawhide
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jan Kratochvil
QA Contact:
Whiteboard: bzcl34nup
Depends On:
TreeView+ depends on / blocked
Reported: 2005-05-08 13:49 UTC by Robin Green
Modified: 2008-05-07 00:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2008-05-07 00:10:15 UTC

Attachments (Terms of Use)

Description Robin Green 2005-05-08 13:49:18 UTC
Description of problem:
Not sure if this is a gcc bug or a gdb bug. Java code that has been compiled
with -findirect-dispatch -shared -Wl,-Bsymbolic (i.e. "BC ABI") is misidentified
by gdb as C++ code, so you get gdb backtraces in C++ syntax, and you fail to set
breakpoints if you try to set them using Java syntax.

Version-Release number of selected component (if applicable):

How reproducible:
Every time

Steps to Reproduce:
0. Install gdb version
1. Build a Java project with gdb --args ant
2. set language java
3. b 'org.eclipse.jdt.internal.compiler.batch.Main.compile(String[])'
4. run
Actual results:
Breakpoint should be hit when the build reaches compile stage.

Expected results:
Breakpoint is never hit. However, translating it to C++ syntax makes it work,
i.e. b

Additional info:

Comment 1 Robin Green 2005-05-08 14:00:39 UTC
Curiouser and curiouser. Not sure if this is related, but gdb thinks the symbol
table information is missing as well. Trying again with "set verbose on" reveals
that it is reading the relevant debuginfo:

Reading symbols from
symbols from

But I cannot get any local variables or method parameters to display for the
method org.eclipse.jdt.internal.compiler.batch.Main.compile(String[]), even
though it supposedly has read the debuginfo:

Breakpoint 2, 0x04922612 in
org::eclipse::jdt::internal::compiler::batch::Main::compile ()
   from /usr/lib/eclipse/plugins/org.eclipse.jdt.core_3.1.0/
(gdb) info locals
No symbol table info available.
(gdb) bt
Reading in symbols for ../../../libffi/src/x86/sysv.S...done.
Reading in symbols for ../../../libffi/src/x86/ffi.c...done.
Reading in symbols for ../../../libjava/java/lang/reflect/ 
Reading in symbols for ../../../libjava/gnu/java/lang/
Reading in symbols for ../../../libjava/gnu/java/lang/
Reading in symbols for ../../../libjava/java/lang/
Reading in symbols for ../../../libjava/
Reading in symbols for ../../../libjava/
Reading in symbols for ../sysdeps/generic/libc-start.c...done.
#0  0x04922612 in org::eclipse::jdt::internal::compiler::batch::Main::compile ()
   from /usr/lib/eclipse/plugins/org.eclipse.jdt.core_3.1.0/
#1  0x03cfb307 in ffi_call_SYSV () at ../../../libffi/src/x86/sysv.S:60
#2  0x03cfafd6 in ffi_call (cif=0xbfb6a398, fn=0x2, rvalue=0xbfb6a3b0,
avalue=0xbfb6a310) at ../../../libffi/src/x86/ffi.c:221
#3  0x0399d404 in _Jv_CallAnyMethodA (obj=0x11a5ee0, return_type=Reading in
symbols for ../../../libjava/java/lang/
0x42a07a0, meth=0x4f2a750, is_constructor=0 '\0', is_virtual_call=1 '\001',
parameter_types=0xfe7f80, args=0xbfb6a410, result=0xbfb6a470,
    is_jni_call=0 '\0', iface=0x0) at
#4  0x0399d960 in _Jv_CallAnyMethodA (obj=0x2, return_type=0x42a07a0,
meth=0x4f2a750, is_constructor=0 '\0', parameter_types=0xfe7f80,
    args=0xfe7f90, iface=0x2) at ../../../libjava/java/lang/reflect/
#5  0x0399ddd5 in java::lang::reflect::Method::invoke (this=0x1137de0,
obj=0x11a5ee0, args=0x2)
    at ../../../libjava/java/lang/reflect/
#6  0x001f1763 in org::eclipse::jdt::core::JDTCompilerAdapter::execute ()
#7  0x0076eb43 in org::apache::tools::ant::taskdefs::Javac::compile () from
#8  0x0076e2dc in org::apache::tools::ant::taskdefs::Javac::execute () from
#9  0x0072b23c in org::apache::tools::ant::UnknownElement::execute () from
#10 0x00729ea4 in org::apache::tools::ant::Task::perform () from
#11 0x007294e3 in org::apache::tools::ant::Target::execute () from
#12 0x007296d7 in org::apache::tools::ant::Target::performTasks () from
#13 0x00723201 in org::apache::tools::ant::Project::executeTarget () from
#14 0x00722ca0 in org::apache::tools::ant::Project::executeTargets () from
#15 0x0071eeb9 in org::apache::tools::ant::Main::runBuild () from
#16 0x0071d166 in org::apache::tools::ant::Main::startAnt () from
#17 0x00b46b99 in org::apache::tools::ant::launch::Launcher::run () from
#18 0x00b46239 in org::apache::tools::ant::launch::Launcher::main () from
#19 0x0398a9cd in gnu::java::lang::MainThread::call_main (this=0x77dc8) at
#20 0x03a1e9c2 in (this=0x77dc8) at
#21 0x03999ce1 in _Jv_ThreadRun (thread=0x77dc8) at
#22 0x0395f6b1 in _Jv_RunMain (vm_args=0x2, klass=0x0, name=0xbfb6d105
"", argc=14, argv=0xbfb6ab38,
    is_jar=false) at ../../../libjava/
#23 0x00d3c9cd in main (argc=19, argv=0xbfb6ab24) at ../../../libjava/
#24 0x00bd0de6 in __libc_start_main (main=0x80483f4, argc=19, ubp_av=0xbfb6ab24,
init=0x80484d8 <__libc_csu_init>,
    fini=0x8048528 <__libc_csu_fini>, rtld_fini=Reading in symbols for
0xbabcfd <_dl_fini>, stack_end=0xbfb6ab1c) at ../sysdeps/generic/libc-start.c:228
#25 0x08048455 in _start ()

Here is the contents of my .gdbinit:

set history save
handle SIGHUP nostop print
handle SIGSEGV nostop print
handle SIGPWR nostop noprint
handle SIGXCPU nostop noprint
handle SIG32 nostop noprint
set debug-file-directory /usr/lib/debug

Comment 2 Robin Green 2005-05-08 14:08:52 UTC
By the way, I used the eclipse-jdt-3.1.0_fc-0.M6.15 and
eclipse-debuginfo-3.1.0_fc-0.M6.15 RPMs for this test case, so the relevant gcc
version is actually whatever gcc version they were compiled with.

Comment 3 Robin Green 2005-05-08 16:29:24 UTC
Possibly a symptom of bug 153247

Comment 4 Jakub Jelinek 2005-05-08 16:40:49 UTC
The Java bits are marked with DW_AT_language 11 (i.e. DW_LANG_Java).

Comment 5 Bug Zapper 2008-04-03 16:09:11 UTC
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:

We will be following the process here: to ensure this
doesn't happen again.

Comment 6 Bug Zapper 2008-05-07 00:10:14 UTC
This bug has been in NEEDINFO for more than 30 days since feedback was
first requested. As a result we are closing it.

If you can reproduce this bug in the future against a maintained Fedora
version please feel free to reopen it against that version.

The process we're following is outlined here:

Note You need to log in before you can comment on or make changes to this bug.