Author Topic: Invoking SE with the -r command  (Read 3277 times)

mcarlson

  • Community Member
  • Posts: 15
  • Hero Points: 0
Invoking SE with the -r command
« on: August 22, 2008, 06:17:18 pm »
Because of our build environment we need to jump through some odd hoops to use GDB in slickedit.
Attaching to a running process works well, but we are working on ways to start the debugger and automatically attach (rather than adding code, for instance, to stall a short lived processes long enough to attach).

We have a _command debug_myprogram() that calls debug_executable() with the correct arguments.
We also have a shell script that looks like this:
Code: [Select]
#!/bin/bash
/opt/slickedit/bin/vs +new -r debug-myprogram $1 $2

The above works, but always invokes a new instance of SE.
Reading the documentation for Invocation Options it looks like we should be able to send this to the already running instance of SE.

Quote
Description
+ or -new
Indicates whether a new instance of the editor should be created or if the existing instance should process the command line parameters. +new creates a new instance. Default is -new.

-r cmdline
Execute command with arguments given and remain resident. No other options or file names can be specified after this option since the rest of the command line is assumed to be the program name and space-delimited arguments for this option.

When I read these togeather it sounds like removing the "+new" (or even an explicit "-new") should give us what we want:
Code: [Select]
#!/bin/bash
/opt/slickedit/bin/vs -new -r debug-myprogram $1 $2

instead, this opens 3 new buffers in the current instance of SE "debug-myprogram" "arg1" "arg2" and immediately exits.

Any ideas on how to do what I want?
Are the options "-new" and "-r" mutually exclusive?

Thanks,
Matt


Graeme

  • Senior Community Member
  • Posts: 1929
  • Hero Points: 223
Re: Invoking SE with the -r command
« Reply #1 on: August 22, 2008, 09:00:30 pm »
Try  "-# debug-myprogram $1 $2"  -  and leave out the -new.  This used to work for me.  Haven't tried it lately.

Edit  - and include the quotes!

Graeme


mcarlson

  • Community Member
  • Posts: 15
  • Hero Points: 0
Re: Invoking SE with the -r command
« Reply #2 on: August 22, 2008, 09:05:40 pm »
Code: [Select]
#!/bin/bash
/opt/slickedit/bin/vs -# debug-myprogram $1 $2

This gave the same results as "-new -r debug-myprogram $1 $2"
Opened several new windows in the first instance of SE.

Thank you for this though, I had been looking at the command option.

Matt

Graeme

  • Senior Community Member
  • Posts: 1929
  • Hero Points: 223
Re: Invoking SE with the -r command
« Reply #3 on: August 22, 2008, 09:08:13 pm »
You left out the quotes?

mcarlson

  • Community Member
  • Posts: 15
  • Hero Points: 0
Re: Invoking SE with the -r command
« Reply #4 on: August 22, 2008, 09:42:20 pm »
Quote
You left out the quotes?

Exactly right.
I figured this out soon after I posted my last reply and have been playing around with the results since.

Thank you very much!

Matt