[cfe-dev] How to debug a code compiled by clang

Devchandra L Meetei dlmeetei at gmail.com
Thu Aug 2 23:23:01 PDT 2012


The error message seen is this

[deleisha at deleisha pegasus]$ gdb cimserver
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-56.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/deleisha/CodeSpace/pegasus/pkg/bin/cimserver...done.
(gdb) start
Temporary breakpoint 1 at 0x4049fd: file cimserver.cpp, line 486.
Starting program: /home/deleisha/CodeSpace/pegasus/pkg/bin/cimserver
[Thread debugging using libthread_db enabled]

Temporary breakpoint 1, main (argc=1, argv=0x7fffffffdda8) at
cimserver.cpp:486
486    cimserver.cpp: No such file or directory.
    in cimserver.cpp
Missing separate debuginfos, use: debuginfo-install
glibc-2.12-1.80.el6_3.3.x86_64 keyutils-libs-1.4-4.el6.x86_64
krb5-libs-1.9-33.el6.x86_64 libcom_err-1.41.12-12.el6.x86_64
libgcc-4.4.6-4.el6.x86_64 libselinux-2.0.94-5.3.el6.x86_64
libstdc++-4.4.6-4.el6.x86_64 nss-softokn-freebl-3.12.9-11.el6.x86_64
openssl-1.0.0-20.el6_2.5.x86_64 zlib-1.2.3-27.el6.x86_64
(gdb)


On Fri, Aug 3, 2012 at 11:25 AM, David Blaikie <dblaikie at gmail.com> wrote:

> On Thu, Aug 2, 2012 at 10:50 PM, Devchandra L Meetei <dlmeetei at gmail.com>
> wrote:
> > I am unable to use gdb on code compiled by clang/clang++ with -g options
> > enabled.
> > when I do break main/start, gdb says file not found.
> > Is it by design? If so, How to debug binaries compiled by clang.
>
> Same way you would with files compiled by gcc. Are you sure you have
> the right file name for the binary?
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120803/c26c062b/attachment.html>


More information about the cfe-dev mailing list