Frequently asked questions

Here are the answers to some frequently asked questions.


Q: This document makes reference to menu item XXXX, but I don't see it on my menu.

A: Your window pane is either too small or the item has scrolled out of view. Press Home and then use the cursor keys to scroll the window contents until you find the item you are looking for.


Q: A window pane or menu appears to be empty.

A: See the answer to the previous question.


Q: My program runs fine when invoked from the debugger, but it doesn't run when invoked from the shell command line.

A: Unlike the command shell, Xcdb loads your program without searching the $PATH environment variable. You've probably got a program by the same name somewhere in your $PATH. Try explicitly qualifying the program name when you type it on the command line. For example, type:

    ./test a b c    # run program in current directory \end{verbatim}
instead of:

    test a b c      # oops, this probably invokes /bin/test \end{verbatim}

Q: The debugger stops with a Signal 0 when it encounters the system() function in my program.

A: This is normal. Just click the Signal item on the command pane to continue, or reinvoke Xcdb with "-i 0."


Q: I can't set a breakpoint on some lines of my C++ program (compiled with cfront).

A: There are bugs in /lib/cpp, the preprocessor used by cfront to perform macro expansion. Try another macro preprocessor; some people have had luck with
/usr/lpp/X11/Xamples/util/cpp/cpp. Point to it with the CC's "cppC" environment variable, and then recompile.

There are also bugs in cfront related to generation of #line directives for templates and include files. Try setting Include files: Ignore in the Preferences menu and see if this helps.


Q: Xcdb displays the wrong source file or line number in my C++ program (compiled with cfront).

A: Try setting Include files: Ignore in the Preferences menu and see if this helps.


Q: Xcdb displays the wrong source file or line number in my C++ program (compiled with xlC).

A: Make sure you have set Include files: Respect on the Preferences menu. Another possibility is that the source file contains more than 65,534 lines. Due to an AIX symbol table design feature, line information for such files is stored incorrectly. The only workaround is to split the source file into smaller pieces.


Q: I can't see one of my local variables, but I know it's there.

A: This is due to a compiler bug. Try the Variables: Unscoped option on the Preferences menu.


Q: My program seems to be running correctly, but the variables displayed by Xcdb look wrong.

A: You probably compiled your program with both -g and -O. The resulting compiler optimizations confuse the debugger. Recompile your program with either -g or -O, but not both.


Q: I can't see code generated from #include files.

A: You need a newer version of xlC (such as version 01.02.0000.0000, or later).


Q: Xcdb produces a warning about an ambiguous breakpoint when I try to set a breakpoint on certain parts of my program.

A: You probably tried to set a breakpoint on an instruction that was one of several "instantiations" generated from the same #include file.

If you are debugging template code generated by the xlC compiler, make sure you've set the Language: C++ option on the Preferences menu.

Otherwise, if you are debugging nontemplate code, or code generated by compilers other than xlC, there is no mechanism by which Xcdb can infer the instruction instantiation to which you refer, so it is not possible to set a breakpoint on the specified line.


Q: I can't see a traceback in the Callers window pane when I set a breakpoint in a signal handler.

A: This is a deficiency in Xcdb that is being addressed.


Q: I get an error when attempting to attach the debugger to a process using -a.

A: This has something to do with shared libraries. If you can reproduce this problem with a small program, please send a defect report to the Taligent Tools Team, via Taligent DTS.


Q: Xcdb is sluggish when stepping. How can I make it faster?

A: Display update performance during stepping operations can be improved by iconifying the NonLocals window pane if it is not needed. The debugger is then saved the expense of reading and formatting (potentially large) amounts of global data from the program's execution image. Also, choosing the -n command-line option will help, by reducing the number of symbols that Xcdb must search. Reducing the size of the main window or using a larger font will also help, because these procedures reduces the amount of window drawing that takes place. Also, enabling xcdb.SaveUnder in your .Xdefaults file may improve performance of pop-up menus (see "Customizing Xcdb" on page 136).


Q: How can I format a number of variables, all in the same style, without tediously clicking More Detail on each one?

A: Try using the Save and Recall selections on the Formats menu to propagate the formatting information from one object to all the others.


Q: How can I change the display format of all the elements of an array at once, without tediously clicking on each one?

A: Try this:

  1. Format the first item in the array.
  2. Use Select Subrange to (re)select the elements you want to see.
    The format of the first element propagates through to all the other elements.

Q: How can I invoke Xcdb from inside my program?

A: Try something like this:

      main()
         {
         foo();
         }
       
      foo()
         {
         bar();
         }
       
      bar()
         {
         trouble();
         }
       
      trouble()
         {
         extern char **p_xargv;   // undocumented variable
         char cmd[100];
         sprintf(cmd, "xcdb -a %d %s", getpid(), p_xargv[0]);
      
         if (fork() == 0)
            system(cmd);          // runs Xcdb
         else
            pause();              // waits until Xcdb issues "Run", "Line Step", etc.
         }

Q: When I Select a subrange, I see only the first 1,000 elements of my selection. Where are the rest?

A: As a safety feature, Xcdb displays at most 1,000 elements per array. Use -e or xcdb.ArrayLimits in your .Xdefaults file to change this setting.


Q: How can I display a region of memory as an unstructured hex dump?

A: Try this (it's a bit of a kludge, but it works):

  1. Determine the address of the region you want to inspect (using Format...as address, for example).
  2. Take any convenient char pointer in your program and set its value to the address you wish to inspect (using Edit).
  3. Select the number of elements to be displayed (using Select subrange).

Q: What version of Xcdb do I have?

A: Type xcdb (no arguments) to find out.


Q: Where can I get the latest version of Xcdb?

A: Obtain XCDB6000 PACKAGE from your nearest AIXTOOLS service machine.


Q: What's new in the latest version of Xcdb?

A: Please read the XCDB6000 NEWS file that is shipped with each XCDB6000 PACKAGE.


Q: I have a question that isn't answered here.

A: Please report any problems you discover (or wish list items) to the Taligent Tools Team, via Taligent DTS.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker