Field not found when searching in ILE C programs under debug mode - c

While I was working on an ILE C program under debug mode, I intended to search the occurrences of a field through the program. This field is part of a structure, so I included the structure variable name in the search as well. But the search did not always work. It displayed the message field not found occasionally, even if that variable was right in front of my eyes. And this happened again when I tried to use that field to set up a conditional breakpoint. Does anyone know why this happened? And how to solve this issue?

If you are doing the search in the ILE debugger using the F command, be sure to start at the top. The ILE Debugger will search from the current point, or sometimes from the last search result. Using T to go to the top of the source will reset that and then you can use F to find again from the top.

Are you taking account of the fact that C is case-sensitive? If you don't use the exact case of the variable name then the variable will not be found; certainly on the conditional breakpoint.

Related

using GDB with arguments

For a class assignment we needed to write a compiler. This includes an optimizer portion. In other words, we take in a file with some "code". An output file is generated. In the second step we take in the outputted code and remove any "dead" code and re-output to a second file. I have some problems with the optimizer portion and would like to use gdb. But I can't get gdb to operate properly with the input and output files arguments. The way we would normally run the optimizer is:
./optimize <tinyL.out> optimized.out
where tinyL.out is the file outputted in the first step and optimized.out is the file I want to output with the new optimized and compiled code.
I have searched Google for the solution and the tips I have found do not seem to work for my situation. Most people seem to want to only accept an input file and not output a separate file as I need to do.
Any help is appreciated (of course)
I'm not exactly sure what you're asking. But since I'm not yet able to comment everywhere, I write this answer with a guess and edit/delete if necessary.
When GDB is started and before you start the program you wish to debug, set the arguments you want to use with set args.
A reference to the documentation.
You just need to do the file redirection within gdb.
gdb ./optimize
(gdb) run < tinyL.out > optimized.out
https://stackoverflow.com/a/2388594/5657035

Eclipse CDT: Mapping console output to source file and line

While debugging code it helps to have source filename and line number on console output. I already use FILE and LINE macros. But it would be great if double clicking a line in the console output would take me to the exact source line which was responsible for outputting that line of log. Can eclipse parse console output and do something like this? It need not work all the time, only when the log line is in a specific format and the source filename and line number are valid.
It's possible to use a workaround if you add the pydev plugin and a few lines of python to call your main function. You can find the needed code here: https://github.com/oct15demo/python_calls_cpp
As noted there, I posted a query on the Eclipse forum to find out the status of any ongoing effort or obstacles to implement within Eclipse.
I could not find out any further information on the feature, if it's there, it's well hidden.
Update March 17, 2022, I shall be working on the feature for Eclipse, don't have an estimate of time yet.

Linux sever--a "^C" appear behind $ after choosing anything with mouse

I have stage server which I use it with Xmanager. In the stage sever,after whatever I choose using the mouse,a "^C" will appear automatically after $.For example ,I choose "system/" with mouse,and a "^C" soon appears in the command line.
It never happened before until yesterday I tried "Shift+Ctrl+V" which means "copy" after I choosing the command line which I wanted to copy, but it didn't work although I tried several times.And then the problem I described existed.
It's really confusing,and I don't whether "^C" has any bad effect.
How to resolve this problem?Anyone knows why it happened?
The reason causing this problem is that I opened youdao dictionary simultaneously with its function of catching words on the screen on. Just close it and the problem won't happen again. I don't know why maybe it has something to do with the software's compatibility.

Dokan cAlternateFileName doesn't seem to work

I am writing a File System Driver for Windows 7. I'm using the Dokan library. In the FindFiles function I want to set the 8.3 alternate name. I am assuming that will show up if I use dir /x but it doesn't. I have tried passing a null terminated string then changed to a blank padded (not null terminated) string as coded below. Neither one show the alternate name the dir /x.
See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365740%28v=vs.85%29.aspx for a reference to cAlternateFileName in struct _WIN32_FIND_DATA.
Does anyone have any information on this?
Here is a clip from my code:
wsprintf(w_surfaceName, L"S%d-P%02x~1", pCartIDtable[count].dsmNumber, pCartIDtable[count].pltrNumber);
wp = wcschr(w_surfaceName, L'\0');
wmemset(wp, L' ', _countof(w_surfaceName) - (wp - w_surfaceName));
wmemcpy(findData.cAlternateFileName, w_surfaceName, _countof(findData.cAlternateFileName));
FillFindData(&findData, DokanFileInfo);
Either the file doesn't have an 8.3 short-name, or the field hasn't been filled in.
Some versions of Windows have short-name generation turned off by default. Some people have short-name generation turned of just to make the file system faster. Even if you have short-name generation turned on now, that doesn't retro-actively go and generate short names across your existing file system.
And the field is not filled in anyway if the request was only for "FindExInfoBasic".
Dokan does not support 8.3 short-names at this point. Progress for implementation of this feature is tracked at: https://github.com/dokan-dev/dokany/issues/301

Bolding text in console output

For extra credit, the professor wants us to use bolding and/or underlining to text output in the current project.
The example he gave was b\bb o\bo l\bl d\bd is displayed as b o l d
Following that example, I marked up SPACE as
printf("\033[7mS\bSP\bPA\bAC\bCE\E- move forward one page\033[0m");
I'm also implementing reverse video by enclosing strings within \033[7m and \033[0m fields. The reverse video inverts the colors of the line appropriately, but doesn't seem to be affecting the bolding, since both strings with and without the reverse video are not bolding.
Could it be the standard shell used in Ubuntu 10.10 that is at fault?
I agree about using curses, but given your starting point ....
I think you want to use the 'bright' feature of VT100 for the bold, ESC[1m
You can probably find better doc on VT100 codes, but using this page I found the codes. ANSI/VT100 Escape Codes
I hope this helps.
Unless you're just trying to be masochistic, try using curses (or ncurses) instead.
// warning: Going from distant memory here...
curs_attron(A_INVERSE); // maybe A_REVERSE? I don't remember for sure.
curs_addstr("SPACE - move forward one page");
curs_attroff(A_INVERSE);

Resources