Search This Blog

Showing posts with label Tips. Show all posts
Showing posts with label Tips. Show all posts

Tuesday, January 9, 2024

Handling Large file - generated

Dealing with Large Symbol Files


nice tool to compress exe or runtime file on linux 
use UPX

Monday, March 27, 2023

Debugging C++ , with VSCode & GDB command ( improve loading performance tip for heavy projects)

 Its all about symbols that loaded into memory in the debug process.

 With VScode could takes time just to get into your breakpoint, on huge c++ project , with many so files and dependencies. 
sometimes moving with F10 takes time , and looks like vscode screen is freezing.
to fix this issue and get much better vscode debug performance follow the next steps:
add to launch.json file as follow the next section, make sure in the exceptionList you have your brand so file .
the section below prevent loading extra symbols that you don't need to debug.
you can add many so file is the exceptionList separated by semicolon "tttt.so;yyy.so"

"symbolLoadInfo": {
                "loadAll": false,
                "exceptionList": "libMyShared.so"
            },  

The next tip with VScode - make sure to close the Local list in the VARIABLES group

GDB 

to work with gdb command line make sure all the symbolic will not loaded , the default is ON.

the next parameter control such behavior

in gdb type 'set auto-solib-add off' - disabled loading any symbolic files.


you can start your program 

and when your SO files loaded , you can CTRL-C 

and use the share command to load your so symbolic file.

share /path/mysofile.so 


option 2 : put in your program the next line 

__asm__ volatile("int $0x03");


its will break into your gdb and use share command to load your symbolic .




enjoy 

Yaniv Tzanany

Monday, March 20, 2023

C++ custom debugger view for VisualCode

you can add custom view  for debugger.

https://www.cppstories.com/2021/natvis-tutorial/

https://devblogs.microsoft.com/cppblog/debug-visualizers-in-visual-c-2015/

create into your root folder  xxx.natvis

make sure in the launch.json  to add

            "visualizerFile": "${workspaceFolder}/xxx.natvis",
            "showDisplayString": true,

more sample:

 https://learn.microsoft.com/en-us/visualstudio/debugger/create-custom-views-of-native-objects?view=vs-2019

note:

the Name of the class must be full qualified e.g. contain namespace name if exist.

even typedef name should be act as new Name in the natvis file.

ty  

enjoy

Yaniv 

sample template class:

template<typename T> class MyObject
{
public:
    MyObject() : myVal( 5 ) {}
    T myVal;
};


sample template  natvis file:

<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

<Type Name="MyObject&lt;*&gt;">
  <DisplayString>{{myVal = {myVal}}}</DisplayString>
  <Expand>
    <Item Name="[myVal]">myVal</Item>
  </Expand>
</Type> 
</AutoVisualizer>

Wednesday, January 25, 2023

Wednesday, February 9, 2022

Free Test tools

 Have a look at this free tools , working good for QA and web testers


https://testproject.io/


Friday, January 7, 2022

Google sheets api - [The caller does not have permission] - shared sheets

In case you cant access to shared sheets via your code.

make sure to create a service account , copy the "email" for this service account.

make sure the one who shared the file, share it with your service account email.

and it should work.


working with API_KEY on shared sheets get failure.

only service account.


access to your own sheets could be done via api_key or service account.

links:

https://developers.google.com/api-client-library/dotnet/guide/aaa_oauth#web-applications-aspnet-mvc

https://cloud.google.com/docs/authentication/production

https://developers.google.com/sheets/api/quickstart/dotnet

        https://ios.developreference.com/article/10721497/Using+.Net+to+access+Google+Sheets+with+a+service+account+generates+a+%E2%80%9CThe+caller+does+not+have+permission+%5B403%5D%E2%80%9D+error

  

Enjoy 

Yaniv 

Wednesday, May 5, 2021

Sunday, September 27, 2020

Move GoDaddy Domain Name To Your Azure Website

very helpful tips

 https://www.codeproject.com/Tips/890336/Set-Your-GoDaddy-Domain-Name-To-Your-Azure-Website#:~:text=Login%20to%20your%20account%20in,the%20window%20in%20step%204


Saturday, November 30, 2019

free for developers

Developers and Open Source authors now have a massive amount of services offering free tiers, but it can be hard to find them all in order to make informed decisions.


https://free-for.dev/#/?id=stun-webrtc-web-socket-servers-and-other-routers

Tuesday, October 22, 2019

C# Controller - accept any json in POST (not typed)

in case you want to get any json string (not typed) , you can try the next code snippets

             [HttpPost]
        public ActionResult Bot(string request)
        {
            Request.InputStream.Position = 0;
            var input = new StreamReader(Request.InputStream).ReadToEnd();

            JObject json = JObject.Parse(input);
           ...........
       }