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/11/2011 05:26 PM, Paul Pluzhnikov wrote:
+
+int main(int argc, char *argv[])
+{
+  if (argc<  2)
+    usage(argv[0]);
+  else
+    {
+      const char *const libname = argv[1];
+      int i, fd, count = 1;
+      struct stat st;
+
+      if (argc>  2)
+        count = atoi (argv[2]);
+
+      if ((fd = open (libname, O_RDONLY)) == -1)
+        {
+          fprintf (stderr, "open (\"%s\", O_RDONLY): %s\n", libname, strerror (errno));

This line is too long.


+          exit (1);
+        }
+
+      if (fstat (fd,&st) != 0)
+        {
+          fprintf (stderr, "fstat (\"%d\"): %s\n", fd, strerror (errno));
+          exit (1);
+        }
+
+      for (i = 0; i<  count; ++i)
+        {
+          const void *const addr = mmap (0, st.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);

This line is too long as well.


+# Start with a fresh gdb.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
We can use "clean_restart" here.

+proc one_test {count match_str} {
+    global solib_binfile gdb_prompt

I don't find any usage of "gdb_prompt", we probably remove it.



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.


--
Yao Qi


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