This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Add tests for JIT debugging interface


On 01/12/2011 09:08 AM, Paul Pluzhnikov wrote:
On Wed, Jan 12, 2011 at 2:03 AM, Pedro Alves<pedro@codesourcery.com> wrote:
On Wednesday 12 January 2011 05:39:32, Yao Qi wrote:
Test cases work well in native GDB.  Does gdbserver have JIT debugging
interface also?  If not, we probably should skip this test for remote
mode or kfail it.

The JIT debugging interface is all implemented in common code, so it should work against remote/gdbserver as well (though I haven't tried it). A gdb_load_shlibs call to copy the shlib to the target appears to be missing though.

I tried running the test with gdbserver-native, and it failed, because 'set args' doesn't work in server mode (AFAICT).


Yes, I also got some failures due to this. Then I hacked jit-main.c to set libname by an absolute path on my laptop, so no args are needed any more. There are still two failures, which are not about 'set args' in gdbserver.


FAIL: gdb.base/jit.exp: info function jit_function
FAIL: gdb.base/jit.exp: info function jit_function

info function jit_function^M
All functions matching regular expression "jit_function":^M
(gdb) FAIL: gdb.base/jit.exp: info function jit_function

In gdb.log, I find something strange,

(gdb) continue^M
Continuing.^M
jit_inferior_init, registering_code = 0^M
jit_inferior_init, reg_addr = 0x80486c4^M
jit_inferior_init, jit_descriptor_addr = 0x804a040^M
Cannot remove breakpoints because program is no longer writable. <-- [1]

There is no such error [1] in native gdb test. I have no clue on this so far.

I grepped through *.exp in search of examples of how to run programs
that require args under gdbserver, but didn't find any.

I want something like

   if {[is_remote host]} {
     spawn gdbserver :2345 exe shlib 1
   } else {
     spawn gdb --args exe shlib 1
   }

Is there a "standard" way to achieve this?

You want notice it missing
if you do the usual gdbserver running on the same machine as
gdb testing (*).

Right. I didn't get that far yet.


Are there instructions for running with gdbserver on different host?

We may re-write jit-main.c a little bit to compute the location of jit-solib.so via getcwd() + argv[0], rather than passing arguments of its location.


--
Yao Qi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]