I noticed that there are a couple of gdb specific environment variables introduced into the stack during debugging. Is there any way I could unset those environment variables alone?
I noticed that there are a couple of gdb specific environment variables introduced into the stack during debugging.
You must be using some kind of IDE, or a wrapper script, that does this. GDB itself doesn't modify environment, unless you ask it to with e.g. set env command.
Related
I was going through this appdynamics document page for the installation of C/C++ SDK.
C/C++ SDK installation on Linux
But since, i am doing this for the first time, i am not sure what is meant in the 3rd point.
I think i have to set the location in my LD_LIBRARY_PATH env variable and then invoke them by typing
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/appdynamics-cpp-sdk/lib
Can somebody explain, what needs to be done?
Yes - you need to set "/opt/appdynamics-cpp-sdk/lib" in your "LD_LIBRARY_PATH" environment variable to use the SDK as you have posted.
Generally this is put in a script used to build your application which you are wanting to instrument.
In development i need to test console utility with server environment variables. Is there a way pass the environment variables and compile utility as if it were running on a server?
Something like a crystal prog.cr -- PROG_ENV=production?
You just set environment variables in your shell like for any other program and they will be available in the Crystal compiler. For example PROG_ENV=production crystal prog.cr
This answer describes how you can manipulate the debugging environment when running gdb interactively. The specific suggestion is to use the following command aid in catching a Heisenbug.
(gdb) set disable-randomization off
However, when using gdb from the command-line, you lose a lot of amenities that you would have with a graphical debugging front end (such as nemiver or kdbg). I am using kdbg, which allows me to specify a command-line for use when invoking gdb. Is there a command-line argument that achieves the same results as the interactive command shown above?
I have a custom shell that I can run C++ applications in. I start the shell from a bash prompt and then run my C++ code. I want to emulate this behavior with Eclipse, particularly for debugging. I can't seem to figure this out.
I could write a simple bash script that kicks off the custom shell and runs my application but Eclipse does not let me debug when I do this.
Is there a way to achieve this functionality?
Please keep in mind eclipse can set environment variables for running/debugging job.
If your shell is more complicated than that, please provide more details about your shell.
But I'm not optimistic about it.
Btw, you can always attach an existing process for debugging.
Say I am in IPython (e.g. on the new QT console), and that I call a C++ library that I wrote from it (e.g. using SWIG or Boost.Python). I would like to set a breakpoint in my C++ code and have the ability to interact with my C++ workspace (i.e. my variables when I hit the breakpoint) with IPython (e.g. plot my C++ variables, etc.).
In other words I would like to debug my C++ code from IPython. Is this at all possible? What are some tools I can use for this?
(assuming you are on Linux)
You just need gdb. First set up configuration telling gdb where your source files are by adding this to $HOME/.gdbinit:
directory absolute-path-to-source
Now start gdb python and on the gdb prompt do:
set args /usr/bin/ipython
run
You can't directly do gdb ipython because ipython is a script. Please refer to the gdb documentation from here on.
In general, you won't be able to debug C++ code directly with IPython. What you can do, though, is use a C++ debugger to debug your C++ code.
Essentially, you tell your C++ debugger to execute whatever process you need to use to run your code (this could be IPython itself), and set a breakpoint in your C++ code (your debugger will know to wait for the appropriate DLL to be loaded if it's in a DLL). From there, you are debugging your part of the code that is running in the IPython process.