2 ms·
I'd gently suggest that if you wanted me to have that context when interpreting your statement, you could have provided it in your original statement or provide
by maxbond 4y ago
I'd gently suggest that if you wanted me to have that context when interpreting your statement, you could have provided it in your original statement or provided it now blamelessly, rather than framing this as a deficiency on my part that I failed to use my crystal ball to determine you were an embedded programmer. (I do very similar things at the application level, for what it's worth.)
I believe the solution I proposed remains viable in that context or for that usage. If I defined a constant for the magic memory address one writes to to configure the MMU, and you and to understand how I implemented context switching, you could navigate to my constant and find usages.
If that solution doesn't work for you, no worries, it was just a suggestion/observation.
- 4ad 4y agoYes, exactly, now you need special tools (you mentioned IDEs) when previously you could have used grep.
- maxbond 4y agoYou could also use CScope or grep for the constant's variable name. I don't consider an IDE to be particularly specialized, but you do you, I hate it when people tell me I'm using the wrong IDE, so I'm not going to tell you to use an IDE. To be clear, I grep for things all the time, even though I use an IDE.
- 4ad 4y agoIt's not about searching for specific values either. Sometimes you find some unknown value that's not reflected in the out of date or simply wrong datasheet. What does it do? Well, it's quite likely it does something related to other values that use the same mask, so you can try to figure out the mask by searching for lexical subsets of the value, which because of the magic of base 16 is an extremely effective strategy in finding related things. Much harder now with underscores. And it's also about being able to search Google for a found constant, which indexes other people's code. There have been plenty of occasions where I found newer version of proprietary driver code that the hardware manufacturer claimed it either lost or doesn't exist and won't provide to us by simple searching for constants on Google... But more often is to just find drivers from other operating systems that already support that device, or mailing lists or forums where other people try to reverse engineer the device.
- maxbond 4y agoFor sure. I think there are some semantic/type-aware grep implementations. I'm sorry this language feature creates frustration for you and interrupts your workflow.