Comments (5)
Weird. I don't reproduce this using cgdb from git master. Also this code hasn't changed in a long time. What version of cgdb are you running? How many lines is the source file, and how big was your terminal?
If you look at sources.c:604, there's a check for this condition and it should just draw a ~ (tilde) vim-style where the buffer is outside of the file boundaries:
/* Outside of file, just finish drawing the vertical line */
if (line < 0 || line >= sview->cur->buf.length) {
I also tried running through valgrind, but it reports no memory access issues.
from cgdb.
I'm running both git master and v0.6.7. Both reliably crash.
I was able to recreate the problem with a very small C program (9 lines):
/* Author: Me */
#include <stdio.h>
int main(int argc, char *argv[])
{
printf("Hello world!\n");
return(0);
}
When my terminal is 19 lines tall I can see the entire source file. If I increase the source window by pressing "=" once or by making my terminal one line larger in the vertical direction, cgdb crashes.
My source file uses a single new-line as the line terminator:
$ hexdump -C main.c
00000000 2f 2a 20 41 75 74 68 6f 72 3a 20 4d 65 20 2a 2f |/* Author: Me */|
00000010 0a 0a 23 69 6e 63 6c 75 64 65 20 3c 73 74 64 69 |..#include <stdi|
00000020 6f 2e 68 3e 0a 0a 69 6e 74 20 6d 61 69 6e 28 69 |o.h>..int main(i|
00000030 6e 74 20 61 72 67 63 2c 20 63 68 61 72 20 2a 61 |nt argc, char *a|
00000040 72 67 76 5b 5d 29 0a 7b 0a 20 20 70 72 69 6e 74 |rgv[]).{. print|
00000050 66 28 22 48 65 6c 6c 6f 20 77 6f 72 6c 64 21 5c |f("Hello world!\|
00000060 6e 22 29 3b 0a 20 20 72 65 74 75 72 6e 28 30 29 |n");. return(0)|
00000070 3b 0a 7d 0a |;.}.|
00000074
Maybe the trailing '\n' is the problem?
from cgdb.
Thanks for the additional info. Still weird though, I don't see this when I run the same program through cgdb and resize the terminal a bunch of times. I've tried cgdb master on linux and 0.6.7 on mac. Tried with my terminal set to 19 lines tall, too.
The trailing newline shouldn't be an issue, those are pretty standard (vim always adds a newline by default, for example).
from cgdb.
I can successfully run cgdb in xterm on OS X.
I can successfully run cgdb in xterm and GNOME Terminal on Linux.
The problem appears to be with Terminal.app on OS X. It declares itself as "xterm-color", but I don't see any color when I run cgdb. Instead of "~" for non-existent lines I see "(null)".
Now that I know I can simply run it in an xterm, there is little incentive to figure out what is wrong when Terminal.app is used.
from cgdb.
Closing really old issues. Please open a new bug if this problem still exists. Thanks.
from cgdb.
Related Issues (20)
- Breakpoints with multiple-symbols set to ask stopped working HOT 3
- configure.ac:3: error: possibly undefined macro: m4_esyscmd_s HOT 2
- cgdb should use full path for breakpoint when pressing space HOT 1
- [bug] sometimes breakpoint cannot make the line number become red HOT 5
- [feature] provide shell completions HOT 2
- [feature] Can cgdb delete mark? HOT 5
- [bug] Alt-. cannot work HOT 2
- [feature] Support mouse scrollbar HOT 6
- how to change gdb program that cgdb use? HOT 1
- Cygwin BUG: [commit: 2022-06-12 208d038] fdopen was not declared in this scope
- Question: How to clear search highlights HOT 5
- cannot stat 'cgdb.htp': No such file or directory HOT 2
- file dialog freezing terminal in msys2/WSL HOT 2
- Cannot Display Color Properly HOT 2
- cgdb bug: remote connect to kdb cannot do twice HOT 3
- ESCape key mixup with readline HOT 2
- how to disable source code display in cgdb windows HOT 3
- utf support HOT 2
- [bug] Assertion in signal_handler on SIG_CHLD HOT 1
- It should be possible to disable makeinfo with configure flags HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cgdb.