Às 02:02 de 22/07/21, red floyd escreveu:
> On 7/21/2021 10:31 AM, Paulo da Silva wrote:
>> Às 02:33 de 20/07/21, Paulo da Silva escreveu:
>>> Às 02:25 de 20/07/21, Paulo da Silva escreveu:
>>>> Às 01:55 de 20/07/21, red floyd escreveu:
>>>>> On 7/19/2021 12:15 PM, Paulo da Silva wrote:
>>>>>> Hi!
...
>>> Error message from debugger back end:
>>> ptrace: Operação não permitida. (Tr. from pt: Operation not
>>> allowed/permited)
>>>
>> Ok, to fix this:
>> Change in /etc/sysctl.d/10-ptrace.conf
>> kernel.yama.ptrace_scope = 1
>> to
>> kernel.yama.ptrace_scope = 0
>>
>> Besides, one needs to put, for example, getchar(); at the beginning of
>> the program for it to wait the debugger attach. Then just hit enter and
>> the debugging should proceed normally.
>>
>> A very weird solution, however!!
>>
>> Regards
>>
>
>
> You could put "break main" in your .gdbinit file. Then it will break at
> main automatically.
>
You are missing the point that the program is launched outside
eclipse/gdb. So it runs ... Later we attach to it from eclipse. So, we
need to force it "to wait" for us to attach to it.
Besides, the eclipse issues a call to gdb using -nx. This means no
.gdbinit is executed.
Regards