Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: [RFC] GDB Hurd Fixes
@ 2013-09-20  0:43 David Michael
  2013-09-20  8:47 ` Pedro Alves
  0 siblings, 1 reply; 9+ messages in thread
From: David Michael @ 2013-09-20  0:43 UTC (permalink / raw)
  To: bug-hurd, gdb-patches

Hi,

(Copying gdb-patches this time.)

Here is an updated patch to successfully build GDB after today's
Hurd/mig changes.

The awk script changes handle the "auto" keyword being dropped from
mig output, and that an "#if TypeCheck" line appears before
arg_check_name is defined in some new functions.

The gnu-nat.c changes define functions for the new process_reply.defs entries.

I'd appreciate any feedback or suggestions for getting GDB building on
current Hurd again.

Thanks.

David


--- gdb/reply_mig_hack.awk    2013-01-01 01:32:50.000000000 -0500
+++ gdb/reply_mig_hack.awk    2013-01-01 01:32:50.000000000 -0500
@@ -85,13 +85,20 @@ parse_phase == 5 && /^[ \t]*(auto|static
   print; next;
 }

+parse_phase == 5 && /^[ \t]*const mach_msg_type_t/ {
+  # The type check structure for an argument.
+  arg_check_name[num_checks] = $3;
+  num_checks++;
+  print; next;
+}
+
 parse_phase == 5 && /^[ \t]*mig_external kern_return_t/ {
   # The declaration of the user server function for this rpc.
   user_function_name = $3;
   print; next;
 }

-parse_phase == 5 && /^#if[ \t]TypeCheck/ {
+parse_phase == 5 && /^#if[ \t]TypeCheck/ && num_checks > 0 {
   # The first args type checking statement; we need to insert our chunk of
   # code that bypasses all the type checks if this is an error return, after
   # which we're done until we get to the next function.  Handily, the size
--- gdb/gnu-nat.c    2013-01-01 01:32:44.000000000 -0500
+++ gdb/gnu-nat.c    2013-01-01 01:32:44.000000000 -0500
@@ -1902,6 +1902,142 @@ S_proc_getmsgport_reply (mach_port_t rep
   return ill_rpc ("S_proc_getmsgport_reply");
 }

+error_t
+S_proc_pid2task_reply (mach_port_t reply, error_t err, mach_port_t task)
+{
+  return ill_rpc ("S_proc_pid2task_reply");
+}
+
+error_t
+S_proc_task2pid_reply (mach_port_t reply, error_t err, pid_t pid)
+{
+  return ill_rpc ("S_proc_task2pid_reply");
+}
+
+error_t
+S_proc_task2proc_reply (mach_port_t reply, error_t err, mach_port_t proc)
+{
+  return ill_rpc ("S_proc_task2proc_reply");
+}
+
+error_t
+S_proc_proc2task_reply (mach_port_t reply, error_t err, mach_port_t task)
+{
+  return ill_rpc ("S_proc_proc2task_reply");
+}
+
+error_t
+S_proc_pid2proc_reply (mach_port_t reply, error_t err, mach_port_t proc)
+{
+  return ill_rpc ("S_proc_pid2proc_reply");
+}
+
+error_t
+S_proc_getprocinfo_reply (mach_port_t reply, error_t err, int flags,
+                          procinfo_t procinfo, mach_msg_type_number_t piCnt,
+                          data_t threadwaits, mach_msg_type_number_t twCnt)
+{
+  return ill_rpc ("S_proc_getprocinfo_reply");
+}
+
+error_t
+S_proc_getprocargs_reply (mach_port_t reply, error_t err,
+                          data_t procargs, mach_msg_type_number_t procargsCnt)
+{
+  return ill_rpc ("S_proc_getprocargs_reply");
+}
+
+error_t
+S_proc_getprocenv_reply (mach_port_t reply, error_t err,
+                         data_t procenv, mach_msg_type_number_t procenvCnt)
+{
+  return ill_rpc ("S_proc_getprocenv_reply");
+}
+
+error_t
+S_proc_getloginid_reply (mach_port_t reply, error_t err, pid_t login_id)
+{
+  return ill_rpc ("S_proc_getloginid_reply");
+}
+
+error_t
+S_proc_getloginpids_reply (mach_port_t reply, error_t err,
+                           pidarray_t pids, mach_msg_type_number_t pidsCnt)
+{
+  return ill_rpc ("S_proc_getloginpids_reply");
+}
+
+error_t
+S_proc_getlogin_reply (mach_port_t reply, error_t err, string_t logname)
+{
+  return ill_rpc ("S_proc_getlogin_reply");
+}
+
+error_t
+S_proc_getsid_reply (mach_port_t reply, error_t err, pid_t sid)
+{
+  return ill_rpc ("S_proc_getsid_reply");
+}
+
+error_t
+S_proc_getsessionpgids_reply (mach_port_t reply, error_t err,
+                              pidarray_t pgidset, mach_msg_type_number_t psCnt)
+{
+  return ill_rpc ("S_proc_getsessionpgids_reply");
+}
+
+error_t
+S_proc_getsessionpids_reply (mach_port_t reply, error_t err,
+                             pidarray_t pidset, mach_msg_type_number_t psCnt)
+{
+  return ill_rpc ("S_proc_getsessionpids_reply");
+}
+
+error_t
+S_proc_getsidport_reply (mach_port_t reply, error_t err, mach_port_t sessport)
+{
+  return ill_rpc ("S_proc_getsidport_reply");
+}
+
+error_t
+S_proc_getpgrp_reply (mach_port_t reply, error_t err, pid_t pgrp)
+{
+  return ill_rpc ("S_proc_getpgrp_reply");
+}
+
+error_t
+S_proc_getpgrppids_reply (mach_port_t reply, error_t err,
+                          pidarray_t pidset, mach_msg_type_number_t pidsetCnt)
+{
+  return ill_rpc ("S_proc_getpgrppids_reply");
+}
+
+error_t
+S_proc_get_tty_reply (mach_port_t reply, error_t err, mach_port_t tty)
+{
+  return ill_rpc ("S_proc_get_tty_reply");
+}
+
+error_t
+S_proc_getnports_reply (mach_port_t reply, error_t err,
+                        mach_msg_type_number_t nports)
+{
+  return ill_rpc ("S_proc_getnports_reply");
+}
+
+error_t
+S_proc_is_important_reply (mach_port_t reply, error_t err, boolean_t essential)
+{
+  return ill_rpc ("S_proc_is_important_reply");
+}
+
+error_t
+S_proc_get_code_reply (mach_port_t reply, error_t err,
+                       vm_address_t start_code, vm_address_t end_code)
+{
+  return ill_rpc ("S_proc_get_code_reply");
+}
+

 /* Msg_reply server routines.  We only use msg_sig_post_untraced_reply.  */


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] GDB Hurd Fixes
  2013-09-20  0:43 [RFC] GDB Hurd Fixes David Michael
@ 2013-09-20  8:47 ` Pedro Alves
  2013-09-20  8:55   ` Thomas Schwinge
  2013-09-20 15:17   ` David Michael
  0 siblings, 2 replies; 9+ messages in thread
From: Pedro Alves @ 2013-09-20  8:47 UTC (permalink / raw)
  To: David Michael; +Cc: bug-hurd, gdb-patches

On 09/20/2013 01:43 AM, David Michael wrote:
> Hi,
> 
> (Copying gdb-patches this time.)

But, we're missing all the context on the gdb-patches@ side.

> 
> Here is an updated patch to successfully build GDB after today's
> Hurd/mig changes.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] GDB Hurd Fixes
  2013-09-20  8:47 ` Pedro Alves
@ 2013-09-20  8:55   ` Thomas Schwinge
  2013-09-20 15:17   ` David Michael
  1 sibling, 0 replies; 9+ messages in thread
From: Thomas Schwinge @ 2013-09-20  8:55 UTC (permalink / raw)
  To: Pedro Alves, David Michael; +Cc: bug-hurd, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 265 bytes --]

Hi!

On Fri, 20 Sep 2013 09:47:21 +0100, Pedro Alves <palves@redhat.com> wrote:
> On 09/20/2013 01:43 AM, David Michael wrote:
> > [Hurd/GDB issue]
> 
> But, we're missing all the context on the gdb-patches@ side.

I'll have a look.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] GDB Hurd Fixes
  2013-09-20  8:47 ` Pedro Alves
  2013-09-20  8:55   ` Thomas Schwinge
@ 2013-09-20 15:17   ` David Michael
  2014-01-06 16:56     ` Thomas Schwinge
  1 sibling, 1 reply; 9+ messages in thread
From: David Michael @ 2013-09-20 15:17 UTC (permalink / raw)
  To: Pedro Alves; +Cc: bug-hurd, gdb-patches

Hi,

On Fri, Sep 20, 2013 at 4:47 AM, Pedro Alves <palves@redhat.com> wrote:
> On 09/20/2013 01:43 AM, David Michael wrote:
>> (Copying gdb-patches this time.)
> But, we're missing all the context on the gdb-patches@ side.

Sorry about that--here's an explanation of the problems in GDB's build
process with current Hurd:

First, mig has stopped using the "auto" keyword in its output.[1]
Without that keyword, gdb/reply_mig_hack.awk fails to match a
necessary pattern and outputs a bad gdb/process_reply_S.c file.  The
first change I made adds a new pattern to the script in addition to
the old one, so it should work with both old and new mig binaries.

Next, new function definitions were added (then renamed) in
<hurd/process_reply.defs>.[2]  In the generated
gdb/process_reply_S.raw, some of the new functions match patterns in
gdb/reply_mig_hack.awk in a different order than expected, producing
bad output again.  The second change I made to the script ensures a
necessary definition is found before writing output.  (It may be
preferable to add a "parse_phase = 6" instead.)

Also because of [2], linking fails due to missing some new functions
in gdb/process_reply_S.c.  I just extended the way other unused
functions from process_reply.defs were handled previously in
gdb/gnu-nat.c.

Thanks.

David

[1] http://git.savannah.gnu.org/cgit/hurd/mig.git/commit/?id=b53836447df7230cd5665a7ccabd2a6e1a6607e5
[2] http://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=e19cc6184fb99394845d56e6e915fea9805e5c28


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] GDB Hurd Fixes
  2013-09-20 15:17   ` David Michael
@ 2014-01-06 16:56     ` Thomas Schwinge
  2014-01-06 17:25       ` Pedro Alves
                         ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Thomas Schwinge @ 2014-01-06 16:56 UTC (permalink / raw)
  To: David Michael; +Cc: bug-hurd, gdb-patches, Pedro Alves

[-- Attachment #1: Type: text/plain, Size: 10776 bytes --]

Hi!

Sorry for the delay, and thanks for the patches you posted.  Here are
three patches, based on yours, that I intend to apply if there are no
further comments.


On Fri, 20 Sep 2013 11:17:08 -0400, David Michael <fedora.dm0@gmail.com> wrote:
> On Fri, Sep 20, 2013 at 4:47 AM, Pedro Alves <palves@redhat.com> wrote:
> > On 09/20/2013 01:43 AM, David Michael wrote:
> >> (Copying gdb-patches this time.)
> > But, we're missing all the context on the gdb-patches@ side.
> 
> Sorry about that--here's an explanation of the problems in GDB's build
> process with current Hurd:
> 
> First, mig has stopped using the "auto" keyword in its output.[1]
> Without that keyword, gdb/reply_mig_hack.awk fails to match a
> necessary pattern and outputs a bad gdb/process_reply_S.c file.  The
> first change I made adds a new pattern to the script in addition to
> the old one, so it should work with both old and new mig binaries.

Instead of adding a new rule, I suggest to extend the existing one as
follows:

commit d8131897afba28934ced82c507114123027a40f8
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Mon Jan 6 15:56:33 2014 +0100

    Hurd: Adapt to changed MIG output.
    
    	gdb/
    	* reply_mig_hack.awk: Don't expect to see the auto keyword.
    
    Based on patch by David Michael <fedora.dm0@gmail.com>.

diff --git gdb/reply_mig_hack.awk gdb/reply_mig_hack.awk
index 97e080f..e137a27 100644
--- gdb/reply_mig_hack.awk
+++ gdb/reply_mig_hack.awk
@@ -78,9 +78,9 @@ parse_phase == 4 {
   print; next;
 }
 
-parse_phase == 5 && /^[ \t]*(auto|static) const mach_msg_type_t/ {
+parse_phase == 5 && /^[ \t]*(auto |static |)const mach_msg_type_t/ {
   # The type check structure for an argument.
-  arg_check_name[num_checks] = $4;
+  arg_check_name[num_checks] = $(NF - 2);
   num_checks++;
   print; next;
 }


> Next, new function definitions were added (then renamed) in
> <hurd/process_reply.defs>.[2]  In the generated
> gdb/process_reply_S.raw, some of the new functions match patterns in
> gdb/reply_mig_hack.awk in a different order than expected, producing
> bad output again.  The second change I made to the script ensures a
> necessary definition is found before writing output.  (It may be
> preferable to add a "parse_phase = 6" instead.)

I had the same thought about adding a new parsing phase, but didn't find
an easy and reliable way for detecting it; for clarity, I suggest to add
a comment, and solve this as follows:

commit ef7a4c2453a8300e93c6cc21e98ac63e0751fadd
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Mon Jan 6 16:01:08 2014 +0100

    Hurd: Make MIG output parsing more robust.
    
    	gdb/
    	* reply_mig_hack.awk: In phase 5, keep going if we have not yet
    	collected the type check structures.
    
    Based on patch by David Michael <fedora.dm0@gmail.com>.

diff --git gdb/reply_mig_hack.awk gdb/reply_mig_hack.awk
index e137a27..b117554 100644
--- gdb/reply_mig_hack.awk
+++ gdb/reply_mig_hack.awk
@@ -92,6 +92,12 @@ parse_phase == 5 && /^[ \t]*mig_external kern_return_t/ {
 }
 
 parse_phase == 5 && /^#if[ \t]TypeCheck/ {
+  # Keep going if we have not yet collected the type check structures.
+  if (num_checks == 0)
+    {
+      print; next;
+    }
+
   # The first args type checking statement; we need to insert our chunk of
   # code that bypasses all the type checks if this is an error return, after
   # which we're done until we get to the next function.  Handily, the size


> Also because of [2], linking fails due to missing some new functions
> in gdb/process_reply_S.c.  I just extended the way other unused
> functions from process_reply.defs were handled previously in
> gdb/gnu-nat.c.

commit 8949ba1abb3100d763850b48365793f12bde0374
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Mon Jan 6 16:28:00 2014 +0100

    Hurd: New RPC reply stub functions.
    
    	gdb/
    	* gnu-nat.c (ill_rpc): Remove function; replaced with this...
    	(ILL_RPC): ... new macro.
    	(do_mach_notify_no_senders, do_mach_notify_port_deleted)
    	(do_mach_notify_msg_accepted, do_mach_notify_port_destroyed)
    	(do_mach_notify_send_once, S_proc_setmsgport_reply)
    	(S_proc_getmsgport_reply, S_msg_sig_post_reply): Generate stub
    	functions with ILL_RPC macro.
    	(S_proc_pid2task_reply, S_proc_task2pid_reply)
    	(S_proc_task2proc_reply, S_proc_proc2task_reply)
    	(S_proc_pid2proc_reply, S_proc_getprocinfo_reply)
    	(S_proc_getprocargs_reply, S_proc_getprocenv_reply)
    	(S_proc_getloginid_reply, S_proc_getloginpids_reply)
    	(S_proc_getlogin_reply, S_proc_getsid_reply)
    	(S_proc_getsessionpgids_reply, S_proc_getsessionpids_reply)
    	(S_proc_getsidport_reply, S_proc_getpgrp_reply)
    	(S_proc_getpgrppids_reply, S_proc_get_tty_reply)
    	(S_proc_getnports_reply, S_proc_is_important_reply)
    	(S_proc_get_code_reply): New stub functions, generated with
    	ILL_RPC macro.
    
    Based on patch by David Michael <fedora.dm0@gmail.com>.

diff --git gdb/gnu-nat.c gdb/gnu-nat.c
index fa55b10..70d7f4f 100644
--- gdb/gnu-nat.c
+++ gdb/gnu-nat.c
@@ -1795,43 +1795,23 @@ do_mach_notify_dead_name (mach_port_t notify, mach_port_t dead_port)
 }
 
 \f
-static error_t
-ill_rpc (char *fun)
-{
-  warning (_("illegal rpc: %s"), fun);
-  return 0;
-}
-
-error_t
-do_mach_notify_no_senders (mach_port_t notify, mach_port_mscount_t count)
-{
-  return ill_rpc ("do_mach_notify_no_senders");
-}
-
-error_t
-do_mach_notify_port_deleted (mach_port_t notify, mach_port_t name)
-{
-  return ill_rpc ("do_mach_notify_port_deleted");
-}
-
-error_t
-do_mach_notify_msg_accepted (mach_port_t notify, mach_port_t name)
-{
-  return ill_rpc ("do_mach_notify_msg_accepted");
-}
-
-error_t
-do_mach_notify_port_destroyed (mach_port_t notify, mach_port_t name)
-{
-  return ill_rpc ("do_mach_notify_port_destroyed");
-}
-
-error_t
-do_mach_notify_send_once (mach_port_t notify)
-{
-  return ill_rpc ("do_mach_notify_send_once");
-}
+#define ILL_RPC(fun, ...) \
+  kern_return_t fun (__VA_ARGS__) \
+  { \
+    warning (_("illegal rpc: %s"), #fun); \
+    return 0; \
+  }
 
+ILL_RPC (do_mach_notify_no_senders,
+	 mach_port_t notify, mach_port_mscount_t count)
+ILL_RPC (do_mach_notify_port_deleted,
+	 mach_port_t notify, mach_port_t name)
+ILL_RPC (do_mach_notify_msg_accepted,
+	 mach_port_t notify, mach_port_t name)
+ILL_RPC (do_mach_notify_port_destroyed,
+	 mach_port_t notify, mach_port_t name)
+ILL_RPC (do_mach_notify_send_once,
+	 mach_port_t notify)
 \f
 /* Process_reply server routines.  We only use process_wait_reply.  */
 
@@ -1888,19 +1868,66 @@ S_proc_wait_reply (mach_port_t reply, error_t err,
   return 0;
 }
 
-error_t
-S_proc_setmsgport_reply (mach_port_t reply, error_t err,
-			 mach_port_t old_msg_port)
-{
-  return ill_rpc ("S_proc_setmsgport_reply");
-}
-
-error_t
-S_proc_getmsgport_reply (mach_port_t reply, error_t err, mach_port_t msg_port)
-{
-  return ill_rpc ("S_proc_getmsgport_reply");
-}
-
+ILL_RPC (S_proc_setmsgport_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 mach_port_t oldmsgport)
+ILL_RPC (S_proc_getmsgport_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 mach_port_t msgports)
+ILL_RPC (S_proc_pid2task_reply,
+	 mach_port_t reply_port, kern_return_t return_code, mach_port_t task)
+ILL_RPC (S_proc_task2pid_reply,
+	 mach_port_t reply_port, kern_return_t return_code, pid_t pid)
+ILL_RPC (S_proc_task2proc_reply,
+	 mach_port_t reply_port, kern_return_t return_code, mach_port_t proc)
+ILL_RPC (S_proc_proc2task_reply,
+	 mach_port_t reply_port, kern_return_t return_code, mach_port_t task)
+ILL_RPC (S_proc_pid2proc_reply,
+	 mach_port_t reply_port, kern_return_t return_code, mach_port_t proc)
+ILL_RPC (S_proc_getprocinfo_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 int flags, procinfo_t procinfo, mach_msg_type_number_t procinfoCnt,
+	 data_t threadwaits, mach_msg_type_number_t threadwaitsCnt)
+ILL_RPC (S_proc_getprocargs_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 data_t procargs, mach_msg_type_number_t procargsCnt)
+ILL_RPC (S_proc_getprocenv_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 data_t procenv, mach_msg_type_number_t procenvCnt)
+ILL_RPC (S_proc_getloginid_reply,
+	 mach_port_t reply_port, kern_return_t return_code, pid_t login_id)
+ILL_RPC (S_proc_getloginpids_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 pidarray_t pids, mach_msg_type_number_t pidsCnt)
+ILL_RPC (S_proc_getlogin_reply,
+	 mach_port_t reply_port, kern_return_t return_code, string_t logname)
+ILL_RPC (S_proc_getsid_reply,
+	 mach_port_t reply_port, kern_return_t return_code, pid_t sid)
+ILL_RPC (S_proc_getsessionpgids_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 pidarray_t pgidset, mach_msg_type_number_t pgidsetCnt)
+ILL_RPC (S_proc_getsessionpids_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 pidarray_t pidset, mach_msg_type_number_t pidsetCnt)
+ILL_RPC (S_proc_getsidport_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 mach_port_t sessport)
+ILL_RPC (S_proc_getpgrp_reply,
+	 mach_port_t reply_port, kern_return_t return_code, pid_t pgrp)
+ILL_RPC (S_proc_getpgrppids_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 pidarray_t pidset, mach_msg_type_number_t pidsetCnt)
+ILL_RPC (S_proc_get_tty_reply,
+	 mach_port_t reply_port, kern_return_t return_code, mach_port_t tty)
+ILL_RPC (S_proc_getnports_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 mach_msg_type_number_t nports)
+ILL_RPC (S_proc_is_important_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 boolean_t essential)
+ILL_RPC (S_proc_get_code_reply,
+	 mach_port_t reply_port, kern_return_t return_code,
+	 vm_address_t start_code, vm_address_t end_code)
 \f
 /* Msg_reply server routines.  We only use msg_sig_post_untraced_reply.  */
 
@@ -1934,12 +1961,8 @@ S_msg_sig_post_untraced_reply (mach_port_t reply, error_t err)
   return 0;
 }
 
-error_t
-S_msg_sig_post_reply (mach_port_t reply, error_t err)
-{
-  return ill_rpc ("S_msg_sig_post_reply");
-}
-
+ILL_RPC (S_msg_sig_post_reply,
+	 mach_port_t reply, error_t err)
 \f
 /* Returns the number of messages queued for the receive right PORT.  */
 static mach_port_msgcount_t


> [1] http://git.savannah.gnu.org/cgit/hurd/mig.git/commit/?id=b53836447df7230cd5665a7ccabd2a6e1a6607e5
> [2] http://git.savannah.gnu.org/cgit/hurd/hurd.git/commit/?id=e19cc6184fb99394845d56e6e915fea9805e5c28


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] GDB Hurd Fixes
  2014-01-06 16:56     ` Thomas Schwinge
@ 2014-01-06 17:25       ` Pedro Alves
  2014-05-06  3:49       ` Samuel Bronson
  2016-01-12 12:01       ` Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk" (was: [RFC] GDB Hurd Fixes) Thomas Schwinge
  2 siblings, 0 replies; 9+ messages in thread
From: Pedro Alves @ 2014-01-06 17:25 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: David Michael, bug-hurd, gdb-patches

On 01/06/2014 04:56 PM, Thomas Schwinge wrote:
> Hi!
> 
> Sorry for the delay, and thanks for the patches you posted.  Here are
> three patches, based on yours, that I intend to apply if there are no
> further comments.

I have no further comments (other than saying that IWBN to
have the rationale for the changes end up in the commit log).

Thanks,
-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] GDB Hurd Fixes
  2014-01-06 16:56     ` Thomas Schwinge
  2014-01-06 17:25       ` Pedro Alves
@ 2014-05-06  3:49       ` Samuel Bronson
  2014-05-06  6:42         ` Thomas Schwinge
  2016-01-12 12:01       ` Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk" (was: [RFC] GDB Hurd Fixes) Thomas Schwinge
  2 siblings, 1 reply; 9+ messages in thread
From: Samuel Bronson @ 2014-05-06  3:49 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: David Michael, bug-hurd, gdb-patches, Pedro Alves

On 1/6/14, Thomas Schwinge <thomas@codesourcery.com> wrote:
> Hi!
>
> Sorry for the delay, and thanks for the patches you posted.  Here are
> three patches, based on yours, that I intend to apply if there are no
> further comments.

What happened to applying these? (I'd like to cherrypick them for the
Debian package.)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [RFC] GDB Hurd Fixes
  2014-05-06  3:49       ` Samuel Bronson
@ 2014-05-06  6:42         ` Thomas Schwinge
  0 siblings, 0 replies; 9+ messages in thread
From: Thomas Schwinge @ 2014-05-06  6:42 UTC (permalink / raw)
  To: Samuel Bronson; +Cc: Pedro Alves, bug-hurd, David Michael, gdb-patches

[-- Attachment #1: Type: text/plain, Size: 804 bytes --]

Hi!

On Mon, 5 May 2014 23:49:33 -0400, Samuel Bronson <naesten@gmail.com> wrote:
> On 1/6/14, Thomas Schwinge <thomas@codesourcery.com> wrote:
> > Sorry for the delay, and thanks for the patches you posted.  Here are
> > three patches, based on yours, that I intend to apply if there are no
> > further comments.
> 
> What happened to applying these?

They got pushed as commits bae8023e39868ab2065ff05be61e151b3c082492,
d47642c93dda6344af12458e4e26587f3353fb44, and
3398af6aa352b0611bc9d66aed72080a876e42d4.

> (I'd like to cherrypick them for the
> Debian package.)

Thanks!  I think you'll also want to pick commit
c82f56d9d760a9b4034eeaac44f2f0fa5779ff69,
<http://news.gmane.org/find-root.php?message_id=%3C8738kyi30l.fsf%40kepler.schwinge.homeip.net%3E>.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk" (was: [RFC] GDB Hurd Fixes)
  2014-01-06 16:56     ` Thomas Schwinge
  2014-01-06 17:25       ` Pedro Alves
  2014-05-06  3:49       ` Samuel Bronson
@ 2016-01-12 12:01       ` Thomas Schwinge
  2 siblings, 0 replies; 9+ messages in thread
From: Thomas Schwinge @ 2016-01-12 12:01 UTC (permalink / raw)
  To: gdb-patches, Samuel Thibault; +Cc: bug-hurd, debian-hurd

[-- Attachment #1: Type: text/plain, Size: 3003 bytes --]

Hi!

On Mon, 6 Jan 2014 17:56:27 +0100, I wrote:
> On Fri, 20 Sep 2013 11:17:08 -0400, David Michael <fedora.dm0@gmail.com> wrote:
> > mig has stopped using the "auto" keyword in its output.[1]
> > Without that keyword, gdb/reply_mig_hack.awk fails to match a
> > necessary pattern and outputs a bad gdb/process_reply_S.c file.

> commit d8131897afba28934ced82c507114123027a40f8
> Author: Thomas Schwinge <thomas@codesourcery.com>
> Date:   Mon Jan 6 15:56:33 2014 +0100
> 
>     Hurd: Adapt to changed MIG output.
>     
>     	gdb/
>     	* reply_mig_hack.awk: Don't expect to see the auto keyword.
>     
>     Based on patch by David Michael <fedora.dm0@gmail.com>.
> 
> diff --git gdb/reply_mig_hack.awk gdb/reply_mig_hack.awk
> index 97e080f..e137a27 100644
> --- gdb/reply_mig_hack.awk
> +++ gdb/reply_mig_hack.awk
> @@ -78,9 +78,9 @@ parse_phase == 4 {
>    print; next;
>  }
>  
> -parse_phase == 5 && /^[ \t]*(auto|static) const mach_msg_type_t/ {
> +parse_phase == 5 && /^[ \t]*(auto |static |)const mach_msg_type_t/ {
>    # The type check structure for an argument.
> -  arg_check_name[num_checks] = $4;
> +  arg_check_name[num_checks] = $(NF - 2);
>    num_checks++;
>    print; next;
>  }

Turns out that the "mawk" AWK implementation doesn't like that regular
expression:

    mawk: [...]/gdb/reply_mig_hack.awk: line 98: regular expression compile failed (missing operand)

I didn't check it against the AWK language definition, but instead just
made the gdb/reply_mig_hack.awk script compatible to "mawk"; pushed:

commit 5eddd57823971bdb54f957d10c11ff3fc9f97b1e
Author: Thomas Schwinge <thomas@codesourcery.com>
Date:   Tue Jan 12 12:53:09 2016 +0100

    Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk"
    
    The "mawk" AWK implementation did't like that regular expression:
    
        mawk: [...]/gdb/reply_mig_hack.awk: line 98: regular expression compile failed (missing operand)
    
    	gdb/
    	* reply_mig_hack.awk: Rewrite one regular expression.
---
 gdb/ChangeLog          | 4 ++++
 gdb/reply_mig_hack.awk | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git gdb/ChangeLog gdb/ChangeLog
index 099a9a9..73b001c 100644
--- gdb/ChangeLog
+++ gdb/ChangeLog
@@ -1,3 +1,7 @@
+2016-01-12  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* reply_mig_hack.awk: Rewrite one regular expression.
+
 2016-01-11  Mike Frysinger  <vapier@gentoo.org>
 
 	* acinclude.m4: Include new warning.m4 file.
diff --git gdb/reply_mig_hack.awk gdb/reply_mig_hack.awk
index 1e2387a..e4c513b 100644
--- gdb/reply_mig_hack.awk
+++ gdb/reply_mig_hack.awk
@@ -95,7 +95,7 @@ parse_phase == 4 {
   print; next;
 }
 
-parse_phase == 5 && /^[ \t]*(auto |static |)const mach_msg_type_t/ {
+parse_phase == 5 && /^[ \t]*(auto |static )?const mach_msg_type_t/ {
   # The type check structure for an argument.
   arg_check_name[num_checks] = $(NF - 2);
   num_checks++;


Grüße
 Thomas

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-01-12 12:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-20  0:43 [RFC] GDB Hurd Fixes David Michael
2013-09-20  8:47 ` Pedro Alves
2013-09-20  8:55   ` Thomas Schwinge
2013-09-20 15:17   ` David Michael
2014-01-06 16:56     ` Thomas Schwinge
2014-01-06 17:25       ` Pedro Alves
2014-05-06  3:49       ` Samuel Bronson
2014-05-06  6:42         ` Thomas Schwinge
2016-01-12 12:01       ` Hurd: Make gdb/reply_mig_hack.awk script compatible to "mawk" (was: [RFC] GDB Hurd Fixes) Thomas Schwinge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox