Debugging a Program With dbx

Case 2a

In Case 2a, if the shared library patch space requested by dbx is eight megabytes or less, you can use rtc_patch_area to make a shared library to serve as a patch area and link it into the a.out.

After you have seen a message like the following:


Enabling Error Checking... dbx: warning: rtc: cannot find patch space within 8Mb (need 563332 bytes for ./sh1.so)
dbx: patch area too far (8Mb limitation); Access checking disabled
         (See `help rtc8M', case 2)

  1. Create a shared object patch1.so for a patch area:


    rtc_patch_area -so patch1.so -size 563332
    

    The -size flag is optional; the default value is 8000000.

  2. 2) Relink the program with patch1.so placed adjacent to sh1.so in the link line. If dbx still requests patch space for the same sh1.so, then try placing patch1.so immediately before sh1.so.

    It may be necessary to use full pathnames instead of the ld -l option to get the desired shared library ordering.

  3. Try RTC again with the new binary; if dbx requests patch space for another shared library, repeat steps 1-2 for that library.

    If the patch space requested by dbx is more than eight megabytes for a given shared library, follow the steps in case 2 above.