完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我使用MPLAB X V3.26和C32 V1.40编译程序。我想得到所有静态/全局变量的列表,以及它们在RAM中的位置。当我在调试中暂停运行时,我可以得到一些,并且在暂停中,我也可以看到带有值的RAM位置列表。但是,我不能得到所有变量名的完整列表及其位置。我本来会想到.map文件中的列表,但我不认为它像我想要的那样列表。那么,我怎么才能拿到这份清单呢?
以上来自于百度翻译 以下为原文 I am using MPLAB X V3.26 and C32 V1.40 compilier. I would like to get a list of all the static/global variables with their location in RAM. I can get a few when I pause the the run in Debug, and in pause I can also see list the RAM locations with the values. However, I cannot get a complete list of all Variable names with their location. I would have expected to the the list in the .map file, but I don't see it list like what I want. So, how can I get this list? |
|
相关推荐
16个回答
|
|
我不知道如何得到MPLA.x来给出一个静态表(不是堆栈)变量。首先,它取决于您正在调试的文件。如果在代码中使用特定的静态变量,则可以在其中设置断点。然后,当断点开火时,你可以在变量上做一个鼠标,然后你会得到变量的地址和值(如HEX)。
以上来自于百度翻译 以下为原文 I don't know how to get MPLAB.X to give a table of static (not on the stack) variables. First of all, it depends on what file you happen to be debugging through. If you know in your code where a particular static variable is being used, you can set a breakpoint there. Then when the breakpoint fires you can do a mouse-over of the variable and you will then get the variable's address and values (as hex) displayed. |
|
|
|
|
|
|
|
我就是这样做的。运行程序并中断。变量经常出现,但是为了确保我能找到变量,我必须把它添加到监视列表中。这是奇怪的,但经常是变量,即使它们是全局的,也不会出现在变量列表中。在任何情况下,我所寻找的是所有全局变量及其在RAM中的位置的列表。这通常在链接器映射中找到。但是,链接器映射不显示这一点。
以上来自于百度翻译 以下为原文 That's how I do it now. Run the program and break. The variables show up often, but to make sure I can find a variable, I have to add it to the Watch list. It's odd, but frequently the variable even though they are global don't show up in the variable list. In any case, what I am looking for is a list of all global variables and their location in RAM. This is usually find in the Linker map. However, the Linker map does not show this. |
|
|
|
马丁,你知道如何建立链接图来显示这些全局变量及其在RAM中的位置吗?我得到的链接器图没有显示这一点。
以上来自于百度翻译 以下为原文 martin, do you know how to set up the linker map to show these global variables and their location in RAM? The linker map I get does not show this. |
|
|
|
在默认设置下,我的
以上来自于百度翻译 以下为原文 With default settings mine looks like this Attached Image(s) |
|
|
|
我注意到这是在非调试模式中。在变量窗口中的调试中,变量被移动到200编辑:当然,如上所述,非全局变量不在其中。
以上来自于百度翻译 以下为原文 I note this is in the non debug mode. In debug in the variables window the variables are moved up 200 edit: and of course as mentioned above, non global variables are not in there |
|
|
|
我使用默认的设置。我只是检查了一个名为PrimTimeNook的映射文件——MeMoMon 0x800 000 610 0x20 Bug看起来不错。
以上来自于百度翻译 以下为原文 I use default settings. I just checked the map file for a variable called PrintTimer - all looks ok to me COMMON 0x80000610 0x20 build/pic32mz_ef_sk_meb2/production/_ext/1360937237/app_manager.o 0x80000610 PrintTimer 0x80000620 app_managerData |
|
|
|
我只是搜索了一下,你知道什么?我在地图上找到了我的变量之一。当我查看之前,我看到了一个普通的和一个对象文件,所以我假设它是关于那个对象的规范,而我所看到的只是一个列表,它列出了地图中不同部分的变量长度。我猜是假设我…再一次。谢谢你让我直爽。现在,我也许可以编写一个程序来获取这个文本文件,并将变量排序并与它们的长度相结合。
以上来自于百度翻译 以下为原文 I just did a search and what do you know. I found one of my variables location in the map. When I looked through before I saw the COMMON and an object file, so I ASSUMED it was specifications about that object and all I was seeing was a listing for the length of the variables in a different section of the map. I guess the ASSUME bit me... again. Thanks for setting me straight. Now I maybe I can write a program to take this text file and sort out the variables and combine it with their lengths. This case is closed. Thanks |
|
|
|
这个C语言应用程序对于XC16HTTPS: //www-嵌入式相关的.COM/Studio/Po.php的MicroMax容器(见文章中的GITHUB链接)非常有用。作者写道:“我已经用Microchip的XC16编译器测试了它,并且对于XC32也很有用(有一些最小的移植)。我不能判断什么是MI。“Nimple移植”意味着,但它可能比编写自己更容易。我也用XC16.&编辑进行了测试:毕竟它是一个GUI,例如XC32-Realff.EXE(…)XC16-Realff.exe和xc16nm. exe),因此您可以在选项行上使用选项-A来生成大量的输出,并查看它是否(或哪些选项)符合您的需求。地图查看器实用程序允许您在GUI中指定这两个GNU实用程序的路径。gt;
以上来自于百度翻译 以下为原文 This C# application works great for XC16 https://www.embeddedrelated.com/showarticle/900.php#commax_container (see link to github inside that article) The author writes: "I've tested it with Microchip's XC16 compiler and should also be useful for XC32 (with some minimal porting). I cannot judge what "minimal porting" means, but it might be easier than writing your own. I tested it also with XC16. |
|
|
|
|
|
|
|
|
|
|
|
RodiMs,MapViewer是非常令人印象深刻的。在我的PIC32编辑:C32 2.02编译器,NM和来自XC32 1.43Eddie:XC32 1.43编译器,NM,Read Efter WorkSeDe:信任RodiMS,一个很好的发现看起来很好。
以上来自于百度翻译 以下为原文 rodims, MapViewer is very impressive. Looks to works fine on my pic32 edit: c32 2.02 compiler, nm and readelf from xc32 1.43 edit: xc32 1.43 compiler, nm, readelf also works edit: credit to rodims, a very nice find Attached Image(s) |
|
|
|
出于好奇,你为什么要知道这个?在代码中设置变量的大小,以便您已经知道这一点。你可以设置变量的名称,这样你就不需要知道它在内存中的位置,因为链接器已经解决了所有对你的名字的引用-并且它们可以从一个链接变为下一个,这取决于一个整体的因素。苏珊
以上来自于百度翻译 以下为原文 Out of curiosity, why do you need to know this? You set the size of the variable in your code so you should know this already. You set the name of the variable so you shouldn't need to know where it is in memory as the linker will have resolved all of the references to the name for you - and they can change from one link to the next depending on a whole stack of factors. I'm just curious as to why this information is needed. Susan |
|
|
|
看起来像是一个愚蠢的问题时间-我需要从那个链接下载(GITHUB)?我找了一个可执行文件,但是找不到。
以上来自于百度翻译 以下为原文 looks like a handy tool silly question time - what do I need to download from that link (github)? I looked for an executable but couldn't find it |
|
|
|
当试图找到内存损坏的问题时,我使用了MAP文件——可能是数组的溢出。
以上来自于百度翻译 以下为原文 I have used the map file when trying to find a problem with memory corruption - maybe an overflow of an array. It can be useful to see relative positions of variables |
|
|
|
没有可执行文件。你可以使用“克隆或下载”/“下载zip”。C++项目由免费VisualStudio社区版构建出来。我得承认,如果你只是想看一看,安装有点胖。至少VS 2017比它的安装包更模块化。MAPVIEW实用程序和源代码是GPL-3,论坛软件对此进行确认,不允许我将其附加到ZIP这里。眨眼:
以上来自于百度翻译 以下为原文 There is no executable. You can use "Clone or download" / "Download ZIP". The C# project builds out of the box with the free Visual Studio Community Edition. I have to admit that the installation is a bit fat if you only want to have a short look. At least VS 2017 is a bit more modular with its installation packages. The MapViewer utility and sources is GPL-3, the Forum software acknowledges this and does not allow me to attach it as ZIP here. wink: |
|
|
|
只有小组成员才能发言,加入小组>>
5125 浏览 9 评论
1984 浏览 8 评论
1914 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3148 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2212 浏览 5 评论
693浏览 1评论
579浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
461浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
598浏览 0评论
493浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-1 01:19 , Processed in 1.454967 second(s), Total 109, Slave 92 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号