epasveer / seer

Seer - a gui frontend to gdb
GNU General Public License v3.0
2.11k stars 67 forks source link

Configuration suggestion #111

Closed chucktilbury closed 8 months ago

chucktilbury commented 1 year ago

I would like to see more options for default selections for the "debug" dialog. Also, I would like to be able to save a local copy of the configuration with things like paths and breakpoints.

For example: load the complete configuration in the following order:

  1. from a "system" config from all users
  2. a "local" config for this user
  3. the system environment
  4. a "more local" config for this project.
  5. the command line.

When a provided config option is different from one that has already been loaded, then the new one is used.

For what it's worth, I am working on a config system that does exactly this for my Goldfish project.

epasveer commented 1 year ago

I agree. This has been in the back of my mind for a while. Basically, hierarchical "session profiles". I'm waiting for Seer to settle down a little more yet.

I'll checkout your Goldfish project out. As long as it's LInux/MacOS portable, it should be fine.

https://github.com/chucktilbury/goldfish

chucktilbury commented 1 year ago

Oh... Um... sorry.... Goldfish has gotten to be a really big project. The (unfinished) configuration project is here: https://github.com/chucktilbury/cfg_parser

It consists mostly of a config file (my own design) loader and a couple of tests. I also have a couple of command line parsers mostly finished. You might also be interested in the assembler project in the "asm" target. It's a fairly complete shell that ties the pre-processor, assember, and VM all together by processing file paths.

All of that should be portable to MAC and Linux. It will need quite a bit of work to get it working with Windblows.

epasveer commented 1 year ago

Hi Chuck,

So I went on a bit of a tangent with this. Instead of a config hierarchy, I went with the notion of a project file. I've revamped the Debug dialog to allow creating a project file and loading a project file.

image

I've also added a way to enter raw gdb commands before the program is loaded and after the program is loaded. These are save to the project file as well.

Later, you run Seer like this to load a project file.

$ seergdb --project runproject.seer

The project file is simple Json and can be hand/machine edited.

$ more runproject.seer 
{
    "seerproject": {
        "executable": "/nas/erniep/Development/seer/tests/hellosegv/hellosegv",
        "postgdbcommands": [
            "info break",
            "info program",
            "info signals"
        ],
        "pregdbcommands": [
            "show radix"
        ],
        "startmode": {
            "arguments": "one two three",
            "breakinfunction": false,
            "breakinfunctionname": "",
            "breakinmain": true,
            "breakpointsfile": "",
            "nobreak": false,
            "nonstopmode": false,
            "randomizestartaddress": false,
            "showassemblytab": true
        },
        "symbolfile": "",
        "workingdirectory": ""
    }
}

The output of the 'pre' and 'post' commands go to the Gdb output tab.

image

Anyway, if you find time, let me know what you think.

epasveer commented 8 months ago

Closing the task. Can be reopened or a new task created.