Microchip
直播中

黄辉

7年用户 231经验值
私信 关注
[问答]

与MDB不一致的行为

我试图用MDB自动化编程。大多数例子都在这样的文本文件中:“c:…MDB.BAT”& lt;pg.txtWe工作得很好。在我的PGM.TXT中,我使用以下命令:设备PIC32 MX795F512LHWORK-ICD3- pDeal. ./MyFr.HEX“QuthoWOWFEWO我试图制作一个通用的.BAT,它适用于任何HEX文件。这导致如下:(ECHO设备PIC32 MX795F512LCHO HWoToRT-ICD3- PECHO程序%1ECHORE退出)“C:…MDB.BAT”。在编程设备之后,“退出”命令永远不会执行,而我只剩下一个异常:“gt;& gt;线程中的异常”。“java. UtiL NouChelEngExpRebug:在Java.UTI.Scult.NestLoad(扫描仪.java:1540)在COM.Microchip .MPLAB。MDB.Debug命令。Mun.Run(main .java:163)在COM.M处找不到任何行。如果我省略了文件的PGM TXT版本中的“退出”命令,就会出现同样的异常。如果我把“退出”作为.BAT程序中的第一个命令,MDB将简单地显示一个空的“& gt”,表示输入被接受,但它不会退出。剩下的命令仍然执行。我尝试过的所有其他命令,不管我如何输入它(文本文件,从.BAT,手动输入),但退出命令似乎都被忽略了。有谁能解释一下为什么会这样?我目前正在运行MPLABX 3.15。

以上来自于百度翻译


      以下为原文

    I'm trying to automate programming using MDB. Most of the examples pipe in a text file like this:
"C:...mdb.bat" < pgm.txt
This works fine. In my pgm.txt I use the following commands:
device PIC32MX795F512L
hwtool ICD3 -p
program "./myFile.hex"
quit
However I was trying to make a general .bat that would work for any hex file. This lead to the following:
(
echo device PIC32MX795F512L
echo hwtool ICD3 -p
echo program %1
echo quit
) | "C:...mdb.bat"
This works as expected with one caveat. After programming the device the "quit" command never executes and I'm left with an exception:
>
>Exception in thread "main" java.util.NoSuchElementException: No line found
at java.util.Scanner.nextLine(Scanner.java:1540)
at com.microchip.mplab.mdb.debugcommands.Main.run(Main.java:163)
at com.microchip.mplab.mdb.debugcommands.Main.main(Main.java:136)
This same exception will occur if I omit the "quit" command in the pgm.txt version of the file. If I put "quit" as the first command in the .bat program, MDB will simply show an empty ">" indicating that the input was accepted, but it won't quit. The rest of the commands still execute.

Every other command that I've tried works no matter how I input it (text file, from a .bat, manual input), but the quit command seems like it's being ignored for some reason. Can anyone shed some light as to why that is?

I'm currently running MPLABX 3.15.

回帖(3)

马念

2018-9-26 10:22:53
谢谢你报告这个问题。这是MDB中的一个bug。首先我们不要考虑这种情况。我们正在努力解决这个问题,我们需要更多的测试来确保它确实解决了你提到的所有问题。既然我们已经为V4.20分支了,我们希望这个修复将在V4.20之后的版本版本中。

以上来自于百度翻译


      以下为原文

    Thank you for reporting this issue. This is a bug in MDB. We might not well consider this situation at the first place. We are working on the fix, and we need more tests to make sure it did fix all the issues you mentioned. Since we already branched for v4.20, we hope this fix will be in the release version that is after v4.20. 
举报

h1654155275.5741

2018-9-26 10:28:58
伟大的!谢谢你的回复。

以上来自于百度翻译


      以下为原文

    Great! Thanks for the reply.
举报

马念

2018-9-26 10:41:38
看来MDB从“一般”.BAT文件中获得“退出”(结束一个空间)。当MDB处理命令时,它对输入字符串进行修整。但是,当它检查“退出”命令退出时,它不会修剪输入字符串以供比较。一旦我们解决了这个问题,这个异常就不再被抛出。正如我之前提到的,这个修复将在V4.20之后的版本版本中。

以上来自于百度翻译


      以下为原文

    It appears that MDB got "quit " (end with a space) for the "echo quit" from your general .bat file. When MDB processes the command, it trims the input string. But when it checks for "quit" command to quit, it doesn't trim the input string for the comparison. Once we fixed this issue, the exception was not thrown anymore. As I mention before, this fix will be in the release version that is after v4.20.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分