Hi,
I don’t know what changed, but you might workaround this by using the c_str() method.
For instance :
$ gdb --args url_unittests --single-process-tests --gtest_filter=GURLTest.Components
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ../build-master-dbg/url_unittests...done.
(gdb) b GURL::spec
Breakpoint 1 at 0x7148c6: file ../src/url/gurl.cc, line 207.
(gdb) r
Starting program: /var/local/jbriance/host-chromium/build-master-dbg/url_unittests --single-process-tests --gtest_filter=GURLTest.Components
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Debugger detected, switching to single process mode.
Pass --test-launcher-debug-launcher to debug the launcher itself.
Detected presence of a debugger, running without test timeouts.
Note: Google Test filter = GURLTest.Components
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from GURLTest
[ RUN ] GURLTest.Components
Breakpoint 1, GURL::spec (this=0x7fffffffd5f0) at ../src/url/gurl.cc:207
207 if (is_valid_ || spec_.empty())
(gdb) print spec_
$1 = <incomplete type>
(gdb) print spec_.c_str()
$2 = (const std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::value_type *) 0xd0856e4eea0 "http://user:pa...@google.com:99/foo;bar?q=a#ref"
(gdb)
I hope this is what you were looking for :)
Julien
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
chromium-dev...@chromium.org.
To view this discussion on the web visit
https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMKsNvrc9OW2UF%3Dc24Cwmby_Y%2B9_sWUJ0rF8Xrh-F%3DzDd9Ei7Q%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
Hi,
No, I’ve no idea why this hangs, but to be honest it is also quite slow for me to show the result of c_str() : around 5 seconds and I’m running gdb on a huge compilation server.
Another workaround which is quick & dirty, but should help avoiding the hang issue you face :
Breakpoint 1, GURL::spec (this=0x7fffffffd5f0) at ../src/url/gurl.cc:207
207 if (is_valid_ || spec_.empty())
(gdb) print spec_
$1 = <incomplete type>
(gdb) p *(char**) ((int*) &spec_+4)
$2 = 0x91236c98ea0 "http://user:pa...@google.com:99/foo;bar?q=a#ref"
Please note that the +4 that I use here depends on your architecture and toolchain, so you might have to test other values to find the right one for you.
Julien
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
Hi again,
After looking a bit more into this, this seems to be related to inlined namespace.
Here’s something that works for me :
207 if (is_valid_ || spec_.empty())
(gdb) p spec_
$1 = <incomplete type>
(gdb) ptype std::__1::string
type = class std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > {
<incomplete type>
}
(gdb) p spec_
$2 = {<std::__1::__basic_string_common<true>> = {<No data fields>},
__r_ = {<std::__1::__compressed_pair_elem<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::__rep, 0, false>> = {__value_ = {{__l = {__cap_ = 65, __size_ = 46,
__data_ = 0x3a03ecf19ea0 "http://user:pa...@google.com:99/foo;bar?q=a#ref"}, __s = {{__size_ = 65 'A', __lx = 65 'A'},
__data_ = "\000\000\000\000\000\000\000.\000\000\000\000\000\000\000\240\236\361\354\003:\000"}, __r = {__words = {65, 46,
63788534570656}}}}}, <std::__1::__compressed_pair_elem<std::__1::allocator<char>, 1, true>> = {<std::__1::allocator<char>> = {<No data fields>}, <No data fields>}, <No data fields>},
static npos = 18446744073709551615}
(gdb)
Julien
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/119d5e34a3474a2cb50b219d7028522a%40XCH-ALN-008.cisco.com.
Hi again,
Adding the following GN arg solves the issue in my env :
use_custom_libcxx = false
When building url_unittests with this arg, I now have :
$ gdb --args url_unittests --single-process-tests --gtest_filter=GURLTest.Components
[...]
(gdb) b GURL::spec
Breakpoint 1 at 0x57ae96: file ../src/url/gurl.cc, line 207.
(gdb) r
[...]
Breakpoint 1, GURL::spec (this=0x7fffffffd870) at ../src/url/gurl.cc:207
207 if (is_valid_ || spec_.empty())
(gdb) p spec_
$1 = "http://user:pa...@google.com:99/foo;bar?q=a#ref"
(gdb)
So to me, the issue is coming from a mixup between libstdc++ and libc++, but I’m not familiar enough with those to be able to fully understand the problem.
According to git log, thomasanderson@ and thakis@ recently pushed changes about this GN arg. Maybe you can ask them if they have more insight into this,
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/59d4df0f43dd4235896e495bc1734c29%40XCH-ALN-008.cisco.com.
Hi again,
Adding the following GN arg solves the issue in my env :
use_custom_libcxx = false
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/CAMKsNvrc9OW2UF%3Dc24Cwmby_Y%2B9_sWUJ0rF8Xrh-F%3DzDd9Ei7Q%40mail.gmail.com.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/119d5e34a3474a2cb50b219d7028522a%40XCH-ALN-008.cisco.com.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/59d4df0f43dd4235896e495bc1734c29%40XCH-ALN-008.cisco.com.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/d12ce3f760d246209f8178f99ebee629%40XCH-ALN-008.cisco.com.