* [PATCH] gdb: add callback defines for new ARGV handling
@ 2011-01-06 9:15 Mike Frysinger
2011-01-10 17:57 ` Doug Evans
2012-04-12 6:27 ` Mike Frysinger
0 siblings, 2 replies; 9+ messages in thread
From: Mike Frysinger @ 2011-01-06 9:15 UTC (permalink / raw)
To: gdb-patches; +Cc: toolchain-devel
The common sim code has slightly unfinished support for these already,
but even arch ports are unable to handle these if the common header does
not define them. This is because the generated callback header includes
simple common gdb/sim headers only which causes it to skip the new ARGV
syscalls. Plus, it isn't like providing these in the common header will
break any sim targets which don't want them.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-01-06 Mike Frysinger <vapier@gentoo.org>
* callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define.
---
include/gdb/callback.h | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/include/gdb/callback.h b/include/gdb/callback.h
index a1f79f9..296dfc3 100644
--- a/include/gdb/callback.h
+++ b/include/gdb/callback.h
@@ -231,6 +231,11 @@ extern host_callback default_callback;
#define CB_SYS_truncate 21
#define CB_SYS_ftruncate 22
#define CB_SYS_pipe 23
+
+/* New ARGV support. */
+#define CB_SYS_argc 24
+#define CB_SYS_argnlen 25
+#define CB_SYS_argn 26
\f
/* Struct use to pass and return information necessary to perform a
system call. */
--
1.7.3.1
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2011-01-06 9:15 [PATCH] gdb: add callback defines for new ARGV handling Mike Frysinger
@ 2011-01-10 17:57 ` Doug Evans
2011-01-10 21:25 ` Mike Frysinger
2012-04-12 6:27 ` Mike Frysinger
1 sibling, 1 reply; 9+ messages in thread
From: Doug Evans @ 2011-01-10 17:57 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel
On Thu, Jan 6, 2011 at 2:15 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> The common sim code has slightly unfinished support for these already,
> but even arch ports are unable to handle these if the common header does
> not define them. This is because the generated callback header includes
> simple common gdb/sim headers only which causes it to skip the new ARGV
> syscalls. Plus, it isn't like providing these in the common header will
> break any sim targets which don't want them.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>
> 2010-01-06 Mike Frysinger <vapier@gentoo.org>
>
> * callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define.
> ---
> include/gdb/callback.h | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/include/gdb/callback.h b/include/gdb/callback.h
> index a1f79f9..296dfc3 100644
> --- a/include/gdb/callback.h
> +++ b/include/gdb/callback.h
> @@ -231,6 +231,11 @@ extern host_callback default_callback;
> #define CB_SYS_truncate 21
> #define CB_SYS_ftruncate 22
> #define CB_SYS_pipe 23
> +
> +/* New ARGV support. */
> +#define CB_SYS_argc 24
> +#define CB_SYS_argnlen 25
> +#define CB_SYS_argn 26
>
> /* Struct use to pass and return information necessary to perform a
> system call. */
The common sim code has CB_SYS_{argv,argvlen}, but I don't see the above.
Where do they come from?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2011-01-10 17:57 ` Doug Evans
@ 2011-01-10 21:25 ` Mike Frysinger
2011-01-10 22:12 ` Doug Evans
0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2011-01-10 21:25 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches, toolchain-devel
On Mon, Jan 10, 2011 at 12:57 PM, Doug Evans wrote:
> On Thu, Jan 6, 2011 at 2:15 AM, Mike Frysinger wrote:
>> The common sim code has slightly unfinished support for these already,
>> but even arch ports are unable to handle these if the common header does
>> not define them. This is because the generated callback header includes
>> simple common gdb/sim headers only which causes it to skip the new ARGV
>> syscalls. Plus, it isn't like providing these in the common header will
>> break any sim targets which don't want them.
>>
>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>>
>> 2010-01-06 Mike Frysinger <vapier@gentoo.org>
>>
>> * callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define.
>> ---
>> include/gdb/callback.h | 5 +++++
>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>
>> diff --git a/include/gdb/callback.h b/include/gdb/callback.h
>> index a1f79f9..296dfc3 100644
>> --- a/include/gdb/callback.h
>> +++ b/include/gdb/callback.h
>> @@ -231,6 +231,11 @@ extern host_callback default_callback;
>> #define CB_SYS_truncate 21
>> #define CB_SYS_ftruncate 22
>> #define CB_SYS_pipe 23
>> +
>> +/* New ARGV support. */
>> +#define CB_SYS_argc 24
>> +#define CB_SYS_argnlen 25
>> +#define CB_SYS_argn 26
>>
>> /* Struct use to pass and return information necessary to perform a
>> system call. */
>
> The common sim code has CB_SYS_{argv,argvlen}, but I don't see the above.
> Where do they come from?
pretty much all the callback "syscalls" that the sim handles are
because of newlib/libgloss
-mike
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2011-01-10 21:25 ` Mike Frysinger
@ 2011-01-10 22:12 ` Doug Evans
2011-01-10 22:29 ` Mike Frysinger
0 siblings, 1 reply; 9+ messages in thread
From: Doug Evans @ 2011-01-10 22:12 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel
On Mon, Jan 10, 2011 at 1:25 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On Mon, Jan 10, 2011 at 12:57 PM, Doug Evans wrote:
>> On Thu, Jan 6, 2011 at 2:15 AM, Mike Frysinger wrote:
>>> The common sim code has slightly unfinished support for these already,
>>> but even arch ports are unable to handle these if the common header does
>>> not define them. This is because the generated callback header includes
>>> simple common gdb/sim headers only which causes it to skip the new ARGV
>>> syscalls. Plus, it isn't like providing these in the common header will
>>> break any sim targets which don't want them.
>>>
>>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>>>
>>> 2010-01-06 Mike Frysinger <vapier@gentoo.org>
>>>
>>> * callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define.
>>> ---
>>> include/gdb/callback.h | 5 +++++
>>> 1 files changed, 5 insertions(+), 0 deletions(-)
>>>
>>> diff --git a/include/gdb/callback.h b/include/gdb/callback.h
>>> index a1f79f9..296dfc3 100644
>>> --- a/include/gdb/callback.h
>>> +++ b/include/gdb/callback.h
>>> @@ -231,6 +231,11 @@ extern host_callback default_callback;
>>> #define CB_SYS_truncate 21
>>> #define CB_SYS_ftruncate 22
>>> #define CB_SYS_pipe 23
>>> +
>>> +/* New ARGV support. */
>>> +#define CB_SYS_argc 24
>>> +#define CB_SYS_argnlen 25
>>> +#define CB_SYS_argn 26
>>>
>>> /* Struct use to pass and return information necessary to perform a
>>> system call. */
>>
>> The common sim code has CB_SYS_{argv,argvlen}, but I don't see the above.
>> Where do they come from?
>
> pretty much all the callback "syscalls" that the sim handles are
> because of newlib/libgloss
> -mike
Ah. src/libgloss/syscall.h has SYS_{argc,argnlen,argn}, added in 2006.
So now we have CB_SYS_{argv,argvlen,argc,argnlen,argn}.
Blech.
It would be nice to know the reasoning behind argn,argnlen.
For callback.h, IWBN to add some documentation regarding why things
are the way they are. E.g. if argn is preferred over argv, why?
Any ideas?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2011-01-10 22:12 ` Doug Evans
@ 2011-01-10 22:29 ` Mike Frysinger
2011-01-11 3:38 ` Doug Evans
0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2011-01-10 22:29 UTC (permalink / raw)
To: Doug Evans; +Cc: gdb-patches, toolchain-devel
[-- Attachment #1: Type: Text/Plain, Size: 2928 bytes --]
On Monday, January 10, 2011 17:11:53 Doug Evans wrote:
> On Mon, Jan 10, 2011 at 1:25 PM, Mike Frysinger wrote:
> > On Mon, Jan 10, 2011 at 12:57 PM, Doug Evans wrote:
> >> On Thu, Jan 6, 2011 at 2:15 AM, Mike Frysinger wrote:
> >>> The common sim code has slightly unfinished support for these already,
> >>> but even arch ports are unable to handle these if the common header
> >>> does not define them. This is because the generated callback header
> >>> includes simple common gdb/sim headers only which causes it to skip
> >>> the new ARGV syscalls. Plus, it isn't like providing these in the
> >>> common header will break any sim targets which don't want them.
> >>>
> >>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> >>>
> >>> 2010-01-06 Mike Frysinger <vapier@gentoo.org>
> >>>
> >>> * callback.h (CB_SYS_argc, CB_SYS_argnlen, CB_SYS_argn): Define.
> >>> ---
> >>> include/gdb/callback.h | 5 +++++
> >>> 1 files changed, 5 insertions(+), 0 deletions(-)
> >>>
> >>> diff --git a/include/gdb/callback.h b/include/gdb/callback.h
> >>> index a1f79f9..296dfc3 100644
> >>> --- a/include/gdb/callback.h
> >>> +++ b/include/gdb/callback.h
> >>> @@ -231,6 +231,11 @@ extern host_callback default_callback;
> >>> #define CB_SYS_truncate 21
> >>> #define CB_SYS_ftruncate 22
> >>> #define CB_SYS_pipe 23
> >>> +
> >>> +/* New ARGV support. */
> >>> +#define CB_SYS_argc 24
> >>> +#define CB_SYS_argnlen 25
> >>> +#define CB_SYS_argn 26
> >>>
> >>> /* Struct use to pass and return information necessary to perform a
> >>> system call. */
> >>
> >> The common sim code has CB_SYS_{argv,argvlen}, but I don't see the
> >> above. Where do they come from?
> >
> > pretty much all the callback "syscalls" that the sim handles are
> > because of newlib/libgloss
> > -mike
>
> Ah. src/libgloss/syscall.h has SYS_{argc,argnlen,argn}, added in 2006.
>
> So now we have CB_SYS_{argv,argvlen,argc,argnlen,argn}.
> Blech.
> It would be nice to know the reasoning behind argn,argnlen.
>
> For callback.h, IWBN to add some documentation regarding why things
> are the way they are. E.g. if argn is preferred over argv, why?
these things were created long before i had even heard of either project, so i
can only speculate on their history. i would guess that argv/argvlen made it
more difficult to do what most people actually want -- pass argc/argv to the
main function. and so argc/argn were born.
all i really know is that argc/argn/argnlen are labeled as "the new approach"
in a few places, and as such, it is what the Blackfin port supports.
it also seems like the syscall handling intended to handle argv at some point,
but someone didnt get around to implementing it. so i could flesh that out
too so that i could take the Blackfin argn/argc code and move it to
common/syscall.c in the sim.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2011-01-10 22:29 ` Mike Frysinger
@ 2011-01-11 3:38 ` Doug Evans
2012-04-09 19:08 ` Mike Frysinger
0 siblings, 1 reply; 9+ messages in thread
From: Doug Evans @ 2011-01-11 3:38 UTC (permalink / raw)
To: Mike Frysinger; +Cc: gdb-patches, toolchain-devel, newlib
[+ newlib]
On Mon, Jan 10, 2011 at 2:29 PM, Mike Frysinger <vapier@gentoo.org> wrote:
>> For callback.h, IWBN to add some documentation regarding why things
>> are the way they are. E.g. if argn is preferred over argv, why?
>
> these things were created long before i had even heard of either project, so i
> can only speculate on their history.
Understood.
> i would guess that argv/argvlen made it
> more difficult to do what most people actually want -- pass argc/argv to the
> main function. and so argc/argn were born.
I wouldn't mind hearing more, sounds pretty fishy.
Though I understand it was before your time.
I found these in the newlib archives:
An inquiry into argv,argvlen:
http://sourceware.org/ml/newlib/2006/msg00859.html
Submission of argc,argn,argnlen:
http://sourceware.org/ml/newlib/2006/msg00883.html
I couldn't find any pushback when argn,argnlen were submitted.
> all i really know is that argc/argn/argnlen are labeled as "the new approach"
> in a few places, and as such, it is what the Blackfin port supports.
Blech.
I'm hesitant to approve the patch, but since this is sim,newlib I
don't want to hold things up much just because of this.
> it also seems like the syscall handling intended to handle argv at some point,
> but someone didnt get around to implementing it. so i could flesh that out
> too so that i could take the Blackfin argn/argc code and move it to
> common/syscall.c in the sim.
newlib: does anyone know the history of SYS_argc,argn,argnlen vs
SYS_argv,argvlen beyond the above mentioned emails?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2011-01-11 3:38 ` Doug Evans
@ 2012-04-09 19:08 ` Mike Frysinger
2012-04-17 7:00 ` Jie Zhang
0 siblings, 1 reply; 9+ messages in thread
From: Mike Frysinger @ 2012-04-09 19:08 UTC (permalink / raw)
To: Doug Evans, Jie Zhang; +Cc: gdb-patches, toolchain-devel, newlib
[-- Attachment #1: Type: Text/Plain, Size: 1770 bytes --]
Jie: could you comment on the below thread ?
-mike
On Monday 10 January 2011 22:38:11 Doug Evans wrote:
> [+ newlib]
>
> On Mon, Jan 10, 2011 at 2:29 PM, Mike Frysinger wrote:
> >> For callback.h, IWBN to add some documentation regarding why things
> >> are the way they are. E.g. if argn is preferred over argv, why?
> >
> > these things were created long before i had even heard of either project,
> > so i can only speculate on their history.
>
> Understood.
>
> > i would guess that argv/argvlen made it
> > more difficult to do what most people actually want -- pass argc/argv to
> > the main function. and so argc/argn were born.
>
> I wouldn't mind hearing more, sounds pretty fishy.
> Though I understand it was before your time.
>
> I found these in the newlib archives:
> An inquiry into argv,argvlen:
> http://sourceware.org/ml/newlib/2006/msg00859.html
> Submission of argc,argn,argnlen:
> http://sourceware.org/ml/newlib/2006/msg00883.html
>
> I couldn't find any pushback when argn,argnlen were submitted.
>
> > all i really know is that argc/argn/argnlen are labeled as "the new
> > approach" in a few places, and as such, it is what the Blackfin port
> > supports.
>
> Blech.
> I'm hesitant to approve the patch, but since this is sim,newlib I
> don't want to hold things up much just because of this.
>
> > it also seems like the syscall handling intended to handle argv at some
> > point, but someone didnt get around to implementing it. so i could
> > flesh that out too so that i could take the Blackfin argn/argc code and
> > move it to common/syscall.c in the sim.
>
> newlib: does anyone know the history of SYS_argc,argn,argnlen vs
> SYS_argv,argvlen beyond the above mentioned emails?
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2011-01-06 9:15 [PATCH] gdb: add callback defines for new ARGV handling Mike Frysinger
2011-01-10 17:57 ` Doug Evans
@ 2012-04-12 6:27 ` Mike Frysinger
1 sibling, 0 replies; 9+ messages in thread
From: Mike Frysinger @ 2012-04-12 6:27 UTC (permalink / raw)
To: gdb-patches; +Cc: toolchain-devel
[-- Attachment #1: Type: Text/Plain, Size: 750 bytes --]
On Thursday 06 January 2011 05:15:08 Mike Frysinger wrote:
> The common sim code has slightly unfinished support for these already,
> but even arch ports are unable to handle these if the common header does
> not define them. This is because the generated callback header includes
> simple common gdb/sim headers only which causes it to skip the new ARGV
> syscalls. Plus, it isn't like providing these in the common header will
> break any sim targets which don't want them.
i've merged this as the gdb/callback.h should be in sync with the libgloss
syscalls. if we decide to drop stuff from libgloss, we can do it in both
places. but for now, this makes argv passing work in the Blackfin sim and
libgloss/newlib targets.
-mike
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] gdb: add callback defines for new ARGV handling
2012-04-09 19:08 ` Mike Frysinger
@ 2012-04-17 7:00 ` Jie Zhang
0 siblings, 0 replies; 9+ messages in thread
From: Jie Zhang @ 2012-04-17 7:00 UTC (permalink / raw)
To: Mike Frysinger; +Cc: Doug Evans, gdb-patches, toolchain-devel, newlib
On Mon, Apr 9, 2012 at 3:08 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> Jie: could you comment on the below thread ?
Yes.
> -mike
>
> On Monday 10 January 2011 22:38:11 Doug Evans wrote:
>> [+ newlib]
>>
>> On Mon, Jan 10, 2011 at 2:29 PM, Mike Frysinger wrote:
>> >> For callback.h, IWBN to add some documentation regarding why things
>> >> are the way they are. E.g. if argn is preferred over argv, why?
>> >
>> > these things were created long before i had even heard of either project,
>> > so i can only speculate on their history.
>>
>> Understood.
>>
>> > i would guess that argv/argvlen made it
>> > more difficult to do what most people actually want -- pass argc/argv to
>> > the main function. and so argc/argn were born.
>>
>> I wouldn't mind hearing more, sounds pretty fishy.
>> Though I understand it was before your time.
>>
It was also much before my time. See my next comment.
>> I found these in the newlib archives:
>> An inquiry into argv,argvlen:
>> http://sourceware.org/ml/newlib/2006/msg00859.html
>> Submission of argc,argn,argnlen:
>> http://sourceware.org/ml/newlib/2006/msg00883.html
>>
>> I couldn't find any pushback when argn,argnlen were submitted.
>>
When I was working on adding argc/argv support for Blackfin
newlib/libgloss/simulator, I just copied the existing implementation
from other ports. I checked out the sim and newlib code around 27 Oct
2006. It seems at that time sh used argc/argn/argnlen while d30v used
argv/argvlen. But the code for CB_SYS_argvlen and CB_SYS_argv was
commented out by "#if 0 /* FIXME: wip */... #endif" in sim. So I just
used the same one as sh port for Blackfin.
The initial sh newlib patch:
http://sourceware.org/ml/newlib/2001/msg00043.html
The initial sh sim patch:
http://sourceware.org/ml/gdb-patches/2001-01/msg00288.html
>> > all i really know is that argc/argn/argnlen are labeled as "the new
>> > approach" in a few places, and as such, it is what the Blackfin port
>> > supports.
I think this is true. CB_SYS_argv/CB_SYS_argvlen came in with the
initial import of gdb repository in 1999. It was still commented out
as WIP when argc/argn/argnlen was added in 2001. It's still commented
out today! I really think we should remove these commented out code,
which has been WIP for 13 years. I don't think it will get done in
near future.
>>
>> Blech.
>> I'm hesitant to approve the patch, but since this is sim,newlib I
>> don't want to hold things up much just because of this.
>>
>> > it also seems like the syscall handling intended to handle argv at some
>> > point, but someone didnt get around to implementing it. so i could
>> > flesh that out too so that i could take the Blackfin argn/argc code and
>> > move it to common/syscall.c in the sim.
>>
>> newlib: does anyone know the history of SYS_argc,argn,argnlen vs
>> SYS_argv,argvlen beyond the above mentioned emails?
The earliest information I know is the two patches I mentioned above.
Regards,
Jie
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-04-17 4:06 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-06 9:15 [PATCH] gdb: add callback defines for new ARGV handling Mike Frysinger
2011-01-10 17:57 ` Doug Evans
2011-01-10 21:25 ` Mike Frysinger
2011-01-10 22:12 ` Doug Evans
2011-01-10 22:29 ` Mike Frysinger
2011-01-11 3:38 ` Doug Evans
2012-04-09 19:08 ` Mike Frysinger
2012-04-17 7:00 ` Jie Zhang
2012-04-12 6:27 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox