-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot debug fc::http_server with Visual Studio or CLion #1141
Comments
also I need to resolve this issue and only after that I will can resolve #929 issue |
Ubuntu 16.04
I use next launch.json in Visual Studio Code for debugger:
|
i use gdb to debug bitshares, never tried other. don't remember if i debugged those specific files before but gdb should work in all cases. |
@oxarbitrage Thx for your answer ! I use gdb too inside Visual Studio Code as you can see in my launch.json configuration file |
@oxarbitrage can you try please to debug http_server.cpp code inside fc library ? |
make sure you are debugging the |
why @oxarbitrage can you try please to debug |
@oxarbitrage I can debug |
I use Eclipse CDT with good success on Ubuntu 18.04, and used it for many years on other operating systems and versions, including Ubuntu 16.04. I am unfamiliar with Visual Studio outside of Windows, so I can't help you much there. But if you want to give Eclpse CDT a try, you may get further. As for why you cannot debug http_server, give us a hint. Why can't you debug it? Does Visual Studio blow up? Does it say you can't do it? Does it refuse to enter the method? Does it not stop at breakpoints within fc::http_server? One note: These components are multithreaded. So you may want to set breakpoints to not confuse yourself when the active thread changes. |
@jmjatlanta Thank you very much for your answer and help ! 👍 I will try Eclipse CDT immediately now :-) and maybe soon will close this issue ! |
Common causes of breakpoints not working:
|
@jmjatlanta Thanks a lot 👍 I think 3rd point is the issue because of compilation maybe, don't know now exactly :-) need to check because fc::http_server must be runned by any http requests I tried to debug all lines of code inside fc::http_server :-) |
the only place in code that |
where then in code witness_node sends results on http requests ? |
it is done with the |
which file inside libraries/fc folder ? cannot understand there are only websocket.cpp and http_server.cpp and http_connection.cpp as I can see also http_connection.cpp is used by cli_wallet as I can see and http_server.cpp is used by witness_node |
does cli_wallet implement http server ? so doesn't witness_node implement http server ? I think that cli_wallet as I can see in code just use http connection and not http server as you said @oxarbitrage |
the witness node open an |
@oxarbitrage Thank you very much 👍 I think I was wrong then :-) I will check it now ... I know that I need to open websocket connection or by curl for API because I need to fix #929 issue.
|
If you want to debug with a specific debugging tool, you need to figure out how to use the tool. To me it's more like basic programming skills. I don't think here is the correct place to discuss it. |
@abitmore for you is like basic programming skills ? but why you answered that you don't know what is the problem with debugging ? @ryanRfox told me yesterday that it is better way to discuss it here and not in telegram. @abitmore what is your suggestion where to discuss this ? Because I really can debug all other stuff for example like websocket, but cannot handle responses from RPC-ENDPOINT on cURL requests, is it basic programming skills for you @abitmore then help me please, can you ? Also I've tried @oxarbitrage solution and can see breakpoints work on wscat requests but not on cURL requests. For example exactly this line of code https://github.com/bitshares/bitshares-fc/blob/0a90eff69778c0ef1d26f75d11d459ca172eff0c/src/network/http/websocket.cpp#L161 can be stopped by breakpoint for wscat requests on sending result, but on cURL requests breakpoints here won't work. |
As @jmjatlanta mentioned above:
|
Also @abitmore I don't want to debug with a specific tool, I just want to debug with any tool but I've tried different debugging tools and cannot debug just some little part in fc library, at the same time other parts of the same fc library I can debug with different debugging tools. @abitmore can you help me please to debug with any debugging tool specific cURL requests for witness_node ? which tool do you suggest for this purpose ? I think if it is really basic programming skills for you than you should help me and after that close this issue :-) |
Please discuss this in issue #929. It's related. |
who can help me guys please 😉 ? I cannot debug fc/src/network/http/http_server.cpp even in Visual Studio cannot debug and cannot debug it even in CLion studio, I've placed breakpoints, but nothing helped me and after simple curl http request I cannot see that program pauses inside fc::http_server
at the same time I can debug in Visual Studio and in CLion fc/src/network/http/websocket.cpp, breakpoints work well enough for fc::websocket !
maybe anybody can help me ? maybe should I use another debuggers ? what is your suggestion/advise ? can anybody advise please what is the best app for debugging processes in C++ so I can debug everything in BitShares-Core project even fc::http_server :-) ?
The text was updated successfully, but these errors were encountered: