当前位置:首页 » 编程软件 » 编译器编译结果在哪里看

编译器编译结果在哪里看

发布时间: 2022-06-12 16:16:52

‘壹’ 学C++的新新新人,不懂Dev-C++编译器运行程序后,怎样才能直接看到结果求教!!

是没加 system("pause");吗?结果屏幕直接关闭了?如果是,在main函数return 0;前加system("pause");

‘贰’ c++编译器运行太快 运行结果看不到怎么办啊

你可能是用的是VS2005以上吧
如果这样的话,我建议你在最后加一个
system("pause");
这样程序运行完之后就会停下来。
当然,中间加断点也是一个比较好的办法。

‘叁’ 如何查看程序被哪个版本编译器编译的linux-gcc

那是不可能的,除非你加入了调试信息,也就是编译的时候加入了-g参数,然后用gdb调试就可以显示。最大程度上查看一个elf文件信息。



readelf -Wa a.out | head
readelf -wi a.out
readelf -p .comment a.out
objmp -s --section .comment audioplayer



如下:

[root@localhost rootfs]# readelf -Wa bin/gzip

复制代码
ELF Header:
Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
Class: ELF32
Data: 2's complement, little endian
Version: 1 (current)
OS/ABI: UNIX - System V
ABI Version: 0
Type: EXEC (Executable file)
Machine: ARM
Version: 0x1
Entry point address: 0xa080
Start of program headers: 52 (bytes into file)
Start of section headers: 1975444 (bytes into file)
Flags: 0x5000002, has entry point, Version5 EABI
Size of this header: 52 (bytes)
Size of program headers: 32 (bytes)
Number of program headers: 6
Size of section headers: 40 (bytes)
Number of section headers: 25
Section header string table index: 24

Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .note.ABI-tag NOTE 000080f4 0000f4 000020 00 A 0 0 4
[ 2] .init PROGBITS 00008114 000114 00000c 00 AX 0 0 4
[ 3] .text PROGBITS 00008120 000120 17fcfc 00 AX 0 0 16
[ 4] __libc_freeres_fn PROGBITS 00187e1c 17fe1c 000f20 00 AX 0 0 4
[ 5] __libc_thread_fre PROGBITS 00188d3c 180d3c 0000e4 00 AX 0 0 4
[ 6] .fini PROGBITS 00188e20 180e20 000008 00 AX 0 0 4
[ 7] .rodata PROGBITS 00188e28 180e28 058147 00 A 0 0 8
[ 8] __libc_subfreeres PROGBITS 001e0f70 1d8f70 00005c 00 A 0 0 4
[ 9] __libc_atexit PROGBITS 001e0fcc 1d8fcc 000004 00 A 0 0 4
[10] __libc_thread_sub PROGBITS 001e0fd0 1d8fd0 000008 00 A 0 0 4
[11] .ARM.extab PROGBITS 001e0fd8 1d8fd8 001b04 00 A 0 0 4
[12] .ARM.exidx ARM_EXIDX 001e2adc 1daadc 006ea8 00 AL 3 0 4
[13] .tdata PROGBITS 001f1984 1e1984 000018 00 WAT 0 0 4
[14] .tbss NOBITS 001f199c 1e199c 000034 00 WAT 0 0 4
[15] .init_array INIT_ARRAY 001f199c 1e199c 000004 00 WA 0 0 4
[16] .fini_array FINI_ARRAY 001f19a0 1e19a0 000008 00 WA 0 0 4
[17] .jcr PROGBITS 001f19a8 1e19a8 000004 00 WA 0 0 4
[18] .data.rel.ro PROGBITS 001f19ac 1e19ac 00002c 00 WA 0 0 4
[19] .got PROGBITS 001f19d8 1e19d8 00007c 04 WA 0 0 4
[20] .data PROGBITS 001f1a58 1e1a58 0008f7 00 WA 0 0 8
[21] .bss NOBITS 001f2350 1e234f 004828 00 WA 0 0 8
[22] __libc_freeres_pt NOBITS 001f6b78 1e234f 00003c 00 WA 0 0 4
[23] .ARM.attributes ARM_ATTRIBUTES 00000000 1e234f 00002b 00 0 0 1
[24] .shstrtab STRTAB 00000000 1e237a 000118 00 0 0 1

Section to Segment mapping:
Segment Sections...
00 .ARM.exidx
01 .note.ABI-tag .init .text __libc_freeres_fn __libc_thread_freeres_fn .fini .rodata __libc_subfreeres __libc_atexit __libc_thread_subfreeres .ARM.extab .ARM.exidx
02 .tdata .init_array .fini_array .jcr .data.rel.ro .got .data .bss __libc_freeres_ptrs
03 .note.ABI-tag
04 .tdata .tbss

Attribute Section: aeabi
File Attributes
Tag_CPU_name: "5TE"
Tag_CPU_arch: v5TE
Tag_ARM_ISA_use: Yes
Tag_THUMB_ISA_use: Thumb-1
Tag_ABI_PCS_wchar_t: 4
Tag_ABI_FP_denormal: Needed
Tag_ABI_FP_exceptions: Needed
Tag_ABI_FP_number_model: IEEE 754
Tag_ABI_align8_needed: Yes
Tag_ABI_align8_preserved: Yes, except leaf SP
Tag_ABI_enum_size: int
Tag_unknown_44: 1 (0x1)
复制代码

How to retrieve the GCC version used to compile a given ELF executable? http://stackoverflow.com/questions/2387040/how-to-retrieve-the-gcc-version-used-to-compile-a-given-elf-executable

QUES: I'd like to retrieve the GCC version used to compile a given executable. I tried readelf but didn't get the information. Any thoughts?

ANS: To complete what others have said: it's not stored in the object (or exe) file, unless you compile with debugging information! (option -g). If you compile with debug info, you can get it back with readelf:

复制代码
[root@localhost test]# gcc a.c
[root@localhost test]# readelf -wi a.out
[root@localhost test]# gcc a.c -g
[root@localhost test]# readelf -wi a.out
The section .debug_info contains:

Compilation Unit @ offset 0x0:
Length: 135
Version: 2
Abbrev Offset: 0
Pointer Size: 8
<0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
DW_AT_stmt_list : 0
DW_AT_high_pc : 0x400453
DW_AT_low_pc : 0x400448
DW_AT_procer : GNU C 4.1.2 20080704 (Red Hat 4.1.2-55)
DW_AT_language : 1 (ANSI C)
DW_AT_name : a.c
DW_AT_comp_dir : /work/farsight/test
<1><61>: Abbrev Number: 2 (DW_TAG_subprogram)
DW_AT_external : 1
DW_AT_name : main
DW_AT_decl_file : 1
DW_AT_decl_line : 4
DW_AT_prototyped : 1
DW_AT_type : <83>
DW_AT_low_pc : 0x400448
DW_AT_high_pc : 0x400453
DW_AT_frame_base : 0 (location list)
<1><83>: Abbrev Number: 3 (DW_TAG_base_type)
DW_AT_name : int
DW_AT_byte_size : 4
DW_AT_encoding : 5 (signed)
复制代码

ANS2:

‘肆’ c++编译器怎样查看运行过程

你先写好你的程序,在工具栏的空白处右键,选择调试,就会出现一个调试工具,那上面的就是可以查看一步一步运行的过程路径,f11是快捷键。你慢慢研究,很好用的。给你张图!

‘伍’ 关于如何判断gcc之类的编译器的编译结果

我们再使用gcc编译的时候可以让他的输出信息保存到文件当中

gccmain.c-omain&>status.txt

上面的命令就是将gcc编译的信息保存到status.txt文件中,然后我们再程序中读取文件,看文件是否有内容,没有内容就说明没有报错和警告,编译成功。有内容就对每一行内容进行判断,看是warring还是error,只有warring也代表编译成功,有error代表编译失败,然后把这些报错信息都打印出来就好了。

下面看一下例子:

‘陆’ c语言编译器怎么看结果啊

1、要点两次按钮,第一次是”编译“按钮,看有没有提示出错,提示没出错,才点“运行”按钮,出错要先改对了才能运行,点”运行“按钮。

2、编译器就是将“一种语言(通常为高级语言)”翻译为“另一种语言(通常为低级语言)”的程序。一个现代编译器的主要工作流程:源代码 (source code) → 预处理器 (preprocessor) → 编译器 (compiler) → 目标代码 (object code) → 链接器 (Linker) → 可执行程序 (executables)。高级计算机语言便于人编写,阅读交流,维护。机器语言是计算机能直接解读、运行的。编译器将汇编或高级计算机语言源程序(Source program)作为输入,翻译成目标语言(Target language)机器代码的等价程序。源代码一般为高级语言 (High-level language), 如Pascal、C、C++、Java、汉语编程等或汇编语言,而目标则是机器语言的目标代码(Object code),有时也称作机器代码(Machine code)。

‘柒’ VC编译器怎样输出编译结果到文件

http://cache..com/c?m=&p=c96ecd16d9c041ed08e296385b51&user=

这个文章,你可以看下,做这个系统很复杂
不过建议如文章内的,使用GCC编译。

‘捌’ 怎样查看C/C++程序编译过后的结果

VC编译生成.obj文件,gcc或g++生成.o文件,链接后windows下生成exe,编译情况(错误、警告等)要看编译器输出

‘玖’ 汇编程序在哪里编辑,运行时候哪里看结果

一、汇编语言程序的运行方式有两种,一种是:如果运行结果在屏幕上显示,则可直接执行(.EXE文件或.COM文件),有时需要在程序中加入两条指令MOV AH,1 INT 21H,作用是使结果在屏幕上停留,直到按任意键为止;另一种是:如果结果在内存或寄存器中,则需要用DEBUG命令-G或-T命令执行后,再用-D显示内存单元的内容或用-R显示寄存器的内容。

二、我用的就是VisualASM编辑器,非常好用。有下列一些汇编工具:
1、MASM(我以前用的,分步的,初学者不易掌握)
2、VISUALASM(我一直在用,感觉比较好,集成环境的,软件下载地址:http://www.onlinedown.net/soft/2002.htm) (强烈推荐)
3、win32汇编的masm32软件包(Windows环境下的)
4、nasm(linux平台)
5、RadASM下载地址http://www.crsky.com/soft/5471.html(功能太大了,我还没用好)

热点内容
内置存储卡可以拆吗 发布:2025-05-18 04:16:35 浏览:335
编译原理课时设置 发布:2025-05-18 04:13:28 浏览:378
linux中进入ip地址服务器 发布:2025-05-18 04:11:21 浏览:612
java用什么软件写 发布:2025-05-18 03:56:19 浏览:31
linux配置vim编译c 发布:2025-05-18 03:55:07 浏览:107
砸百鬼脚本 发布:2025-05-18 03:53:34 浏览:942
安卓手机如何拍视频和苹果一样 发布:2025-05-18 03:40:47 浏览:739
为什么安卓手机连不上苹果7热点 发布:2025-05-18 03:40:13 浏览:802
网卡访问 发布:2025-05-18 03:35:04 浏览:510
接收和发送服务器地址 发布:2025-05-18 03:33:48 浏览:371