[oi-dev] GDB in hipster

Aurélien Larcher aurelien.larcher at gmail.com
Mon Sep 29 23:24:26 UTC 2014


Hi Alexander,
thank you for your reply.
The only specific thing is that the code I develop uses MPI.
I just checked if just calling a simple MPI_Init causes issues but I do not
have much time right now so I just quickly copied a code snippet.
I will get back to you later this week possibly.

------------------------------------------
alarcher at phainos> cat mpi_init.c
#include <mpi.h>

int main(int argc, char* argv[])
{
  int initialized;
  MPI_Initialized(&initialized);

  if(!initialized)
  {
   MPI_Init(&argc, &argv);
  }
  return 0;
}
alarcher at phainos> gcc -ggdb mpi_init.c `pkg-config --libs mpich`
alarcher at phainos> gdb ./a.out
GNU gdb (GDB) 7.6.2
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i386-pc-solaris2.11".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/alarcher/hipster/gdb/a.out...done.
(gdb) run
Starting program: /home/alarcher/hipster/gdb/./a.out
procfs:3974 -- process not stopped.
procfs: ...giving up...
(gdb) q
A debugging session is active.

    Inferior 1 [process 3696] will be killed.

Quit anyway? (y or n)
------------------------------------------

GDB 7.6.1's changelog mentions the following so I could check how this
possibly affects us.

* PR tdep/15420 (Cannot debug threaded programs on newer versions
    of x86-solaris - Solaris 10, Update 10 or later)

Thank you.
Best regards,

Aurelien



On Mon, Sep 29, 2014 at 2:42 PM, Alexander Pyhalov <alp at rsu.ru> wrote:

> On 09/29/2014 16:31, Aurélien Larcher wrote:
>
>> Hi,
>> is anyone able to use gdb from the latest hipster package ?
>> Whenever I tried to load and run an executable I get:
>>
>> procfs:3961 -- process not stopped.
>> procfs: ...giving up...
>> (gdb) bt
>> Target is executing.
>>
>> But this is actually not the case.
>> I had compiled 7.6.x myself before and had the same issue, thus avoided it
>> as I did not have the time to investigate.
>> Thank you,
>>
>>
> Hi.
> Could you give more information.
> For me it works somehow:
>
> $ cat hello.c
> #include <stdio.h>
> int
> main(int argc, char **argv)
> {
>   (void) printf("Hello World!\n");
>   return (0);
> }
> $ gcc hello.c -O0 -ggdb -o hello
> $ gdb ./hello
> ...
> (gdb) break puts
> Breakpoint 1 at 0x8050a5c
> (gdb) run
> Starting program: /export/home/alp/srcs/tests/./hello
> [Thread debugging using libthread_db enabled]
> [New Thread 1 (LWP 1)]
> [Switching to Thread 1 (LWP 1)]
>
> Breakpoint 1, 0xfeecbb66 in puts () from /lib/libc.so.1
> (gdb) bt
> #0  0xfeecbb66 in puts () from /lib/libc.so.1
> #1  0x08050cf5 in main (argc=1, argv=0x8047da4) at hello.c:5
> (gdb)
>
> Is there a specific program which is not handled by gdb? Perhaps,
> something multi-threaded ?
>
> --
> Best regards,
> Alexander Pyhalov,
> system administrator of Southern Federal University IT department
>



-- 
-------------------------------------------------------------------------------
LARCHER Aurélien          | KTH, School of Computer Science and
Communication
Work: +46 (0) 8 790 71 42 | Lindstedtsvägen 5, Plan 4, 100 44 Stockholm,
SWEDEN
-------------------------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openindiana.org/pipermail/oi-dev/attachments/20140930/c3c82049/attachment-0005.html>


More information about the oi-dev mailing list