Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Buildling gdb on Ubuntu 18.04
@ 2019-01-30  7:41 Ömer Sinan Ağacan
  2019-01-30 14:58 ` Simon Marchi
  0 siblings, 1 reply; 8+ messages in thread
From: Ömer Sinan Ağacan @ 2019-01-30  7:41 UTC (permalink / raw)
  To: gdb

I'm trying to build gdb from git on Ubuntu 18.04 to see if some of the bugs I'm
observing with machine interface of 8.1.0.20180409-git are fixed in the
development version. I got a few different errors before but with some help from
people on the IRC channel I was able to make progress, and current status is
this: https://gist.github.com/osa1/4548c5bc2d167541557e0a349944eb00

Does anyone have any ideas on how to move from there? Kernel version on Ubuntu
18.04: 4.15.0-44-generic

Thanks

Ömer


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

* Re: Buildling gdb on Ubuntu 18.04
  2019-01-30  7:41 Buildling gdb on Ubuntu 18.04 Ömer Sinan Ağacan
@ 2019-01-30 14:58 ` Simon Marchi
  2019-01-30 15:12   ` Ömer Sinan Ağacan
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Marchi @ 2019-01-30 14:58 UTC (permalink / raw)
  To: Ömer Sinan Ağacan; +Cc: gdb

On 2019-01-30 02:40, Ömer Sinan Ağacan wrote:
> I'm trying to build gdb from git on Ubuntu 18.04 to see if some of the 
> bugs I'm
> observing with machine interface of 8.1.0.20180409-git are fixed in the
> development version. I got a few different errors before but with some 
> help from
> people on the IRC channel I was able to make progress, and current 
> status is
> this: https://gist.github.com/osa1/4548c5bc2d167541557e0a349944eb00
> 
> Does anyone have any ideas on how to move from there? Kernel version on 
> Ubuntu
> 18.04: 4.15.0-44-generic
> 
> Thanks
> 
> Ömer

About this error:

nat/gdb_ptrace.h:129:8: error: ‘PTRACE_TYPE_RET’ does not name a type; 
did you mean ‘PTRACE_TYPE_ARG3’?

The PTRACE_TYPE_RET type should be defined in the gdb/config.h file, in 
your build directory.  For example, I have

650 /* Define as the return type of ptrace. */                           
           │warning: File 
"/home/emaisin/build/binutils-gdb/gdb/gdb-gdb.py" auto-loading has be
651 #define PTRACE_TYPE_RET long


Is there a mention of PTRACE_TYPE_RET in your config.h?  I assume it is 
undefined?

Simon


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

* Re: Buildling gdb on Ubuntu 18.04
  2019-01-30 14:58 ` Simon Marchi
@ 2019-01-30 15:12   ` Ömer Sinan Ağacan
  2019-01-30 15:50     ` Simon Marchi
  0 siblings, 1 reply; 8+ messages in thread
From: Ömer Sinan Ağacan @ 2019-01-30 15:12 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb

Actually it's not undefined, I see this in the file

    /* Define as the return type of ptrace. */
    #define PTRACE_TYPE_RET long

Do I need to include config.h in a file maybe?

Ömer

Simon Marchi <simon.marchi@polymtl.ca>, 30 Oca 2019 Çar, 17:58
tarihinde şunu yazdı:
>
> On 2019-01-30 02:40, Ömer Sinan Ağacan wrote:
> > I'm trying to build gdb from git on Ubuntu 18.04 to see if some of the
> > bugs I'm
> > observing with machine interface of 8.1.0.20180409-git are fixed in the
> > development version. I got a few different errors before but with some
> > help from
> > people on the IRC channel I was able to make progress, and current
> > status is
> > this: https://gist.github.com/osa1/4548c5bc2d167541557e0a349944eb00
> >
> > Does anyone have any ideas on how to move from there? Kernel version on
> > Ubuntu
> > 18.04: 4.15.0-44-generic
> >
> > Thanks
> >
> > Ömer
>
> About this error:
>
> nat/gdb_ptrace.h:129:8: error: ‘PTRACE_TYPE_RET’ does not name a type;
> did you mean ‘PTRACE_TYPE_ARG3’?
>
> The PTRACE_TYPE_RET type should be defined in the gdb/config.h file, in
> your build directory.  For example, I have
>
> 650 /* Define as the return type of ptrace. */
>            │warning: File
> "/home/emaisin/build/binutils-gdb/gdb/gdb-gdb.py" auto-loading has be
> 651 #define PTRACE_TYPE_RET long
>
>
> Is there a mention of PTRACE_TYPE_RET in your config.h?  I assume it is
> undefined?
>
> Simon


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

* Re: Buildling gdb on Ubuntu 18.04
  2019-01-30 15:12   ` Ömer Sinan Ağacan
@ 2019-01-30 15:50     ` Simon Marchi
  2019-01-30 19:45       ` Ömer Sinan Ağacan
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Marchi @ 2019-01-30 15:50 UTC (permalink / raw)
  To: Ömer Sinan Ağacan; +Cc: gdb

On 2019-01-30 10:12, Ömer Sinan Ağacan wrote:
> Actually it's not undefined, I see this in the file
> 
>     /* Define as the return type of ptrace. */
>     #define PTRACE_TYPE_RET long
> 
> Do I need to include config.h in a file maybe?

config.h should already be included wherever necessary.  I am a bit at 
loss here.  GDB should build fine using these standard steps in most 
situations:


git clone git://sourceware.org/git/binutils-gdb.git
cd binutils-gdb
./configure
make


I just tried these commands in an Ubuntu 18.04 Docker container, and it 
built fine.  Note that to make sure to have all necessary dependencies 
required to build GDB, you can use "apt-get build-dep gdb" on 
Debian/Ubuntu (to be able to use "build-dep" in a docker container, you 
need to uncomment the "deb-src" lines in /etc/apt/sources.list and do an 
"apt-get update").  The versions of all the build tools in Ubuntu 18.04 
are expected to work, so there should be no need to build bison or 
anything from source.

Simon


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

* Re: Buildling gdb on Ubuntu 18.04
  2019-01-30 15:50     ` Simon Marchi
@ 2019-01-30 19:45       ` Ömer Sinan Ağacan
  2019-01-30 20:01         ` Simon Marchi
  0 siblings, 1 reply; 8+ messages in thread
From: Ömer Sinan Ağacan @ 2019-01-30 19:45 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb

Interesting, I was also able to build in a docker container and it works when I
copy the executable to the host system, so my problem is kind of solved. I'm
still wondering what's wrong with my system though ...

(Too bad the bug exists in the development version too so I have to deal with it
in my application...)

Ömer

Simon Marchi <simon.marchi@polymtl.ca>, 30 Oca 2019 Çar, 18:50
tarihinde şunu yazdı:
>
> On 2019-01-30 10:12, Ömer Sinan Ağacan wrote:
> > Actually it's not undefined, I see this in the file
> >
> >     /* Define as the return type of ptrace. */
> >     #define PTRACE_TYPE_RET long
> >
> > Do I need to include config.h in a file maybe?
>
> config.h should already be included wherever necessary.  I am a bit at
> loss here.  GDB should build fine using these standard steps in most
> situations:
>
>
> git clone git://sourceware.org/git/binutils-gdb.git
> cd binutils-gdb
> ./configure
> make
>
>
> I just tried these commands in an Ubuntu 18.04 Docker container, and it
> built fine.  Note that to make sure to have all necessary dependencies
> required to build GDB, you can use "apt-get build-dep gdb" on
> Debian/Ubuntu (to be able to use "build-dep" in a docker container, you
> need to uncomment the "deb-src" lines in /etc/apt/sources.list and do an
> "apt-get update").  The versions of all the build tools in Ubuntu 18.04
> are expected to work, so there should be no need to build bison or
> anything from source.
>
> Simon


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

* Re: Buildling gdb on Ubuntu 18.04
  2019-01-30 19:45       ` Ömer Sinan Ağacan
@ 2019-01-30 20:01         ` Simon Marchi
  2019-01-31  6:23           ` Ömer Sinan Ağacan
  0 siblings, 1 reply; 8+ messages in thread
From: Simon Marchi @ 2019-01-30 20:01 UTC (permalink / raw)
  To: Ömer Sinan Ağacan; +Cc: gdb

On 2019-01-30 14:45, Ömer Sinan Ağacan wrote:
> Interesting, I was also able to build in a docker container and it 
> works when I
> copy the executable to the host system, so my problem is kind of 
> solved. I'm
> still wondering what's wrong with my system though ...
> 
> (Too bad the bug exists in the development version too so I have to 
> deal with it
> in my application...)

Sorry for not being able to help you for your build issue, it looks like 
a one off weird thing with your setup (with enough digging one would 
probably find it).

Which bug are you referring to?  Is it something know and documented in 
Bugzilla?

Simon


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

* Re: Buildling gdb on Ubuntu 18.04
  2019-01-30 20:01         ` Simon Marchi
@ 2019-01-31  6:23           ` Ömer Sinan Ağacan
  2019-01-31 15:54             ` Simon Marchi
  0 siblings, 1 reply; 8+ messages in thread
From: Ömer Sinan Ağacan @ 2019-01-31  6:23 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb

> Which bug are you referring to?  Is it something know and documented in
> Bugzilla?

I don't of if any of these are documented in Bugzilla, but

- gdb sometimes prints more than one newline after a record. According to
  section 27.2.2 there should be only one newline.

- According to 27.2.2 a sequence of records result records should come after
  out-of-band record, but I sometimes get a sequence like [out-of-bound,
  result, out-of-bound].

- According to 27.2.2 a sequence of records should terminate with "(gdb)\n" or
  "(gdb)\r\n", but I get "(gdb) \n".

- Most annoyingly, when I add a breakpoint to a location that corresponds to
  multiple locations in the source code (so it leads to adding more than one
  breakpoint), the mi syntax gdb prints looks like this

      =breakpoint-created,bkpt={...},{...},{...}

  which is not valid because a "result" should look like `x=y` so stuff after
  the first "result" (`bkpt={...}`) are not actually results.

Ömer

Simon Marchi <simon.marchi@polymtl.ca>, 30 Oca 2019 Çar, 23:01
tarihinde şunu yazdı:
>
> On 2019-01-30 14:45, Ömer Sinan Ağacan wrote:
> > Interesting, I was also able to build in a docker container and it
> > works when I
> > copy the executable to the host system, so my problem is kind of
> > solved. I'm
> > still wondering what's wrong with my system though ...
> >
> > (Too bad the bug exists in the development version too so I have to
> > deal with it
> > in my application...)
>
> Sorry for not being able to help you for your build issue, it looks like
> a one off weird thing with your setup (with enough digging one would
> probably find it).
>
> Which bug are you referring to?  Is it something know and documented in
> Bugzilla?
>
> Simon


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

* Re: Buildling gdb on Ubuntu 18.04
  2019-01-31  6:23           ` Ömer Sinan Ağacan
@ 2019-01-31 15:54             ` Simon Marchi
  0 siblings, 0 replies; 8+ messages in thread
From: Simon Marchi @ 2019-01-31 15:54 UTC (permalink / raw)
  To: Ömer Sinan Ağacan; +Cc: gdb

On 2019-01-31 01:22, Ömer Sinan Ağacan wrote:
>> Which bug are you referring to?  Is it something know and documented 
>> in
>> Bugzilla?
> 
> I don't of if any of these are documented in Bugzilla, but
> 
> - gdb sometimes prints more than one newline after a record. According 
> to
>   section 27.2.2 there should be only one newline.

Oh, can you give a sequence of commands that triggers this?

> - According to 27.2.2 a sequence of records result records should come 
> after
>   out-of-band record, but I sometimes get a sequence like 
> [out-of-bound,
>   result, out-of-bound].

I am not sure about the pedantic accuracy of the grammar for this, but I 
guess it works because the last out-of-band record can be considered as 
before the next result record, that has not yet arrived.  The idea is 
that out-of-band records can happen pretty much at any time (and they 
are not necessarily related to the command you happen to have just 
issued previously).

> - According to 27.2.2 a sequence of records should terminate with 
> "(gdb)\n" or
>   "(gdb)\r\n", but I get "(gdb) \n".

We should check how old versions behaved, but I would guess that in this 
case it's the documentation that is wrong, and should include the space. 
  Would you mind sending a patch for this?

> - Most annoyingly, when I add a breakpoint to a location that 
> corresponds to
>   multiple locations in the source code (so it leads to adding more 
> than one
>   breakpoint), the mi syntax gdb prints looks like this
> 
>       =breakpoint-created,bkpt={...},{...},{...}
> 
>   which is not valid because a "result" should look like `x=y` so stuff 
> after
>   the first "result" (`bkpt={...}`) are not actually results.

This last one is the one I aim to fix in

   https://sourceware.org/ml/gdb-patches/2019-01/msg00427.html

Can you check if the proposed output makes sense to you?

Simon


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

end of thread, other threads:[~2019-01-31 15:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-30  7:41 Buildling gdb on Ubuntu 18.04 Ömer Sinan Ağacan
2019-01-30 14:58 ` Simon Marchi
2019-01-30 15:12   ` Ömer Sinan Ağacan
2019-01-30 15:50     ` Simon Marchi
2019-01-30 19:45       ` Ömer Sinan Ağacan
2019-01-30 20:01         ` Simon Marchi
2019-01-31  6:23           ` Ömer Sinan Ağacan
2019-01-31 15:54             ` Simon Marchi

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