bug-ddd
[Top][All Lists]
Advanced

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

viewing source fails with special characters (DDD 3.3.1)


From: G. Del Merritt
Subject: viewing source fails with special characters (DDD 3.3.1)
Date: Wed, 20 Aug 2003 15:17:46 -0400

I just upgraded DDD as part of an upgrade from Red Hat 7.x to Red Hat 9.  The
old version of DDD "worked" fine, but DDD 3.3.1 shows the following problem:

   /* A long comment at the top of a C file.
      blah blah blah
      In §3.2 of the CSS1 spec
      blah blah blah
    */
   code follows; a total of 1923 "lines" in the file, 66246 bytes.

When I step into functions in that file, the source display window truncates,
and all I see is:  

   /* A long comment at the top of the file.
      blah blah blah
      In 

Note that the text stops displaying immediately before the "§" character.
Note that the character for the paragraph symbol is the sequence of the two
octal bytes "\302" and "\247", aka "0xC2" and "0xA7".

When I edit the source and replace "§" with a single space, I can again step
through the code and "see" where I'm going.

As a special case, I trimmed down to a Hello World example.  It doesn't show
quite the same behavior, but it still shows an anomaly, which may be directly
related the problem I am seeing.  Take the following code, called "foo.c":

---------------------- 8< --- foo.c --- 8< ----------------------
/* 
  A simple comment, with a twist.  We'll reference a paragraph in another
  document like this:

  In §3.2 of the CSS1 spec, it discusses an algorithm

  And nothing else should show up!
 */

#include <stdlib.h>

main()
{
  printf("Hello World!  And Hello, Paragraphs...\n");
}
---------------------- 8< --- end of foo.c --- 8< ----------------------

Compile it with:
   % gcc -o foo -g foo.c

Bring it up with DDD as:
   % ddd ./foo &

In the source window I see the "§" and I see a "junk" character before it
(looks like an A with either an umlaut or another diacritical mark).  This
suggests the new DDD doesn't understand multi-byte characters as well as the
older version does.

My "live" example is too complex for me to send along; among other things, the
function I am stepping into is in a source file that is distinct from the
"main()".  A guess is that switching to that file on the fly is causing the
display of the source to behave differently from the compact example I have
included.  Nonetheless, the sample I send along displays fine in older
versions of DDD.

Here's the .ddd/log file:

GNU DDD 3.3.1 (i386-redhat-linux-gnu)
Copyright (C) 1995-1999 Technische Universität Braunschweig, Germany.
Copyright (C) 1999-2001 Universität Passau, Germany.

Compiled with GCC 3.2.1 20021207 (Red Hat Linux 8.0 3.2.1-2), GNU libc 2.3
Requires X11R6, Xt11R6, Motif 2.2.3 (Motif Version 2.2.2)
Includes XPM 3.4.11, Athena Panner, DDD core
Built 2003-01-25 by Compile Server <address@hidden>.
$  ddd ./foo
+  /bin/sh -c 'exec gdb -q -fullname '\''./foo'\'''
#  Hello, world!
#  Starting GDB...
#  Running GDB (pid 21003, tty /dev/pts/4)...
<- "(gdb) "
-> "set prompt (gdb) \n"
#  Current language: C/C++
#  Searching "vsllib/ddd.vsl"...
#  Trying "/home/dmerritt/.ddd//vsllib/ddd.vsl"
#  Trying "/usr/share/ddd-3.3.1/vsllib/ddd.vsl"
#  Searching "vsllib/ddd.vsl"..."/usr/share/ddd-3.3.1/vsllib/ddd.vsl".
<- "(gdb) "
-> "set height 0\n"
<- "(gdb) "
-> "set width 0\n"
<- "(gdb) "
-> "set annotate 1\n"
<- "(gdb) "
-> " set verbose off\n"
<- "(gdb) "
-> "info line\n"
<- "No line number information available.\n"
<- "(gdb) "
-> "list\n"
<- "5\t  In \302\2473.2 of the CSS1 spec, it discusses an algorithm\n"
   "6\t\n"
   "7\t  And nothing else should show up!\n"
   "8\t */\n"
   "9\t\n"
   "10\t#include <stdlib.h>\n"
   "11\t\n"
   "12\tmain()\n"
   "13\t{\n"
   "14\t  printf(\"Hello World!  And Hello, Paragraphs...\\n"
   "\");\n"
<- "(gdb) "
-> "info line\n"
<- "Line 14 of \"foo.c\" starts at address 0x80483ea <main+6> and ends at 
0x80483fa <main+22>.\n"
   "\032\032/home/dmerritt/xml_play/4gad/foo.c:14:227:beg:0x80483ea\n"
<- "(gdb) "
-> "output 4711\n"
<- "4711(gdb) "
-> "show language\n"
<- "The current source language is \"auto; currently c\".\n"
   "(gdb) "
-> "show version\n"
<- "GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)\n"
   "Copyright 2003 Free Software Foundation, Inc.\n"
   "GDB is free software, covered by the GNU General Public License, and you 
are\n"
   "welcome to change it and/or distribute copies of it under certain 
conditions.\n"
   "Type \"show copying\" to see the conditions.\n"
   "There is absolutely no warranty for GDB.  Type \"show warranty\" for 
details.\n"
   "This GDB was configured as \"i386-redhat-linux-gnu\".\n"
   "(gdb) "
-> "pwd\n"
<- "Working directory /home/dmerritt/xml_play/4gad.\n"
   "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "show history filename\n"
<- "The filename in which to record the command history is 
\"/home/dmerritt/xml_play/4gad/.gdb_history\".\n"
   "(gdb) "
-> "show history size\n"
<- "The size of the command history is 1000.\n"
   "(gdb) "
#  Reading file "/home/dmerritt/xml_play/4gad/foo.c"...
#  Reading file "/home/dmerritt/xml_play/4gad/foo.c"...done.
#  File "/home/dmerritt/xml_play/4gad/foo.c" 15 lines, 299 characters
#  Setting buttons...
#  Setting buttons...done.
-> "info source\n"
<- "Current source file is foo.c\n"
   "Compilation directory is /home/dmerritt/xml_play/4gad/\n"
   "Located in /home/dmerritt/xml_play/4gad/foo.c\n"
   "Contains 15 lines.\n"
   "Source language is c.\n"
   "Compiled with stabs debugging format.\n"
   "Does not include preprocessor macro info.\n"
   "(gdb) "
-> "info files\n"
<- "Symbols from \"/home/dmerritt/xml_play/4gad/foo\".\n"
   "Local exec file:\n"
   "\t`/home/dmerritt/xml_play/4gad/foo\', file type elf32-i386.\n"
   "\tEntry point: 0x8048300\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x08048158 is .hash\n"
   "\t0x08048158 - 0x080481c8 is .dynsym\n"
   "\t0x080481c8 - 0x08048242 is .dynstr\n"
   "\t0x08048242 - 0x08048250 is .gnu.version\n"
   "\t0x08048250 - 0x08048270 is .gnu.version_r\n"
   "\t0x08048270 - 0x08048278 is .rel.dyn\n"
   "\t0x08048278 - 0x08048298 is .rel.plt\n"
   "\t0x08048298 - 0x080482af is .init\n"
   "\t0x080482b0 - 0x08048300 is .plt\n"
   "\t0x08048300 - 0x080484a4 is .text\n"
   "\t0x080484a4 - 0x080484bf is .fini\n"
   "\t0x080484c0 - 0x08048508 is .rodata\n"
   "\t0x08049508 - 0x08049514 is .data\n"
   "\t0x08049514 - 0x08049518 is .eh_frame\n"
   "\t0x08049518 - 0x080495e0 is .dynamic\n"
   "\t0x080495e0 - 0x080495e8 is .ctors\n"
   "\t0x080495e8 - 0x080495f0 is .dtors\n"
   "\t0x080495f0 - 0x08049610 is .got\n"
   "\t0x08049610 - 0x08049628 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
-> "set confirm off\n"
<- "(gdb) "
-> "source /tmp/dddVVWuOa\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "# reset\n"
<- "(gdb) "
-> "info breakpoints\n"
<- "No breakpoints or watchpoints.\n"
   "(gdb) "
-> "display\n"
<- "(gdb) "
-> "info display\n"
<- "There are no auto-display expressions now.\n"
   "(gdb) "
-> "set environment TERM dumb\n"
<- "(gdb) "
-> "info files\n"
<- "Symbols from \"/home/dmerritt/xml_play/4gad/foo\".\n"
   "Local exec file:\n"
   "\t`/home/dmerritt/xml_play/4gad/foo\', file type elf32-i386.\n"
   "\tEntry point: 0x8048300\n"
   "\t0x080480f4 - 0x08048107 is .interp\n"
   "\t0x08048108 - 0x08048128 is .note.ABI-tag\n"
   "\t0x08048128 - 0x08048158 is .hash\n"
   "\t0x08048158 - 0x080481c8 is .dynsym\n"
   "\t0x080481c8 - 0x08048242 is .dynstr\n"
   "\t0x08048242 - 0x08048250 is .gnu.version\n"
   "\t0x08048250 - 0x08048270 is .gnu.version_r\n"
   "\t0x08048270 - 0x08048278 is .rel.dyn\n"
   "\t0x08048278 - 0x08048298 is .rel.plt\n"
   "\t0x08048298 - 0x080482af is .init\n"
   "\t0x080482b0 - 0x08048300 is .plt\n"
   "\t0x08048300 - 0x080484a4 is .text\n"
   "\t0x080484a4 - 0x080484bf is .fini\n"
   "\t0x080484c0 - 0x08048508 is .rodata\n"
   "\t0x08049508 - 0x08049514 is .data\n"
   "\t0x08049514 - 0x08049518 is .eh_frame\n"
   "\t0x08049518 - 0x080495e0 is .dynamic\n"
   "\t0x080495e0 - 0x080495e8 is .ctors\n"
   "\t0x080495e8 - 0x080495f0 is .dtors\n"
   "\t0x080495f0 - 0x08049610 is .got\n"
   "\t0x08049610 - 0x08049628 is .bss\n"
   "(gdb) "
-> "info program\n"
<- "The program being debugged is not being run.\n"
   "(gdb) "
#  Starting GDB...done.
#  Welcome to DDD 3.3.1 "Blue Gnu" (i386-redhat-linux-gnu)
-> "help detach\n"
<- "Detach a process or file previously attached.\n"
   "If a process, it is no longer traced, and it continues its execution.  If\n"
   "you were debugging a file, the file is closed and gdb no longer accesses 
it.\n"
   "(gdb) "
-> "help run\n"
<- "Start debugged program.  You may specify arguments to give it.\n"
   "Args may include \"*\", or \"[...]\"; they are expanded using \"sh\".\n"
   "Input and output redirection with \">\", \"<\", or \">>\" are also 
allowed.\n"
   "\n"
   "With no arguments, uses arguments last specified (with \"run\" or \"set 
args\").\n"
   "To cancel previous arguments and run with no arguments,\n"
   "use \"set args\" without arguments.\n"
   "(gdb) "
-> "help step\n"
<- "Step program until it reaches a different source line.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help stepi\n"
<- "Step one instruction exactly.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help next\n"
<- "Step program, proceeding through subroutine calls.\n"
   "Like the \"step\" command as long as subroutine calls do not happen;\n"
   "when they do, the call is treated as one instruction.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help nexti\n"
<- "Step one instruction, but proceed through subroutine calls.\n"
   "Argument N means do this N times (or till program stops for another 
reason).\n"
   "(gdb) "
-> "help until\n"
<- "Execute until the program reaches a source line greater than the current\n"
   "or a specified location (same args as break command) within the current 
frame.\n"
   "(gdb) "
-> "help finish\n"
<- "Execute until selected stack frame returns.\n"
   "Upon return, the value returned is printed and put in the value history.\n"
   "(gdb) "
-> "help cont\n"
<- "Continue program being debugged, after signal or breakpoint.\n"
   "If proceeding from breakpoint, a number N may be used as an argument,\n"
   "which means to set the ignore count of that breakpoint to N - 1 (so that\n"
   "the breakpoint won\'t break until the Nth time it is reached).\n"
   "(gdb) "
-> "help signal\n"
<- "Continue program giving it signal specified by the argument.\n"
   "An argument of \"0\" means continue program without giving it a signal.\n"
   "(gdb) "
-> "help kill\n"
<- "Kill execution of program being debugged.\n"
   "(gdb) "
-> "help up\n"
<- "Select and print stack frame that called this one.\n"
   "An argument says how many frames up to go.\n"
   "(gdb) "
-> "help down\n"
<- "Select and print stack frame called by this one.\n"
   "An argument says how many frames down to go.\n"
   "(gdb) "





reply via email to

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