emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Extend gdb to filter registers


From: Yuan Fu
Subject: Re: Extend gdb to filter registers
Date: Thu, 16 Jan 2020 19:38:25 -0500

Here is an updated patch for store-window feature. I fixed some problem of the last one and added some new features. With this patch, you can

1. store your window configuration to a file, and load it back in a gdb session, and
2. set a default window config file to be loaded on gdb startup.
3. Now gdb preserves the window configuration you had before starting gdb

More about 3.: currently when gdb quits, it leaves you with two windows, one in gdb comint buffer and one in source buffer, regardless of what you had before staring gdb. The third commit in the patch makes gdb restore the old window configuration you had before staring gdb.

I also attached my window configuration file as default-rearrange.

Yuan


On Thu, Jan 16, 2020 at 10:04 AM Yuan Fu <address@hidden> wrote:

> I'm back working on gdb. This time I fixed a issue where gdb opens more than one window to display source
> code. By the design of gdb-mi, it should only have one source window.

Thanks, can you show a use case where such a problem happens?

Yes, basically any program with more than one source file and a large screen (display-buffer will reuse window if there aren't enough space).

A minimal setup:

a.c:

int f1(int a) {
    return a + 1;
}

b.c:

#include "a.c"

int main() {
    int b = f1(1);
    int c = 0;
    return b + c;
}

Steps:
- M-x gdb
- b main
- r
- s (many times)

And when you step into f1 which is in a.c, gdb opens another window to display it (again, if your screen is large enough).

BTW, I say "by design gdb uses a single source window" because gdb-display-source-window is written that way.

Yuan

Attachment: store-window.patch
Description: Text Data

Attachment: default-rearrange
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]