LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 801|回复: 2

How to enty into an called function internal by "step" of GC

[复制链接]
发表于 2005-12-31 14:58:45 | 显示全部楼层 |阅读模式
[PHP]
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
#include <linux/fb.h>
#include <sys/mman.h>

int main()
{
    int fbfd = 0;
    struct fb_var_screeninfo vinfo;
    struct fb_fix_screeninfo finfo;
    long int screensize = 0;
    char *fbp = 0;
    int x = 0, y = 0;
    long int location = 0;

    // Open the file for reading and writing
    fbfd = open("/dev/fb0", O_RDWR);
    if (!fbfd) {
        printf("Error: cannot open framebuffer device.\n");
        exit(1);
    }
    printf("The framebuffer device was opened successfully.\n");

    // Get fixed screen information
    if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
        printf("Error reading fixed information.\n");
        exit(2);
    }

    // Get variable screen information
    if (ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo)) {
        printf("Error reading variable information.\n");
    (.......)

[/PHP]
 楼主| 发表于 2005-12-31 15:03:59 | 显示全部楼层
I just to debug it without any intention. So I done like this:
[PHP]
(gdb) run
Starting program: /home/Test_QT/framebuffer/main
The framebuffer device was opened successfully.

Breakpoint 1, main () at main.c:27
27          if (ioctl(fbfd, FBIOGET_FSCREENINFO, &finfo)) {
(gdb) step
28              printf("Error reading fixed information.\n");
(gdb)
Error reading fixed information.
29              exit(2);
(gdb)

Program exited with code 02.
(gdb)
The program is not being run.
(gdb)
[/PHP]
I want to enter into internal of  the ioctl() funtion.
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-31 20:37:42 | 显示全部楼层
终于跑到XP上了。为什么总是不能进入调用函数的内部呢?为什么左边的数字行数与原程序中的行数内容不对应呢?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表