debugging

Identify source file name for a symbol in gdb debugger

拈花ヽ惹草 提交于 2020-08-25 04:21:07
问题 I am debugging an application based on multiple C++ shared libraries in gdb on Ubuntu 18.04 and want to find the source code (or at least the name of the shared library or C++ namespace) of a symbol called TRUE . All code has been compiled with -g3 -O0 -Wall . Edit: I have "only" the debug symbols available for shared libraries and the application code is compiled with -g3 -O0 -Wall . Here is what I know about the symbol in gdb : (gdb) ptype TRUE type = enum {FALSE, TRUE} (gdb) whatis TRUE

How to debug Django custom management command using VS Code

ⅰ亾dé卋堺 提交于 2020-08-24 09:00:29
问题 I am trying to debug a custom management command using Visual Studio Code. For this I have gone through the official VS Code tutorials for working with Python and Django, and I have managed to get debugging to work while following these tutorials. VS Code Python tutorial / VS Code Django tutorial The problem is that for a Python script (no Django), the debugger works because I run a specific file (by pressing f5) while the file's tab is open. Django debugging works because VS Code knows when

Can I step into Python library code?

前提是你 提交于 2020-08-24 07:33:05
问题 When I run my Python debugger, I can step into functions that I write. But if I try to step into a library function like os.mkdir("folder") , for example, it "steps over" it instead. Is there a way to step into builtin library functions to see what Python is doing under the hood? Ideally there'd be a way to do this in PyPy so that you could keep drilling down into Python code. 回答1: pdb , the Python Debugger, cannot step into C functions like os.mkdir , but gdb can. Try this: gdb --args python

How to write a debugging helper for qtcreator?

China☆狼群 提交于 2020-08-23 08:02:06
问题 When debugging my C++ program using the glm::vec3 class with gdb, the vector classes are quite cumbersome to work with: I've read in the manual, that it's possible to write debug helpers. I've managed to get qtcreator to load the file (the debugger exits immediately with an error, if my python file has a syntax error). How can I write a minimalistic debugging helper? What I've already tried: Here's the C++ code #include <glm/glm.hpp> class Foo { }; int main(int, char**) { glm::vec3 vec3(42,

Python-pdb skip code (as in “not execute”)

南楼画角 提交于 2020-08-22 07:31:13
问题 Is there a way to skip a line or two altogether in pdb? Say I have a pdb session: > print 10 import pdb; pdb.set_trace() destroy_the_universe() # side effect useful_line() And I want to go straight to useful_line() WITHOUT invoking pdb() once again, or destroying the universe. Is there a way to skip (i.e. not execute code) what is between print 10 and useful_line()? 回答1: Use the j / jump command: test.py contains: def destroy_the_universe(): raise RuntimeError("Armageddon") def useful_line():

Is it possible debug iOS Chrome on Windows 10?

青春壹個敷衍的年華 提交于 2020-08-22 05:11:48
问题 As the title says, I need to debug a website opened with mobile Chrome on an iOS device (iPod, iPad etc.) on Windows 10. I have successfully set up iOS Safari debugging on Windows 10 via Chrome DevTools (GitHub repo , helpful comment). I would love to do the same thing except with Chrome or Firefox and not Safari. Is it even possible? 回答1: Yes it is. You'll need node first and (web inspector enabled on iOS>Settings>Safari) then... Install weinre sudo npm -g i weinre (or) npm i -g weinre Run

Is it possible debug iOS Chrome on Windows 10?

一笑奈何 提交于 2020-08-22 05:11:00
问题 As the title says, I need to debug a website opened with mobile Chrome on an iOS device (iPod, iPad etc.) on Windows 10. I have successfully set up iOS Safari debugging on Windows 10 via Chrome DevTools (GitHub repo , helpful comment). I would love to do the same thing except with Chrome or Firefox and not Safari. Is it even possible? 回答1: Yes it is. You'll need node first and (web inspector enabled on iOS>Settings>Safari) then... Install weinre sudo npm -g i weinre (or) npm i -g weinre Run

Visual Studio Code debugger with Chrome refused to connect to localhost

£可爱£侵袭症+ 提交于 2020-08-21 06:52:31
问题 I've tried several suggestions on other posts to no avail. I have a 9 month old project that no longer shows in the browser from F5 debugging in vs code. I set up a brand new simple project with an index.html file to try to get Visual Studio code to launch it in a Chrome browser window. I keep getting an error page in chrome that says: This site can’t be reached localhost refused to connect. Did you mean http://localhost8000.com/? Search Google for localhost 8000 ERR_CONNECTION_REFUSED launch

Simplify modular exponentiation C++

穿精又带淫゛_ 提交于 2020-08-20 12:24:54
问题 I am attempting to write the decryption function for an RSA encryption system, everything seemed to be working fine for very small numbers, however sometimes the output just isn't correct (I think that the cause may be a floating point error or some kind of stack overflow). The process which is causing me problems can be simplified to (11^23) mod 187 but I will include the full code in case anybody wants to see it. I know that the answer should be 88 as it is the example used in Appendix J of

VSCode cannot read user input while debugging a python code in integratedTerminal

↘锁芯ラ 提交于 2020-08-20 11:28:09
问题 In this two-line python code: string = input("What's your name? ") if string != '': print('Hello, ' + string + '!') While I run debugging, it waits for user input. After typing a name, the Terminal (Python Debug Console) just halts there, the print() line never gets executed. See the screenshot below The launch.json file is below (as default): { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https:/