免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: prc
打印 上一主题 下一主题

[其他] 帮助你阅读内核源码 [复制链接]

论坛徽章:
0
11 [报告]
发表于 2015-12-11 18:48 |只看该作者
本帖最后由 prc 于 2015-12-11 18:48 编辑
hnwyllmm 发表于 2015-12-10 12:51
回复 9# prc
github.com/zeromq/zeromq4-1  (抱歉没有URL权限)
这是官方版本的下载地址,但是我自己测试 ...

更新一下codeless的代码,在zeromq4.1上是没问题的;4.04由于没有代码就没试。

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:49:03
12 [报告]
发表于 2015-12-19 23:13 |只看该作者
本帖最后由 shihyu 于 2015-12-19 23:13 编辑

测试 linux-2.6.32.69

make defconfig
../codeless/y-Make --yz-cc=gcc --yz-postprocess=cl
  1. function gcc()
  2. {
  3.     /home/shihyu/github/codeless/cl.exe --yz-no-output --yz-save-dep=/home/shihyu/github/linux-2.6.32.69/cl/depends.txt --yz-save-cl=/home/shihyu/github/linux-2.6.32.69/cl/commands.txt --yz-save-condvals=/home/shihyu/github/linux-2.6.32.69/cl/condvals.txt --yz-top-dir=/home/shihyu/github/linux-2.6.32.69 --yz-cc=gcc --yz-verbose=0 "$@" || return $?
  4.     /usr/bin/gcc $*
  5. }
  6. function g++()
  7. {
  8.     /home/shihyu/github/codeless/cl.exe --yz-no-output --yz-save-dep=/home/shihyu/github/linux-2.6.32.69/cl/depends.txt --yz-save-cl=/home/shihyu/github/linux-2.6.32.69/cl/commands.txt --yz-save-condvals=/home/shihyu/github/linux-2.6.32.69/cl/condvals.txt --yz-top-dir=/home/shihyu/github/linux-2.6.32.69 --yz-cc=gcc --yz-verbose=0 "$@" || return $?
  9.     /usr/bin/g++ $*
  10. }
  11. export -f gcc g++
  12. /usr/bin/make SHELL=bash

  13. bash: line 1: 13811 Segmentation fault      (core dumped) /home/shihyu/github/codeless/cl.exe --yz-no-output --yz-save-dep=/home/shihyu/github/linux-2.6.32.69/cl/depends.txt --yz-save-cl=/home/shihyu/github/linux-2.6.32.69/cl/commands.txt --yz-save-condvals=/home/shihyu/github/linux-2.6.32.69/cl/condvals.txt --yz-top-dir=/home/shihyu/github/linux-2.6.32.69 --yz-cc=gcc --yz-verbose=0 "$@"
  14.   HOSTCC  scripts/kconfig/conf.o
  15. bash: line 1: 13907 Segmentation fault      (core dumped) /home/shihyu/github/codeless/cl.exe --yz-no-output --yz-save-dep=/home/shihyu/github/linux-2.6.32.69/cl/depends.txt --yz-save-cl=/home/shihyu/github/linux-2.6.32.69/cl/commands.txt --yz-save-condvals=/home/shihyu/github/linux-2.6.32.69/cl/condvals.txt --yz-top-dir=/home/shihyu/github/linux-2.6.32.69 --yz-cc=gcc --yz-verbose=0 "$@"
  16. make[2]: *** [scripts/kconfig/conf.o] Error 139
  17. make[1]: *** [silentoldconfig] Error 2
  18. make: *** No rule to make target `include/config/auto.conf', needed by `include/config/kernel.release'.  Stop
复制代码

论坛徽章:
0
13 [报告]
发表于 2015-12-23 15:34 |只看该作者
回复 12# shihyu
bug已修复,请更新代码

   

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:49:03
14 [报告]
发表于 2015-12-23 22:49 |只看该作者
本帖最后由 shihyu 于 2015-12-23 22:49 编辑


还是一样错误讯息xd

论坛徽章:
0
15 [报告]
发表于 2015-12-25 12:51 |只看该作者
楼主,我这里也是同样的BUG
hnwyllmm@ubuntu:~/linux-2.6.32.63$ uname -a
Linux ubuntu 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
使用的是Ubuntu 14.04 Server版

hnwyllmm@ubuntu:~/linux-2.6.32.63$ file core
core: ELF 64-bit LSB  core file x86-64, version 1 (SYSV), SVR4-style, from '/home/hnwyllmm/codeless/cl.exe --yz-no-output --yz-save-dep=/home/hnwyllmm/linu'
  1. hnwyllmm@ubuntu:~/linux-2.6.32.63$ gdb ../codeless/cl.exe core
  2. GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
  3. Copyright (C) 2014 Free Software Foundation, Inc.
  4. License GPLv3+: GNU GPL version 3 or later <>
  5. This is free software: you are free to change and redistribute it.
  6. There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
  7. and "show warranty" for details.
  8. This GDB was configured as "x86_64-linux-gnu".
  9. Type "show configuration" for configuration details.
  10. For bug reporting instructions, please see:
  11. >.
  12. Find the GDB manual and other documentation resources online at:
  13. <>.
  14. For help, type "help".
  15. Type "apropos word" to search for commands related to "word"...
  16. Reading symbols from ../codeless/cl.exe...done.
  17. [New LWP 5458]
  18. [Thread debugging using libthread_db enabled]
  19. Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
  20. Core was generated by `/home/hnwyllmm/codeless/cl.exe --yz-no-output --yz-save-dep=/home/hnwyllmm/linu'.
  21. Program terminated with signal SIGSEGV, Segmentation fault.
  22. #0  __GI___pthread_mutex_lock (mutex=0x0) at ../nptl/pthread_mutex_lock.c:66
  23. 66      ../nptl/pthread_mutex_lock.c: No such file or directory.
  24. (gdb) bt
  25. #0  __GI___pthread_mutex_lock (mutex=0x0) at ../nptl/pthread_mutex_lock.c:66
  26. #1  0x0000000000416fe1 in ipsc_acc_bytes (sc=0x0, index=0, val=512) at ../common/ip_sc.c:54
  27. #2  0x0000000000404066 in OsFileWriter::Write (this=0x12b1400, buf=0x12b1c18, count=<optimized out>) at FileWriter.cpp:106
  28. #3  0x0000000000402d8f in save_command_line (filename=..., my_args=..., cc_args=..., host_cc=...) at startup.cpp:86
  29. #4  main (argc=<optimized out>, argv=<optimized out>) at startup.cpp:215
  30. (gdb)
复制代码
  1. (gdb) f 1
  2. #1  0x0000000000416fe1 in ipsc_acc_bytes (sc=0x0, index=0, val=512) at ../common/ip_sc.c:54
  3. 54          pthread_mutex_lock(&sc->lock);
  4. (gdb) info local
  5. No locals.
  6. (gdb) info reg
  7. rax            0x0      0
  8. rbx            0x0      0
  9. rcx            0xffffffffffffffff       -1
  10. rdx            0x200    512
  11. rsi            0x0      0
  12. rdi            0x0      0
  13. rbp            0x200    0x200
  14. rsp            0x7fff0d77cf00   0x7fff0d77cf00
  15. r8             0x0      0
  16. r9             0x1      1
  17. r10            0x7fff0d77ccc0   140733419343040
  18. r11            0x2b3edc166410   47548980421648
  19. r12            0x0      0
  20. r13            0x12b1c18        19602456
  21. r14            0x0      0
  22. r15            0x0      0
  23. rip            0x416fe1 0x416fe1 <ipsc_acc_bytes+17>
  24. eflags         0x10206  [ PF IF RF ]
  25. cs             0x33     51
  26. ss             0x2b     43
  27. ds             0x0      0
  28. es             0x0      0
  29. fs             0x0      0
  30. gs             0x0      0
  31. (gdb)
复制代码

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:58:11
16 [报告]
发表于 2015-12-25 14:42 |只看该作者
useful, thx

论坛徽章:
0
17 [报告]
发表于 2015-12-25 19:31 |只看该作者
回复 14# shihyu

能把core和cl.exe发过来吗
ijkxyz@msn.com


   

论坛徽章:
0
18 [报告]
发表于 2015-12-25 19:32 |只看该作者
回复 15# hnwyllmm
请更新代码

   

论坛徽章:
1
2015年迎新春徽章
日期:2015-03-04 09:49:03
19 [报告]
发表于 2015-12-27 11:07 |只看该作者
linux-2.6.32.69  可以

可是測試 linux-4.3.3 會失敗
  1. ../codeless/y-Make --yz-cc=gcc --yz-postprocess=cl
  2. function gcc()
  3. {
  4.     /home/shihyu/github/codeless/cl.exe --yz-no-output --yz-save-dep=/home/shihyu/github/linux-4.3.3/cl/depends.txt --yz-save-cl=/home/shihyu/github/linux-4.3.3/cl/commands.txt --yz-save-condvals=/home/shihyu/github/linux-4.3.3/cl/condvals.txt --yz-top-dir=/home/shihyu/github/linux-4.3.3 --yz-cc=gcc --yz-verbose=0 "$@" || return $?
  5.     /usr/bin/gcc $*
  6. }
  7. function g++()
  8. {
  9.     /home/shihyu/github/codeless/cl.exe --yz-no-output --yz-save-dep=/home/shihyu/github/linux-4.3.3/cl/depends.txt --yz-save-cl=/home/shihyu/github/linux-4.3.3/cl/commands.txt --yz-save-condvals=/home/shihyu/github/linux-4.3.3/cl/condvals.txt --yz-top-dir=/home/shihyu/github/linux-4.3.3 --yz-cc=gcc --yz-verbose=0 "$@" || return $?
  10.     /usr/bin/g++ $*
  11. }
  12. export -f gcc g++
  13. /usr/bin/make SHELL=bash

  14.   CHK     include/config/kernel.release
  15.   CHK     include/generated/uapi/linux/version.h
  16.   CHK     include/generated/utsrelease.h
  17.   CHK     include/generated/bounds.h
  18.   CHK     include/generated/timeconst.h
  19.   CC      arch/x86/kernel/asm-offsets.s
  20.   include/asm-generic/pgtable.h:12
  21.   ./arch/x86/include/asm/pgtable.h:884
  22.   include/linux/mm.h:55
  23.   include/linux/suspend.h:8
  24.   arch/x86/kernel/asm-offsets.c:12
  25. defined following -
  26. make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 120
  27. make: *** [prepare0] Error 2
复制代码

论坛徽章:
0
20 [报告]
发表于 2015-12-31 15:43 |只看该作者
回复 19# shihyu
已修复
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP