[cfe-users] [llvm-bugs] Question about debug symbol

David Blaikie via cfe-users cfe-users at lists.llvm.org
Tue Oct 18 08:06:43 PDT 2016


(moving this thread from llvm-bugs (which is just for our automated bug
database emails) to cfe-users)

GCC uses an optimization for debug info that Clang has, but does not enable
on platforms where the default debugger is LLDB (because LLDB doesn't
handle debug info that has this optimization enabled).

If you aren't using LLDB, you can explicitly pass "-fno-standalone-debug"
to get the optimized behavior and that should match or be better than GCC's
(in my experiments, LLVM's is about half the size of GCC's when using this
flag).

If you are using LLDB, I'm not sure there's much you can do.

On Mon, Oct 17, 2016 at 7:35 AM 석진무 via llvm-bugs <llvm-bugs at lists.llvm.org>
wrote:

> Hello LLVM admins,
>
> I'm jinmoo seok, live in seout, Korea.
>
>
>
> i have some problem about debug symbol.
>
> i want to how to solve this problem, so i email you.
>
>
>
> source code is :
>
> #include<iostream>
>
> int main() {
>
> std::cout << "hello world" << std::endl;
>
> return 0;
>
> }
>
>
>
> this is simple source.
>
> but when i build it width debug symbol using clang, binary size is 100kb.
>
> when using gcc, binary size is 19kb
>
>
>
> i tryed "readelf -wi <binary>"
>
> readelf: dwarf_loclist_form_expr_b: Invalid argument [dwarf_loclist_from_expr_b(279)]
> <237>   DW_AT_data_member_location: 0 byte block:   ()
> <4><23a>: Abbrev Number: 9 (DW_TAG_member)
> <23b>   DW_AT_name        : (indirect string) __precision_
> <23f>   DW_AT_type        : <0x799>
> <243>   DW_AT_decl_file   : 2
> <244>   DW_AT_decl_line   : 363
>
> this message is repeatedly output.
>
> what does message mean?
>
>
>
> and i tryed "readelf -s <binary>"
>
> <address>     0 NOTYPE  LOCAL  DEFAULT   31
>
> this message is output too many.
>
> why debug_str size is too big?
>
>
>
> i test both clang34 and clang38
>
> clang38's binary size is nearly as twice as clang34's binary.
>
>
>
> i wan't to why this problem happen.
>
>
>
> My environment:
>
> i386
>
> freebsd11
>
>
>
>
> _______________________________________________
> llvm-bugs mailing list
> llvm-bugs at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-users/attachments/20161018/a2511827/attachment.html>


More information about the cfe-users mailing list