target remote :1234 Remote debugging using :1234...Truncated register 37 in remote ‘g‘ packet

target remote :1234
Remote debugging using :1234
warning: while parsing target description (at line 1): Target description specified unknown architecture “aarch64”
warning: Could not load XML target description; ignoring
Truncated register 37 in remote ‘g’ packet
因为exploit64是64位arm架构的,故需要使用qemu模拟执行,当使用qemu-aarch64 -g 1234 ./exploit64,并且使用gdb远程连接时

$ gdb
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04.1) 9.2
Copyright (C) 2020 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 "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
pwndbg: loaded 157 pwndbg commands and 45 shell commands. Type pwndbg [--shell | --all] [filter] for a list.
pwndbg: created $rebase, $base, $ida GDB functions (can be used with print/break)
------- tip of the day (disable with set show-tips off) -------
GDB's follow-fork-mode parameter can be used to set whether to trace parent or child after fork() calls
pwndbg> target remote :1234
Remote debugging using :1234
warning: while parsing target description (at line 1): Target description specified unknown architecture "aarch64"
warning: Could not load XML target description; ignoring
Truncated register 37 in remote 'g' packet

报了如上错。因为本机是x86架构的,故这里为了解决连接的问题,应该使用gdb-multiarch来执行。
参考文件:https://stackoverflow.com/questions/53524546/gdbserver-target-description-specified-unknown-architecture-aarch64

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 这个警告的意思是 #endif 的位置不正确,可能会导致编译错误或者预期外的结果。在 main.h 文件中,你需要检查一下所有的 #if、#ifdef 和 #ifndef 指令,确保它们都有相应的 #endif 控制指令,并且它们的嵌套关系正确。如果有不正确的嵌套关系,就会导致编译器无法正确识别条件编译的区域,从而引发警告或者错误。你可以在编译器的输出信息中查找具体的位置,然后进行修复。 ### 回答2: 这个警告是C编译器给出的错误提示,意味着main.h文件中的endif控制命令放置位置不正确。 在C语言中,#if、#else、#elif、#endif是用来条件编译的预处理指令。它们可以根据一些条件来决定是否编译特定部分的代码。 而这个警告提示的错误是由于#if或者#ifdef(判断某个宏是否已经被定义)之后没有正确的放置对应的#endif。 为了解决这个问题,我们需要检查main.h文件中的条件编译指令的使用。首先,确保所有的#if语句都有对应的#endif,这样可以确保条件编译的合理性。其次,检查#endif的位置是否正确,即它出现在与#if匹配的相同作用域内。如果有多个嵌套的#if语句,需要逐层检查对应的#endif是否正确放置。 例如,如果有如下的代码片段: ``` #ifdef DEBUG // 调试模式下的代码 printf("Debugging...\n"); #else // 发布模式下的代码 printf("Releasing...\n"); #ifdef LOG // 记录日志 printf("Logging...\n"); #endif #endif ``` 我们需要确保两个#ifdef之后的#endif都在同一级别,即与对应的#ifdef在同一个作用域内,没有嵌套的问题。 总之,警告C312: misplaced endif control的出现是因为条件编译中的endif放置位置不正确。通过检查和调整条件编译指令的位置,可以解决这个问题。 ### 回答3: “main.h(37): warning C312: misplaced endif control”是由编译器给出的警告信息。这个警告通常是由于条件编译指令的不正确使用导致的。 条件编译指令(如#if、#ifdef、#ifndef、#endif等)是用来根据不同的条件选择性地编译代码块的。在代码文件中,应该使用#if或#ifdef开始一个条件编译块,然后使用#endif结束该块。然而,警告信息中的错误表明#if或#ifdef之后的#endif语句被放置在了不正确的位置上。 解决这个警告的方法是检查代码文件中的条件编译块,并确保每个#if或#ifdef都有对应的#endif语句,并且它们的位置正确。错误的位置可能是由于条件编译块之间的嵌套错误造成的,或者是由于条件编译语句的不正确的使用导致的。 例如,让我们假设在main.h文件的第37行有一个#if条件编译块,并且在之后应该有一个对应的#endif语句。我们需要检查之前的代码,确保没有其他的条件编译块嵌套在该块内部,也要确保该条件编译块的结束位置是否正确。 总之,要解决“main.h(37): warning C312: misplaced endif control”警告,我们需要检查并修复代码中条件编译指令的使用,以保证每个条件编译块都有正确的结束位置,并避免嵌套错误。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值