[cfe-dev] libcxx install location?
Larry Evans
cppljevans at suddenlink.net
Sat Feb 5 18:56:04 PST 2011
On 02/05/11 09:09, Jean-Daniel Dupas wrote:
[snip]
> After theses changes, I was able to compile a simple hello world program.
>
> --------- hello.cpp
> #include <iostream>
>
> int main (int argc, char * const argv[]) {
> // insert code here...
> std::cout << "Hello, World!\n";
> return 0;
> }
> ------------------------
>
> Unfortunalty, this simple code does not run properly. It prints "Hello
> World", and then a lot of garbage (and sometimes segfault too).
>
> But this may be a good base to start hacking on libc++.
>
The attached code, with:
#define EMTPY_STDOUT_STR
runs OK; however, with:
//#define EMTPY_STDOUT_STR
it prints the "?" followed by a bunch of garbage just like you
describe.
I did try gdb and after a *lot* of stepping through many statement,
finished with:
(gdb) s
std::__1::__stdoutbuf<char>::sync (this=<value optimized out>) at
../include/__std_stream:202
(gdb) s
(gdb) s
Line number 287 out of range; ../src/iostream.cpp has 53 lines.
(gdb) s
std::__1::codecvt<char, char, __mbstate_t>::unshift (this=<value
optimized out>) at ../include/__locale:745
(gdb) s
Die: DW_TAG_restrict_type (abbrev 191, offset 0xf53ba)
parent at offset: 0x79b11
has children: FALSE
attributes:
DW_AT_type (DW_FORM_ref4) constant ref: 0x94ec8 (adjusted)
Die: DW_TAG_restrict_type (abbrev 191, offset 0xf53ba)
parent at offset: 0x79b11
has children: FALSE
attributes:
DW_AT_type (DW_FORM_ref4) constant ref: 0x94ec8 (adjusted)
Dwarf Error: Cannot find type of die [in module /usr/lib/libc++.so.1]
(gdb)
After that, tried further stepping; however, nothing changed so I
finally had to kill it.
I don't know what to conclude from that, but maybe others can
glean some useful information and hopefully provide some
suggestions about how to find the problem.
-Larry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cout.cpp
Type: text/x-c++src
Size: 168 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110205/887c5c02/attachment.cpp>
More information about the cfe-dev
mailing list