Marián ŠpánikMarián Špánik

My feedback

  1. 1 vote
    Vote
    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      You have left! (?) (thinking…)
      0 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
      Marián ŠpánikMarián Špánik shared this idea  · 
    • 1 vote
      Vote
      Sign in
      Check!
      (thinking…)
      Reset
      or sign in with
      • facebook
      • google
        Password icon
        I agree to the terms of service
        Signed in as (Sign out)
        You have left! (?) (thinking…)
        1 comment  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
      • 1 vote
        Vote
        Sign in
        Check!
        (thinking…)
        Reset
        or sign in with
        • facebook
        • google
          Password icon
          I agree to the terms of service
          Signed in as (Sign out)
          You have left! (?) (thinking…)
          0 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
          Marián ŠpánikMarián Špánik shared this idea  · 
        • 309 votes
          Vote
          Sign in
          Check!
          (thinking…)
          Reset
          or sign in with
          • facebook
          • google
            Password icon
            I agree to the terms of service
            Signed in as (Sign out)
            You have left! (?) (thinking…)
            15 comments  ·  Visual Studio IDE » Debugging and Diagnostics  ·  Flag idea as inappropriate…  ·  Admin →

            Thank you for using Visual Studio and for your commitment to improving it. We are currently evaluating whether we will be able to address this suggestion in a future release. Thanks for capturing the pain points you feel when stepping through multithreaded applications while debugging. We will be providing an update soon.

            Additionally, I wanted to clarify that the debugger will only ever complete a step on the thread from which the step was originated. So if you hit a breakpoint, disable it, and then begin stepping you should not stop on a different thread. If you have other breakpoints in your application and another thread hits one, then you will be debugging in the mixed thread state as described in this item.

            Kaycee Anderson
            Program Manager, Visual Studio

            Marián ŠpánikMarián Špánik commented  · 

            If I recall correctly it had been a pain to debug a C++ code in #pragma omp parallel for as it kept switching between OpenMP threads. I am not sure whether the issue was fixed or is still present.

          • 287 votes
            Vote
            Sign in
            Check!
            (thinking…)
            Reset
            or sign in with
            • facebook
            • google
              Password icon
              I agree to the terms of service
              Signed in as (Sign out)
              You have left! (?) (thinking…)
              8 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
              Marián ŠpánikMarián Špánik commented  · 

              This can be work-arounded by enabling "Show all files" in the solution explorer but it then display a lot of build folders, e.g. Debug, Release and x64. This reminds me first versions of DOS when partitions didn't have directories (although I am too young to live through it) so all files were in a root directory of the partition... it was overcomed a really very long time ago. This is a must, why wasn't it still implemented?

              Marián ŠpánikMarián Špánik supported this idea  · 
            • 4 votes
              Vote
              Sign in
              Check!
              (thinking…)
              Reset
              or sign in with
              • facebook
              • google
                Password icon
                I agree to the terms of service
                Signed in as (Sign out)
                You have left! (?) (thinking…)
                1 comment  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                Marián ŠpánikMarián Špánik commented  · 

                It is already implemented: https://msdn.microsoft.com/en-us/library/dn457346.aspx
                Alternatively you can also use a Debug.StepIntoSpecific command (I think it is Shift+Alt+F11 or something like that) which asks you which function you want to step into.

              • 158 votes
                Vote
                Sign in
                Check!
                (thinking…)
                Reset
                or sign in with
                • facebook
                • google
                  Password icon
                  I agree to the terms of service
                  Signed in as (Sign out)
                  You have left! (?) (thinking…)
                  under review  ·  7 comments  ·  Visual Studio IDE » Debugging and Diagnostics  ·  Flag idea as inappropriate…  ·  Admin →
                  Marián ŠpánikMarián Špánik commented  · 

                  The old autoexp.dat works for mixed mode debugging, so there is no explanation why the natvis shouldn't work. I have only one possible explanation but let's pray it didn't happen actually - that they took the code of the native debug engine and COPIED it to the managed debug engine - and none of the updates to the native debugging engine went there because of that.

                  Marián ŠpánikMarián Špánik commented  · 

                  I am starting to think that debugger for C++/CLI is completely different from native C++ debugger or at least most of it is. Missing Edit and Continue, different error message in watch window, not recognizing constructs for specifying module name like {,,msvcr120.dll}_crtBreakAlloc in watch window, missing support for debug visualizers, etc. - I think they should definitely do something with that.

                • 7 votes
                  Vote
                  Sign in
                  Check!
                  (thinking…)
                  Reset
                  or sign in with
                  • facebook
                  • google
                    Password icon
                    I agree to the terms of service
                    Signed in as (Sign out)
                    You have left! (?) (thinking…)
                    1 comment  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                    Marián ŠpánikMarián Špánik commented  · 

                    Also for _com_error a text from _com_error::Description() should be displayed and for own types an user-defined text. Maybe it could be defined in .natvis what should be displayed there.

                  • 75 votes
                    Vote
                    Sign in
                    Check!
                    (thinking…)
                    Reset
                    or sign in with
                    • facebook
                    • google
                      Password icon
                      I agree to the terms of service
                      Signed in as (Sign out)
                      You have left! (?) (thinking…)
                      1 comment  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                      Marián ŠpánikMarián Špánik supported this idea  · 
                    • 49 votes
                      Vote
                      Sign in
                      Check!
                      (thinking…)
                      Reset
                      or sign in with
                      • facebook
                      • google
                        Password icon
                        I agree to the terms of service
                        Signed in as (Sign out)
                        You have left! (?) (thinking…)
                        4 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                        Marián ŠpánikMarián Špánik supported this idea  · 
                        Marián ŠpánikMarián Špánik commented  · 

                        Currently we have to write code like this (I didn't check whether it compiles):

                        public ref class ManagedClass
                        {
                        NativeClass *nativeInstance = new NativeClass();

                        public:
                        ~ManagedClass(){this->!ManagedClass();}
                        !ManagedClass(){delete nativeInstance;}

                        // methods here
                        }

                        A second option to the suggestion is to store the native instance by value inside the managed class. It would require changes in .NET, but it would save a lot of programmers' time. It should be something like this:
                        public ref class ManagedClass
                        {
                        NativeClass nativeInstance; // uses automatic storage in a similar way as if it were inside a native class
                        // no manual cleanup of nativeInstance needed
                        }
                        In worst case the compiler could translate this code to the code we currently need to write (generating code for both native destructor and managed finalizer).

                      • 309 votes
                        Vote
                        Sign in
                        Check!
                        (thinking…)
                        Reset
                        or sign in with
                        • facebook
                        • google
                          Password icon
                          I agree to the terms of service
                          Signed in as (Sign out)
                          You have left! (?) (thinking…)
                          10 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                          Marián ŠpánikMarián Špánik commented  · 

                          Please also make the behavior similar for std::make_shared and std::make_unique. In this case case the debugger should stop in a constructor of the newly created object:

                          #include <memory>
                          struct A
                          {
                          A(int x){}
                          };

                          int main()
                          {
                          auto p = std::make_shared<A>(1); // after using Step Into here the debugger should break in A::A(int)
                          }

                        • 3 votes
                          Vote
                          Sign in
                          Check!
                          (thinking…)
                          Reset
                          or sign in with
                          • facebook
                          • google
                            Password icon
                            I agree to the terms of service
                            Signed in as (Sign out)
                            You have left! (?) (thinking…)
                            1 comment  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                            Marián ŠpánikMarián Špánik commented  · 

                            A correct version would be int main(std::dynarray<std::string> &args) with args passed by a reference (maybe const), otherwise an unneccessary copy of the whole dynarray with all the strings would be done when the CRT would be calling this main.

                            MS is already breaking the standard by having a wmain with argv being of a type wchar_t**.

                          • 1 vote
                            Vote
                            Sign in
                            Check!
                            (thinking…)
                            Reset
                            or sign in with
                            • facebook
                            • google
                              Password icon
                              I agree to the terms of service
                              Signed in as (Sign out)
                              You have left! (?) (thinking…)
                              3 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                              Marián ŠpánikMarián Špánik commented  · 

                              This can be done with lambda expressions. They have a slightly different syntax but they do the same:

                              public static int mainCalc(int a)
                              {
                              int b = 0;

                              Func<int, int> calc = (c) => a + b + c;

                              b = 100;
                              int d = calc(1) + calc(2);
                              return d;
                              }

                              You can also make a block with a lambda expressions, with the more similar syntax to a function definition:

                              public static int mainCalc2(int a)
                              {
                              int b = 100;

                              Func<int, int> calc = (c) =>
                              {
                              return a + b + c;
                              };

                              b = 100;
                              int d = calc(1) + calc(2);
                              return d;
                              }

                            • 11 votes
                              Vote
                              Sign in
                              Check!
                              (thinking…)
                              Reset
                              or sign in with
                              • facebook
                              • google
                                Password icon
                                I agree to the terms of service
                                Signed in as (Sign out)
                                You have left! (?) (thinking…)
                                0 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                                Marián ŠpánikMarián Špánik supported this idea  · 
                                Marián ŠpánikMarián Špánik shared this idea  · 
                              • 5,228 votes
                                Vote
                                Sign in
                                Check!
                                (thinking…)
                                Reset
                                or sign in with
                                • facebook
                                • google
                                  Password icon
                                  I agree to the terms of service
                                  Signed in as (Sign out)
                                  You have left! (?) (thinking…)
                                  92 comments  ·  Visual Studio IDE » Languages - C#  ·  Flag idea as inappropriate…  ·  Admin →
                                  Marián ŠpánikMarián Špánik commented  · 

                                  One possible solution is to use a structs instead of classes. The struct, as a value type, can't be null. However the struct can't be polymorphic (at least I think so) and you can't store any reference to it anywhere and you have to not forget to pass it as a reference to every function (ref keyword), otherwise you would copy it in each call. Also existing classes can't be used as the structs...
                                  https://msdn.microsoft.com/en-us/library/ah19swz4.aspx

                                • 36 votes
                                  Vote
                                  Sign in
                                  Check!
                                  (thinking…)
                                  Reset
                                  or sign in with
                                  • facebook
                                  • google
                                    Password icon
                                    I agree to the terms of service
                                    Signed in as (Sign out)
                                    You have left! (?) (thinking…)
                                    5 comments  ·  Visual Studio IDE » Install  ·  Flag idea as inappropriate…  ·  Admin →
                                  • 478 votes
                                    Vote
                                    Sign in
                                    Check!
                                    (thinking…)
                                    Reset
                                    or sign in with
                                    • facebook
                                    • google
                                      Password icon
                                      I agree to the terms of service
                                      Signed in as (Sign out)
                                      You have left! (?) (thinking…)
                                      20 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                                      Marián ŠpánikMarián Špánik commented  · 

                                      ... or make the C++ compiler faster so the precompiled headers would be not needed. I know it is not as simple as it looks, I have a notion how the compiler's source code looks after all the years just by looking at that full-of-macros Windows.h. The PCHs reduce build times to a tiny fraction so it would need to be blazingly fast to reach that build time without them. Maybe the non-standard modules would do it as the parser would not need to peek that header files over and over for many source files (which takes majority of the build time).

                                    • 6 votes
                                      Vote
                                      Sign in
                                      Check!
                                      (thinking…)
                                      Reset
                                      or sign in with
                                      • facebook
                                      • google
                                        Password icon
                                        I agree to the terms of service
                                        Signed in as (Sign out)
                                        You have left! (?) (thinking…)
                                        1 comment  ·  Visual Studio IDE  ·  Flag idea as inappropriate…  ·  Admin →
                                        Marián ŠpánikMarián Špánik commented  · 

                                        Also open source the C++ debugger so we can implement the features you weren't able to implement for years (recognizing overloaded operators, recognizing functions present in another module - DLL or EXE - than one at top of call stack, quickinfo and add watch for global variables and functions present in different namespace when using namespace is in code and they are written without full name, etc).

                                      • 10 votes
                                        Vote
                                        Sign in
                                        Check!
                                        (thinking…)
                                        Reset
                                        or sign in with
                                        • facebook
                                        • google
                                          Password icon
                                          I agree to the terms of service
                                          Signed in as (Sign out)
                                          You have left! (?) (thinking…)
                                          1 comment  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                                          Marián ŠpánikMarián Špánik shared this idea  · 
                                        • 67 votes
                                          Vote
                                          Sign in
                                          Check!
                                          (thinking…)
                                          Reset
                                          or sign in with
                                          • facebook
                                          • google
                                            Password icon
                                            I agree to the terms of service
                                            Signed in as (Sign out)
                                            You have left! (?) (thinking…)
                                            5 comments  ·  Visual Studio IDE » Languages - C++  ·  Flag idea as inappropriate…  ·  Admin →
                                            Marián ŠpánikMarián Špánik commented  · 

                                            The solution is (for MS):

                                            - rewrite #defines of constants to enums, it will be much better - it will also appear in debug information in addition to solving these problems, for example (I took random constants from winuser.h, starting from line 10858 on my computer):
                                            /*
                                            * Get/SetWindowWord/Long offsets for use with WC_DIALOG windows
                                            */
                                            enum WindowLongOffsets
                                            {
                                            DWL_MSGRESULT = 0,
                                            DWL_DLGPROC = 4,
                                            DWL_USER = 8,
                                            };

                                            - convert macros to functions:
                                            inline COLORREF RGB(int r, int g, int b)
                                            {
                                            // just copy the previous body of macro here
                                            return ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16)));
                                            }

                                            - for functions with ...A and ...W:

                                            * either use wrappers:
                                            #ifdef UNICODE
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxW(hWnd, lpText, lpCaption, uType);
                                            }
                                            #else
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxA(hWnd, lpText, lpCaption, uType);
                                            }
                                            #endif

                                            * or (even better) make overloads for both - just use the MessageBox above without #ifdefs, C++'s syntax allows it:
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxW(hWnd, lpText, lpCaption, uType);
                                            }
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxA(hWnd, lpText, lpCaption, uType);
                                            }

                                            * or maybe both of them to make it still working with C code:

                                            #ifndef __cplusplus
                                            #ifdef UNICODE
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxW(hWnd, lpText, lpCaption, uType);
                                            }
                                            #else
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxA(hWnd, lpText, lpCaption, uType);
                                            }
                                            #endif

                                            #else // __cplusplus
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxW(hWnd, lpText, lpCaption, uType);
                                            }
                                            inline WINUSERAPI int WINAPI MessageBox(_In_opt_ HWND hWnd, _In_opt_ LPCSTR lpText, _In_opt_ LPCSTR lpCaption, _In_ UINT uType)
                                            {
                                            return MessageBoxA(hWnd, lpText, lpCaption, uType);
                                            }

                                            #endif

                                            I hope you have some generator for code like that in winuser.h, otherwise it would be a **** of lots of changes for you. Macros are the worst part of C++ language, almost anyone will tell it to you.

                                            One last question: why the **** do you have structs like
                                            typedef struct tagRECT
                                            {
                                            LONG left;
                                            LONG top;
                                            LONG right;
                                            LONG bottom;
                                            } RECT

                                            when you can write (still compatible with C)
                                            typedef struct RECT
                                            {
                                            LONG left;
                                            LONG top;
                                            LONG right;
                                            LONG bottom;
                                            } RECT
                                            ? You have two different names for the same struct, confusing programs like Visual Assist.

                                          Feedback and Knowledge Base