From f4e4feb619fd364bf267e3e2af3afee3fb68a6ab Mon Sep 17 00:00:00 2001 From: Misha Brukman Date: Thu, 15 Apr 2004 20:49:32 +0000 Subject: [PATCH] Add note about passing arguments to program being debugged. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12970 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/HowToSubmitABug.html | 75 +++++++++++++++++++++------------------ docs/llvm.css | 4 +++ 2 files changed, 44 insertions(+), 35 deletions(-) diff --git a/docs/HowToSubmitABug.html b/docs/HowToSubmitABug.html index 84d7b8ba108..de9b5b166d5 100644 --- a/docs/HowToSubmitABug.html +++ b/docs/HowToSubmitABug.html @@ -147,9 +147,10 @@ along with a brief description of the error it caused.

compilation, compile your test-case to a .s file with the -save-temps option to llvm-gcc. Then run:

-
-  gccas -debug-pass=Arguments < /dev/null -o - > /dev/null
-
+
+

gccas -debug-pass=Arguments < /dev/null -o - > /dev/null +

+

... which will print a list of arguments, indicating the list of passes that gccas runs. Once you have the input file and the list of @@ -170,10 +171,10 @@ compilation, gather all of the .o bytecode files and libraries that are being linked together (the "llvm-gcc -v" output should include the full list of objects linked). Then run:

-
-  llvm-as < /dev/null > null.bc
-  gccld -debug-pass=Arguments null.bc
-

+

+

llvm-as < /dev/null > null.bc + gccld -debug-pass=Arguments null.bc

+

... which will print a list of arguments, indicating the list of passes that gccld runs. Once you have the input files and the list of @@ -194,9 +195,9 @@ files and a list of passes which crash when run on the specified input. In order to reduce the list of passes (which is probably large) and the input to something tractable, use the bugpoint tool as follows:

-
-  bugpoint <input files> <list of passes>
-

+

+

bugpoint <input files> <list of passes>

+

bugpoint will print a bunch of output as it reduces the test-case, but it should eventually print something like this:

@@ -231,9 +232,10 @@ finishes its run.

the output through, e.g. C backend, the JIT, or LLC, and a selection of passes, one of which may be causing the error, and run, for example:

-
-  bugpoint -run-cbe [... optimization passes ...] file-to-test.bc
-
+
+

bugpoint -run-cbe [... optimization passes ...] file-to-test.bc +--args -- [program arguments]

+

bugpoint will try to narrow down your list of passes to the one pass that causes an error, and simplify the bytecode file as much as it can to assist @@ -260,15 +262,17 @@ Backend, and then link in the shared object it generates.

To debug the JIT:

-
-  bugpoint -run-jit -output=[correct output file] [bytecodefile]
-
+
+

bugpoint -run-jit -output=[correct output file] [bytecode file] +--args -- [program arguments]

+

Similarly, to debug the LLC, one would run:

-
-  bugpoint -run-llc -output=[correct output file] [bytecodefile]
-
+
+

bugpoint -run-llc -output=[correct output file] [bytecode file] +--args -- [program arguments]

+

At the end of a successful bugpoint run, you will be presented with two bytecode files: a safe file which can be compiled with the C @@ -280,27 +284,28 @@ the following:

    -
  1. Regenerate the shared object from the safe bytecode file:
    +
  2. Regenerate the shared object from the safe bytecode file:

    -
    -  llc -march=c safe.bc -o safe.c
    - gcc -shared safe.c -o safe.so -
  3. +
    +

    llc -march=c safe.bc -o safe.c
    + gcc -shared safe.c -o safe.so

    +
    -
  4. If debugging LLC, compile test bytecode native and link with the shared object:
    +
  5. If debugging LLC, compile test bytecode native and link with the shared + object:

    -
    -  llc test.bc -o test.s -f
    - gcc test.s safe.so -o test.llc
    - ./test.llc [program options] -
  6. +
    +

    llc test.bc -o test.s -f
    + gcc test.s safe.so -o test.llc
    + ./test.llc [program options]

    +
    -
  7. If debugging the JIT, load the shared object and supply the test -bytecode: +
  8. If debugging the JIT, load the shared object and supply the test + bytecode:

    -
    -  lli -load=safe.so test.bc [program options]
    -
  9. +
    +

    lli -load=safe.so test.bc [program options]

    +
diff --git a/docs/llvm.css b/docs/llvm.css index a2b1e0465c3..06be5830795 100644 --- a/docs/llvm.css +++ b/docs/llvm.css @@ -51,3 +51,7 @@ address { clear: right; } padding: 1px 1px 1px 1px; border: 1px; } .doc_warning { color: red; font-weight: bold } + +.doc_code { border: solid 1px gray; background: #eeeeee; + width: 700px; margin: 0 0 0 1em; + padding: 0 0 0 1em } -- 2.34.1