diff options
author | gdb-2.8 <gdb@fsf.org> | 1988-09-03 08:00:00 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2012-06-03 15:36:31 +0100 |
commit | 3bf57d210832b28e9361990830eb722a619f031b (patch) | |
tree | ba506d293bde0f6500d0cee3e643ebf8890d9cf7 /gdb/testbpt.c | |
parent | 7c75bab3d3ef344a6a0b13b9ab59ecd5855aceb5 (diff) | |
download | gdb-3bf57d210832b28e9361990830eb722a619f031b.zip gdb-3bf57d210832b28e9361990830eb722a619f031b.tar.gz gdb-3bf57d210832b28e9361990830eb722a619f031b.tar.bz2 |
gdb-2.8
Diffstat (limited to 'gdb/testbpt.c')
-rw-r--r-- | gdb/testbpt.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/gdb/testbpt.c b/gdb/testbpt.c new file mode 100644 index 0000000..baa4e51 --- /dev/null +++ b/gdb/testbpt.c @@ -0,0 +1,33 @@ +/* Run this program straight. Then set a breakpoint in `dump', + run it again, and continue the program. Diff the outputs + and you will see what the supplied debugger does for a breakpoint. */ + +int dump (); +int after_dump (); + +main () +{ + printf ("main = 0x%x\ndump = 0x%x\nend = 0x%x\n", main, dump, after_dump); + + dump (main, after_dump); +} + +int dump (p, q) + int *p; + int *q; +{ + int cnt = 0; + printf ("dump: 0x%x-0x%x\n", p, q); + + while (p < q) + { + if ((cnt++ & 3) == 0) + printf ("\n0x%08x: ", p); + printf ("0x%08x ", *p++); + } + printf ("\n"); +} + +after_dump () +{ +} |