gdb,why "next" show each source line twice?
c, c++, gdb
Solution
What level of optimisation did you have when you compiled this?
Even a minimal level of optimisation can cause your debugger to jump around the source lines like crazy as the compiler inlines, reorders and generally plays with your code.
Problem
everyone,when use "next" instruction within gdb,i found each line of sourcecode display twice-----i am quite sure,these code are not in any loop.this is the phenomenon: ``` (gdb) frame #0 ap_get_client_block (r=0x8560d48, buffer=0xb68501b7 "<?xml version=\"1.0\" encoding=\"utf-8\"?><Root><OperCode>SMS101</OperCode><AppId>SMSMsgFilterReq</AppId><Req><UserMobile>13925237429</UserMobile><SendMsg>abc圲34¨圲23a露07\214圲21¢<237朲11?东215圲10°<214朲27¥応227露07\214正常,hao"..., bufsiz=81920) at http_filters.c:1540 1540 if (r->remaining < 0 || (!r->read_chunked && r->remaining == 0)) { (gdb) n 1544 bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); (gdb) 1545 if (bb == NULL) { (gdb) 1544 bb = apr_brigade_create(r->pool, r->connection->bucket_alloc); (gdb) 1545 if (bb == NULL) { ``` -----the line 1544,1545 are not in any loop,but they got repeated. May anybody enlighten me?