Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot open files with '#' in path #2

Closed
venzy opened this issue Aug 8, 2012 · 2 comments
Closed

Cannot open files with '#' in path #2

venzy opened this issue Aug 8, 2012 · 2 comments

Comments

@venzy
Copy link

venzy commented Aug 8, 2012

Some of the executables I debug have absolute paths to source files embedded. Many of these absolute paths contain '#'. When I use filedlg to navigate to such a file, and select it with the Enter key, the file does not open, and I'm left with the file that was previously open (if any) in the top pane.

These filenames have to be quoted when being sent via tgdb as server list filename:1
E.g. server list "filename:1"
or server list "filename":1

I did the latter and it seems to work, in this sort of hacky workaround in filedlg.c (probably better done in the tgdb layers?)

int filedlg_recv_char(struct filedlg *fd, int key, char *file) {
...
    switch ( key ) {
...
       /* User selected a file */
        case '\n':
        case '\r':
        case CGDB_KEY_CTRL_M:
            snprintf(file, MAX_LINE, "\"%s\"", fd->buf->files[fd->buf->sel_line]);
            return 1; 
...
}
@mmueller
Copy link
Member

Thanks for the report venzy, please comment if you get a chance to test this change on your example.

@venzy
Copy link
Author

venzy commented Aug 12, 2012

Might have been a comma instead of '#' causing the issues. In any case, your commit appears to work for my example (I opened a few files, set breakpoints) - nice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants