How to execute gdb script in eclipse when it attached? - eclipse

I usually run a load libraries script when I attached to a process when I using eclipse.
I what it run this script automatically after I just attached to the process. But the .gdbinit script is executed at the beginning of attaching. Thus load libraries will fail in the .gdbinit script.
Is there a "ON_ATTACHED" function to let me do that?

I found the solution in another of my questions, I can write a .gdbinit script and define a post_run command.
How to redefine a gdb built-in command and call and call the original

Related

eclipse: how to debug a Scala program called from a shell script

I have a Scala program that is triggered from a shell script. I'd like to be able to run the program in eclipse in debug mode. Anybody knows how that can be done?
Thanks.
I'm not sure if there is a way to debug both together, but what you can do is run your script with the option -xv. So...
user#mypc$: bash -xv myscript other_args
That will show you the commands that are executed along with their parameters.
Then in Eclipse you can debug your Scala program normally and pass those parameters to it through the main method or run configuration.
Typically debuggers are language specific and won't be able to do both bash scripts and code in another language, but with this method, you should be able to figure out what's going on.

rawr jruby creating exe

I've a very simple Ruby script, which I've used rawr to package up into a *.jar file. I can then run the *.jar file with java -jar *.jar. I would like to make my program into an executable so I did rake rawr:bundle:exe. It says that it successfully created an executable and I can see the executable it created.
What I don't understand is, when I double click the executable (or attempt to run it in the command prompt), it doesn't really do anything; it is supposed to display 'hello' and wait for me to push enter (on STDOUT) but nothing really happens. If I run the *.jar file, it displays 'hello'. How am I supposed to run the executable? I was expecting that when I double click the *.exe, that a command prompt window pop up displaying 'hello' and waiting for me to push enter...
Since the program displays to STDOUT, and doesn't have a GUI component, I think you need to run this from the command prompt. Not sure what OS your on, since you said .exe, I'm assuming windows. so you just need to run it from the command prompt instead of by double-clicking on it.
so in the same folder where you are able to succesfully execute:
java -jar *.jar
just type:
myApplication.exe
Or, if your in another location on the machine you can type:
C:\full\path\to\myApplication.exe
Otherwise, the process is just going to run in the background with no way for you to see the results.

how to execute c program in windows command prompt when run from eclipse cdt

I downloaded and configured eclipse cdt along with MinGW and able to compile c programs.
My question, how to start executing the program in command prompt when Run option clicked from eclipse. Currently it always executes the program in eclipse console.
Reason to have command prompt for executing c programs is to accept user inputs.
I would also like to know is there a way to accept user inputs when c program running in eclipse console.
Thanks in advance,
-Manju
I guess i am quite late but still you can try this out. You can execute c programs through Eclipse cdt by writing a batch file and calling them through a click of button or any other event handler. Just make sure you are in the correct directory before attempting to compile and execute the file.
You can find various resources online to create a batch file which can help you execute programs through the console.
On compiling the file, (if you haven't specified an output file), a.exe file will be created. To execute this file with command line inputs just type the following in cmd (as long as you are in the same directory)
a.exe "command line inputs"
where "command line inputs" are the inputs you want to provide to your program.
Hope this is helpful!
i know 8 years is very late,but maybe somone else like me see this,so my answer is :
you should use:
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
after every printf statment to be able to input data in eclipse ide console tab ,
as i understood :""The root cause of the I/O problem is that we're using Windows pipes to communicate with the underlying process. The pipes are buffered"
you can refer to this links for more informations;
http://wiki.eclipse.org/CDT/User/FAQ#Eclipse_console_does_not_show_output_on_Windows
https://bugs.eclipse.org/bugs/show_bug.cgi?id=173732

Batch file in eclipse path variables not found

I want to start a batch-script in my eclipse. (Instructions here: How to run a batch script (.bat file) from eclipse)
In my batch file i need some commands like pear or phing.
I put the path to these commands into my environment variable called PATH.
(Works fine with cmd manually)
After starting the script, I'm getting this error:
'pear' is not recognized as an internal or external command,
operable program or batch file.
If I type pear by hand, it doesn't work either.
You need to restart Eclipse after changing the system environment; environment variable changes requires any process that is already running to be restarted in order for that application to pick up the changes.
Another option might be to put the full path to those commands in the .bat file so that it doesn't rely on the system environment in order to work properly.
Tip: Make sure to close and start eclipse afresh for PATH variable changes to take effect. Using the Restart option in File menu may not help here.

How to debug a tcl script which is argument to an executable?

I have a application which takes tcl script as argument. I want to debug tcl script when the application processes it.
My development environment consists of Dynamic Languages Toolkit along with Active state remote debugger -dbgp_tcldebug. I am able to debug the individual tcl scripts with this setup.
I created a tcl project in eclipse and added 'startup.tcl' and 'argumentScript.tcl' scripts and added following command to the startup script,
set ExecutableName "xyz.exe"
set returnValue [catch {eval exec $ExecutableName "argumentScript.tcl" } result]
My debugger works fine with 'startup.tcl' script. I added the breakpoint in 'argumentScript.tcl' but it is not working. How can I debug the "argumentScript.tcl" script ?
Edit: A solution without using eclipse environment is Tcl Dev Kit with remote debugging feature.
you could use tcls introspective abilities to have the script debug itself e.g. using trace
puts f "debug message" is our all!
Just dump all that you need in log file. Simple, Stupid and Robust :)