Changes between Version 5 and Version 6 of jazz/09-01-14


Ignore:
Timestamp:
Jan 14, 2009, 3:52:52 PM (16 years ago)
Author:
jazz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • jazz/09-01-14

    v5 v6  
    2121 * (續 [wiki:jazz/08-11-17 08-11-17@GMT-6 BUGFIX: jfbterm (3)])
    2222
     23 * 在看 fbcommon.c 時,發現在這組出現錯誤的 mmap 前曾跑過另一組 mmap, 因此把參數印出來對照看看。
     24 * gdb debug 程序
     25{{{
     26file jfbterm
     27set args -e ls
     28show args
     29break fbcommon.c:500
     30break fbcommon.c:557
     31break fbcommon.c:566
     32run
     33p fb_fix
     34c
     35p fb_fix
     36c
     37p fb_fix.smem_len
     38p p->soff
     39p p->slen
     40p fb_fix.mmem_len
     41p p->moff
     42p p->mlen
     43}}}
     44{{{
     45This GDB was configured as "x86_64-linux-gnu".
     46(gdb) file jfbterm
     47Reading symbols from /root/jfbterm-0.4.7-dev/jfbterm...done.
     48(gdb) set args -e ls
     49(gdb) show args
     50Argument list to give program being debugged when it is started is "-e ls".
     51(gdb) break fbcommon.c:500
     52Breakpoint 1 at 0x40303d: file fbcommon.c, line 500.
     53(gdb) break fbcommon.c:557
     54Breakpoint 2 at 0x40327e: file fbcommon.c, line 557.
     55(gdb) break fbcommon.c:566
     56Breakpoint 3 at 0x403301: file fbcommon.c, line 566.
     57(gdb) run
     58Starting program: /root/jfbterm-0.4.7-dev/jfbterm -e ls
     59Breakpoint 1, tfbm_open (p=0x6146e0) at fbcommon.c:501
     60501             if (fb_var.yres_virtual != fb_var.yres) {
     61(gdb) p fb_fix
     62$1 = {id = "▒▒C▒\210\177\000\000\006\000\000\000\000\000\000", smem_start = 30778096, smem_len = 3032756978, type = 32648, type_aux = 0, visual = 0,
     63  xpanstep = 65535, ypanstep = 65535, ywrapstep = 65535, line_length = 1, mmio_start = 15, mmio_len = 30816528, accel = 0, reserved = {53071, 64, 0}}
     64(gdb) c
     65Continuing.
     66Breakpoint 2, tfbm_open (p=0x6146e0) at fbcommon.c:557
     67557             p->smem = (u_char*)mmap(NULL, p->slen, PROT_READ|PROT_WRITE,
     68(gdb) p fb_fix
     69$2 = {id = "VESA VGA\000\000\000\000\000\000\000", smem_start = 4026531840, smem_len = 1572864, type = 0, type_aux = 0, visual = 3, xpanstep = 0,
     70  ypanstep = 0, ywrapstep = 0, line_length = 1024, mmio_start = 0, mmio_len = 0, accel = 0, reserved = {0, 0, 0}}
     71(gdb) c
     72Continuing.
     73
     74Breakpoint 3, tfbm_open (p=0x6146e0) at fbcommon.c:566
     75566             if(p->mlen == 0)
     76(gdb) p fb_fix.smem_len
     77$3 = 1572864
     78(gdb) p p->soff
     79$4 = 0
     80(gdb) p p->slen
     81$5 = 1572864
     82(gdb) p fb_fix.mmem_len
     83There is no member named mmem_len.
     84(gdb) p p->moff
     85$6 = 0
     86(gdb) p p->mlen
     87$7 = 0
     88(gdb)
     89}}}