There's no -g parameter given to gcc. The emerge overrides CFLAGS by adding -march=i686 etc. stuff in there, which also removes -g parameter. Try to figure out some way to add it back.
(gdb) bt full #0 0xb7d80080 in virtual_storage_sync_init () from /usr/lib/dovecot/imap/lib20_virtual_plugin.so No symbol table info available. #1 0x08070294 in imap_sync_init (client=0x8134a40, box=0x813d480, imap_flags=IMAP_SYNC_FLAG_SAFE, flags=0) at imap-sync.c:146 ctx = (struct imap_sync_context *) 0x83809b8 __PRETTY_FUNCTION__ = "imap_sync_init" #2 0x0807057a in cmd_sync_delayed (client=0x8134a40) at imap-sync.c:591 cmd = <value optimized out> first_expunge = <value optimized out> first_nonexpunge = <value optimized out> __PRETTY_FUNCTION__ = "cmd_sync_delayed" #3 0x08067b64 in client_handle_input (client=0x8134a40) at client.c:728 ret = false remove_io = false handled_commands = true __PRETTY_FUNCTION__ = "client_handle_input" #4 0x0806838f in client_input (client=0x8134a40) at client.c:752 cmd = <value optimized out> output = (struct ostream *) 0x8134bf4 bytes = <value optimized out> __PRETTY_FUNCTION__ = "client_input" #5 0x080fa720 in io_loop_handler_run (ioloop=0x812e9b0) at ioloop-epoll.c:208 ctx = (struct ioloop_handler_context *) 0x812eab8 event = (const struct epoll_event *) 0x812eaf8 list = (struct io_list *) 0x8134c78 io = (struct io_file *) 0x8134c50 tv = {tv_sec = 0, tv_usec = 395850} t_id = 2 msecs = <value optimized out> ret = 1 i = 0 j = 0 call = <value optimized out> #6 0x080f9ba0 in io_loop_run (ioloop=0x812e9b0) at ioloop.c:338 No locals. #7 0x08070e15 in main (argc=Cannot access memory at address 0xe ) at main.c:323 No locals. (gdb)