Opened 13 years ago
Closed 13 years ago
#8173 closed bug (fixed)
Weird characters in gdb Terminal title
Reported by: | humdinger | Owned by: | anevilyak |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/Terminal | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
This is hrev43375.
When entering gdb after a crash or debugging a thread, the Terminal title sports some curious characters:
Attachments (2)
Change History (16)
by , 13 years ago
Attachment: | gdb-terminal-title.png added |
---|
comment:2 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 13 years ago
Had a quick look, and I'm somewhat puzzled right now... the diff for debug_server itself as part of hrev43319 at least looks fine, and Terminal had no changes.
follow-up: 5 comment:4 by , 13 years ago
On second thought, I might see the problem. The paths that get assigned inside _SetupGDBArguments() are assigned from BPath objects that are set up on the stack, and not copied. These potentially get trashed afterwards when returning from there and executing other things, leaving us with a bogus argv array, no?
comment:5 by , 13 years ago
Replying to anevilyak:
On second thought, I might see the problem. The paths that get assigned inside _SetupGDBArguments() are assigned from BPath objects that are set up on the stack, and not copied. These potentially get trashed afterwards when returning from there and executing other things, leaving us with a bogus argv array, no?
Yes, the window title is also on the stack. Furthermore _SetupGDBArguments()
should really return a status_t.
comment:6 by , 13 years ago
Owner: | changed from | to
---|
Will try to find time to deal with it this weekend then. Thanks!
follow-up: 9 comment:7 by , 13 years ago
I now tried hrev43319 and that shows the same issue... sorry guys...
comment:8 by , 13 years ago
Problem with charecters inside the terminal window itself as well. screenshot attached.hrev 43354-dirty gcc2hybrid
follow-up: 10 comment:9 by , 13 years ago
Replying to SeanCollins:
Problem with charecters inside the terminal window itself as well. screenshot attached.hrev 43354-dirty gcc2hybrid
That one has nothing to do with the Terminal - the bash profile was not loaded because of settings path change some weeks ago - it should be fixed in the recent revisions. Just check and open another bug if it still observed. Please remove the attachment from this ticket.
Replying to humdinger:
I now tried hrev43319 and that shows the same issue... sorry guys...
Handling of OSC ANSI codes are done here http://cgit.haiku-os.org/haiku/tree/src/apps/terminal/TermParse.cpp#n1043 can you check with putting some dprintf tracing about the header gdb which trying to set in Terminal? May be some garbage data was interpreted as ANSI OSC sequence.
Are there any way to reproduce this situation?
comment:10 by , 13 years ago
Replying to siarzhuk:
Replying to SeanCollins:
Problem with charecters inside the terminal window itself as well. screenshot attached.hrev 43354-dirty gcc2hybrid
That one has nothing to do with the Terminal - the bash profile was not loaded because of settings path change some weeks ago - it should be fixed in the recent revisions. Just check and open another bug if it still observed. Please remove the attachment from this ticket.
I can't edit the ticket. and the hrev I am on is 5 days old.
comment:11 by , 13 years ago
Attached a patch for review: We now pass in a BString object that _SetupGDBArguments() can build up its command string in, with marker characters indicating the bounds of the arguments, then replace those with nulls before building up the argv array. This ensures that the character buffer for all the args is valid when calling load_image(). Thoughts?
follow-up: 13 comment:12 by , 13 years ago
Mmh, not so nice IMO. I'd use the BStringList
class (which I sneaked in recently) to construct the arguments list and prepare the argv vector from it just before calling load_image()
.
BTW, the patch also contains debug output in src/kits/interface/ColumnListView.cpp
.
comment:13 by , 13 years ago
Replying to bonefish:
Mmh, not so nice IMO. I'd use the
BStringList
class (which I sneaked in recently) to construct the arguments list and prepare the argv vector from it just before callingload_image()
.
Wish I'd known about that one sooner :) will rework it, thanks for the hint.
Weird characters