金沙国际官网_金沙国际平台登录

因为这个金沙国际官网_金沙国际平台登录网站与很多的大型澳门赌场都有合作,金沙国际官网_金沙国际平台登录尽职尽责,高效执行,保持好奇心,不断学习,追求卓越,点击进入金沙国际官网_金沙国际平台登录马上体验吧,所以现在也正式地开始了营业。

您的位置:金沙国际官网 > 金沙国际平台登录 > 对Linux进程的理解

对Linux进程的理解

发布时间:2019-11-05 02:22编辑:金沙国际平台登录浏览(186)

    配置环境:

    在本科期间学习过进程,网上也有很多关于进程的知识,但对于进程到底是什么一直没有让我满意的解答(以下截图来自网络,感觉对进程理解有问题,说得也很虚)。

    usage

    在使用 gdb debug 程式前,
    compile 需要加 -g 產生 debug information

    gcc -g
    

        include:libpq-fe.h文件

    图片 1图片 2

    Do not print the introductory and copyright messages.

    -quiet
    -q "Quiet". Do not print the introductory and copyright messages. These messages are also suppressed in batch mode.

    $ gdb a.out
    
    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 a.out...done.
    (gdb)
    
    $ gdb -q a.out
    
    Reading symbols from a.out...done.
    (gdb)
    

        lib:libpq.lib文件

    但今天找到这个博文感觉挺符合我的胃口:

    get the address of variable

    (gdb) p &a
    

        dll:libeay32.dll,libiconv-2.dll,libintl-8.dll,libpq.dll,ssleay32.dll五个文件

     

    difference between (gdb)r with (gdb) start

    break-through@breakthrough-ThinkPad-T460p:~/working_space/test/5$ gdb -q a.out
    Reading symbols from a.out...done.
    (gdb) r
    Starting program: /home/break-through/working_space/test/5/a.out 
    test.a = 1, test.b=2, test.c=3
    [Inferior 1 (process 7607) exited normally]
    (gdb) p &test.a
    No symbol "test" in current context.
    
    break-through@breakthrough-ThinkPad-T460p:~/working_space/test/5$ gdb -q a.out
    Reading symbols from a.out...done.
    (gdb) start
    Temporary breakpoint 1 at 0x400535: file container_of.c, line 11.
    Starting program: /home/break-through/working_space/test/5/a.out 
    
    Temporary breakpoint 1, main () at container_of.c:11
    11          test.a = 1;
    (gdb) p &test.a
    $1 = (int *) 0x7fffffffddb0
    

    连接代码: 

    • 进程的本质

    print source code

    (gdb) list
    

    PGresult *res;//存放结果
    PGconn *m_conn;

    进程是Linux内核提供的一个环境(资源分配的基本单位),包括:

    Display assemble code

    (gdb) disassemble
    

    //连接数据库

    (1)进程控制块(用于操作系统对进程的管理)。

    Setting breakpoint

    (gdb) b line_number
    

    本文由金沙国际官网发布于金沙国际平台登录,转载请注明出处:对Linux进程的理解

    关键词:

上一篇:没有了

下一篇:没有了