codelldb icon indicating copy to clipboard operation
codelldb copied to clipboard

Add filter option to pickProcess command

Open nkronlage opened this issue 2 years ago • 5 comments

I work in the Chromium code base which uses several different processes.

It'd be very convenient if the pickProcess list was filtered to just the processes I care about.

Here's a potential change to let you filter the process list by using the existing "program" option.

Here's what I put in my launch config:

  "program": "org.chromium.chrome"

And here's the result:

image

Note, this builds on #1001 to get the config in to pickProcess

nkronlage avatar Oct 01 '23 01:10 nkronlage

Let's not overload program with this. The same can be accomplished via input variables.

vadimcn avatar Oct 01 '23 07:10 vadimcn

Good idea. How does this look?

Note, I couldn't find a way to access the config's initCommands from the input variable so you have to duplicate them. LMK if you know of a way to pass those around.

nkronlage avatar Oct 01 '23 22:10 nkronlage

Note, I couldn't find a way to access the config's initCommands from the input variable so you have to duplicate them. LMK if you know of a way to pass those around.

Ah, I was not aware of this difference in the command invocation. I can think of a couple of ways of doing it:

  • The resolveDebugConfiguration function gets called immediately before the variable resolution, so it could stash a reference to the current DebugConfiguration in a global variable or in extension context,
  • resolveDebugConfiguration actually performs its own variable resolution (things like ${dbgconfig:...} and ${cargo:...}), which could be extended.

On the other hand, standard variable resolution is, well, standard. So I'm kinda leaning towards the way it's implemented in your PR.

vadimcn avatar Oct 02 '23 05:10 vadimcn

Yeah, I'm fine with the duplication too. Maybe something to change later if it becomes onerous.

Also, added a try/catch around the process list call to pop up an error if the command fails:

image

nkronlage avatar Oct 02 '23 16:10 nkronlage

Added an error if the filter doesn't find anything:

image

My team members are very excited to use this extension for debugging. Lmk if there's any thoughts on incorporating these changes. Thanks!!

nkronlage avatar Oct 24 '23 23:10 nkronlage