简体   繁体   English

用gdb调试wget命令

[英]debug wget command with gdb

I want to debug wget with a special url. 我想用特殊的URL调试wget

So how to pass the url to gdb? 那么如何将URL传递给gdb? I already tried with --args <the url> , but it dosen't work. 我已经尝试使用--args <the url> ,但是它没有用。

Please help me. 请帮我。

ps: I used gdb in the wrong way gdb wget --args http://www.google.com/ , it should be gdb --args wget http://www.google.com/ ps:我以错误的方式使用了gdb gdb wget --args http://www.google.com/ ,应该是gdb --args wget http://www.google.com/

This should work: 这应该工作:

[ ~]$ gdb -q --args /usr/bin/wget https://www.google.com/
Reading symbols from /usr/bin/wget...Reading symbols from /usr/lib/debug/usr/bin/wget.debug...done.
done.
(gdb) start 
Temporary breakpoint 1 at 0xbda0: file main.c, line 1186.
Starting program: /usr/bin/wget https://www.google.com/
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Temporary breakpoint 1, main (argc=2, argv=0x7fffffffdce8) at main.c:1186
1186    {
Missing separate debuginfos, use: dnf debuginfo-install gnutls-3.5.7-3.fc25.x86_64
(gdb) list 
1181    const char *program_name; /* Needed by lib/error.c. */
1182    const char *program_argstring; /* Needed by wget_warc.c. */
1183    
1184    int
1185    main (int argc, char **argv)
1186    {
1187      char **url, **t, *p;
1188      int i, ret, longindex;
1189      int nurl;
1190      int retconf;
(gdb) 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM