|
With Visual Studio I can set conditional breakpoints. Although even there, I fall back on this technique, because variants are usable for it everywhere - even on command line builds, even with GCC, and even in C#!
Real programmers use butterflies
|
|
|
|
|
If it is .net code then you can use the free tool that I use for C#:
dotPeek: Free .NET Decompiler & Assembly Browser by JetBrains[^]
I don't know if any other tool that is free to use that does the same thing for non .net code.
This tool reads in a .dll and shows you all the members, methods, classes, etc. in tree form (and searchable). I have used it to port over VB.net code to C#, that was only in a .dll (missing source code). It helps a lot.
... of course, providing the assembly code is was not obfuscated first.
|
|
|
|
|
Yeah, I use VS's builtins, reflector or ildasm for that. This is unmanaged code though so you don't have type information in a happy metadata file to work with, and the C++ compiler may take that neat little struct you made and totally deconstruct it into its component parts and scatter it across your binary.
So things get ... complicated.
Real programmers use butterflies
|
|
|
|
|
I suppose that you are curious as to how that multiply affected your code.
movsd xmm0, QWORD PTR __real@4024000000000000
; 457 : st.real+=(cp*(pow(10, (st.flags.fracCount * -1))));
neg eax <------------That's the sign reversal
xorps xmm1, xmm1
|
|
|
|
|
I assumed that, but it's nice to verify. One thing I miss about Visual Studio is getting disassembly out of your code was pretty easy. No wrangling with much.
What's interesting to me is what registers it's using. looks like SIMD instructions.
Real programmers use butterflies
|
|
|
|
|
Actually, it's not that hard. The hardest part is determining how far to go. What I mean is I have a little library that will disassemble X86 code up to the 32-bit, Pentium level. It does not do X86-64 stuff. It began life as a 486 disassembler and I added more to it for the Pentium instruction set and tweaked it a bit more. Here's the prototype of the entry point :
int DisAsm( unsigned char *buffer, int length, FILE *fpout ); As I mentioned, I'm not sure how to determine the length in compiled code. I used this when I wrote a C-like scripting language and then converted its java-style, interpreted byte code into Pentium machine code and this let me see the emitted code so, of course, I knew the length. You could probably set up a table of your functions addresses and use some pointer arithmetic to determine the bounds of each function's code. You could also use this along with a PE file reader and make a disassembler for executable files if you wanted to. FWIW, I have compared its output with listings output from VS C++ and they agreed.
Anyway, I can share this with you if you would like it. I found it years ago and it has a GNU license. Here's a comment from it : Quote: The code was originally snaffled from the GNU C++ debugger, as ported
to DOS by DJ Delorie and Kent Williams (williams@herky.cs.uiowa.edu).
Extensively modified by Robin Hilliard in Jan and May 1992.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Cool. I probably don't need it right now but that is cool code. 😎
Real programmers use butterflies
|
|
|
|
|
Something that would enhance a stack trace log (on an exception, for example) would be including each stack frame and the contents of registers so that the values of locals could be looked at during debugging.
|
|
|
|
|
Cool for making core dumps useful maybe
Real programmers use butterflies
|
|
|
|
|
Maybe is right, because it can be hard to tell where the compiler squirreled the locals away!
|
|
|
|
|
Running into that right now, looking at my .S file for a project compiled with all optimizations enabled, and the asm code is all very postmodern.
What is a type, really? Definitely my compiler is eschewing grand narratives about my data and getting very creative about how it interprets it. I'm having a hard time keeping up.
Real programmers use butterflies
|
|
|
|
|
When we went from a stack machine (running on a CPU developed in-house during the 1980s) to the Motorola 68K series, it created lots of work for our compiler and tools groups.
|
|
|
|
|
Writing that machine code generator is one of the funnest things I have ever done. It was done purely for performance reasons. We were trying to sell a targeted application framework and we got lots of questions about the performance of the script engine. As it turns out, it was more than adequate and get even more so as machines got faster but people didn't buy that so I figured out a high performance option. Once I got it done it was fascinating to evaluate its performance. I found that it was neck and neck with Visual C++'s unoptimized code and I was very, very happy with that. The interesting thing was comparing the performance with VC++ code that was optimized. That really showed me the power of optimization because in some cases I saw a 50% improvement. In the stuff I was most interested in, which was numerical computations, it was more like 20% but that is significant. Back then, the fastest hardware was just getting into the 200MHz range so optimization was very important. Now, we are in the multi-gigahertz range and CPUs barely register any usage at all when running that application, which is still being actively deployed.
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
Heady days! Back when optimizations still mattered. It's one of the things I like about writing stuff that deals with huge data and/or tiny devices. Optimization still matters. And then making it cross platform to boot? And without a ton of conditional compiles? I'm really having fun getting the C++ compiler to do this dance with me.
Real programmers use butterflies
|
|
|
|
|
Mrs. Wife was, as wives are wont to be, "in a mood last night". Wanting surfaces left bare (as though company were coming) and making assorted demands on where in the house I work from. This morning I experienced the "things bundled in one heap and rubber-banded together" effect.
So - I wonder: will this jolly scene continue into the evening, with a dialog in which only one party is aloud to speak? Alternatively, will she come to her senses (for a while), having slept off whatever burr got up . . . ?
Will the year end with whining or wine?
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I would recommend Wining & Dining, and as a last resort SMOKE DEVICES[^]
modified 31-Dec-20 8:44am.
|
|
|
|
|
OK - champagne (non-EU approved source !!!!) is in fridge. I'm the cook around here (she's a lucky lady, indeed !). Going out to eat is a not-possible thing.* Actually, a favorite of hers (you have inspired me) is a pseudo-lasagna (a hybrid with a baked-ziti type construction, but with Orzo and ricotta: much easier to prepare). That may indeed work.
Unless she starts in before I start cooking or something like that. Perhaps if I let her win at 500 Rummy?
The whole trick, really, is to let "them" talk and just try to ignore the things that are gossipy and/or preposterous pronouncements.
* The closest we have, for what seems like forever, is takeout. Tasty; more food for less money; but it doesn't satisfy her feminine desire to be, well, wined and dined.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
That reminds of a single-frame comic. Male Prostitute[^]
"They have a consciousness, they have a life, they have a soul! Damn you! Let the rabbits wear glasses! Save our brothers! Can I get an amen?"
|
|
|
|
|
W∴ Balboos, GHB wrote: Will the year end with whining or wine?
Why not watch this classic play together?
Runs, ducks, rolls, & hides...
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
You, Sir, are definitely no help!
|
|
|
|
|
Perhaps she has been reading your Lounge posts, and her worst fears have been confirmed
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
KSS rules preclude my describing how the New Year started.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Happy New Year to all! May 2021 be kinder to you than 2020 was.
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
All I am hoping for is that 2021 is NOT worse than 2020.
|
|
|
|
|
Based upon peoples behavior and current trends, it looks like 2021 will be mostly uphill because we're starting out in a rush to hell. Look for Hell-Max about early to middle January: those who have picked up COVID at xmas parties can share it at New Years parties.
After that, for a while, things should begin to taper off. If the vaccinations work, and there aren't any riots when those eligible for the vaccine becomes most of us, we may yet enjoy the majority of the year.
Anyone who makes it to 2022 is declared a winner.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|