[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-wget] Running Wget through gdb in the tests
From: |
Ander Juaristi |
Subject: |
[Bug-wget] Running Wget through gdb in the tests |
Date: |
Thu, 09 Apr 2015 00:29:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
Hi,
I usually find useful to run Wget through gdb while running the tests, so that
I can see in real time how Wget performs internally under the test. Here's what
I do:
1. In WgetTests.pm, make WGETPATH point to gdb:
our $WGETPATH = '/usr/bin/gdb';
2. Pick some test and change the cmdline:
my $cmdline = $WgetTest::WGETPATH . " ~/path/to/my/wget";
3. Run the test normally:
$ ./Test-iri-disabled.px
(gdb) break url_parse
4. Figure out which port is the Perl HTTP server listening on:
$ netstat -lp | grep perl | awk '{ print $4 }' | cut -d: -f2
5. Run Wget, and let it pass the test, while stopping at breakpoints, viewing
variables, etc:
(gdb) run --no-iri -nH -r http://localhost:<port>
And I feel smart and happy this way :D
But I wonder if there's a not-so-hackish way of wrapping Wget into gdb when
running the tests. I mean, is there a feature in the tests themselves that
allows this? Would be a great feature.
--
Regards,
- AJ
- [Bug-wget] Running Wget through gdb in the tests,
Ander Juaristi <=